diff --git a/.circleci/parallel.sh b/.circleci/parallel.sh index bf7704d5b2e..bf67b7738be 100755 --- a/.circleci/parallel.sh +++ b/.circleci/parallel.sh @@ -28,6 +28,7 @@ elif [ "$JOB_ID" = "testPythonClientSamples" ]; then elif [ "$JOB_ID" = "testJava17ClientSamples" ]; then echo "Running job $JOB_ID ..." java -version + mvn -version cat ./.circleci/testJava17ClientSamples.sh | parallel else diff --git a/docs/generators/java.md b/docs/generators/java.md index 580f3c8f638..9b4c5ca80f0 100644 --- a/docs/generators/java.md +++ b/docs/generators/java.md @@ -178,7 +178,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl | Name | Supported | Defined By | | ---- | --------- | ---------- | |schemas|✓|OAS3 -|responses|✗|OAS3 +|responses|✓|OAS3 |parameters|✗|OAS3 |examples|✗|OAS3 |requestBodies|✓|OAS3 @@ -220,7 +220,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |Servers|✓|OAS3 |Security|✗|OAS2,OAS3 |ComponentSchemas|✓|OAS3 -|ComponentResponses|✗|OAS3 +|ComponentResponses|✓|OAS3 |ComponentParameters|✗|OAS3 |ComponentRequestBodies|✓|OAS3 |ComponentHeaders|✗|OAS3 diff --git a/samples/client/3_0_3_unit_test/java/.openapi-generator/FILES b/samples/client/3_0_3_unit_test/java/.openapi-generator/FILES index 5f64d40a904..a10ac39dd60 100644 --- a/samples/client/3_0_3_unit_test/java/.openapi-generator/FILES +++ b/samples/client/3_0_3_unit_test/java/.openapi-generator/FILES @@ -190,6 +190,9 @@ src/main/java/org/openapijsonschematools/client/parameter/ParameterStyle.java src/main/java/org/openapijsonschematools/client/requestbody/GenericRequestBody.java src/main/java/org/openapijsonschematools/client/requestbody/RequestBodySerializer.java src/main/java/org/openapijsonschematools/client/requestbody/SerializedRequestBody.java +src/main/java/org/openapijsonschematools/client/response/ApiResponse.java +src/main/java/org/openapijsonschematools/client/response/DeserializedApiResponse.java +src/main/java/org/openapijsonschematools/client/response/ResponseDeserializer.java src/main/java/org/openapijsonschematools/client/schemas/AnyTypeJsonSchema.java src/main/java/org/openapijsonschematools/client/schemas/BooleanJsonSchema.java src/main/java/org/openapijsonschematools/client/schemas/DateJsonSchema.java @@ -292,6 +295,7 @@ src/main/java/org/openapijsonschematools/client/servers/ServerWithVariables.java src/main/java/org/openapijsonschematools/client/servers/ServerWithoutVariables.java src/test/java/org/openapijsonschematools/client/configurations/JsonSchemaKeywordFlagsTest.java src/test/java/org/openapijsonschematools/client/requestbody/RequestBodySerializerTest.java +src/test/java/org/openapijsonschematools/client/response/ResponseDeserializerTest.java src/test/java/org/openapijsonschematools/client/schemas/AnyTypeSchemaTest.java src/test/java/org/openapijsonschematools/client/schemas/ArrayTypeSchemaTest.java src/test/java/org/openapijsonschematools/client/schemas/BooleanSchemaTest.java diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.md index 345b70bc1b2..7c340eb79de 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.md @@ -4,7 +4,7 @@ public class AdditionalpropertiesAllowsASchemaWhichShouldValidate
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,53 +12,54 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [AdditionalpropertiesAllowsASchemaWhichShouldValidate.AdditionalpropertiesAllowsASchemaWhichShouldValidate1Boxed](#additionalpropertiesallowsaschemawhichshouldvalidate1boxed)
abstract sealed validated payload class | -| static class | [AdditionalpropertiesAllowsASchemaWhichShouldValidate.AdditionalpropertiesAllowsASchemaWhichShouldValidate1BoxedMap](#additionalpropertiesallowsaschemawhichshouldvalidate1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AdditionalpropertiesAllowsASchemaWhichShouldValidate.AdditionalpropertiesAllowsASchemaWhichShouldValidate1Boxed](#additionalpropertiesallowsaschemawhichshouldvalidate1boxed)
sealed interface for validated payloads | +| record | [AdditionalpropertiesAllowsASchemaWhichShouldValidate.AdditionalpropertiesAllowsASchemaWhichShouldValidate1BoxedMap](#additionalpropertiesallowsaschemawhichshouldvalidate1boxedmap)
boxed class to store validated Map payloads | | static class | [AdditionalpropertiesAllowsASchemaWhichShouldValidate.AdditionalpropertiesAllowsASchemaWhichShouldValidate1](#additionalpropertiesallowsaschemawhichshouldvalidate1)
schema class | | static class | [AdditionalpropertiesAllowsASchemaWhichShouldValidate.AdditionalpropertiesAllowsASchemaWhichShouldValidateMapBuilder](#additionalpropertiesallowsaschemawhichshouldvalidatemapbuilder)
builder for Map payloads | | static class | [AdditionalpropertiesAllowsASchemaWhichShouldValidate.AdditionalpropertiesAllowsASchemaWhichShouldValidateMap](#additionalpropertiesallowsaschemawhichshouldvalidatemap)
output class for Map payloads | -| static class | [AdditionalpropertiesAllowsASchemaWhichShouldValidate.BarBoxed](#barboxed)
abstract sealed validated payload class | -| static class | [AdditionalpropertiesAllowsASchemaWhichShouldValidate.BarBoxedVoid](#barboxedvoid)
boxed class to store validated null payloads | -| static class | [AdditionalpropertiesAllowsASchemaWhichShouldValidate.BarBoxedBoolean](#barboxedboolean)
boxed class to store validated boolean payloads | -| static class | [AdditionalpropertiesAllowsASchemaWhichShouldValidate.BarBoxedNumber](#barboxednumber)
boxed class to store validated Number payloads | -| static class | [AdditionalpropertiesAllowsASchemaWhichShouldValidate.BarBoxedString](#barboxedstring)
boxed class to store validated String payloads | -| static class | [AdditionalpropertiesAllowsASchemaWhichShouldValidate.BarBoxedList](#barboxedlist)
boxed class to store validated List payloads | -| static class | [AdditionalpropertiesAllowsASchemaWhichShouldValidate.BarBoxedMap](#barboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AdditionalpropertiesAllowsASchemaWhichShouldValidate.BarBoxed](#barboxed)
sealed interface for validated payloads | +| record | [AdditionalpropertiesAllowsASchemaWhichShouldValidate.BarBoxedVoid](#barboxedvoid)
boxed class to store validated null payloads | +| record | [AdditionalpropertiesAllowsASchemaWhichShouldValidate.BarBoxedBoolean](#barboxedboolean)
boxed class to store validated boolean payloads | +| record | [AdditionalpropertiesAllowsASchemaWhichShouldValidate.BarBoxedNumber](#barboxednumber)
boxed class to store validated Number payloads | +| record | [AdditionalpropertiesAllowsASchemaWhichShouldValidate.BarBoxedString](#barboxedstring)
boxed class to store validated String payloads | +| record | [AdditionalpropertiesAllowsASchemaWhichShouldValidate.BarBoxedList](#barboxedlist)
boxed class to store validated List payloads | +| record | [AdditionalpropertiesAllowsASchemaWhichShouldValidate.BarBoxedMap](#barboxedmap)
boxed class to store validated Map payloads | | static class | [AdditionalpropertiesAllowsASchemaWhichShouldValidate.Bar](#bar)
schema class | -| static class | [AdditionalpropertiesAllowsASchemaWhichShouldValidate.FooBoxed](#fooboxed)
abstract sealed validated payload class | -| static class | [AdditionalpropertiesAllowsASchemaWhichShouldValidate.FooBoxedVoid](#fooboxedvoid)
boxed class to store validated null payloads | -| static class | [AdditionalpropertiesAllowsASchemaWhichShouldValidate.FooBoxedBoolean](#fooboxedboolean)
boxed class to store validated boolean payloads | -| static class | [AdditionalpropertiesAllowsASchemaWhichShouldValidate.FooBoxedNumber](#fooboxednumber)
boxed class to store validated Number payloads | -| static class | [AdditionalpropertiesAllowsASchemaWhichShouldValidate.FooBoxedString](#fooboxedstring)
boxed class to store validated String payloads | -| static class | [AdditionalpropertiesAllowsASchemaWhichShouldValidate.FooBoxedList](#fooboxedlist)
boxed class to store validated List payloads | -| static class | [AdditionalpropertiesAllowsASchemaWhichShouldValidate.FooBoxedMap](#fooboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AdditionalpropertiesAllowsASchemaWhichShouldValidate.FooBoxed](#fooboxed)
sealed interface for validated payloads | +| record | [AdditionalpropertiesAllowsASchemaWhichShouldValidate.FooBoxedVoid](#fooboxedvoid)
boxed class to store validated null payloads | +| record | [AdditionalpropertiesAllowsASchemaWhichShouldValidate.FooBoxedBoolean](#fooboxedboolean)
boxed class to store validated boolean payloads | +| record | [AdditionalpropertiesAllowsASchemaWhichShouldValidate.FooBoxedNumber](#fooboxednumber)
boxed class to store validated Number payloads | +| record | [AdditionalpropertiesAllowsASchemaWhichShouldValidate.FooBoxedString](#fooboxedstring)
boxed class to store validated String payloads | +| record | [AdditionalpropertiesAllowsASchemaWhichShouldValidate.FooBoxedList](#fooboxedlist)
boxed class to store validated List payloads | +| record | [AdditionalpropertiesAllowsASchemaWhichShouldValidate.FooBoxedMap](#fooboxedmap)
boxed class to store validated Map payloads | | static class | [AdditionalpropertiesAllowsASchemaWhichShouldValidate.Foo](#foo)
schema class | -| static class | [AdditionalpropertiesAllowsASchemaWhichShouldValidate.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
abstract sealed validated payload class | -| static class | [AdditionalpropertiesAllowsASchemaWhichShouldValidate.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | +| sealed interface | [AdditionalpropertiesAllowsASchemaWhichShouldValidate.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
sealed interface for validated payloads | +| record | [AdditionalpropertiesAllowsASchemaWhichShouldValidate.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | | static class | [AdditionalpropertiesAllowsASchemaWhichShouldValidate.AdditionalProperties](#additionalproperties)
schema class | ## AdditionalpropertiesAllowsASchemaWhichShouldValidate1Boxed -public static abstract sealed class AdditionalpropertiesAllowsASchemaWhichShouldValidate1Boxed
+public sealed interface AdditionalpropertiesAllowsASchemaWhichShouldValidate1Boxed
permits
[AdditionalpropertiesAllowsASchemaWhichShouldValidate1BoxedMap](#additionalpropertiesallowsaschemawhichshouldvalidate1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AdditionalpropertiesAllowsASchemaWhichShouldValidate1BoxedMap -public static final class AdditionalpropertiesAllowsASchemaWhichShouldValidate1BoxedMap
-extends [AdditionalpropertiesAllowsASchemaWhichShouldValidate1Boxed](#additionalpropertiesallowsaschemawhichshouldvalidate1boxed) +public record AdditionalpropertiesAllowsASchemaWhichShouldValidate1BoxedMap
+implements [AdditionalpropertiesAllowsASchemaWhichShouldValidate1Boxed](#additionalpropertiesallowsaschemawhichshouldvalidate1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalpropertiesAllowsASchemaWhichShouldValidate1BoxedMap([AdditionalpropertiesAllowsASchemaWhichShouldValidateMap](#additionalpropertiesallowsaschemawhichshouldvalidatemap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [AdditionalpropertiesAllowsASchemaWhichShouldValidateMap](#additionalpropertiesallowsaschemawhichshouldvalidatemap) | data
validated payload | +| [AdditionalpropertiesAllowsASchemaWhichShouldValidateMap](#additionalpropertiesallowsaschemawhichshouldvalidatemap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalpropertiesAllowsASchemaWhichShouldValidate1 public static class AdditionalpropertiesAllowsASchemaWhichShouldValidate1
@@ -104,7 +105,9 @@ AdditionalpropertiesAllowsASchemaWhichShouldValidate.AdditionalpropertiesAllowsA | ----------------- | ---------------------- | | [AdditionalpropertiesAllowsASchemaWhichShouldValidateMap](#additionalpropertiesallowsaschemawhichshouldvalidatemap) | validate([Map<?, ?>](#additionalpropertiesallowsaschemawhichshouldvalidatemapbuilder) arg, SchemaConfiguration configuration) | | [AdditionalpropertiesAllowsASchemaWhichShouldValidate1BoxedMap](#additionalpropertiesallowsaschemawhichshouldvalidate1boxedmap) | validateAndBox([Map<?, ?>](#additionalpropertiesallowsaschemawhichshouldvalidatemapbuilder) arg, SchemaConfiguration configuration) | +| [AdditionalpropertiesAllowsASchemaWhichShouldValidate1Boxed](#additionalpropertiesallowsaschemawhichshouldvalidate1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## AdditionalpropertiesAllowsASchemaWhichShouldValidateMapBuilder public class AdditionalpropertiesAllowsASchemaWhichShouldValidateMapBuilder
builder for `Map` @@ -155,7 +158,7 @@ A class to store validated Map payloads | boolean | getAdditionalProperty(String name)
provides type safety for additional properties | ## BarBoxed -public static abstract sealed class BarBoxed
+public sealed interface BarBoxed
permits
[BarBoxedVoid](#barboxedvoid), [BarBoxedBoolean](#barboxedboolean), @@ -164,103 +167,109 @@ permits
[BarBoxedList](#barboxedlist), [BarBoxedMap](#barboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## BarBoxedVoid -public static final class BarBoxedVoid
-extends [BarBoxed](#barboxed) +public record BarBoxedVoid
+implements [BarBoxed](#barboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BarBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## BarBoxedBoolean -public static final class BarBoxedBoolean
-extends [BarBoxed](#barboxed) +public record BarBoxedBoolean
+implements [BarBoxed](#barboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BarBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## BarBoxedNumber -public static final class BarBoxedNumber
-extends [BarBoxed](#barboxed) +public record BarBoxedNumber
+implements [BarBoxed](#barboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BarBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## BarBoxedString -public static final class BarBoxedString
-extends [BarBoxed](#barboxed) +public record BarBoxedString
+implements [BarBoxed](#barboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BarBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## BarBoxedList -public static final class BarBoxedList
-extends [BarBoxed](#barboxed) +public record BarBoxedList
+implements [BarBoxed](#barboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BarBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## BarBoxedMap -public static final class BarBoxedMap
-extends [BarBoxed](#barboxed) +public record BarBoxedMap
+implements [BarBoxed](#barboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BarBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Bar public static class Bar
@@ -274,7 +283,7 @@ A schema class that validates payloads | validateAndBox | ## FooBoxed -public static abstract sealed class FooBoxed
+public sealed interface FooBoxed
permits
[FooBoxedVoid](#fooboxedvoid), [FooBoxedBoolean](#fooboxedboolean), @@ -283,103 +292,109 @@ permits
[FooBoxedList](#fooboxedlist), [FooBoxedMap](#fooboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## FooBoxedVoid -public static final class FooBoxedVoid
-extends [FooBoxed](#fooboxed) +public record FooBoxedVoid
+implements [FooBoxed](#fooboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FooBoxedBoolean -public static final class FooBoxedBoolean
-extends [FooBoxed](#fooboxed) +public record FooBoxedBoolean
+implements [FooBoxed](#fooboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FooBoxedNumber -public static final class FooBoxedNumber
-extends [FooBoxed](#fooboxed) +public record FooBoxedNumber
+implements [FooBoxed](#fooboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FooBoxedString -public static final class FooBoxedString
-extends [FooBoxed](#fooboxed) +public record FooBoxedString
+implements [FooBoxed](#fooboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FooBoxedList -public static final class FooBoxedList
-extends [FooBoxed](#fooboxed) +public record FooBoxedList
+implements [FooBoxed](#fooboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FooBoxedMap -public static final class FooBoxedMap
-extends [FooBoxed](#fooboxed) +public record FooBoxedMap
+implements [FooBoxed](#fooboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Foo public static class Foo
@@ -393,27 +408,28 @@ A schema class that validates payloads | validateAndBox | ## AdditionalPropertiesBoxed -public static abstract sealed class AdditionalPropertiesBoxed
+public sealed interface AdditionalPropertiesBoxed
permits
[AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AdditionalPropertiesBoxedBoolean -public static final class AdditionalPropertiesBoxedBoolean
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedBoolean
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalProperties public static class AdditionalProperties
diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/AdditionalpropertiesAreAllowedByDefault.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/AdditionalpropertiesAreAllowedByDefault.md index 3d0102a4a24..b7e5ca27e35 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/AdditionalpropertiesAreAllowedByDefault.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/AdditionalpropertiesAreAllowedByDefault.md @@ -4,7 +4,7 @@ public class AdditionalpropertiesAreAllowedByDefault
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,35 +12,35 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [AdditionalpropertiesAreAllowedByDefault.AdditionalpropertiesAreAllowedByDefault1Boxed](#additionalpropertiesareallowedbydefault1boxed)
abstract sealed validated payload class | -| static class | [AdditionalpropertiesAreAllowedByDefault.AdditionalpropertiesAreAllowedByDefault1BoxedVoid](#additionalpropertiesareallowedbydefault1boxedvoid)
boxed class to store validated null payloads | -| static class | [AdditionalpropertiesAreAllowedByDefault.AdditionalpropertiesAreAllowedByDefault1BoxedBoolean](#additionalpropertiesareallowedbydefault1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [AdditionalpropertiesAreAllowedByDefault.AdditionalpropertiesAreAllowedByDefault1BoxedNumber](#additionalpropertiesareallowedbydefault1boxednumber)
boxed class to store validated Number payloads | -| static class | [AdditionalpropertiesAreAllowedByDefault.AdditionalpropertiesAreAllowedByDefault1BoxedString](#additionalpropertiesareallowedbydefault1boxedstring)
boxed class to store validated String payloads | -| static class | [AdditionalpropertiesAreAllowedByDefault.AdditionalpropertiesAreAllowedByDefault1BoxedList](#additionalpropertiesareallowedbydefault1boxedlist)
boxed class to store validated List payloads | -| static class | [AdditionalpropertiesAreAllowedByDefault.AdditionalpropertiesAreAllowedByDefault1BoxedMap](#additionalpropertiesareallowedbydefault1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AdditionalpropertiesAreAllowedByDefault.AdditionalpropertiesAreAllowedByDefault1Boxed](#additionalpropertiesareallowedbydefault1boxed)
sealed interface for validated payloads | +| record | [AdditionalpropertiesAreAllowedByDefault.AdditionalpropertiesAreAllowedByDefault1BoxedVoid](#additionalpropertiesareallowedbydefault1boxedvoid)
boxed class to store validated null payloads | +| record | [AdditionalpropertiesAreAllowedByDefault.AdditionalpropertiesAreAllowedByDefault1BoxedBoolean](#additionalpropertiesareallowedbydefault1boxedboolean)
boxed class to store validated boolean payloads | +| record | [AdditionalpropertiesAreAllowedByDefault.AdditionalpropertiesAreAllowedByDefault1BoxedNumber](#additionalpropertiesareallowedbydefault1boxednumber)
boxed class to store validated Number payloads | +| record | [AdditionalpropertiesAreAllowedByDefault.AdditionalpropertiesAreAllowedByDefault1BoxedString](#additionalpropertiesareallowedbydefault1boxedstring)
boxed class to store validated String payloads | +| record | [AdditionalpropertiesAreAllowedByDefault.AdditionalpropertiesAreAllowedByDefault1BoxedList](#additionalpropertiesareallowedbydefault1boxedlist)
boxed class to store validated List payloads | +| record | [AdditionalpropertiesAreAllowedByDefault.AdditionalpropertiesAreAllowedByDefault1BoxedMap](#additionalpropertiesareallowedbydefault1boxedmap)
boxed class to store validated Map payloads | | static class | [AdditionalpropertiesAreAllowedByDefault.AdditionalpropertiesAreAllowedByDefault1](#additionalpropertiesareallowedbydefault1)
schema class | | static class | [AdditionalpropertiesAreAllowedByDefault.AdditionalpropertiesAreAllowedByDefaultMapBuilder](#additionalpropertiesareallowedbydefaultmapbuilder)
builder for Map payloads | | static class | [AdditionalpropertiesAreAllowedByDefault.AdditionalpropertiesAreAllowedByDefaultMap](#additionalpropertiesareallowedbydefaultmap)
output class for Map payloads | -| static class | [AdditionalpropertiesAreAllowedByDefault.BarBoxed](#barboxed)
abstract sealed validated payload class | -| static class | [AdditionalpropertiesAreAllowedByDefault.BarBoxedVoid](#barboxedvoid)
boxed class to store validated null payloads | -| static class | [AdditionalpropertiesAreAllowedByDefault.BarBoxedBoolean](#barboxedboolean)
boxed class to store validated boolean payloads | -| static class | [AdditionalpropertiesAreAllowedByDefault.BarBoxedNumber](#barboxednumber)
boxed class to store validated Number payloads | -| static class | [AdditionalpropertiesAreAllowedByDefault.BarBoxedString](#barboxedstring)
boxed class to store validated String payloads | -| static class | [AdditionalpropertiesAreAllowedByDefault.BarBoxedList](#barboxedlist)
boxed class to store validated List payloads | -| static class | [AdditionalpropertiesAreAllowedByDefault.BarBoxedMap](#barboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AdditionalpropertiesAreAllowedByDefault.BarBoxed](#barboxed)
sealed interface for validated payloads | +| record | [AdditionalpropertiesAreAllowedByDefault.BarBoxedVoid](#barboxedvoid)
boxed class to store validated null payloads | +| record | [AdditionalpropertiesAreAllowedByDefault.BarBoxedBoolean](#barboxedboolean)
boxed class to store validated boolean payloads | +| record | [AdditionalpropertiesAreAllowedByDefault.BarBoxedNumber](#barboxednumber)
boxed class to store validated Number payloads | +| record | [AdditionalpropertiesAreAllowedByDefault.BarBoxedString](#barboxedstring)
boxed class to store validated String payloads | +| record | [AdditionalpropertiesAreAllowedByDefault.BarBoxedList](#barboxedlist)
boxed class to store validated List payloads | +| record | [AdditionalpropertiesAreAllowedByDefault.BarBoxedMap](#barboxedmap)
boxed class to store validated Map payloads | | static class | [AdditionalpropertiesAreAllowedByDefault.Bar](#bar)
schema class | -| static class | [AdditionalpropertiesAreAllowedByDefault.FooBoxed](#fooboxed)
abstract sealed validated payload class | -| static class | [AdditionalpropertiesAreAllowedByDefault.FooBoxedVoid](#fooboxedvoid)
boxed class to store validated null payloads | -| static class | [AdditionalpropertiesAreAllowedByDefault.FooBoxedBoolean](#fooboxedboolean)
boxed class to store validated boolean payloads | -| static class | [AdditionalpropertiesAreAllowedByDefault.FooBoxedNumber](#fooboxednumber)
boxed class to store validated Number payloads | -| static class | [AdditionalpropertiesAreAllowedByDefault.FooBoxedString](#fooboxedstring)
boxed class to store validated String payloads | -| static class | [AdditionalpropertiesAreAllowedByDefault.FooBoxedList](#fooboxedlist)
boxed class to store validated List payloads | -| static class | [AdditionalpropertiesAreAllowedByDefault.FooBoxedMap](#fooboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AdditionalpropertiesAreAllowedByDefault.FooBoxed](#fooboxed)
sealed interface for validated payloads | +| record | [AdditionalpropertiesAreAllowedByDefault.FooBoxedVoid](#fooboxedvoid)
boxed class to store validated null payloads | +| record | [AdditionalpropertiesAreAllowedByDefault.FooBoxedBoolean](#fooboxedboolean)
boxed class to store validated boolean payloads | +| record | [AdditionalpropertiesAreAllowedByDefault.FooBoxedNumber](#fooboxednumber)
boxed class to store validated Number payloads | +| record | [AdditionalpropertiesAreAllowedByDefault.FooBoxedString](#fooboxedstring)
boxed class to store validated String payloads | +| record | [AdditionalpropertiesAreAllowedByDefault.FooBoxedList](#fooboxedlist)
boxed class to store validated List payloads | +| record | [AdditionalpropertiesAreAllowedByDefault.FooBoxedMap](#fooboxedmap)
boxed class to store validated Map payloads | | static class | [AdditionalpropertiesAreAllowedByDefault.Foo](#foo)
schema class | ## AdditionalpropertiesAreAllowedByDefault1Boxed -public static abstract sealed class AdditionalpropertiesAreAllowedByDefault1Boxed
+public sealed interface AdditionalpropertiesAreAllowedByDefault1Boxed
permits
[AdditionalpropertiesAreAllowedByDefault1BoxedVoid](#additionalpropertiesareallowedbydefault1boxedvoid), [AdditionalpropertiesAreAllowedByDefault1BoxedBoolean](#additionalpropertiesareallowedbydefault1boxedboolean), @@ -49,103 +49,109 @@ permits
[AdditionalpropertiesAreAllowedByDefault1BoxedList](#additionalpropertiesareallowedbydefault1boxedlist), [AdditionalpropertiesAreAllowedByDefault1BoxedMap](#additionalpropertiesareallowedbydefault1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AdditionalpropertiesAreAllowedByDefault1BoxedVoid -public static final class AdditionalpropertiesAreAllowedByDefault1BoxedVoid
-extends [AdditionalpropertiesAreAllowedByDefault1Boxed](#additionalpropertiesareallowedbydefault1boxed) +public record AdditionalpropertiesAreAllowedByDefault1BoxedVoid
+implements [AdditionalpropertiesAreAllowedByDefault1Boxed](#additionalpropertiesareallowedbydefault1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalpropertiesAreAllowedByDefault1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalpropertiesAreAllowedByDefault1BoxedBoolean -public static final class AdditionalpropertiesAreAllowedByDefault1BoxedBoolean
-extends [AdditionalpropertiesAreAllowedByDefault1Boxed](#additionalpropertiesareallowedbydefault1boxed) +public record AdditionalpropertiesAreAllowedByDefault1BoxedBoolean
+implements [AdditionalpropertiesAreAllowedByDefault1Boxed](#additionalpropertiesareallowedbydefault1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalpropertiesAreAllowedByDefault1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalpropertiesAreAllowedByDefault1BoxedNumber -public static final class AdditionalpropertiesAreAllowedByDefault1BoxedNumber
-extends [AdditionalpropertiesAreAllowedByDefault1Boxed](#additionalpropertiesareallowedbydefault1boxed) +public record AdditionalpropertiesAreAllowedByDefault1BoxedNumber
+implements [AdditionalpropertiesAreAllowedByDefault1Boxed](#additionalpropertiesareallowedbydefault1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalpropertiesAreAllowedByDefault1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalpropertiesAreAllowedByDefault1BoxedString -public static final class AdditionalpropertiesAreAllowedByDefault1BoxedString
-extends [AdditionalpropertiesAreAllowedByDefault1Boxed](#additionalpropertiesareallowedbydefault1boxed) +public record AdditionalpropertiesAreAllowedByDefault1BoxedString
+implements [AdditionalpropertiesAreAllowedByDefault1Boxed](#additionalpropertiesareallowedbydefault1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalpropertiesAreAllowedByDefault1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalpropertiesAreAllowedByDefault1BoxedList -public static final class AdditionalpropertiesAreAllowedByDefault1BoxedList
-extends [AdditionalpropertiesAreAllowedByDefault1Boxed](#additionalpropertiesareallowedbydefault1boxed) +public record AdditionalpropertiesAreAllowedByDefault1BoxedList
+implements [AdditionalpropertiesAreAllowedByDefault1Boxed](#additionalpropertiesareallowedbydefault1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalpropertiesAreAllowedByDefault1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalpropertiesAreAllowedByDefault1BoxedMap -public static final class AdditionalpropertiesAreAllowedByDefault1BoxedMap
-extends [AdditionalpropertiesAreAllowedByDefault1Boxed](#additionalpropertiesareallowedbydefault1boxed) +public record AdditionalpropertiesAreAllowedByDefault1BoxedMap
+implements [AdditionalpropertiesAreAllowedByDefault1Boxed](#additionalpropertiesareallowedbydefault1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalpropertiesAreAllowedByDefault1BoxedMap([AdditionalpropertiesAreAllowedByDefaultMap](#additionalpropertiesareallowedbydefaultmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [AdditionalpropertiesAreAllowedByDefaultMap](#additionalpropertiesareallowedbydefaultmap) | data
validated payload | +| [AdditionalpropertiesAreAllowedByDefaultMap](#additionalpropertiesareallowedbydefaultmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalpropertiesAreAllowedByDefault1 public static class AdditionalpropertiesAreAllowedByDefault1
@@ -177,7 +183,9 @@ A schema class that validates payloads | [AdditionalpropertiesAreAllowedByDefault1BoxedBoolean](#additionalpropertiesareallowedbydefault1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [AdditionalpropertiesAreAllowedByDefault1BoxedMap](#additionalpropertiesareallowedbydefault1boxedmap) | validateAndBox([Map<?, ?>](#additionalpropertiesareallowedbydefaultmapbuilder) arg, SchemaConfiguration configuration) | | [AdditionalpropertiesAreAllowedByDefault1BoxedList](#additionalpropertiesareallowedbydefault1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [AdditionalpropertiesAreAllowedByDefault1Boxed](#additionalpropertiesareallowedbydefault1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## AdditionalpropertiesAreAllowedByDefaultMapBuilder public class AdditionalpropertiesAreAllowedByDefaultMapBuilder
builder for `Map` @@ -236,7 +244,7 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## BarBoxed -public static abstract sealed class BarBoxed
+public sealed interface BarBoxed
permits
[BarBoxedVoid](#barboxedvoid), [BarBoxedBoolean](#barboxedboolean), @@ -245,103 +253,109 @@ permits
[BarBoxedList](#barboxedlist), [BarBoxedMap](#barboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## BarBoxedVoid -public static final class BarBoxedVoid
-extends [BarBoxed](#barboxed) +public record BarBoxedVoid
+implements [BarBoxed](#barboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BarBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## BarBoxedBoolean -public static final class BarBoxedBoolean
-extends [BarBoxed](#barboxed) +public record BarBoxedBoolean
+implements [BarBoxed](#barboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BarBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## BarBoxedNumber -public static final class BarBoxedNumber
-extends [BarBoxed](#barboxed) +public record BarBoxedNumber
+implements [BarBoxed](#barboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BarBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## BarBoxedString -public static final class BarBoxedString
-extends [BarBoxed](#barboxed) +public record BarBoxedString
+implements [BarBoxed](#barboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BarBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## BarBoxedList -public static final class BarBoxedList
-extends [BarBoxed](#barboxed) +public record BarBoxedList
+implements [BarBoxed](#barboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BarBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## BarBoxedMap -public static final class BarBoxedMap
-extends [BarBoxed](#barboxed) +public record BarBoxedMap
+implements [BarBoxed](#barboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BarBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Bar public static class Bar
@@ -355,7 +369,7 @@ A schema class that validates payloads | validateAndBox | ## FooBoxed -public static abstract sealed class FooBoxed
+public sealed interface FooBoxed
permits
[FooBoxedVoid](#fooboxedvoid), [FooBoxedBoolean](#fooboxedboolean), @@ -364,103 +378,109 @@ permits
[FooBoxedList](#fooboxedlist), [FooBoxedMap](#fooboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## FooBoxedVoid -public static final class FooBoxedVoid
-extends [FooBoxed](#fooboxed) +public record FooBoxedVoid
+implements [FooBoxed](#fooboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FooBoxedBoolean -public static final class FooBoxedBoolean
-extends [FooBoxed](#fooboxed) +public record FooBoxedBoolean
+implements [FooBoxed](#fooboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FooBoxedNumber -public static final class FooBoxedNumber
-extends [FooBoxed](#fooboxed) +public record FooBoxedNumber
+implements [FooBoxed](#fooboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FooBoxedString -public static final class FooBoxedString
-extends [FooBoxed](#fooboxed) +public record FooBoxedString
+implements [FooBoxed](#fooboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FooBoxedList -public static final class FooBoxedList
-extends [FooBoxed](#fooboxed) +public record FooBoxedList
+implements [FooBoxed](#fooboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FooBoxedMap -public static final class FooBoxedMap
-extends [FooBoxed](#fooboxed) +public record FooBoxedMap
+implements [FooBoxed](#fooboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Foo public static class Foo
diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/AdditionalpropertiesCanExistByItself.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/AdditionalpropertiesCanExistByItself.md index 159c5b6a253..b2488de4fd8 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/AdditionalpropertiesCanExistByItself.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/AdditionalpropertiesCanExistByItself.md @@ -4,7 +4,7 @@ public class AdditionalpropertiesCanExistByItself
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,37 +12,38 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [AdditionalpropertiesCanExistByItself.AdditionalpropertiesCanExistByItself1Boxed](#additionalpropertiescanexistbyitself1boxed)
abstract sealed validated payload class | -| static class | [AdditionalpropertiesCanExistByItself.AdditionalpropertiesCanExistByItself1BoxedMap](#additionalpropertiescanexistbyitself1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AdditionalpropertiesCanExistByItself.AdditionalpropertiesCanExistByItself1Boxed](#additionalpropertiescanexistbyitself1boxed)
sealed interface for validated payloads | +| record | [AdditionalpropertiesCanExistByItself.AdditionalpropertiesCanExistByItself1BoxedMap](#additionalpropertiescanexistbyitself1boxedmap)
boxed class to store validated Map payloads | | static class | [AdditionalpropertiesCanExistByItself.AdditionalpropertiesCanExistByItself1](#additionalpropertiescanexistbyitself1)
schema class | | static class | [AdditionalpropertiesCanExistByItself.AdditionalpropertiesCanExistByItselfMapBuilder](#additionalpropertiescanexistbyitselfmapbuilder)
builder for Map payloads | | static class | [AdditionalpropertiesCanExistByItself.AdditionalpropertiesCanExistByItselfMap](#additionalpropertiescanexistbyitselfmap)
output class for Map payloads | -| static class | [AdditionalpropertiesCanExistByItself.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
abstract sealed validated payload class | -| static class | [AdditionalpropertiesCanExistByItself.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | +| sealed interface | [AdditionalpropertiesCanExistByItself.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
sealed interface for validated payloads | +| record | [AdditionalpropertiesCanExistByItself.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | | static class | [AdditionalpropertiesCanExistByItself.AdditionalProperties](#additionalproperties)
schema class | ## AdditionalpropertiesCanExistByItself1Boxed -public static abstract sealed class AdditionalpropertiesCanExistByItself1Boxed
+public sealed interface AdditionalpropertiesCanExistByItself1Boxed
permits
[AdditionalpropertiesCanExistByItself1BoxedMap](#additionalpropertiescanexistbyitself1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AdditionalpropertiesCanExistByItself1BoxedMap -public static final class AdditionalpropertiesCanExistByItself1BoxedMap
-extends [AdditionalpropertiesCanExistByItself1Boxed](#additionalpropertiescanexistbyitself1boxed) +public record AdditionalpropertiesCanExistByItself1BoxedMap
+implements [AdditionalpropertiesCanExistByItself1Boxed](#additionalpropertiescanexistbyitself1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalpropertiesCanExistByItself1BoxedMap([AdditionalpropertiesCanExistByItselfMap](#additionalpropertiescanexistbyitselfmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [AdditionalpropertiesCanExistByItselfMap](#additionalpropertiescanexistbyitselfmap) | data
validated payload | +| [AdditionalpropertiesCanExistByItselfMap](#additionalpropertiescanexistbyitselfmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalpropertiesCanExistByItself1 public static class AdditionalpropertiesCanExistByItself1
@@ -87,7 +88,9 @@ AdditionalpropertiesCanExistByItself.AdditionalpropertiesCanExistByItselfMap val | ----------------- | ---------------------- | | [AdditionalpropertiesCanExistByItselfMap](#additionalpropertiescanexistbyitselfmap) | validate([Map<?, ?>](#additionalpropertiescanexistbyitselfmapbuilder) arg, SchemaConfiguration configuration) | | [AdditionalpropertiesCanExistByItself1BoxedMap](#additionalpropertiescanexistbyitself1boxedmap) | validateAndBox([Map<?, ?>](#additionalpropertiescanexistbyitselfmapbuilder) arg, SchemaConfiguration configuration) | +| [AdditionalpropertiesCanExistByItself1Boxed](#additionalpropertiescanexistbyitself1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## AdditionalpropertiesCanExistByItselfMapBuilder public class AdditionalpropertiesCanExistByItselfMapBuilder
builder for `Map` @@ -118,27 +121,28 @@ A class to store validated Map payloads | boolean | getAdditionalProperty(String name)
provides type safety for additional properties | ## AdditionalPropertiesBoxed -public static abstract sealed class AdditionalPropertiesBoxed
+public sealed interface AdditionalPropertiesBoxed
permits
[AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AdditionalPropertiesBoxedBoolean -public static final class AdditionalPropertiesBoxedBoolean
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedBoolean
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalProperties public static class AdditionalProperties
diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.md index e6386d2d5e2..465de81c43a 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.md @@ -4,7 +4,7 @@ public class AdditionalpropertiesShouldNotLookInApplicators
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,40 +12,40 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [AdditionalpropertiesShouldNotLookInApplicators.AdditionalpropertiesShouldNotLookInApplicators1Boxed](#additionalpropertiesshouldnotlookinapplicators1boxed)
abstract sealed validated payload class | -| static class | [AdditionalpropertiesShouldNotLookInApplicators.AdditionalpropertiesShouldNotLookInApplicators1BoxedVoid](#additionalpropertiesshouldnotlookinapplicators1boxedvoid)
boxed class to store validated null payloads | -| static class | [AdditionalpropertiesShouldNotLookInApplicators.AdditionalpropertiesShouldNotLookInApplicators1BoxedBoolean](#additionalpropertiesshouldnotlookinapplicators1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [AdditionalpropertiesShouldNotLookInApplicators.AdditionalpropertiesShouldNotLookInApplicators1BoxedNumber](#additionalpropertiesshouldnotlookinapplicators1boxednumber)
boxed class to store validated Number payloads | -| static class | [AdditionalpropertiesShouldNotLookInApplicators.AdditionalpropertiesShouldNotLookInApplicators1BoxedString](#additionalpropertiesshouldnotlookinapplicators1boxedstring)
boxed class to store validated String payloads | -| static class | [AdditionalpropertiesShouldNotLookInApplicators.AdditionalpropertiesShouldNotLookInApplicators1BoxedList](#additionalpropertiesshouldnotlookinapplicators1boxedlist)
boxed class to store validated List payloads | -| static class | [AdditionalpropertiesShouldNotLookInApplicators.AdditionalpropertiesShouldNotLookInApplicators1BoxedMap](#additionalpropertiesshouldnotlookinapplicators1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AdditionalpropertiesShouldNotLookInApplicators.AdditionalpropertiesShouldNotLookInApplicators1Boxed](#additionalpropertiesshouldnotlookinapplicators1boxed)
sealed interface for validated payloads | +| record | [AdditionalpropertiesShouldNotLookInApplicators.AdditionalpropertiesShouldNotLookInApplicators1BoxedVoid](#additionalpropertiesshouldnotlookinapplicators1boxedvoid)
boxed class to store validated null payloads | +| record | [AdditionalpropertiesShouldNotLookInApplicators.AdditionalpropertiesShouldNotLookInApplicators1BoxedBoolean](#additionalpropertiesshouldnotlookinapplicators1boxedboolean)
boxed class to store validated boolean payloads | +| record | [AdditionalpropertiesShouldNotLookInApplicators.AdditionalpropertiesShouldNotLookInApplicators1BoxedNumber](#additionalpropertiesshouldnotlookinapplicators1boxednumber)
boxed class to store validated Number payloads | +| record | [AdditionalpropertiesShouldNotLookInApplicators.AdditionalpropertiesShouldNotLookInApplicators1BoxedString](#additionalpropertiesshouldnotlookinapplicators1boxedstring)
boxed class to store validated String payloads | +| record | [AdditionalpropertiesShouldNotLookInApplicators.AdditionalpropertiesShouldNotLookInApplicators1BoxedList](#additionalpropertiesshouldnotlookinapplicators1boxedlist)
boxed class to store validated List payloads | +| record | [AdditionalpropertiesShouldNotLookInApplicators.AdditionalpropertiesShouldNotLookInApplicators1BoxedMap](#additionalpropertiesshouldnotlookinapplicators1boxedmap)
boxed class to store validated Map payloads | | static class | [AdditionalpropertiesShouldNotLookInApplicators.AdditionalpropertiesShouldNotLookInApplicators1](#additionalpropertiesshouldnotlookinapplicators1)
schema class | | static class | [AdditionalpropertiesShouldNotLookInApplicators.AdditionalpropertiesShouldNotLookInApplicatorsMapBuilder](#additionalpropertiesshouldnotlookinapplicatorsmapbuilder)
builder for Map payloads | | static class | [AdditionalpropertiesShouldNotLookInApplicators.AdditionalpropertiesShouldNotLookInApplicatorsMap](#additionalpropertiesshouldnotlookinapplicatorsmap)
output class for Map payloads | -| static class | [AdditionalpropertiesShouldNotLookInApplicators.Schema0Boxed](#schema0boxed)
abstract sealed validated payload class | -| static class | [AdditionalpropertiesShouldNotLookInApplicators.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | -| static class | [AdditionalpropertiesShouldNotLookInApplicators.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | -| static class | [AdditionalpropertiesShouldNotLookInApplicators.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | -| static class | [AdditionalpropertiesShouldNotLookInApplicators.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | -| static class | [AdditionalpropertiesShouldNotLookInApplicators.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | -| static class | [AdditionalpropertiesShouldNotLookInApplicators.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AdditionalpropertiesShouldNotLookInApplicators.Schema0Boxed](#schema0boxed)
sealed interface for validated payloads | +| record | [AdditionalpropertiesShouldNotLookInApplicators.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | +| record | [AdditionalpropertiesShouldNotLookInApplicators.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | +| record | [AdditionalpropertiesShouldNotLookInApplicators.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | +| record | [AdditionalpropertiesShouldNotLookInApplicators.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | +| record | [AdditionalpropertiesShouldNotLookInApplicators.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | +| record | [AdditionalpropertiesShouldNotLookInApplicators.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | | static class | [AdditionalpropertiesShouldNotLookInApplicators.Schema0](#schema0)
schema class | | static class | [AdditionalpropertiesShouldNotLookInApplicators.Schema0MapBuilder](#schema0mapbuilder)
builder for Map payloads | | static class | [AdditionalpropertiesShouldNotLookInApplicators.Schema0Map](#schema0map)
output class for Map payloads | -| static class | [AdditionalpropertiesShouldNotLookInApplicators.FooBoxed](#fooboxed)
abstract sealed validated payload class | -| static class | [AdditionalpropertiesShouldNotLookInApplicators.FooBoxedVoid](#fooboxedvoid)
boxed class to store validated null payloads | -| static class | [AdditionalpropertiesShouldNotLookInApplicators.FooBoxedBoolean](#fooboxedboolean)
boxed class to store validated boolean payloads | -| static class | [AdditionalpropertiesShouldNotLookInApplicators.FooBoxedNumber](#fooboxednumber)
boxed class to store validated Number payloads | -| static class | [AdditionalpropertiesShouldNotLookInApplicators.FooBoxedString](#fooboxedstring)
boxed class to store validated String payloads | -| static class | [AdditionalpropertiesShouldNotLookInApplicators.FooBoxedList](#fooboxedlist)
boxed class to store validated List payloads | -| static class | [AdditionalpropertiesShouldNotLookInApplicators.FooBoxedMap](#fooboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AdditionalpropertiesShouldNotLookInApplicators.FooBoxed](#fooboxed)
sealed interface for validated payloads | +| record | [AdditionalpropertiesShouldNotLookInApplicators.FooBoxedVoid](#fooboxedvoid)
boxed class to store validated null payloads | +| record | [AdditionalpropertiesShouldNotLookInApplicators.FooBoxedBoolean](#fooboxedboolean)
boxed class to store validated boolean payloads | +| record | [AdditionalpropertiesShouldNotLookInApplicators.FooBoxedNumber](#fooboxednumber)
boxed class to store validated Number payloads | +| record | [AdditionalpropertiesShouldNotLookInApplicators.FooBoxedString](#fooboxedstring)
boxed class to store validated String payloads | +| record | [AdditionalpropertiesShouldNotLookInApplicators.FooBoxedList](#fooboxedlist)
boxed class to store validated List payloads | +| record | [AdditionalpropertiesShouldNotLookInApplicators.FooBoxedMap](#fooboxedmap)
boxed class to store validated Map payloads | | static class | [AdditionalpropertiesShouldNotLookInApplicators.Foo](#foo)
schema class | -| static class | [AdditionalpropertiesShouldNotLookInApplicators.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
abstract sealed validated payload class | -| static class | [AdditionalpropertiesShouldNotLookInApplicators.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | +| sealed interface | [AdditionalpropertiesShouldNotLookInApplicators.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
sealed interface for validated payloads | +| record | [AdditionalpropertiesShouldNotLookInApplicators.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | | static class | [AdditionalpropertiesShouldNotLookInApplicators.AdditionalProperties](#additionalproperties)
schema class | ## AdditionalpropertiesShouldNotLookInApplicators1Boxed -public static abstract sealed class AdditionalpropertiesShouldNotLookInApplicators1Boxed
+public sealed interface AdditionalpropertiesShouldNotLookInApplicators1Boxed
permits
[AdditionalpropertiesShouldNotLookInApplicators1BoxedVoid](#additionalpropertiesshouldnotlookinapplicators1boxedvoid), [AdditionalpropertiesShouldNotLookInApplicators1BoxedBoolean](#additionalpropertiesshouldnotlookinapplicators1boxedboolean), @@ -54,103 +54,109 @@ permits
[AdditionalpropertiesShouldNotLookInApplicators1BoxedList](#additionalpropertiesshouldnotlookinapplicators1boxedlist), [AdditionalpropertiesShouldNotLookInApplicators1BoxedMap](#additionalpropertiesshouldnotlookinapplicators1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AdditionalpropertiesShouldNotLookInApplicators1BoxedVoid -public static final class AdditionalpropertiesShouldNotLookInApplicators1BoxedVoid
-extends [AdditionalpropertiesShouldNotLookInApplicators1Boxed](#additionalpropertiesshouldnotlookinapplicators1boxed) +public record AdditionalpropertiesShouldNotLookInApplicators1BoxedVoid
+implements [AdditionalpropertiesShouldNotLookInApplicators1Boxed](#additionalpropertiesshouldnotlookinapplicators1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalpropertiesShouldNotLookInApplicators1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalpropertiesShouldNotLookInApplicators1BoxedBoolean -public static final class AdditionalpropertiesShouldNotLookInApplicators1BoxedBoolean
-extends [AdditionalpropertiesShouldNotLookInApplicators1Boxed](#additionalpropertiesshouldnotlookinapplicators1boxed) +public record AdditionalpropertiesShouldNotLookInApplicators1BoxedBoolean
+implements [AdditionalpropertiesShouldNotLookInApplicators1Boxed](#additionalpropertiesshouldnotlookinapplicators1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalpropertiesShouldNotLookInApplicators1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalpropertiesShouldNotLookInApplicators1BoxedNumber -public static final class AdditionalpropertiesShouldNotLookInApplicators1BoxedNumber
-extends [AdditionalpropertiesShouldNotLookInApplicators1Boxed](#additionalpropertiesshouldnotlookinapplicators1boxed) +public record AdditionalpropertiesShouldNotLookInApplicators1BoxedNumber
+implements [AdditionalpropertiesShouldNotLookInApplicators1Boxed](#additionalpropertiesshouldnotlookinapplicators1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalpropertiesShouldNotLookInApplicators1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalpropertiesShouldNotLookInApplicators1BoxedString -public static final class AdditionalpropertiesShouldNotLookInApplicators1BoxedString
-extends [AdditionalpropertiesShouldNotLookInApplicators1Boxed](#additionalpropertiesshouldnotlookinapplicators1boxed) +public record AdditionalpropertiesShouldNotLookInApplicators1BoxedString
+implements [AdditionalpropertiesShouldNotLookInApplicators1Boxed](#additionalpropertiesshouldnotlookinapplicators1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalpropertiesShouldNotLookInApplicators1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalpropertiesShouldNotLookInApplicators1BoxedList -public static final class AdditionalpropertiesShouldNotLookInApplicators1BoxedList
-extends [AdditionalpropertiesShouldNotLookInApplicators1Boxed](#additionalpropertiesshouldnotlookinapplicators1boxed) +public record AdditionalpropertiesShouldNotLookInApplicators1BoxedList
+implements [AdditionalpropertiesShouldNotLookInApplicators1Boxed](#additionalpropertiesshouldnotlookinapplicators1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalpropertiesShouldNotLookInApplicators1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalpropertiesShouldNotLookInApplicators1BoxedMap -public static final class AdditionalpropertiesShouldNotLookInApplicators1BoxedMap
-extends [AdditionalpropertiesShouldNotLookInApplicators1Boxed](#additionalpropertiesshouldnotlookinapplicators1boxed) +public record AdditionalpropertiesShouldNotLookInApplicators1BoxedMap
+implements [AdditionalpropertiesShouldNotLookInApplicators1Boxed](#additionalpropertiesshouldnotlookinapplicators1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalpropertiesShouldNotLookInApplicators1BoxedMap([AdditionalpropertiesShouldNotLookInApplicatorsMap](#additionalpropertiesshouldnotlookinapplicatorsmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [AdditionalpropertiesShouldNotLookInApplicatorsMap](#additionalpropertiesshouldnotlookinapplicatorsmap) | data
validated payload | +| [AdditionalpropertiesShouldNotLookInApplicatorsMap](#additionalpropertiesshouldnotlookinapplicatorsmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalpropertiesShouldNotLookInApplicators1 public static class AdditionalpropertiesShouldNotLookInApplicators1
@@ -183,7 +189,9 @@ A schema class that validates payloads | [AdditionalpropertiesShouldNotLookInApplicators1BoxedBoolean](#additionalpropertiesshouldnotlookinapplicators1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [AdditionalpropertiesShouldNotLookInApplicators1BoxedMap](#additionalpropertiesshouldnotlookinapplicators1boxedmap) | validateAndBox([Map<?, ?>](#additionalpropertiesshouldnotlookinapplicatorsmapbuilder) arg, SchemaConfiguration configuration) | | [AdditionalpropertiesShouldNotLookInApplicators1BoxedList](#additionalpropertiesshouldnotlookinapplicators1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [AdditionalpropertiesShouldNotLookInApplicators1Boxed](#additionalpropertiesshouldnotlookinapplicators1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## AdditionalpropertiesShouldNotLookInApplicatorsMapBuilder public class AdditionalpropertiesShouldNotLookInApplicatorsMapBuilder
builder for `Map` @@ -214,7 +222,7 @@ A class to store validated Map payloads | boolean | getAdditionalProperty(String name)
provides type safety for additional properties | ## Schema0Boxed -public static abstract sealed class Schema0Boxed
+public sealed interface Schema0Boxed
permits
[Schema0BoxedVoid](#schema0boxedvoid), [Schema0BoxedBoolean](#schema0boxedboolean), @@ -223,103 +231,109 @@ permits
[Schema0BoxedList](#schema0boxedlist), [Schema0BoxedMap](#schema0boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema0BoxedVoid -public static final class Schema0BoxedVoid
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedVoid
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedBoolean -public static final class Schema0BoxedBoolean
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedBoolean
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedNumber -public static final class Schema0BoxedNumber
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedNumber
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedString -public static final class Schema0BoxedString
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedString
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedList -public static final class Schema0BoxedList
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedList
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedMap -public static final class Schema0BoxedMap
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedMap
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedMap([Schema0Map](#schema0map) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [Schema0Map](#schema0map) | data
validated payload | +| [Schema0Map](#schema0map) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0 public static class Schema0
@@ -351,7 +365,9 @@ A schema class that validates payloads | [Schema0BoxedBoolean](#schema0boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Schema0BoxedMap](#schema0boxedmap) | validateAndBox([Map<?, ?>](#schema0mapbuilder) arg, SchemaConfiguration configuration) | | [Schema0BoxedList](#schema0boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Schema0Boxed](#schema0boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema0MapBuilder public class Schema0MapBuilder
builder for `Map` @@ -400,7 +416,7 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## FooBoxed -public static abstract sealed class FooBoxed
+public sealed interface FooBoxed
permits
[FooBoxedVoid](#fooboxedvoid), [FooBoxedBoolean](#fooboxedboolean), @@ -409,103 +425,109 @@ permits
[FooBoxedList](#fooboxedlist), [FooBoxedMap](#fooboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## FooBoxedVoid -public static final class FooBoxedVoid
-extends [FooBoxed](#fooboxed) +public record FooBoxedVoid
+implements [FooBoxed](#fooboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FooBoxedBoolean -public static final class FooBoxedBoolean
-extends [FooBoxed](#fooboxed) +public record FooBoxedBoolean
+implements [FooBoxed](#fooboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FooBoxedNumber -public static final class FooBoxedNumber
-extends [FooBoxed](#fooboxed) +public record FooBoxedNumber
+implements [FooBoxed](#fooboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FooBoxedString -public static final class FooBoxedString
-extends [FooBoxed](#fooboxed) +public record FooBoxedString
+implements [FooBoxed](#fooboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FooBoxedList -public static final class FooBoxedList
-extends [FooBoxed](#fooboxed) +public record FooBoxedList
+implements [FooBoxed](#fooboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FooBoxedMap -public static final class FooBoxedMap
-extends [FooBoxed](#fooboxed) +public record FooBoxedMap
+implements [FooBoxed](#fooboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Foo public static class Foo
@@ -519,27 +541,28 @@ A schema class that validates payloads | validateAndBox | ## AdditionalPropertiesBoxed -public static abstract sealed class AdditionalPropertiesBoxed
+public sealed interface AdditionalPropertiesBoxed
permits
[AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AdditionalPropertiesBoxedBoolean -public static final class AdditionalPropertiesBoxedBoolean
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedBoolean
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalProperties public static class AdditionalProperties
diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/Allof.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/Allof.md index 208abe021c6..079e4fe18ca 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/Allof.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/Allof.md @@ -4,7 +4,7 @@ public class Allof
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,43 +12,43 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Allof.Allof1Boxed](#allof1boxed)
abstract sealed validated payload class | -| static class | [Allof.Allof1BoxedVoid](#allof1boxedvoid)
boxed class to store validated null payloads | -| static class | [Allof.Allof1BoxedBoolean](#allof1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [Allof.Allof1BoxedNumber](#allof1boxednumber)
boxed class to store validated Number payloads | -| static class | [Allof.Allof1BoxedString](#allof1boxedstring)
boxed class to store validated String payloads | -| static class | [Allof.Allof1BoxedList](#allof1boxedlist)
boxed class to store validated List payloads | -| static class | [Allof.Allof1BoxedMap](#allof1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [Allof.Allof1Boxed](#allof1boxed)
sealed interface for validated payloads | +| record | [Allof.Allof1BoxedVoid](#allof1boxedvoid)
boxed class to store validated null payloads | +| record | [Allof.Allof1BoxedBoolean](#allof1boxedboolean)
boxed class to store validated boolean payloads | +| record | [Allof.Allof1BoxedNumber](#allof1boxednumber)
boxed class to store validated Number payloads | +| record | [Allof.Allof1BoxedString](#allof1boxedstring)
boxed class to store validated String payloads | +| record | [Allof.Allof1BoxedList](#allof1boxedlist)
boxed class to store validated List payloads | +| record | [Allof.Allof1BoxedMap](#allof1boxedmap)
boxed class to store validated Map payloads | | static class | [Allof.Allof1](#allof1)
schema class | -| static class | [Allof.Schema1Boxed](#schema1boxed)
abstract sealed validated payload class | -| static class | [Allof.Schema1BoxedVoid](#schema1boxedvoid)
boxed class to store validated null payloads | -| static class | [Allof.Schema1BoxedBoolean](#schema1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [Allof.Schema1BoxedNumber](#schema1boxednumber)
boxed class to store validated Number payloads | -| static class | [Allof.Schema1BoxedString](#schema1boxedstring)
boxed class to store validated String payloads | -| static class | [Allof.Schema1BoxedList](#schema1boxedlist)
boxed class to store validated List payloads | -| static class | [Allof.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [Allof.Schema1Boxed](#schema1boxed)
sealed interface for validated payloads | +| record | [Allof.Schema1BoxedVoid](#schema1boxedvoid)
boxed class to store validated null payloads | +| record | [Allof.Schema1BoxedBoolean](#schema1boxedboolean)
boxed class to store validated boolean payloads | +| record | [Allof.Schema1BoxedNumber](#schema1boxednumber)
boxed class to store validated Number payloads | +| record | [Allof.Schema1BoxedString](#schema1boxedstring)
boxed class to store validated String payloads | +| record | [Allof.Schema1BoxedList](#schema1boxedlist)
boxed class to store validated List payloads | +| record | [Allof.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | | static class | [Allof.Schema1](#schema1)
schema class | | static class | [Allof.Schema1MapBuilder](#schema1mapbuilder)
builder for Map payloads | | static class | [Allof.Schema1Map](#schema1map)
output class for Map payloads | -| static class | [Allof.FooBoxed](#fooboxed)
abstract sealed validated payload class | -| static class | [Allof.FooBoxedString](#fooboxedstring)
boxed class to store validated String payloads | +| sealed interface | [Allof.FooBoxed](#fooboxed)
sealed interface for validated payloads | +| record | [Allof.FooBoxedString](#fooboxedstring)
boxed class to store validated String payloads | | static class | [Allof.Foo](#foo)
schema class | -| static class | [Allof.Schema0Boxed](#schema0boxed)
abstract sealed validated payload class | -| static class | [Allof.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | -| static class | [Allof.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | -| static class | [Allof.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | -| static class | [Allof.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | -| static class | [Allof.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | -| static class | [Allof.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [Allof.Schema0Boxed](#schema0boxed)
sealed interface for validated payloads | +| record | [Allof.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | +| record | [Allof.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | +| record | [Allof.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | +| record | [Allof.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | +| record | [Allof.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | +| record | [Allof.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | | static class | [Allof.Schema0](#schema0)
schema class | | static class | [Allof.Schema0MapBuilder](#schema0mapbuilder)
builder for Map payloads | | static class | [Allof.Schema0Map](#schema0map)
output class for Map payloads | -| static class | [Allof.BarBoxed](#barboxed)
abstract sealed validated payload class | -| static class | [Allof.BarBoxedNumber](#barboxednumber)
boxed class to store validated Number payloads | +| sealed interface | [Allof.BarBoxed](#barboxed)
sealed interface for validated payloads | +| record | [Allof.BarBoxedNumber](#barboxednumber)
boxed class to store validated Number payloads | | static class | [Allof.Bar](#bar)
schema class | ## Allof1Boxed -public static abstract sealed class Allof1Boxed
+public sealed interface Allof1Boxed
permits
[Allof1BoxedVoid](#allof1boxedvoid), [Allof1BoxedBoolean](#allof1boxedboolean), @@ -57,103 +57,109 @@ permits
[Allof1BoxedList](#allof1boxedlist), [Allof1BoxedMap](#allof1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Allof1BoxedVoid -public static final class Allof1BoxedVoid
-extends [Allof1Boxed](#allof1boxed) +public record Allof1BoxedVoid
+implements [Allof1Boxed](#allof1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Allof1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Allof1BoxedBoolean -public static final class Allof1BoxedBoolean
-extends [Allof1Boxed](#allof1boxed) +public record Allof1BoxedBoolean
+implements [Allof1Boxed](#allof1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Allof1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Allof1BoxedNumber -public static final class Allof1BoxedNumber
-extends [Allof1Boxed](#allof1boxed) +public record Allof1BoxedNumber
+implements [Allof1Boxed](#allof1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Allof1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Allof1BoxedString -public static final class Allof1BoxedString
-extends [Allof1Boxed](#allof1boxed) +public record Allof1BoxedString
+implements [Allof1Boxed](#allof1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Allof1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Allof1BoxedList -public static final class Allof1BoxedList
-extends [Allof1Boxed](#allof1boxed) +public record Allof1BoxedList
+implements [Allof1Boxed](#allof1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Allof1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Allof1BoxedMap -public static final class Allof1BoxedMap
-extends [Allof1Boxed](#allof1boxed) +public record Allof1BoxedMap
+implements [Allof1Boxed](#allof1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Allof1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Allof1 public static class Allof1
@@ -185,9 +191,11 @@ A schema class that validates payloads | [Allof1BoxedBoolean](#allof1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Allof1BoxedMap](#allof1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [Allof1BoxedList](#allof1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Allof1Boxed](#allof1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema1Boxed -public static abstract sealed class Schema1Boxed
+public sealed interface Schema1Boxed
permits
[Schema1BoxedVoid](#schema1boxedvoid), [Schema1BoxedBoolean](#schema1boxedboolean), @@ -196,103 +204,109 @@ permits
[Schema1BoxedList](#schema1boxedlist), [Schema1BoxedMap](#schema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema1BoxedVoid -public static final class Schema1BoxedVoid
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedVoid
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedBoolean -public static final class Schema1BoxedBoolean
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedBoolean
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedNumber -public static final class Schema1BoxedNumber
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedNumber
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedString -public static final class Schema1BoxedString
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedString
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedList -public static final class Schema1BoxedList
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedList
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedMap -public static final class Schema1BoxedMap
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedMap
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedMap([Schema1Map](#schema1map) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [Schema1Map](#schema1map) | data
validated payload | +| [Schema1Map](#schema1map) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1 public static class Schema1
@@ -325,7 +339,9 @@ A schema class that validates payloads | [Schema1BoxedBoolean](#schema1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Schema1BoxedMap](#schema1boxedmap) | validateAndBox([Map<?, ?>](#schema1mapbuilder) arg, SchemaConfiguration configuration) | | [Schema1BoxedList](#schema1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Schema1Boxed](#schema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema1Map0Builder public class Schema1Map0Builder
builder for `Map` @@ -381,27 +397,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## FooBoxed -public static abstract sealed class FooBoxed
+public sealed interface FooBoxed
permits
[FooBoxedString](#fooboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## FooBoxedString -public static final class FooBoxedString
-extends [FooBoxed](#fooboxed) +public record FooBoxedString
+implements [FooBoxed](#fooboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Foo public static class Foo
@@ -415,7 +432,7 @@ A schema class that validates payloads | validateAndBox | ## Schema0Boxed -public static abstract sealed class Schema0Boxed
+public sealed interface Schema0Boxed
permits
[Schema0BoxedVoid](#schema0boxedvoid), [Schema0BoxedBoolean](#schema0boxedboolean), @@ -424,103 +441,109 @@ permits
[Schema0BoxedList](#schema0boxedlist), [Schema0BoxedMap](#schema0boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema0BoxedVoid -public static final class Schema0BoxedVoid
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedVoid
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedBoolean -public static final class Schema0BoxedBoolean
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedBoolean
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedNumber -public static final class Schema0BoxedNumber
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedNumber
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedString -public static final class Schema0BoxedString
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedString
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedList -public static final class Schema0BoxedList
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedList
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedMap -public static final class Schema0BoxedMap
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedMap
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedMap([Schema0Map](#schema0map) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [Schema0Map](#schema0map) | data
validated payload | +| [Schema0Map](#schema0map) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0 public static class Schema0
@@ -553,7 +576,9 @@ A schema class that validates payloads | [Schema0BoxedBoolean](#schema0boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Schema0BoxedMap](#schema0boxedmap) | validateAndBox([Map<?, ?>](#schema0mapbuilder) arg, SchemaConfiguration configuration) | | [Schema0BoxedList](#schema0boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Schema0Boxed](#schema0boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema0Map0Builder public class Schema0Map0Builder
builder for `Map` @@ -612,27 +637,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## BarBoxed -public static abstract sealed class BarBoxed
+public sealed interface BarBoxed
permits
[BarBoxedNumber](#barboxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## BarBoxedNumber -public static final class BarBoxedNumber
-extends [BarBoxed](#barboxed) +public record BarBoxedNumber
+implements [BarBoxed](#barboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BarBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Bar public static class Bar
diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/AllofCombinedWithAnyofOneof.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/AllofCombinedWithAnyofOneof.md index 6a21dc5716c..8aa4f4859ce 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/AllofCombinedWithAnyofOneof.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/AllofCombinedWithAnyofOneof.md @@ -4,47 +4,47 @@ public class AllofCombinedWithAnyofOneof
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [AllofCombinedWithAnyofOneof.AllofCombinedWithAnyofOneof1Boxed](#allofcombinedwithanyofoneof1boxed)
abstract sealed validated payload class | -| static class | [AllofCombinedWithAnyofOneof.AllofCombinedWithAnyofOneof1BoxedVoid](#allofcombinedwithanyofoneof1boxedvoid)
boxed class to store validated null payloads | -| static class | [AllofCombinedWithAnyofOneof.AllofCombinedWithAnyofOneof1BoxedBoolean](#allofcombinedwithanyofoneof1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [AllofCombinedWithAnyofOneof.AllofCombinedWithAnyofOneof1BoxedNumber](#allofcombinedwithanyofoneof1boxednumber)
boxed class to store validated Number payloads | -| static class | [AllofCombinedWithAnyofOneof.AllofCombinedWithAnyofOneof1BoxedString](#allofcombinedwithanyofoneof1boxedstring)
boxed class to store validated String payloads | -| static class | [AllofCombinedWithAnyofOneof.AllofCombinedWithAnyofOneof1BoxedList](#allofcombinedwithanyofoneof1boxedlist)
boxed class to store validated List payloads | -| static class | [AllofCombinedWithAnyofOneof.AllofCombinedWithAnyofOneof1BoxedMap](#allofcombinedwithanyofoneof1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AllofCombinedWithAnyofOneof.AllofCombinedWithAnyofOneof1Boxed](#allofcombinedwithanyofoneof1boxed)
sealed interface for validated payloads | +| record | [AllofCombinedWithAnyofOneof.AllofCombinedWithAnyofOneof1BoxedVoid](#allofcombinedwithanyofoneof1boxedvoid)
boxed class to store validated null payloads | +| record | [AllofCombinedWithAnyofOneof.AllofCombinedWithAnyofOneof1BoxedBoolean](#allofcombinedwithanyofoneof1boxedboolean)
boxed class to store validated boolean payloads | +| record | [AllofCombinedWithAnyofOneof.AllofCombinedWithAnyofOneof1BoxedNumber](#allofcombinedwithanyofoneof1boxednumber)
boxed class to store validated Number payloads | +| record | [AllofCombinedWithAnyofOneof.AllofCombinedWithAnyofOneof1BoxedString](#allofcombinedwithanyofoneof1boxedstring)
boxed class to store validated String payloads | +| record | [AllofCombinedWithAnyofOneof.AllofCombinedWithAnyofOneof1BoxedList](#allofcombinedwithanyofoneof1boxedlist)
boxed class to store validated List payloads | +| record | [AllofCombinedWithAnyofOneof.AllofCombinedWithAnyofOneof1BoxedMap](#allofcombinedwithanyofoneof1boxedmap)
boxed class to store validated Map payloads | | static class | [AllofCombinedWithAnyofOneof.AllofCombinedWithAnyofOneof1](#allofcombinedwithanyofoneof1)
schema class | -| static class | [AllofCombinedWithAnyofOneof.Schema0Boxed](#schema0boxed)
abstract sealed validated payload class | -| static class | [AllofCombinedWithAnyofOneof.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | -| static class | [AllofCombinedWithAnyofOneof.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | -| static class | [AllofCombinedWithAnyofOneof.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | -| static class | [AllofCombinedWithAnyofOneof.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | -| static class | [AllofCombinedWithAnyofOneof.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | -| static class | [AllofCombinedWithAnyofOneof.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AllofCombinedWithAnyofOneof.Schema0Boxed](#schema0boxed)
sealed interface for validated payloads | +| record | [AllofCombinedWithAnyofOneof.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | +| record | [AllofCombinedWithAnyofOneof.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | +| record | [AllofCombinedWithAnyofOneof.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | +| record | [AllofCombinedWithAnyofOneof.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | +| record | [AllofCombinedWithAnyofOneof.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | +| record | [AllofCombinedWithAnyofOneof.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | | static class | [AllofCombinedWithAnyofOneof.Schema0](#schema0)
schema class | -| static class | [AllofCombinedWithAnyofOneof.Schema01Boxed](#schema01boxed)
abstract sealed validated payload class | -| static class | [AllofCombinedWithAnyofOneof.Schema01BoxedVoid](#schema01boxedvoid)
boxed class to store validated null payloads | -| static class | [AllofCombinedWithAnyofOneof.Schema01BoxedBoolean](#schema01boxedboolean)
boxed class to store validated boolean payloads | -| static class | [AllofCombinedWithAnyofOneof.Schema01BoxedNumber](#schema01boxednumber)
boxed class to store validated Number payloads | -| static class | [AllofCombinedWithAnyofOneof.Schema01BoxedString](#schema01boxedstring)
boxed class to store validated String payloads | -| static class | [AllofCombinedWithAnyofOneof.Schema01BoxedList](#schema01boxedlist)
boxed class to store validated List payloads | -| static class | [AllofCombinedWithAnyofOneof.Schema01BoxedMap](#schema01boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AllofCombinedWithAnyofOneof.Schema01Boxed](#schema01boxed)
sealed interface for validated payloads | +| record | [AllofCombinedWithAnyofOneof.Schema01BoxedVoid](#schema01boxedvoid)
boxed class to store validated null payloads | +| record | [AllofCombinedWithAnyofOneof.Schema01BoxedBoolean](#schema01boxedboolean)
boxed class to store validated boolean payloads | +| record | [AllofCombinedWithAnyofOneof.Schema01BoxedNumber](#schema01boxednumber)
boxed class to store validated Number payloads | +| record | [AllofCombinedWithAnyofOneof.Schema01BoxedString](#schema01boxedstring)
boxed class to store validated String payloads | +| record | [AllofCombinedWithAnyofOneof.Schema01BoxedList](#schema01boxedlist)
boxed class to store validated List payloads | +| record | [AllofCombinedWithAnyofOneof.Schema01BoxedMap](#schema01boxedmap)
boxed class to store validated Map payloads | | static class | [AllofCombinedWithAnyofOneof.Schema01](#schema01)
schema class | -| static class | [AllofCombinedWithAnyofOneof.Schema02Boxed](#schema02boxed)
abstract sealed validated payload class | -| static class | [AllofCombinedWithAnyofOneof.Schema02BoxedVoid](#schema02boxedvoid)
boxed class to store validated null payloads | -| static class | [AllofCombinedWithAnyofOneof.Schema02BoxedBoolean](#schema02boxedboolean)
boxed class to store validated boolean payloads | -| static class | [AllofCombinedWithAnyofOneof.Schema02BoxedNumber](#schema02boxednumber)
boxed class to store validated Number payloads | -| static class | [AllofCombinedWithAnyofOneof.Schema02BoxedString](#schema02boxedstring)
boxed class to store validated String payloads | -| static class | [AllofCombinedWithAnyofOneof.Schema02BoxedList](#schema02boxedlist)
boxed class to store validated List payloads | -| static class | [AllofCombinedWithAnyofOneof.Schema02BoxedMap](#schema02boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AllofCombinedWithAnyofOneof.Schema02Boxed](#schema02boxed)
sealed interface for validated payloads | +| record | [AllofCombinedWithAnyofOneof.Schema02BoxedVoid](#schema02boxedvoid)
boxed class to store validated null payloads | +| record | [AllofCombinedWithAnyofOneof.Schema02BoxedBoolean](#schema02boxedboolean)
boxed class to store validated boolean payloads | +| record | [AllofCombinedWithAnyofOneof.Schema02BoxedNumber](#schema02boxednumber)
boxed class to store validated Number payloads | +| record | [AllofCombinedWithAnyofOneof.Schema02BoxedString](#schema02boxedstring)
boxed class to store validated String payloads | +| record | [AllofCombinedWithAnyofOneof.Schema02BoxedList](#schema02boxedlist)
boxed class to store validated List payloads | +| record | [AllofCombinedWithAnyofOneof.Schema02BoxedMap](#schema02boxedmap)
boxed class to store validated Map payloads | | static class | [AllofCombinedWithAnyofOneof.Schema02](#schema02)
schema class | ## AllofCombinedWithAnyofOneof1Boxed -public static abstract sealed class AllofCombinedWithAnyofOneof1Boxed
+public sealed interface AllofCombinedWithAnyofOneof1Boxed
permits
[AllofCombinedWithAnyofOneof1BoxedVoid](#allofcombinedwithanyofoneof1boxedvoid), [AllofCombinedWithAnyofOneof1BoxedBoolean](#allofcombinedwithanyofoneof1boxedboolean), @@ -53,103 +53,109 @@ permits
[AllofCombinedWithAnyofOneof1BoxedList](#allofcombinedwithanyofoneof1boxedlist), [AllofCombinedWithAnyofOneof1BoxedMap](#allofcombinedwithanyofoneof1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AllofCombinedWithAnyofOneof1BoxedVoid -public static final class AllofCombinedWithAnyofOneof1BoxedVoid
-extends [AllofCombinedWithAnyofOneof1Boxed](#allofcombinedwithanyofoneof1boxed) +public record AllofCombinedWithAnyofOneof1BoxedVoid
+implements [AllofCombinedWithAnyofOneof1Boxed](#allofcombinedwithanyofoneof1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofCombinedWithAnyofOneof1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofCombinedWithAnyofOneof1BoxedBoolean -public static final class AllofCombinedWithAnyofOneof1BoxedBoolean
-extends [AllofCombinedWithAnyofOneof1Boxed](#allofcombinedwithanyofoneof1boxed) +public record AllofCombinedWithAnyofOneof1BoxedBoolean
+implements [AllofCombinedWithAnyofOneof1Boxed](#allofcombinedwithanyofoneof1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofCombinedWithAnyofOneof1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofCombinedWithAnyofOneof1BoxedNumber -public static final class AllofCombinedWithAnyofOneof1BoxedNumber
-extends [AllofCombinedWithAnyofOneof1Boxed](#allofcombinedwithanyofoneof1boxed) +public record AllofCombinedWithAnyofOneof1BoxedNumber
+implements [AllofCombinedWithAnyofOneof1Boxed](#allofcombinedwithanyofoneof1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofCombinedWithAnyofOneof1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofCombinedWithAnyofOneof1BoxedString -public static final class AllofCombinedWithAnyofOneof1BoxedString
-extends [AllofCombinedWithAnyofOneof1Boxed](#allofcombinedwithanyofoneof1boxed) +public record AllofCombinedWithAnyofOneof1BoxedString
+implements [AllofCombinedWithAnyofOneof1Boxed](#allofcombinedwithanyofoneof1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofCombinedWithAnyofOneof1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofCombinedWithAnyofOneof1BoxedList -public static final class AllofCombinedWithAnyofOneof1BoxedList
-extends [AllofCombinedWithAnyofOneof1Boxed](#allofcombinedwithanyofoneof1boxed) +public record AllofCombinedWithAnyofOneof1BoxedList
+implements [AllofCombinedWithAnyofOneof1Boxed](#allofcombinedwithanyofoneof1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofCombinedWithAnyofOneof1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofCombinedWithAnyofOneof1BoxedMap -public static final class AllofCombinedWithAnyofOneof1BoxedMap
-extends [AllofCombinedWithAnyofOneof1Boxed](#allofcombinedwithanyofoneof1boxed) +public record AllofCombinedWithAnyofOneof1BoxedMap
+implements [AllofCombinedWithAnyofOneof1Boxed](#allofcombinedwithanyofoneof1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofCombinedWithAnyofOneof1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofCombinedWithAnyofOneof1 public static class AllofCombinedWithAnyofOneof1
@@ -183,9 +189,11 @@ A schema class that validates payloads | [AllofCombinedWithAnyofOneof1BoxedBoolean](#allofcombinedwithanyofoneof1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [AllofCombinedWithAnyofOneof1BoxedMap](#allofcombinedwithanyofoneof1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [AllofCombinedWithAnyofOneof1BoxedList](#allofcombinedwithanyofoneof1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [AllofCombinedWithAnyofOneof1Boxed](#allofcombinedwithanyofoneof1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema0Boxed -public static abstract sealed class Schema0Boxed
+public sealed interface Schema0Boxed
permits
[Schema0BoxedVoid](#schema0boxedvoid), [Schema0BoxedBoolean](#schema0boxedboolean), @@ -194,103 +202,109 @@ permits
[Schema0BoxedList](#schema0boxedlist), [Schema0BoxedMap](#schema0boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema0BoxedVoid -public static final class Schema0BoxedVoid
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedVoid
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedBoolean -public static final class Schema0BoxedBoolean
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedBoolean
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedNumber -public static final class Schema0BoxedNumber
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedNumber
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedString -public static final class Schema0BoxedString
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedString
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedList -public static final class Schema0BoxedList
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedList
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedMap -public static final class Schema0BoxedMap
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedMap
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0 public static class Schema0
@@ -322,9 +336,11 @@ A schema class that validates payloads | [Schema0BoxedBoolean](#schema0boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Schema0BoxedMap](#schema0boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [Schema0BoxedList](#schema0boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Schema0Boxed](#schema0boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema01Boxed -public static abstract sealed class Schema01Boxed
+public sealed interface Schema01Boxed
permits
[Schema01BoxedVoid](#schema01boxedvoid), [Schema01BoxedBoolean](#schema01boxedboolean), @@ -333,103 +349,109 @@ permits
[Schema01BoxedList](#schema01boxedlist), [Schema01BoxedMap](#schema01boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema01BoxedVoid -public static final class Schema01BoxedVoid
-extends [Schema01Boxed](#schema01boxed) +public record Schema01BoxedVoid
+implements [Schema01Boxed](#schema01boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema01BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema01BoxedBoolean -public static final class Schema01BoxedBoolean
-extends [Schema01Boxed](#schema01boxed) +public record Schema01BoxedBoolean
+implements [Schema01Boxed](#schema01boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema01BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema01BoxedNumber -public static final class Schema01BoxedNumber
-extends [Schema01Boxed](#schema01boxed) +public record Schema01BoxedNumber
+implements [Schema01Boxed](#schema01boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema01BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema01BoxedString -public static final class Schema01BoxedString
-extends [Schema01Boxed](#schema01boxed) +public record Schema01BoxedString
+implements [Schema01Boxed](#schema01boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema01BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema01BoxedList -public static final class Schema01BoxedList
-extends [Schema01Boxed](#schema01boxed) +public record Schema01BoxedList
+implements [Schema01Boxed](#schema01boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema01BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema01BoxedMap -public static final class Schema01BoxedMap
-extends [Schema01Boxed](#schema01boxed) +public record Schema01BoxedMap
+implements [Schema01Boxed](#schema01boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema01BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema01 public static class Schema01
@@ -461,9 +483,11 @@ A schema class that validates payloads | [Schema01BoxedBoolean](#schema01boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Schema01BoxedMap](#schema01boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [Schema01BoxedList](#schema01boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Schema01Boxed](#schema01boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema02Boxed -public static abstract sealed class Schema02Boxed
+public sealed interface Schema02Boxed
permits
[Schema02BoxedVoid](#schema02boxedvoid), [Schema02BoxedBoolean](#schema02boxedboolean), @@ -472,103 +496,109 @@ permits
[Schema02BoxedList](#schema02boxedlist), [Schema02BoxedMap](#schema02boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema02BoxedVoid -public static final class Schema02BoxedVoid
-extends [Schema02Boxed](#schema02boxed) +public record Schema02BoxedVoid
+implements [Schema02Boxed](#schema02boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema02BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema02BoxedBoolean -public static final class Schema02BoxedBoolean
-extends [Schema02Boxed](#schema02boxed) +public record Schema02BoxedBoolean
+implements [Schema02Boxed](#schema02boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema02BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema02BoxedNumber -public static final class Schema02BoxedNumber
-extends [Schema02Boxed](#schema02boxed) +public record Schema02BoxedNumber
+implements [Schema02Boxed](#schema02boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema02BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema02BoxedString -public static final class Schema02BoxedString
-extends [Schema02Boxed](#schema02boxed) +public record Schema02BoxedString
+implements [Schema02Boxed](#schema02boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema02BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema02BoxedList -public static final class Schema02BoxedList
-extends [Schema02Boxed](#schema02boxed) +public record Schema02BoxedList
+implements [Schema02Boxed](#schema02boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema02BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema02BoxedMap -public static final class Schema02BoxedMap
-extends [Schema02Boxed](#schema02boxed) +public record Schema02BoxedMap
+implements [Schema02Boxed](#schema02boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema02BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema02 public static class Schema02
@@ -600,5 +630,7 @@ A schema class that validates payloads | [Schema02BoxedBoolean](#schema02boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Schema02BoxedMap](#schema02boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [Schema02BoxedList](#schema02boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Schema02Boxed](#schema02boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/AllofSimpleTypes.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/AllofSimpleTypes.md index 0d06f2192b5..6e506fe215a 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/AllofSimpleTypes.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/AllofSimpleTypes.md @@ -4,39 +4,39 @@ public class AllofSimpleTypes
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [AllofSimpleTypes.AllofSimpleTypes1Boxed](#allofsimpletypes1boxed)
abstract sealed validated payload class | -| static class | [AllofSimpleTypes.AllofSimpleTypes1BoxedVoid](#allofsimpletypes1boxedvoid)
boxed class to store validated null payloads | -| static class | [AllofSimpleTypes.AllofSimpleTypes1BoxedBoolean](#allofsimpletypes1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [AllofSimpleTypes.AllofSimpleTypes1BoxedNumber](#allofsimpletypes1boxednumber)
boxed class to store validated Number payloads | -| static class | [AllofSimpleTypes.AllofSimpleTypes1BoxedString](#allofsimpletypes1boxedstring)
boxed class to store validated String payloads | -| static class | [AllofSimpleTypes.AllofSimpleTypes1BoxedList](#allofsimpletypes1boxedlist)
boxed class to store validated List payloads | -| static class | [AllofSimpleTypes.AllofSimpleTypes1BoxedMap](#allofsimpletypes1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AllofSimpleTypes.AllofSimpleTypes1Boxed](#allofsimpletypes1boxed)
sealed interface for validated payloads | +| record | [AllofSimpleTypes.AllofSimpleTypes1BoxedVoid](#allofsimpletypes1boxedvoid)
boxed class to store validated null payloads | +| record | [AllofSimpleTypes.AllofSimpleTypes1BoxedBoolean](#allofsimpletypes1boxedboolean)
boxed class to store validated boolean payloads | +| record | [AllofSimpleTypes.AllofSimpleTypes1BoxedNumber](#allofsimpletypes1boxednumber)
boxed class to store validated Number payloads | +| record | [AllofSimpleTypes.AllofSimpleTypes1BoxedString](#allofsimpletypes1boxedstring)
boxed class to store validated String payloads | +| record | [AllofSimpleTypes.AllofSimpleTypes1BoxedList](#allofsimpletypes1boxedlist)
boxed class to store validated List payloads | +| record | [AllofSimpleTypes.AllofSimpleTypes1BoxedMap](#allofsimpletypes1boxedmap)
boxed class to store validated Map payloads | | static class | [AllofSimpleTypes.AllofSimpleTypes1](#allofsimpletypes1)
schema class | -| static class | [AllofSimpleTypes.Schema1Boxed](#schema1boxed)
abstract sealed validated payload class | -| static class | [AllofSimpleTypes.Schema1BoxedVoid](#schema1boxedvoid)
boxed class to store validated null payloads | -| static class | [AllofSimpleTypes.Schema1BoxedBoolean](#schema1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [AllofSimpleTypes.Schema1BoxedNumber](#schema1boxednumber)
boxed class to store validated Number payloads | -| static class | [AllofSimpleTypes.Schema1BoxedString](#schema1boxedstring)
boxed class to store validated String payloads | -| static class | [AllofSimpleTypes.Schema1BoxedList](#schema1boxedlist)
boxed class to store validated List payloads | -| static class | [AllofSimpleTypes.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AllofSimpleTypes.Schema1Boxed](#schema1boxed)
sealed interface for validated payloads | +| record | [AllofSimpleTypes.Schema1BoxedVoid](#schema1boxedvoid)
boxed class to store validated null payloads | +| record | [AllofSimpleTypes.Schema1BoxedBoolean](#schema1boxedboolean)
boxed class to store validated boolean payloads | +| record | [AllofSimpleTypes.Schema1BoxedNumber](#schema1boxednumber)
boxed class to store validated Number payloads | +| record | [AllofSimpleTypes.Schema1BoxedString](#schema1boxedstring)
boxed class to store validated String payloads | +| record | [AllofSimpleTypes.Schema1BoxedList](#schema1boxedlist)
boxed class to store validated List payloads | +| record | [AllofSimpleTypes.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | | static class | [AllofSimpleTypes.Schema1](#schema1)
schema class | -| static class | [AllofSimpleTypes.Schema0Boxed](#schema0boxed)
abstract sealed validated payload class | -| static class | [AllofSimpleTypes.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | -| static class | [AllofSimpleTypes.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | -| static class | [AllofSimpleTypes.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | -| static class | [AllofSimpleTypes.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | -| static class | [AllofSimpleTypes.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | -| static class | [AllofSimpleTypes.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AllofSimpleTypes.Schema0Boxed](#schema0boxed)
sealed interface for validated payloads | +| record | [AllofSimpleTypes.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | +| record | [AllofSimpleTypes.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | +| record | [AllofSimpleTypes.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | +| record | [AllofSimpleTypes.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | +| record | [AllofSimpleTypes.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | +| record | [AllofSimpleTypes.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | | static class | [AllofSimpleTypes.Schema0](#schema0)
schema class | ## AllofSimpleTypes1Boxed -public static abstract sealed class AllofSimpleTypes1Boxed
+public sealed interface AllofSimpleTypes1Boxed
permits
[AllofSimpleTypes1BoxedVoid](#allofsimpletypes1boxedvoid), [AllofSimpleTypes1BoxedBoolean](#allofsimpletypes1boxedboolean), @@ -45,103 +45,109 @@ permits
[AllofSimpleTypes1BoxedList](#allofsimpletypes1boxedlist), [AllofSimpleTypes1BoxedMap](#allofsimpletypes1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AllofSimpleTypes1BoxedVoid -public static final class AllofSimpleTypes1BoxedVoid
-extends [AllofSimpleTypes1Boxed](#allofsimpletypes1boxed) +public record AllofSimpleTypes1BoxedVoid
+implements [AllofSimpleTypes1Boxed](#allofsimpletypes1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofSimpleTypes1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofSimpleTypes1BoxedBoolean -public static final class AllofSimpleTypes1BoxedBoolean
-extends [AllofSimpleTypes1Boxed](#allofsimpletypes1boxed) +public record AllofSimpleTypes1BoxedBoolean
+implements [AllofSimpleTypes1Boxed](#allofsimpletypes1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofSimpleTypes1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofSimpleTypes1BoxedNumber -public static final class AllofSimpleTypes1BoxedNumber
-extends [AllofSimpleTypes1Boxed](#allofsimpletypes1boxed) +public record AllofSimpleTypes1BoxedNumber
+implements [AllofSimpleTypes1Boxed](#allofsimpletypes1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofSimpleTypes1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofSimpleTypes1BoxedString -public static final class AllofSimpleTypes1BoxedString
-extends [AllofSimpleTypes1Boxed](#allofsimpletypes1boxed) +public record AllofSimpleTypes1BoxedString
+implements [AllofSimpleTypes1Boxed](#allofsimpletypes1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofSimpleTypes1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofSimpleTypes1BoxedList -public static final class AllofSimpleTypes1BoxedList
-extends [AllofSimpleTypes1Boxed](#allofsimpletypes1boxed) +public record AllofSimpleTypes1BoxedList
+implements [AllofSimpleTypes1Boxed](#allofsimpletypes1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofSimpleTypes1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofSimpleTypes1BoxedMap -public static final class AllofSimpleTypes1BoxedMap
-extends [AllofSimpleTypes1Boxed](#allofsimpletypes1boxed) +public record AllofSimpleTypes1BoxedMap
+implements [AllofSimpleTypes1Boxed](#allofsimpletypes1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofSimpleTypes1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofSimpleTypes1 public static class AllofSimpleTypes1
@@ -173,9 +179,11 @@ A schema class that validates payloads | [AllofSimpleTypes1BoxedBoolean](#allofsimpletypes1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [AllofSimpleTypes1BoxedMap](#allofsimpletypes1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [AllofSimpleTypes1BoxedList](#allofsimpletypes1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [AllofSimpleTypes1Boxed](#allofsimpletypes1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema1Boxed -public static abstract sealed class Schema1Boxed
+public sealed interface Schema1Boxed
permits
[Schema1BoxedVoid](#schema1boxedvoid), [Schema1BoxedBoolean](#schema1boxedboolean), @@ -184,103 +192,109 @@ permits
[Schema1BoxedList](#schema1boxedlist), [Schema1BoxedMap](#schema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema1BoxedVoid -public static final class Schema1BoxedVoid
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedVoid
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedBoolean -public static final class Schema1BoxedBoolean
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedBoolean
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedNumber -public static final class Schema1BoxedNumber
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedNumber
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedString -public static final class Schema1BoxedString
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedString
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedList -public static final class Schema1BoxedList
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedList
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedMap -public static final class Schema1BoxedMap
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedMap
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1 public static class Schema1
@@ -312,9 +326,11 @@ A schema class that validates payloads | [Schema1BoxedBoolean](#schema1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Schema1BoxedMap](#schema1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [Schema1BoxedList](#schema1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Schema1Boxed](#schema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema0Boxed -public static abstract sealed class Schema0Boxed
+public sealed interface Schema0Boxed
permits
[Schema0BoxedVoid](#schema0boxedvoid), [Schema0BoxedBoolean](#schema0boxedboolean), @@ -323,103 +339,109 @@ permits
[Schema0BoxedList](#schema0boxedlist), [Schema0BoxedMap](#schema0boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema0BoxedVoid -public static final class Schema0BoxedVoid
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedVoid
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedBoolean -public static final class Schema0BoxedBoolean
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedBoolean
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedNumber -public static final class Schema0BoxedNumber
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedNumber
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedString -public static final class Schema0BoxedString
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedString
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedList -public static final class Schema0BoxedList
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedList
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedMap -public static final class Schema0BoxedMap
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedMap
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0 public static class Schema0
@@ -451,5 +473,7 @@ A schema class that validates payloads | [Schema0BoxedBoolean](#schema0boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Schema0BoxedMap](#schema0boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [Schema0BoxedList](#schema0boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Schema0Boxed](#schema0boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/AllofWithBaseSchema.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/AllofWithBaseSchema.md index 02f0f53d81e..81125243a09 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/AllofWithBaseSchema.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/AllofWithBaseSchema.md @@ -4,7 +4,7 @@ public class AllofWithBaseSchema
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,48 +12,48 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [AllofWithBaseSchema.AllofWithBaseSchema1Boxed](#allofwithbaseschema1boxed)
abstract sealed validated payload class | -| static class | [AllofWithBaseSchema.AllofWithBaseSchema1BoxedVoid](#allofwithbaseschema1boxedvoid)
boxed class to store validated null payloads | -| static class | [AllofWithBaseSchema.AllofWithBaseSchema1BoxedBoolean](#allofwithbaseschema1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [AllofWithBaseSchema.AllofWithBaseSchema1BoxedNumber](#allofwithbaseschema1boxednumber)
boxed class to store validated Number payloads | -| static class | [AllofWithBaseSchema.AllofWithBaseSchema1BoxedString](#allofwithbaseschema1boxedstring)
boxed class to store validated String payloads | -| static class | [AllofWithBaseSchema.AllofWithBaseSchema1BoxedList](#allofwithbaseschema1boxedlist)
boxed class to store validated List payloads | -| static class | [AllofWithBaseSchema.AllofWithBaseSchema1BoxedMap](#allofwithbaseschema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AllofWithBaseSchema.AllofWithBaseSchema1Boxed](#allofwithbaseschema1boxed)
sealed interface for validated payloads | +| record | [AllofWithBaseSchema.AllofWithBaseSchema1BoxedVoid](#allofwithbaseschema1boxedvoid)
boxed class to store validated null payloads | +| record | [AllofWithBaseSchema.AllofWithBaseSchema1BoxedBoolean](#allofwithbaseschema1boxedboolean)
boxed class to store validated boolean payloads | +| record | [AllofWithBaseSchema.AllofWithBaseSchema1BoxedNumber](#allofwithbaseschema1boxednumber)
boxed class to store validated Number payloads | +| record | [AllofWithBaseSchema.AllofWithBaseSchema1BoxedString](#allofwithbaseschema1boxedstring)
boxed class to store validated String payloads | +| record | [AllofWithBaseSchema.AllofWithBaseSchema1BoxedList](#allofwithbaseschema1boxedlist)
boxed class to store validated List payloads | +| record | [AllofWithBaseSchema.AllofWithBaseSchema1BoxedMap](#allofwithbaseschema1boxedmap)
boxed class to store validated Map payloads | | static class | [AllofWithBaseSchema.AllofWithBaseSchema1](#allofwithbaseschema1)
schema class | | static class | [AllofWithBaseSchema.AllofWithBaseSchemaMapBuilder](#allofwithbaseschemamapbuilder)
builder for Map payloads | | static class | [AllofWithBaseSchema.AllofWithBaseSchemaMap](#allofwithbaseschemamap)
output class for Map payloads | -| static class | [AllofWithBaseSchema.BarBoxed](#barboxed)
abstract sealed validated payload class | -| static class | [AllofWithBaseSchema.BarBoxedNumber](#barboxednumber)
boxed class to store validated Number payloads | +| sealed interface | [AllofWithBaseSchema.BarBoxed](#barboxed)
sealed interface for validated payloads | +| record | [AllofWithBaseSchema.BarBoxedNumber](#barboxednumber)
boxed class to store validated Number payloads | | static class | [AllofWithBaseSchema.Bar](#bar)
schema class | -| static class | [AllofWithBaseSchema.Schema1Boxed](#schema1boxed)
abstract sealed validated payload class | -| static class | [AllofWithBaseSchema.Schema1BoxedVoid](#schema1boxedvoid)
boxed class to store validated null payloads | -| static class | [AllofWithBaseSchema.Schema1BoxedBoolean](#schema1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [AllofWithBaseSchema.Schema1BoxedNumber](#schema1boxednumber)
boxed class to store validated Number payloads | -| static class | [AllofWithBaseSchema.Schema1BoxedString](#schema1boxedstring)
boxed class to store validated String payloads | -| static class | [AllofWithBaseSchema.Schema1BoxedList](#schema1boxedlist)
boxed class to store validated List payloads | -| static class | [AllofWithBaseSchema.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AllofWithBaseSchema.Schema1Boxed](#schema1boxed)
sealed interface for validated payloads | +| record | [AllofWithBaseSchema.Schema1BoxedVoid](#schema1boxedvoid)
boxed class to store validated null payloads | +| record | [AllofWithBaseSchema.Schema1BoxedBoolean](#schema1boxedboolean)
boxed class to store validated boolean payloads | +| record | [AllofWithBaseSchema.Schema1BoxedNumber](#schema1boxednumber)
boxed class to store validated Number payloads | +| record | [AllofWithBaseSchema.Schema1BoxedString](#schema1boxedstring)
boxed class to store validated String payloads | +| record | [AllofWithBaseSchema.Schema1BoxedList](#schema1boxedlist)
boxed class to store validated List payloads | +| record | [AllofWithBaseSchema.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | | static class | [AllofWithBaseSchema.Schema1](#schema1)
schema class | | static class | [AllofWithBaseSchema.Schema1MapBuilder](#schema1mapbuilder)
builder for Map payloads | | static class | [AllofWithBaseSchema.Schema1Map](#schema1map)
output class for Map payloads | -| static class | [AllofWithBaseSchema.BazBoxed](#bazboxed)
abstract sealed validated payload class | -| static class | [AllofWithBaseSchema.BazBoxedVoid](#bazboxedvoid)
boxed class to store validated null payloads | +| sealed interface | [AllofWithBaseSchema.BazBoxed](#bazboxed)
sealed interface for validated payloads | +| record | [AllofWithBaseSchema.BazBoxedVoid](#bazboxedvoid)
boxed class to store validated null payloads | | static class | [AllofWithBaseSchema.Baz](#baz)
schema class | -| static class | [AllofWithBaseSchema.Schema0Boxed](#schema0boxed)
abstract sealed validated payload class | -| static class | [AllofWithBaseSchema.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | -| static class | [AllofWithBaseSchema.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | -| static class | [AllofWithBaseSchema.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | -| static class | [AllofWithBaseSchema.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | -| static class | [AllofWithBaseSchema.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | -| static class | [AllofWithBaseSchema.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AllofWithBaseSchema.Schema0Boxed](#schema0boxed)
sealed interface for validated payloads | +| record | [AllofWithBaseSchema.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | +| record | [AllofWithBaseSchema.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | +| record | [AllofWithBaseSchema.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | +| record | [AllofWithBaseSchema.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | +| record | [AllofWithBaseSchema.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | +| record | [AllofWithBaseSchema.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | | static class | [AllofWithBaseSchema.Schema0](#schema0)
schema class | | static class | [AllofWithBaseSchema.Schema0MapBuilder](#schema0mapbuilder)
builder for Map payloads | | static class | [AllofWithBaseSchema.Schema0Map](#schema0map)
output class for Map payloads | -| static class | [AllofWithBaseSchema.FooBoxed](#fooboxed)
abstract sealed validated payload class | -| static class | [AllofWithBaseSchema.FooBoxedString](#fooboxedstring)
boxed class to store validated String payloads | +| sealed interface | [AllofWithBaseSchema.FooBoxed](#fooboxed)
sealed interface for validated payloads | +| record | [AllofWithBaseSchema.FooBoxedString](#fooboxedstring)
boxed class to store validated String payloads | | static class | [AllofWithBaseSchema.Foo](#foo)
schema class | ## AllofWithBaseSchema1Boxed -public static abstract sealed class AllofWithBaseSchema1Boxed
+public sealed interface AllofWithBaseSchema1Boxed
permits
[AllofWithBaseSchema1BoxedVoid](#allofwithbaseschema1boxedvoid), [AllofWithBaseSchema1BoxedBoolean](#allofwithbaseschema1boxedboolean), @@ -62,103 +62,109 @@ permits
[AllofWithBaseSchema1BoxedList](#allofwithbaseschema1boxedlist), [AllofWithBaseSchema1BoxedMap](#allofwithbaseschema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AllofWithBaseSchema1BoxedVoid -public static final class AllofWithBaseSchema1BoxedVoid
-extends [AllofWithBaseSchema1Boxed](#allofwithbaseschema1boxed) +public record AllofWithBaseSchema1BoxedVoid
+implements [AllofWithBaseSchema1Boxed](#allofwithbaseschema1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofWithBaseSchema1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofWithBaseSchema1BoxedBoolean -public static final class AllofWithBaseSchema1BoxedBoolean
-extends [AllofWithBaseSchema1Boxed](#allofwithbaseschema1boxed) +public record AllofWithBaseSchema1BoxedBoolean
+implements [AllofWithBaseSchema1Boxed](#allofwithbaseschema1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofWithBaseSchema1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofWithBaseSchema1BoxedNumber -public static final class AllofWithBaseSchema1BoxedNumber
-extends [AllofWithBaseSchema1Boxed](#allofwithbaseschema1boxed) +public record AllofWithBaseSchema1BoxedNumber
+implements [AllofWithBaseSchema1Boxed](#allofwithbaseschema1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofWithBaseSchema1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofWithBaseSchema1BoxedString -public static final class AllofWithBaseSchema1BoxedString
-extends [AllofWithBaseSchema1Boxed](#allofwithbaseschema1boxed) +public record AllofWithBaseSchema1BoxedString
+implements [AllofWithBaseSchema1Boxed](#allofwithbaseschema1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofWithBaseSchema1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofWithBaseSchema1BoxedList -public static final class AllofWithBaseSchema1BoxedList
-extends [AllofWithBaseSchema1Boxed](#allofwithbaseschema1boxed) +public record AllofWithBaseSchema1BoxedList
+implements [AllofWithBaseSchema1Boxed](#allofwithbaseschema1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofWithBaseSchema1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofWithBaseSchema1BoxedMap -public static final class AllofWithBaseSchema1BoxedMap
-extends [AllofWithBaseSchema1Boxed](#allofwithbaseschema1boxed) +public record AllofWithBaseSchema1BoxedMap
+implements [AllofWithBaseSchema1Boxed](#allofwithbaseschema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofWithBaseSchema1BoxedMap([AllofWithBaseSchemaMap](#allofwithbaseschemamap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [AllofWithBaseSchemaMap](#allofwithbaseschemamap) | data
validated payload | +| [AllofWithBaseSchemaMap](#allofwithbaseschemamap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofWithBaseSchema1 public static class AllofWithBaseSchema1
@@ -192,7 +198,9 @@ A schema class that validates payloads | [AllofWithBaseSchema1BoxedBoolean](#allofwithbaseschema1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [AllofWithBaseSchema1BoxedMap](#allofwithbaseschema1boxedmap) | validateAndBox([Map<?, ?>](#allofwithbaseschemamapbuilder) arg, SchemaConfiguration configuration) | | [AllofWithBaseSchema1BoxedList](#allofwithbaseschema1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [AllofWithBaseSchema1Boxed](#allofwithbaseschema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## AllofWithBaseSchemaMap0Builder public class AllofWithBaseSchemaMap0Builder
builder for `Map` @@ -251,27 +259,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## BarBoxed -public static abstract sealed class BarBoxed
+public sealed interface BarBoxed
permits
[BarBoxedNumber](#barboxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## BarBoxedNumber -public static final class BarBoxedNumber
-extends [BarBoxed](#barboxed) +public record BarBoxedNumber
+implements [BarBoxed](#barboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BarBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Bar public static class Bar
@@ -285,7 +294,7 @@ A schema class that validates payloads | validateAndBox | ## Schema1Boxed -public static abstract sealed class Schema1Boxed
+public sealed interface Schema1Boxed
permits
[Schema1BoxedVoid](#schema1boxedvoid), [Schema1BoxedBoolean](#schema1boxedboolean), @@ -294,103 +303,109 @@ permits
[Schema1BoxedList](#schema1boxedlist), [Schema1BoxedMap](#schema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema1BoxedVoid -public static final class Schema1BoxedVoid
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedVoid
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedBoolean -public static final class Schema1BoxedBoolean
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedBoolean
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedNumber -public static final class Schema1BoxedNumber
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedNumber
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedString -public static final class Schema1BoxedString
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedString
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedList -public static final class Schema1BoxedList
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedList
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedMap -public static final class Schema1BoxedMap
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedMap
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedMap([Schema1Map](#schema1map) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [Schema1Map](#schema1map) | data
validated payload | +| [Schema1Map](#schema1map) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1 public static class Schema1
@@ -423,7 +438,9 @@ A schema class that validates payloads | [Schema1BoxedBoolean](#schema1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Schema1BoxedMap](#schema1boxedmap) | validateAndBox([Map<?, ?>](#schema1mapbuilder) arg, SchemaConfiguration configuration) | | [Schema1BoxedList](#schema1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Schema1Boxed](#schema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema1Map0Builder public class Schema1Map0Builder
builder for `Map` @@ -479,27 +496,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## BazBoxed -public static abstract sealed class BazBoxed
+public sealed interface BazBoxed
permits
[BazBoxedVoid](#bazboxedvoid) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## BazBoxedVoid -public static final class BazBoxedVoid
-extends [BazBoxed](#bazboxed) +public record BazBoxedVoid
+implements [BazBoxed](#bazboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BazBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Baz public static class Baz
@@ -513,7 +531,7 @@ A schema class that validates payloads | validateAndBox | ## Schema0Boxed -public static abstract sealed class Schema0Boxed
+public sealed interface Schema0Boxed
permits
[Schema0BoxedVoid](#schema0boxedvoid), [Schema0BoxedBoolean](#schema0boxedboolean), @@ -522,103 +540,109 @@ permits
[Schema0BoxedList](#schema0boxedlist), [Schema0BoxedMap](#schema0boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema0BoxedVoid -public static final class Schema0BoxedVoid
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedVoid
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedBoolean -public static final class Schema0BoxedBoolean
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedBoolean
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedNumber -public static final class Schema0BoxedNumber
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedNumber
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedString -public static final class Schema0BoxedString
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedString
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedList -public static final class Schema0BoxedList
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedList
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedMap -public static final class Schema0BoxedMap
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedMap
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedMap([Schema0Map](#schema0map) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [Schema0Map](#schema0map) | data
validated payload | +| [Schema0Map](#schema0map) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0 public static class Schema0
@@ -651,7 +675,9 @@ A schema class that validates payloads | [Schema0BoxedBoolean](#schema0boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Schema0BoxedMap](#schema0boxedmap) | validateAndBox([Map<?, ?>](#schema0mapbuilder) arg, SchemaConfiguration configuration) | | [Schema0BoxedList](#schema0boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Schema0Boxed](#schema0boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema0Map0Builder public class Schema0Map0Builder
builder for `Map` @@ -707,27 +733,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## FooBoxed -public static abstract sealed class FooBoxed
+public sealed interface FooBoxed
permits
[FooBoxedString](#fooboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## FooBoxedString -public static final class FooBoxedString
-extends [FooBoxed](#fooboxed) +public record FooBoxedString
+implements [FooBoxed](#fooboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Foo public static class Foo
diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/AllofWithOneEmptySchema.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/AllofWithOneEmptySchema.md index 8bb3b9ca2ec..353eef7b1a4 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/AllofWithOneEmptySchema.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/AllofWithOneEmptySchema.md @@ -4,31 +4,31 @@ public class AllofWithOneEmptySchema
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [AllofWithOneEmptySchema.AllofWithOneEmptySchema1Boxed](#allofwithoneemptyschema1boxed)
abstract sealed validated payload class | -| static class | [AllofWithOneEmptySchema.AllofWithOneEmptySchema1BoxedVoid](#allofwithoneemptyschema1boxedvoid)
boxed class to store validated null payloads | -| static class | [AllofWithOneEmptySchema.AllofWithOneEmptySchema1BoxedBoolean](#allofwithoneemptyschema1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [AllofWithOneEmptySchema.AllofWithOneEmptySchema1BoxedNumber](#allofwithoneemptyschema1boxednumber)
boxed class to store validated Number payloads | -| static class | [AllofWithOneEmptySchema.AllofWithOneEmptySchema1BoxedString](#allofwithoneemptyschema1boxedstring)
boxed class to store validated String payloads | -| static class | [AllofWithOneEmptySchema.AllofWithOneEmptySchema1BoxedList](#allofwithoneemptyschema1boxedlist)
boxed class to store validated List payloads | -| static class | [AllofWithOneEmptySchema.AllofWithOneEmptySchema1BoxedMap](#allofwithoneemptyschema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AllofWithOneEmptySchema.AllofWithOneEmptySchema1Boxed](#allofwithoneemptyschema1boxed)
sealed interface for validated payloads | +| record | [AllofWithOneEmptySchema.AllofWithOneEmptySchema1BoxedVoid](#allofwithoneemptyschema1boxedvoid)
boxed class to store validated null payloads | +| record | [AllofWithOneEmptySchema.AllofWithOneEmptySchema1BoxedBoolean](#allofwithoneemptyschema1boxedboolean)
boxed class to store validated boolean payloads | +| record | [AllofWithOneEmptySchema.AllofWithOneEmptySchema1BoxedNumber](#allofwithoneemptyschema1boxednumber)
boxed class to store validated Number payloads | +| record | [AllofWithOneEmptySchema.AllofWithOneEmptySchema1BoxedString](#allofwithoneemptyschema1boxedstring)
boxed class to store validated String payloads | +| record | [AllofWithOneEmptySchema.AllofWithOneEmptySchema1BoxedList](#allofwithoneemptyschema1boxedlist)
boxed class to store validated List payloads | +| record | [AllofWithOneEmptySchema.AllofWithOneEmptySchema1BoxedMap](#allofwithoneemptyschema1boxedmap)
boxed class to store validated Map payloads | | static class | [AllofWithOneEmptySchema.AllofWithOneEmptySchema1](#allofwithoneemptyschema1)
schema class | -| static class | [AllofWithOneEmptySchema.Schema0Boxed](#schema0boxed)
abstract sealed validated payload class | -| static class | [AllofWithOneEmptySchema.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | -| static class | [AllofWithOneEmptySchema.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | -| static class | [AllofWithOneEmptySchema.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | -| static class | [AllofWithOneEmptySchema.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | -| static class | [AllofWithOneEmptySchema.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | -| static class | [AllofWithOneEmptySchema.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AllofWithOneEmptySchema.Schema0Boxed](#schema0boxed)
sealed interface for validated payloads | +| record | [AllofWithOneEmptySchema.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | +| record | [AllofWithOneEmptySchema.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | +| record | [AllofWithOneEmptySchema.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | +| record | [AllofWithOneEmptySchema.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | +| record | [AllofWithOneEmptySchema.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | +| record | [AllofWithOneEmptySchema.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | | static class | [AllofWithOneEmptySchema.Schema0](#schema0)
schema class | ## AllofWithOneEmptySchema1Boxed -public static abstract sealed class AllofWithOneEmptySchema1Boxed
+public sealed interface AllofWithOneEmptySchema1Boxed
permits
[AllofWithOneEmptySchema1BoxedVoid](#allofwithoneemptyschema1boxedvoid), [AllofWithOneEmptySchema1BoxedBoolean](#allofwithoneemptyschema1boxedboolean), @@ -37,103 +37,109 @@ permits
[AllofWithOneEmptySchema1BoxedList](#allofwithoneemptyschema1boxedlist), [AllofWithOneEmptySchema1BoxedMap](#allofwithoneemptyschema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AllofWithOneEmptySchema1BoxedVoid -public static final class AllofWithOneEmptySchema1BoxedVoid
-extends [AllofWithOneEmptySchema1Boxed](#allofwithoneemptyschema1boxed) +public record AllofWithOneEmptySchema1BoxedVoid
+implements [AllofWithOneEmptySchema1Boxed](#allofwithoneemptyschema1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofWithOneEmptySchema1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofWithOneEmptySchema1BoxedBoolean -public static final class AllofWithOneEmptySchema1BoxedBoolean
-extends [AllofWithOneEmptySchema1Boxed](#allofwithoneemptyschema1boxed) +public record AllofWithOneEmptySchema1BoxedBoolean
+implements [AllofWithOneEmptySchema1Boxed](#allofwithoneemptyschema1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofWithOneEmptySchema1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofWithOneEmptySchema1BoxedNumber -public static final class AllofWithOneEmptySchema1BoxedNumber
-extends [AllofWithOneEmptySchema1Boxed](#allofwithoneemptyschema1boxed) +public record AllofWithOneEmptySchema1BoxedNumber
+implements [AllofWithOneEmptySchema1Boxed](#allofwithoneemptyschema1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofWithOneEmptySchema1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofWithOneEmptySchema1BoxedString -public static final class AllofWithOneEmptySchema1BoxedString
-extends [AllofWithOneEmptySchema1Boxed](#allofwithoneemptyschema1boxed) +public record AllofWithOneEmptySchema1BoxedString
+implements [AllofWithOneEmptySchema1Boxed](#allofwithoneemptyschema1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofWithOneEmptySchema1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofWithOneEmptySchema1BoxedList -public static final class AllofWithOneEmptySchema1BoxedList
-extends [AllofWithOneEmptySchema1Boxed](#allofwithoneemptyschema1boxed) +public record AllofWithOneEmptySchema1BoxedList
+implements [AllofWithOneEmptySchema1Boxed](#allofwithoneemptyschema1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofWithOneEmptySchema1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofWithOneEmptySchema1BoxedMap -public static final class AllofWithOneEmptySchema1BoxedMap
-extends [AllofWithOneEmptySchema1Boxed](#allofwithoneemptyschema1boxed) +public record AllofWithOneEmptySchema1BoxedMap
+implements [AllofWithOneEmptySchema1Boxed](#allofwithoneemptyschema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofWithOneEmptySchema1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofWithOneEmptySchema1 public static class AllofWithOneEmptySchema1
@@ -165,9 +171,11 @@ A schema class that validates payloads | [AllofWithOneEmptySchema1BoxedBoolean](#allofwithoneemptyschema1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [AllofWithOneEmptySchema1BoxedMap](#allofwithoneemptyschema1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [AllofWithOneEmptySchema1BoxedList](#allofwithoneemptyschema1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [AllofWithOneEmptySchema1Boxed](#allofwithoneemptyschema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema0Boxed -public static abstract sealed class Schema0Boxed
+public sealed interface Schema0Boxed
permits
[Schema0BoxedVoid](#schema0boxedvoid), [Schema0BoxedBoolean](#schema0boxedboolean), @@ -176,103 +184,109 @@ permits
[Schema0BoxedList](#schema0boxedlist), [Schema0BoxedMap](#schema0boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema0BoxedVoid -public static final class Schema0BoxedVoid
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedVoid
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedBoolean -public static final class Schema0BoxedBoolean
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedBoolean
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedNumber -public static final class Schema0BoxedNumber
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedNumber
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedString -public static final class Schema0BoxedString
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedString
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedList -public static final class Schema0BoxedList
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedList
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedMap -public static final class Schema0BoxedMap
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedMap
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0 public static class Schema0
diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/AllofWithTheFirstEmptySchema.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/AllofWithTheFirstEmptySchema.md index 60262417c7c..f4341590119 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/AllofWithTheFirstEmptySchema.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/AllofWithTheFirstEmptySchema.md @@ -4,34 +4,34 @@ public class AllofWithTheFirstEmptySchema
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [AllofWithTheFirstEmptySchema.AllofWithTheFirstEmptySchema1Boxed](#allofwiththefirstemptyschema1boxed)
abstract sealed validated payload class | -| static class | [AllofWithTheFirstEmptySchema.AllofWithTheFirstEmptySchema1BoxedVoid](#allofwiththefirstemptyschema1boxedvoid)
boxed class to store validated null payloads | -| static class | [AllofWithTheFirstEmptySchema.AllofWithTheFirstEmptySchema1BoxedBoolean](#allofwiththefirstemptyschema1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [AllofWithTheFirstEmptySchema.AllofWithTheFirstEmptySchema1BoxedNumber](#allofwiththefirstemptyschema1boxednumber)
boxed class to store validated Number payloads | -| static class | [AllofWithTheFirstEmptySchema.AllofWithTheFirstEmptySchema1BoxedString](#allofwiththefirstemptyschema1boxedstring)
boxed class to store validated String payloads | -| static class | [AllofWithTheFirstEmptySchema.AllofWithTheFirstEmptySchema1BoxedList](#allofwiththefirstemptyschema1boxedlist)
boxed class to store validated List payloads | -| static class | [AllofWithTheFirstEmptySchema.AllofWithTheFirstEmptySchema1BoxedMap](#allofwiththefirstemptyschema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AllofWithTheFirstEmptySchema.AllofWithTheFirstEmptySchema1Boxed](#allofwiththefirstemptyschema1boxed)
sealed interface for validated payloads | +| record | [AllofWithTheFirstEmptySchema.AllofWithTheFirstEmptySchema1BoxedVoid](#allofwiththefirstemptyschema1boxedvoid)
boxed class to store validated null payloads | +| record | [AllofWithTheFirstEmptySchema.AllofWithTheFirstEmptySchema1BoxedBoolean](#allofwiththefirstemptyschema1boxedboolean)
boxed class to store validated boolean payloads | +| record | [AllofWithTheFirstEmptySchema.AllofWithTheFirstEmptySchema1BoxedNumber](#allofwiththefirstemptyschema1boxednumber)
boxed class to store validated Number payloads | +| record | [AllofWithTheFirstEmptySchema.AllofWithTheFirstEmptySchema1BoxedString](#allofwiththefirstemptyschema1boxedstring)
boxed class to store validated String payloads | +| record | [AllofWithTheFirstEmptySchema.AllofWithTheFirstEmptySchema1BoxedList](#allofwiththefirstemptyschema1boxedlist)
boxed class to store validated List payloads | +| record | [AllofWithTheFirstEmptySchema.AllofWithTheFirstEmptySchema1BoxedMap](#allofwiththefirstemptyschema1boxedmap)
boxed class to store validated Map payloads | | static class | [AllofWithTheFirstEmptySchema.AllofWithTheFirstEmptySchema1](#allofwiththefirstemptyschema1)
schema class | -| static class | [AllofWithTheFirstEmptySchema.Schema1Boxed](#schema1boxed)
abstract sealed validated payload class | -| static class | [AllofWithTheFirstEmptySchema.Schema1BoxedNumber](#schema1boxednumber)
boxed class to store validated Number payloads | +| sealed interface | [AllofWithTheFirstEmptySchema.Schema1Boxed](#schema1boxed)
sealed interface for validated payloads | +| record | [AllofWithTheFirstEmptySchema.Schema1BoxedNumber](#schema1boxednumber)
boxed class to store validated Number payloads | | static class | [AllofWithTheFirstEmptySchema.Schema1](#schema1)
schema class | -| static class | [AllofWithTheFirstEmptySchema.Schema0Boxed](#schema0boxed)
abstract sealed validated payload class | -| static class | [AllofWithTheFirstEmptySchema.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | -| static class | [AllofWithTheFirstEmptySchema.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | -| static class | [AllofWithTheFirstEmptySchema.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | -| static class | [AllofWithTheFirstEmptySchema.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | -| static class | [AllofWithTheFirstEmptySchema.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | -| static class | [AllofWithTheFirstEmptySchema.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AllofWithTheFirstEmptySchema.Schema0Boxed](#schema0boxed)
sealed interface for validated payloads | +| record | [AllofWithTheFirstEmptySchema.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | +| record | [AllofWithTheFirstEmptySchema.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | +| record | [AllofWithTheFirstEmptySchema.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | +| record | [AllofWithTheFirstEmptySchema.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | +| record | [AllofWithTheFirstEmptySchema.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | +| record | [AllofWithTheFirstEmptySchema.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | | static class | [AllofWithTheFirstEmptySchema.Schema0](#schema0)
schema class | ## AllofWithTheFirstEmptySchema1Boxed -public static abstract sealed class AllofWithTheFirstEmptySchema1Boxed
+public sealed interface AllofWithTheFirstEmptySchema1Boxed
permits
[AllofWithTheFirstEmptySchema1BoxedVoid](#allofwiththefirstemptyschema1boxedvoid), [AllofWithTheFirstEmptySchema1BoxedBoolean](#allofwiththefirstemptyschema1boxedboolean), @@ -40,103 +40,109 @@ permits
[AllofWithTheFirstEmptySchema1BoxedList](#allofwiththefirstemptyschema1boxedlist), [AllofWithTheFirstEmptySchema1BoxedMap](#allofwiththefirstemptyschema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AllofWithTheFirstEmptySchema1BoxedVoid -public static final class AllofWithTheFirstEmptySchema1BoxedVoid
-extends [AllofWithTheFirstEmptySchema1Boxed](#allofwiththefirstemptyschema1boxed) +public record AllofWithTheFirstEmptySchema1BoxedVoid
+implements [AllofWithTheFirstEmptySchema1Boxed](#allofwiththefirstemptyschema1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofWithTheFirstEmptySchema1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofWithTheFirstEmptySchema1BoxedBoolean -public static final class AllofWithTheFirstEmptySchema1BoxedBoolean
-extends [AllofWithTheFirstEmptySchema1Boxed](#allofwiththefirstemptyschema1boxed) +public record AllofWithTheFirstEmptySchema1BoxedBoolean
+implements [AllofWithTheFirstEmptySchema1Boxed](#allofwiththefirstemptyschema1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofWithTheFirstEmptySchema1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofWithTheFirstEmptySchema1BoxedNumber -public static final class AllofWithTheFirstEmptySchema1BoxedNumber
-extends [AllofWithTheFirstEmptySchema1Boxed](#allofwiththefirstemptyschema1boxed) +public record AllofWithTheFirstEmptySchema1BoxedNumber
+implements [AllofWithTheFirstEmptySchema1Boxed](#allofwiththefirstemptyschema1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofWithTheFirstEmptySchema1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofWithTheFirstEmptySchema1BoxedString -public static final class AllofWithTheFirstEmptySchema1BoxedString
-extends [AllofWithTheFirstEmptySchema1Boxed](#allofwiththefirstemptyschema1boxed) +public record AllofWithTheFirstEmptySchema1BoxedString
+implements [AllofWithTheFirstEmptySchema1Boxed](#allofwiththefirstemptyschema1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofWithTheFirstEmptySchema1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofWithTheFirstEmptySchema1BoxedList -public static final class AllofWithTheFirstEmptySchema1BoxedList
-extends [AllofWithTheFirstEmptySchema1Boxed](#allofwiththefirstemptyschema1boxed) +public record AllofWithTheFirstEmptySchema1BoxedList
+implements [AllofWithTheFirstEmptySchema1Boxed](#allofwiththefirstemptyschema1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofWithTheFirstEmptySchema1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofWithTheFirstEmptySchema1BoxedMap -public static final class AllofWithTheFirstEmptySchema1BoxedMap
-extends [AllofWithTheFirstEmptySchema1Boxed](#allofwiththefirstemptyschema1boxed) +public record AllofWithTheFirstEmptySchema1BoxedMap
+implements [AllofWithTheFirstEmptySchema1Boxed](#allofwiththefirstemptyschema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofWithTheFirstEmptySchema1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofWithTheFirstEmptySchema1 public static class AllofWithTheFirstEmptySchema1
@@ -168,29 +174,32 @@ A schema class that validates payloads | [AllofWithTheFirstEmptySchema1BoxedBoolean](#allofwiththefirstemptyschema1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [AllofWithTheFirstEmptySchema1BoxedMap](#allofwiththefirstemptyschema1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [AllofWithTheFirstEmptySchema1BoxedList](#allofwiththefirstemptyschema1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [AllofWithTheFirstEmptySchema1Boxed](#allofwiththefirstemptyschema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema1Boxed -public static abstract sealed class Schema1Boxed
+public sealed interface Schema1Boxed
permits
[Schema1BoxedNumber](#schema1boxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema1BoxedNumber -public static final class Schema1BoxedNumber
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedNumber
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1 public static class Schema1
@@ -204,7 +213,7 @@ A schema class that validates payloads | validateAndBox | ## Schema0Boxed -public static abstract sealed class Schema0Boxed
+public sealed interface Schema0Boxed
permits
[Schema0BoxedVoid](#schema0boxedvoid), [Schema0BoxedBoolean](#schema0boxedboolean), @@ -213,103 +222,109 @@ permits
[Schema0BoxedList](#schema0boxedlist), [Schema0BoxedMap](#schema0boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema0BoxedVoid -public static final class Schema0BoxedVoid
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedVoid
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedBoolean -public static final class Schema0BoxedBoolean
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedBoolean
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedNumber -public static final class Schema0BoxedNumber
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedNumber
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedString -public static final class Schema0BoxedString
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedString
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedList -public static final class Schema0BoxedList
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedList
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedMap -public static final class Schema0BoxedMap
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedMap
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0 public static class Schema0
diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/AllofWithTheLastEmptySchema.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/AllofWithTheLastEmptySchema.md index f43f920d986..6d626d52eb9 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/AllofWithTheLastEmptySchema.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/AllofWithTheLastEmptySchema.md @@ -4,34 +4,34 @@ public class AllofWithTheLastEmptySchema
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [AllofWithTheLastEmptySchema.AllofWithTheLastEmptySchema1Boxed](#allofwiththelastemptyschema1boxed)
abstract sealed validated payload class | -| static class | [AllofWithTheLastEmptySchema.AllofWithTheLastEmptySchema1BoxedVoid](#allofwiththelastemptyschema1boxedvoid)
boxed class to store validated null payloads | -| static class | [AllofWithTheLastEmptySchema.AllofWithTheLastEmptySchema1BoxedBoolean](#allofwiththelastemptyschema1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [AllofWithTheLastEmptySchema.AllofWithTheLastEmptySchema1BoxedNumber](#allofwiththelastemptyschema1boxednumber)
boxed class to store validated Number payloads | -| static class | [AllofWithTheLastEmptySchema.AllofWithTheLastEmptySchema1BoxedString](#allofwiththelastemptyschema1boxedstring)
boxed class to store validated String payloads | -| static class | [AllofWithTheLastEmptySchema.AllofWithTheLastEmptySchema1BoxedList](#allofwiththelastemptyschema1boxedlist)
boxed class to store validated List payloads | -| static class | [AllofWithTheLastEmptySchema.AllofWithTheLastEmptySchema1BoxedMap](#allofwiththelastemptyschema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AllofWithTheLastEmptySchema.AllofWithTheLastEmptySchema1Boxed](#allofwiththelastemptyschema1boxed)
sealed interface for validated payloads | +| record | [AllofWithTheLastEmptySchema.AllofWithTheLastEmptySchema1BoxedVoid](#allofwiththelastemptyschema1boxedvoid)
boxed class to store validated null payloads | +| record | [AllofWithTheLastEmptySchema.AllofWithTheLastEmptySchema1BoxedBoolean](#allofwiththelastemptyschema1boxedboolean)
boxed class to store validated boolean payloads | +| record | [AllofWithTheLastEmptySchema.AllofWithTheLastEmptySchema1BoxedNumber](#allofwiththelastemptyschema1boxednumber)
boxed class to store validated Number payloads | +| record | [AllofWithTheLastEmptySchema.AllofWithTheLastEmptySchema1BoxedString](#allofwiththelastemptyschema1boxedstring)
boxed class to store validated String payloads | +| record | [AllofWithTheLastEmptySchema.AllofWithTheLastEmptySchema1BoxedList](#allofwiththelastemptyschema1boxedlist)
boxed class to store validated List payloads | +| record | [AllofWithTheLastEmptySchema.AllofWithTheLastEmptySchema1BoxedMap](#allofwiththelastemptyschema1boxedmap)
boxed class to store validated Map payloads | | static class | [AllofWithTheLastEmptySchema.AllofWithTheLastEmptySchema1](#allofwiththelastemptyschema1)
schema class | -| static class | [AllofWithTheLastEmptySchema.Schema1Boxed](#schema1boxed)
abstract sealed validated payload class | -| static class | [AllofWithTheLastEmptySchema.Schema1BoxedVoid](#schema1boxedvoid)
boxed class to store validated null payloads | -| static class | [AllofWithTheLastEmptySchema.Schema1BoxedBoolean](#schema1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [AllofWithTheLastEmptySchema.Schema1BoxedNumber](#schema1boxednumber)
boxed class to store validated Number payloads | -| static class | [AllofWithTheLastEmptySchema.Schema1BoxedString](#schema1boxedstring)
boxed class to store validated String payloads | -| static class | [AllofWithTheLastEmptySchema.Schema1BoxedList](#schema1boxedlist)
boxed class to store validated List payloads | -| static class | [AllofWithTheLastEmptySchema.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AllofWithTheLastEmptySchema.Schema1Boxed](#schema1boxed)
sealed interface for validated payloads | +| record | [AllofWithTheLastEmptySchema.Schema1BoxedVoid](#schema1boxedvoid)
boxed class to store validated null payloads | +| record | [AllofWithTheLastEmptySchema.Schema1BoxedBoolean](#schema1boxedboolean)
boxed class to store validated boolean payloads | +| record | [AllofWithTheLastEmptySchema.Schema1BoxedNumber](#schema1boxednumber)
boxed class to store validated Number payloads | +| record | [AllofWithTheLastEmptySchema.Schema1BoxedString](#schema1boxedstring)
boxed class to store validated String payloads | +| record | [AllofWithTheLastEmptySchema.Schema1BoxedList](#schema1boxedlist)
boxed class to store validated List payloads | +| record | [AllofWithTheLastEmptySchema.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | | static class | [AllofWithTheLastEmptySchema.Schema1](#schema1)
schema class | -| static class | [AllofWithTheLastEmptySchema.Schema0Boxed](#schema0boxed)
abstract sealed validated payload class | -| static class | [AllofWithTheLastEmptySchema.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | +| sealed interface | [AllofWithTheLastEmptySchema.Schema0Boxed](#schema0boxed)
sealed interface for validated payloads | +| record | [AllofWithTheLastEmptySchema.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | | static class | [AllofWithTheLastEmptySchema.Schema0](#schema0)
schema class | ## AllofWithTheLastEmptySchema1Boxed -public static abstract sealed class AllofWithTheLastEmptySchema1Boxed
+public sealed interface AllofWithTheLastEmptySchema1Boxed
permits
[AllofWithTheLastEmptySchema1BoxedVoid](#allofwiththelastemptyschema1boxedvoid), [AllofWithTheLastEmptySchema1BoxedBoolean](#allofwiththelastemptyschema1boxedboolean), @@ -40,103 +40,109 @@ permits
[AllofWithTheLastEmptySchema1BoxedList](#allofwiththelastemptyschema1boxedlist), [AllofWithTheLastEmptySchema1BoxedMap](#allofwiththelastemptyschema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AllofWithTheLastEmptySchema1BoxedVoid -public static final class AllofWithTheLastEmptySchema1BoxedVoid
-extends [AllofWithTheLastEmptySchema1Boxed](#allofwiththelastemptyschema1boxed) +public record AllofWithTheLastEmptySchema1BoxedVoid
+implements [AllofWithTheLastEmptySchema1Boxed](#allofwiththelastemptyschema1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofWithTheLastEmptySchema1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofWithTheLastEmptySchema1BoxedBoolean -public static final class AllofWithTheLastEmptySchema1BoxedBoolean
-extends [AllofWithTheLastEmptySchema1Boxed](#allofwiththelastemptyschema1boxed) +public record AllofWithTheLastEmptySchema1BoxedBoolean
+implements [AllofWithTheLastEmptySchema1Boxed](#allofwiththelastemptyschema1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofWithTheLastEmptySchema1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofWithTheLastEmptySchema1BoxedNumber -public static final class AllofWithTheLastEmptySchema1BoxedNumber
-extends [AllofWithTheLastEmptySchema1Boxed](#allofwiththelastemptyschema1boxed) +public record AllofWithTheLastEmptySchema1BoxedNumber
+implements [AllofWithTheLastEmptySchema1Boxed](#allofwiththelastemptyschema1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofWithTheLastEmptySchema1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofWithTheLastEmptySchema1BoxedString -public static final class AllofWithTheLastEmptySchema1BoxedString
-extends [AllofWithTheLastEmptySchema1Boxed](#allofwiththelastemptyschema1boxed) +public record AllofWithTheLastEmptySchema1BoxedString
+implements [AllofWithTheLastEmptySchema1Boxed](#allofwiththelastemptyschema1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofWithTheLastEmptySchema1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofWithTheLastEmptySchema1BoxedList -public static final class AllofWithTheLastEmptySchema1BoxedList
-extends [AllofWithTheLastEmptySchema1Boxed](#allofwiththelastemptyschema1boxed) +public record AllofWithTheLastEmptySchema1BoxedList
+implements [AllofWithTheLastEmptySchema1Boxed](#allofwiththelastemptyschema1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofWithTheLastEmptySchema1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofWithTheLastEmptySchema1BoxedMap -public static final class AllofWithTheLastEmptySchema1BoxedMap
-extends [AllofWithTheLastEmptySchema1Boxed](#allofwiththelastemptyschema1boxed) +public record AllofWithTheLastEmptySchema1BoxedMap
+implements [AllofWithTheLastEmptySchema1Boxed](#allofwiththelastemptyschema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofWithTheLastEmptySchema1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofWithTheLastEmptySchema1 public static class AllofWithTheLastEmptySchema1
@@ -168,9 +174,11 @@ A schema class that validates payloads | [AllofWithTheLastEmptySchema1BoxedBoolean](#allofwiththelastemptyschema1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [AllofWithTheLastEmptySchema1BoxedMap](#allofwiththelastemptyschema1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [AllofWithTheLastEmptySchema1BoxedList](#allofwiththelastemptyschema1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [AllofWithTheLastEmptySchema1Boxed](#allofwiththelastemptyschema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema1Boxed -public static abstract sealed class Schema1Boxed
+public sealed interface Schema1Boxed
permits
[Schema1BoxedVoid](#schema1boxedvoid), [Schema1BoxedBoolean](#schema1boxedboolean), @@ -179,103 +187,109 @@ permits
[Schema1BoxedList](#schema1boxedlist), [Schema1BoxedMap](#schema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema1BoxedVoid -public static final class Schema1BoxedVoid
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedVoid
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedBoolean -public static final class Schema1BoxedBoolean
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedBoolean
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedNumber -public static final class Schema1BoxedNumber
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedNumber
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedString -public static final class Schema1BoxedString
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedString
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedList -public static final class Schema1BoxedList
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedList
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedMap -public static final class Schema1BoxedMap
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedMap
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1 public static class Schema1
@@ -289,27 +303,28 @@ A schema class that validates payloads | validateAndBox | ## Schema0Boxed -public static abstract sealed class Schema0Boxed
+public sealed interface Schema0Boxed
permits
[Schema0BoxedNumber](#schema0boxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema0BoxedNumber -public static final class Schema0BoxedNumber
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedNumber
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0 public static class Schema0
diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/AllofWithTwoEmptySchemas.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/AllofWithTwoEmptySchemas.md index e72c6155a05..4875f70770c 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/AllofWithTwoEmptySchemas.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/AllofWithTwoEmptySchemas.md @@ -4,39 +4,39 @@ public class AllofWithTwoEmptySchemas
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [AllofWithTwoEmptySchemas.AllofWithTwoEmptySchemas1Boxed](#allofwithtwoemptyschemas1boxed)
abstract sealed validated payload class | -| static class | [AllofWithTwoEmptySchemas.AllofWithTwoEmptySchemas1BoxedVoid](#allofwithtwoemptyschemas1boxedvoid)
boxed class to store validated null payloads | -| static class | [AllofWithTwoEmptySchemas.AllofWithTwoEmptySchemas1BoxedBoolean](#allofwithtwoemptyschemas1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [AllofWithTwoEmptySchemas.AllofWithTwoEmptySchemas1BoxedNumber](#allofwithtwoemptyschemas1boxednumber)
boxed class to store validated Number payloads | -| static class | [AllofWithTwoEmptySchemas.AllofWithTwoEmptySchemas1BoxedString](#allofwithtwoemptyschemas1boxedstring)
boxed class to store validated String payloads | -| static class | [AllofWithTwoEmptySchemas.AllofWithTwoEmptySchemas1BoxedList](#allofwithtwoemptyschemas1boxedlist)
boxed class to store validated List payloads | -| static class | [AllofWithTwoEmptySchemas.AllofWithTwoEmptySchemas1BoxedMap](#allofwithtwoemptyschemas1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AllofWithTwoEmptySchemas.AllofWithTwoEmptySchemas1Boxed](#allofwithtwoemptyschemas1boxed)
sealed interface for validated payloads | +| record | [AllofWithTwoEmptySchemas.AllofWithTwoEmptySchemas1BoxedVoid](#allofwithtwoemptyschemas1boxedvoid)
boxed class to store validated null payloads | +| record | [AllofWithTwoEmptySchemas.AllofWithTwoEmptySchemas1BoxedBoolean](#allofwithtwoemptyschemas1boxedboolean)
boxed class to store validated boolean payloads | +| record | [AllofWithTwoEmptySchemas.AllofWithTwoEmptySchemas1BoxedNumber](#allofwithtwoemptyschemas1boxednumber)
boxed class to store validated Number payloads | +| record | [AllofWithTwoEmptySchemas.AllofWithTwoEmptySchemas1BoxedString](#allofwithtwoemptyschemas1boxedstring)
boxed class to store validated String payloads | +| record | [AllofWithTwoEmptySchemas.AllofWithTwoEmptySchemas1BoxedList](#allofwithtwoemptyschemas1boxedlist)
boxed class to store validated List payloads | +| record | [AllofWithTwoEmptySchemas.AllofWithTwoEmptySchemas1BoxedMap](#allofwithtwoemptyschemas1boxedmap)
boxed class to store validated Map payloads | | static class | [AllofWithTwoEmptySchemas.AllofWithTwoEmptySchemas1](#allofwithtwoemptyschemas1)
schema class | -| static class | [AllofWithTwoEmptySchemas.Schema1Boxed](#schema1boxed)
abstract sealed validated payload class | -| static class | [AllofWithTwoEmptySchemas.Schema1BoxedVoid](#schema1boxedvoid)
boxed class to store validated null payloads | -| static class | [AllofWithTwoEmptySchemas.Schema1BoxedBoolean](#schema1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [AllofWithTwoEmptySchemas.Schema1BoxedNumber](#schema1boxednumber)
boxed class to store validated Number payloads | -| static class | [AllofWithTwoEmptySchemas.Schema1BoxedString](#schema1boxedstring)
boxed class to store validated String payloads | -| static class | [AllofWithTwoEmptySchemas.Schema1BoxedList](#schema1boxedlist)
boxed class to store validated List payloads | -| static class | [AllofWithTwoEmptySchemas.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AllofWithTwoEmptySchemas.Schema1Boxed](#schema1boxed)
sealed interface for validated payloads | +| record | [AllofWithTwoEmptySchemas.Schema1BoxedVoid](#schema1boxedvoid)
boxed class to store validated null payloads | +| record | [AllofWithTwoEmptySchemas.Schema1BoxedBoolean](#schema1boxedboolean)
boxed class to store validated boolean payloads | +| record | [AllofWithTwoEmptySchemas.Schema1BoxedNumber](#schema1boxednumber)
boxed class to store validated Number payloads | +| record | [AllofWithTwoEmptySchemas.Schema1BoxedString](#schema1boxedstring)
boxed class to store validated String payloads | +| record | [AllofWithTwoEmptySchemas.Schema1BoxedList](#schema1boxedlist)
boxed class to store validated List payloads | +| record | [AllofWithTwoEmptySchemas.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | | static class | [AllofWithTwoEmptySchemas.Schema1](#schema1)
schema class | -| static class | [AllofWithTwoEmptySchemas.Schema0Boxed](#schema0boxed)
abstract sealed validated payload class | -| static class | [AllofWithTwoEmptySchemas.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | -| static class | [AllofWithTwoEmptySchemas.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | -| static class | [AllofWithTwoEmptySchemas.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | -| static class | [AllofWithTwoEmptySchemas.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | -| static class | [AllofWithTwoEmptySchemas.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | -| static class | [AllofWithTwoEmptySchemas.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AllofWithTwoEmptySchemas.Schema0Boxed](#schema0boxed)
sealed interface for validated payloads | +| record | [AllofWithTwoEmptySchemas.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | +| record | [AllofWithTwoEmptySchemas.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | +| record | [AllofWithTwoEmptySchemas.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | +| record | [AllofWithTwoEmptySchemas.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | +| record | [AllofWithTwoEmptySchemas.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | +| record | [AllofWithTwoEmptySchemas.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | | static class | [AllofWithTwoEmptySchemas.Schema0](#schema0)
schema class | ## AllofWithTwoEmptySchemas1Boxed -public static abstract sealed class AllofWithTwoEmptySchemas1Boxed
+public sealed interface AllofWithTwoEmptySchemas1Boxed
permits
[AllofWithTwoEmptySchemas1BoxedVoid](#allofwithtwoemptyschemas1boxedvoid), [AllofWithTwoEmptySchemas1BoxedBoolean](#allofwithtwoemptyschemas1boxedboolean), @@ -45,103 +45,109 @@ permits
[AllofWithTwoEmptySchemas1BoxedList](#allofwithtwoemptyschemas1boxedlist), [AllofWithTwoEmptySchemas1BoxedMap](#allofwithtwoemptyschemas1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AllofWithTwoEmptySchemas1BoxedVoid -public static final class AllofWithTwoEmptySchemas1BoxedVoid
-extends [AllofWithTwoEmptySchemas1Boxed](#allofwithtwoemptyschemas1boxed) +public record AllofWithTwoEmptySchemas1BoxedVoid
+implements [AllofWithTwoEmptySchemas1Boxed](#allofwithtwoemptyschemas1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofWithTwoEmptySchemas1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofWithTwoEmptySchemas1BoxedBoolean -public static final class AllofWithTwoEmptySchemas1BoxedBoolean
-extends [AllofWithTwoEmptySchemas1Boxed](#allofwithtwoemptyschemas1boxed) +public record AllofWithTwoEmptySchemas1BoxedBoolean
+implements [AllofWithTwoEmptySchemas1Boxed](#allofwithtwoemptyschemas1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofWithTwoEmptySchemas1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofWithTwoEmptySchemas1BoxedNumber -public static final class AllofWithTwoEmptySchemas1BoxedNumber
-extends [AllofWithTwoEmptySchemas1Boxed](#allofwithtwoemptyschemas1boxed) +public record AllofWithTwoEmptySchemas1BoxedNumber
+implements [AllofWithTwoEmptySchemas1Boxed](#allofwithtwoemptyschemas1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofWithTwoEmptySchemas1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofWithTwoEmptySchemas1BoxedString -public static final class AllofWithTwoEmptySchemas1BoxedString
-extends [AllofWithTwoEmptySchemas1Boxed](#allofwithtwoemptyschemas1boxed) +public record AllofWithTwoEmptySchemas1BoxedString
+implements [AllofWithTwoEmptySchemas1Boxed](#allofwithtwoemptyschemas1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofWithTwoEmptySchemas1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofWithTwoEmptySchemas1BoxedList -public static final class AllofWithTwoEmptySchemas1BoxedList
-extends [AllofWithTwoEmptySchemas1Boxed](#allofwithtwoemptyschemas1boxed) +public record AllofWithTwoEmptySchemas1BoxedList
+implements [AllofWithTwoEmptySchemas1Boxed](#allofwithtwoemptyschemas1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofWithTwoEmptySchemas1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofWithTwoEmptySchemas1BoxedMap -public static final class AllofWithTwoEmptySchemas1BoxedMap
-extends [AllofWithTwoEmptySchemas1Boxed](#allofwithtwoemptyschemas1boxed) +public record AllofWithTwoEmptySchemas1BoxedMap
+implements [AllofWithTwoEmptySchemas1Boxed](#allofwithtwoemptyschemas1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofWithTwoEmptySchemas1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofWithTwoEmptySchemas1 public static class AllofWithTwoEmptySchemas1
@@ -173,9 +179,11 @@ A schema class that validates payloads | [AllofWithTwoEmptySchemas1BoxedBoolean](#allofwithtwoemptyschemas1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [AllofWithTwoEmptySchemas1BoxedMap](#allofwithtwoemptyschemas1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [AllofWithTwoEmptySchemas1BoxedList](#allofwithtwoemptyschemas1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [AllofWithTwoEmptySchemas1Boxed](#allofwithtwoemptyschemas1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema1Boxed -public static abstract sealed class Schema1Boxed
+public sealed interface Schema1Boxed
permits
[Schema1BoxedVoid](#schema1boxedvoid), [Schema1BoxedBoolean](#schema1boxedboolean), @@ -184,103 +192,109 @@ permits
[Schema1BoxedList](#schema1boxedlist), [Schema1BoxedMap](#schema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema1BoxedVoid -public static final class Schema1BoxedVoid
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedVoid
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedBoolean -public static final class Schema1BoxedBoolean
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedBoolean
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedNumber -public static final class Schema1BoxedNumber
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedNumber
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedString -public static final class Schema1BoxedString
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedString
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedList -public static final class Schema1BoxedList
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedList
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedMap -public static final class Schema1BoxedMap
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedMap
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1 public static class Schema1
@@ -294,7 +308,7 @@ A schema class that validates payloads | validateAndBox | ## Schema0Boxed -public static abstract sealed class Schema0Boxed
+public sealed interface Schema0Boxed
permits
[Schema0BoxedVoid](#schema0boxedvoid), [Schema0BoxedBoolean](#schema0boxedboolean), @@ -303,103 +317,109 @@ permits
[Schema0BoxedList](#schema0boxedlist), [Schema0BoxedMap](#schema0boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema0BoxedVoid -public static final class Schema0BoxedVoid
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedVoid
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedBoolean -public static final class Schema0BoxedBoolean
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedBoolean
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedNumber -public static final class Schema0BoxedNumber
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedNumber
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedString -public static final class Schema0BoxedString
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedString
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedList -public static final class Schema0BoxedList
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedList
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedMap -public static final class Schema0BoxedMap
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedMap
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0 public static class Schema0
diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/Anyof.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/Anyof.md index 8c0f413375b..316b94bb0d9 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/Anyof.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/Anyof.md @@ -4,34 +4,34 @@ public class Anyof
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Anyof.Anyof1Boxed](#anyof1boxed)
abstract sealed validated payload class | -| static class | [Anyof.Anyof1BoxedVoid](#anyof1boxedvoid)
boxed class to store validated null payloads | -| static class | [Anyof.Anyof1BoxedBoolean](#anyof1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [Anyof.Anyof1BoxedNumber](#anyof1boxednumber)
boxed class to store validated Number payloads | -| static class | [Anyof.Anyof1BoxedString](#anyof1boxedstring)
boxed class to store validated String payloads | -| static class | [Anyof.Anyof1BoxedList](#anyof1boxedlist)
boxed class to store validated List payloads | -| static class | [Anyof.Anyof1BoxedMap](#anyof1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [Anyof.Anyof1Boxed](#anyof1boxed)
sealed interface for validated payloads | +| record | [Anyof.Anyof1BoxedVoid](#anyof1boxedvoid)
boxed class to store validated null payloads | +| record | [Anyof.Anyof1BoxedBoolean](#anyof1boxedboolean)
boxed class to store validated boolean payloads | +| record | [Anyof.Anyof1BoxedNumber](#anyof1boxednumber)
boxed class to store validated Number payloads | +| record | [Anyof.Anyof1BoxedString](#anyof1boxedstring)
boxed class to store validated String payloads | +| record | [Anyof.Anyof1BoxedList](#anyof1boxedlist)
boxed class to store validated List payloads | +| record | [Anyof.Anyof1BoxedMap](#anyof1boxedmap)
boxed class to store validated Map payloads | | static class | [Anyof.Anyof1](#anyof1)
schema class | -| static class | [Anyof.Schema1Boxed](#schema1boxed)
abstract sealed validated payload class | -| static class | [Anyof.Schema1BoxedVoid](#schema1boxedvoid)
boxed class to store validated null payloads | -| static class | [Anyof.Schema1BoxedBoolean](#schema1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [Anyof.Schema1BoxedNumber](#schema1boxednumber)
boxed class to store validated Number payloads | -| static class | [Anyof.Schema1BoxedString](#schema1boxedstring)
boxed class to store validated String payloads | -| static class | [Anyof.Schema1BoxedList](#schema1boxedlist)
boxed class to store validated List payloads | -| static class | [Anyof.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [Anyof.Schema1Boxed](#schema1boxed)
sealed interface for validated payloads | +| record | [Anyof.Schema1BoxedVoid](#schema1boxedvoid)
boxed class to store validated null payloads | +| record | [Anyof.Schema1BoxedBoolean](#schema1boxedboolean)
boxed class to store validated boolean payloads | +| record | [Anyof.Schema1BoxedNumber](#schema1boxednumber)
boxed class to store validated Number payloads | +| record | [Anyof.Schema1BoxedString](#schema1boxedstring)
boxed class to store validated String payloads | +| record | [Anyof.Schema1BoxedList](#schema1boxedlist)
boxed class to store validated List payloads | +| record | [Anyof.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | | static class | [Anyof.Schema1](#schema1)
schema class | -| static class | [Anyof.Schema0Boxed](#schema0boxed)
abstract sealed validated payload class | -| static class | [Anyof.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | +| sealed interface | [Anyof.Schema0Boxed](#schema0boxed)
sealed interface for validated payloads | +| record | [Anyof.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | | static class | [Anyof.Schema0](#schema0)
schema class | ## Anyof1Boxed -public static abstract sealed class Anyof1Boxed
+public sealed interface Anyof1Boxed
permits
[Anyof1BoxedVoid](#anyof1boxedvoid), [Anyof1BoxedBoolean](#anyof1boxedboolean), @@ -40,103 +40,109 @@ permits
[Anyof1BoxedList](#anyof1boxedlist), [Anyof1BoxedMap](#anyof1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Anyof1BoxedVoid -public static final class Anyof1BoxedVoid
-extends [Anyof1Boxed](#anyof1boxed) +public record Anyof1BoxedVoid
+implements [Anyof1Boxed](#anyof1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Anyof1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Anyof1BoxedBoolean -public static final class Anyof1BoxedBoolean
-extends [Anyof1Boxed](#anyof1boxed) +public record Anyof1BoxedBoolean
+implements [Anyof1Boxed](#anyof1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Anyof1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Anyof1BoxedNumber -public static final class Anyof1BoxedNumber
-extends [Anyof1Boxed](#anyof1boxed) +public record Anyof1BoxedNumber
+implements [Anyof1Boxed](#anyof1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Anyof1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Anyof1BoxedString -public static final class Anyof1BoxedString
-extends [Anyof1Boxed](#anyof1boxed) +public record Anyof1BoxedString
+implements [Anyof1Boxed](#anyof1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Anyof1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Anyof1BoxedList -public static final class Anyof1BoxedList
-extends [Anyof1Boxed](#anyof1boxed) +public record Anyof1BoxedList
+implements [Anyof1Boxed](#anyof1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Anyof1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Anyof1BoxedMap -public static final class Anyof1BoxedMap
-extends [Anyof1Boxed](#anyof1boxed) +public record Anyof1BoxedMap
+implements [Anyof1Boxed](#anyof1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Anyof1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Anyof1 public static class Anyof1
@@ -168,9 +174,11 @@ A schema class that validates payloads | [Anyof1BoxedBoolean](#anyof1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Anyof1BoxedMap](#anyof1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [Anyof1BoxedList](#anyof1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Anyof1Boxed](#anyof1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema1Boxed -public static abstract sealed class Schema1Boxed
+public sealed interface Schema1Boxed
permits
[Schema1BoxedVoid](#schema1boxedvoid), [Schema1BoxedBoolean](#schema1boxedboolean), @@ -179,103 +187,109 @@ permits
[Schema1BoxedList](#schema1boxedlist), [Schema1BoxedMap](#schema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema1BoxedVoid -public static final class Schema1BoxedVoid
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedVoid
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedBoolean -public static final class Schema1BoxedBoolean
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedBoolean
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedNumber -public static final class Schema1BoxedNumber
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedNumber
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedString -public static final class Schema1BoxedString
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedString
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedList -public static final class Schema1BoxedList
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedList
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedMap -public static final class Schema1BoxedMap
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedMap
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1 public static class Schema1
@@ -307,29 +321,32 @@ A schema class that validates payloads | [Schema1BoxedBoolean](#schema1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Schema1BoxedMap](#schema1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [Schema1BoxedList](#schema1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Schema1Boxed](#schema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema0Boxed -public static abstract sealed class Schema0Boxed
+public sealed interface Schema0Boxed
permits
[Schema0BoxedNumber](#schema0boxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema0BoxedNumber -public static final class Schema0BoxedNumber
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedNumber
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0 public static class Schema0
diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/AnyofComplexTypes.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/AnyofComplexTypes.md index 3b0fde2e61d..9d0ee6763c9 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/AnyofComplexTypes.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/AnyofComplexTypes.md @@ -4,7 +4,7 @@ public class AnyofComplexTypes
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,43 +12,43 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [AnyofComplexTypes.AnyofComplexTypes1Boxed](#anyofcomplextypes1boxed)
abstract sealed validated payload class | -| static class | [AnyofComplexTypes.AnyofComplexTypes1BoxedVoid](#anyofcomplextypes1boxedvoid)
boxed class to store validated null payloads | -| static class | [AnyofComplexTypes.AnyofComplexTypes1BoxedBoolean](#anyofcomplextypes1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [AnyofComplexTypes.AnyofComplexTypes1BoxedNumber](#anyofcomplextypes1boxednumber)
boxed class to store validated Number payloads | -| static class | [AnyofComplexTypes.AnyofComplexTypes1BoxedString](#anyofcomplextypes1boxedstring)
boxed class to store validated String payloads | -| static class | [AnyofComplexTypes.AnyofComplexTypes1BoxedList](#anyofcomplextypes1boxedlist)
boxed class to store validated List payloads | -| static class | [AnyofComplexTypes.AnyofComplexTypes1BoxedMap](#anyofcomplextypes1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AnyofComplexTypes.AnyofComplexTypes1Boxed](#anyofcomplextypes1boxed)
sealed interface for validated payloads | +| record | [AnyofComplexTypes.AnyofComplexTypes1BoxedVoid](#anyofcomplextypes1boxedvoid)
boxed class to store validated null payloads | +| record | [AnyofComplexTypes.AnyofComplexTypes1BoxedBoolean](#anyofcomplextypes1boxedboolean)
boxed class to store validated boolean payloads | +| record | [AnyofComplexTypes.AnyofComplexTypes1BoxedNumber](#anyofcomplextypes1boxednumber)
boxed class to store validated Number payloads | +| record | [AnyofComplexTypes.AnyofComplexTypes1BoxedString](#anyofcomplextypes1boxedstring)
boxed class to store validated String payloads | +| record | [AnyofComplexTypes.AnyofComplexTypes1BoxedList](#anyofcomplextypes1boxedlist)
boxed class to store validated List payloads | +| record | [AnyofComplexTypes.AnyofComplexTypes1BoxedMap](#anyofcomplextypes1boxedmap)
boxed class to store validated Map payloads | | static class | [AnyofComplexTypes.AnyofComplexTypes1](#anyofcomplextypes1)
schema class | -| static class | [AnyofComplexTypes.Schema1Boxed](#schema1boxed)
abstract sealed validated payload class | -| static class | [AnyofComplexTypes.Schema1BoxedVoid](#schema1boxedvoid)
boxed class to store validated null payloads | -| static class | [AnyofComplexTypes.Schema1BoxedBoolean](#schema1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [AnyofComplexTypes.Schema1BoxedNumber](#schema1boxednumber)
boxed class to store validated Number payloads | -| static class | [AnyofComplexTypes.Schema1BoxedString](#schema1boxedstring)
boxed class to store validated String payloads | -| static class | [AnyofComplexTypes.Schema1BoxedList](#schema1boxedlist)
boxed class to store validated List payloads | -| static class | [AnyofComplexTypes.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AnyofComplexTypes.Schema1Boxed](#schema1boxed)
sealed interface for validated payloads | +| record | [AnyofComplexTypes.Schema1BoxedVoid](#schema1boxedvoid)
boxed class to store validated null payloads | +| record | [AnyofComplexTypes.Schema1BoxedBoolean](#schema1boxedboolean)
boxed class to store validated boolean payloads | +| record | [AnyofComplexTypes.Schema1BoxedNumber](#schema1boxednumber)
boxed class to store validated Number payloads | +| record | [AnyofComplexTypes.Schema1BoxedString](#schema1boxedstring)
boxed class to store validated String payloads | +| record | [AnyofComplexTypes.Schema1BoxedList](#schema1boxedlist)
boxed class to store validated List payloads | +| record | [AnyofComplexTypes.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | | static class | [AnyofComplexTypes.Schema1](#schema1)
schema class | | static class | [AnyofComplexTypes.Schema1MapBuilder](#schema1mapbuilder)
builder for Map payloads | | static class | [AnyofComplexTypes.Schema1Map](#schema1map)
output class for Map payloads | -| static class | [AnyofComplexTypes.FooBoxed](#fooboxed)
abstract sealed validated payload class | -| static class | [AnyofComplexTypes.FooBoxedString](#fooboxedstring)
boxed class to store validated String payloads | +| sealed interface | [AnyofComplexTypes.FooBoxed](#fooboxed)
sealed interface for validated payloads | +| record | [AnyofComplexTypes.FooBoxedString](#fooboxedstring)
boxed class to store validated String payloads | | static class | [AnyofComplexTypes.Foo](#foo)
schema class | -| static class | [AnyofComplexTypes.Schema0Boxed](#schema0boxed)
abstract sealed validated payload class | -| static class | [AnyofComplexTypes.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | -| static class | [AnyofComplexTypes.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | -| static class | [AnyofComplexTypes.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | -| static class | [AnyofComplexTypes.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | -| static class | [AnyofComplexTypes.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | -| static class | [AnyofComplexTypes.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AnyofComplexTypes.Schema0Boxed](#schema0boxed)
sealed interface for validated payloads | +| record | [AnyofComplexTypes.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | +| record | [AnyofComplexTypes.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | +| record | [AnyofComplexTypes.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | +| record | [AnyofComplexTypes.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | +| record | [AnyofComplexTypes.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | +| record | [AnyofComplexTypes.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | | static class | [AnyofComplexTypes.Schema0](#schema0)
schema class | | static class | [AnyofComplexTypes.Schema0MapBuilder](#schema0mapbuilder)
builder for Map payloads | | static class | [AnyofComplexTypes.Schema0Map](#schema0map)
output class for Map payloads | -| static class | [AnyofComplexTypes.BarBoxed](#barboxed)
abstract sealed validated payload class | -| static class | [AnyofComplexTypes.BarBoxedNumber](#barboxednumber)
boxed class to store validated Number payloads | +| sealed interface | [AnyofComplexTypes.BarBoxed](#barboxed)
sealed interface for validated payloads | +| record | [AnyofComplexTypes.BarBoxedNumber](#barboxednumber)
boxed class to store validated Number payloads | | static class | [AnyofComplexTypes.Bar](#bar)
schema class | ## AnyofComplexTypes1Boxed -public static abstract sealed class AnyofComplexTypes1Boxed
+public sealed interface AnyofComplexTypes1Boxed
permits
[AnyofComplexTypes1BoxedVoid](#anyofcomplextypes1boxedvoid), [AnyofComplexTypes1BoxedBoolean](#anyofcomplextypes1boxedboolean), @@ -57,103 +57,109 @@ permits
[AnyofComplexTypes1BoxedList](#anyofcomplextypes1boxedlist), [AnyofComplexTypes1BoxedMap](#anyofcomplextypes1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AnyofComplexTypes1BoxedVoid -public static final class AnyofComplexTypes1BoxedVoid
-extends [AnyofComplexTypes1Boxed](#anyofcomplextypes1boxed) +public record AnyofComplexTypes1BoxedVoid
+implements [AnyofComplexTypes1Boxed](#anyofcomplextypes1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AnyofComplexTypes1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AnyofComplexTypes1BoxedBoolean -public static final class AnyofComplexTypes1BoxedBoolean
-extends [AnyofComplexTypes1Boxed](#anyofcomplextypes1boxed) +public record AnyofComplexTypes1BoxedBoolean
+implements [AnyofComplexTypes1Boxed](#anyofcomplextypes1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AnyofComplexTypes1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AnyofComplexTypes1BoxedNumber -public static final class AnyofComplexTypes1BoxedNumber
-extends [AnyofComplexTypes1Boxed](#anyofcomplextypes1boxed) +public record AnyofComplexTypes1BoxedNumber
+implements [AnyofComplexTypes1Boxed](#anyofcomplextypes1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AnyofComplexTypes1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AnyofComplexTypes1BoxedString -public static final class AnyofComplexTypes1BoxedString
-extends [AnyofComplexTypes1Boxed](#anyofcomplextypes1boxed) +public record AnyofComplexTypes1BoxedString
+implements [AnyofComplexTypes1Boxed](#anyofcomplextypes1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AnyofComplexTypes1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AnyofComplexTypes1BoxedList -public static final class AnyofComplexTypes1BoxedList
-extends [AnyofComplexTypes1Boxed](#anyofcomplextypes1boxed) +public record AnyofComplexTypes1BoxedList
+implements [AnyofComplexTypes1Boxed](#anyofcomplextypes1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AnyofComplexTypes1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AnyofComplexTypes1BoxedMap -public static final class AnyofComplexTypes1BoxedMap
-extends [AnyofComplexTypes1Boxed](#anyofcomplextypes1boxed) +public record AnyofComplexTypes1BoxedMap
+implements [AnyofComplexTypes1Boxed](#anyofcomplextypes1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AnyofComplexTypes1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AnyofComplexTypes1 public static class AnyofComplexTypes1
@@ -185,9 +191,11 @@ A schema class that validates payloads | [AnyofComplexTypes1BoxedBoolean](#anyofcomplextypes1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [AnyofComplexTypes1BoxedMap](#anyofcomplextypes1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [AnyofComplexTypes1BoxedList](#anyofcomplextypes1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [AnyofComplexTypes1Boxed](#anyofcomplextypes1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema1Boxed -public static abstract sealed class Schema1Boxed
+public sealed interface Schema1Boxed
permits
[Schema1BoxedVoid](#schema1boxedvoid), [Schema1BoxedBoolean](#schema1boxedboolean), @@ -196,103 +204,109 @@ permits
[Schema1BoxedList](#schema1boxedlist), [Schema1BoxedMap](#schema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema1BoxedVoid -public static final class Schema1BoxedVoid
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedVoid
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedBoolean -public static final class Schema1BoxedBoolean
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedBoolean
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedNumber -public static final class Schema1BoxedNumber
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedNumber
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedString -public static final class Schema1BoxedString
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedString
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedList -public static final class Schema1BoxedList
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedList
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedMap -public static final class Schema1BoxedMap
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedMap
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedMap([Schema1Map](#schema1map) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [Schema1Map](#schema1map) | data
validated payload | +| [Schema1Map](#schema1map) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1 public static class Schema1
@@ -325,7 +339,9 @@ A schema class that validates payloads | [Schema1BoxedBoolean](#schema1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Schema1BoxedMap](#schema1boxedmap) | validateAndBox([Map<?, ?>](#schema1mapbuilder) arg, SchemaConfiguration configuration) | | [Schema1BoxedList](#schema1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Schema1Boxed](#schema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema1Map0Builder public class Schema1Map0Builder
builder for `Map` @@ -381,27 +397,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## FooBoxed -public static abstract sealed class FooBoxed
+public sealed interface FooBoxed
permits
[FooBoxedString](#fooboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## FooBoxedString -public static final class FooBoxedString
-extends [FooBoxed](#fooboxed) +public record FooBoxedString
+implements [FooBoxed](#fooboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Foo public static class Foo
@@ -415,7 +432,7 @@ A schema class that validates payloads | validateAndBox | ## Schema0Boxed -public static abstract sealed class Schema0Boxed
+public sealed interface Schema0Boxed
permits
[Schema0BoxedVoid](#schema0boxedvoid), [Schema0BoxedBoolean](#schema0boxedboolean), @@ -424,103 +441,109 @@ permits
[Schema0BoxedList](#schema0boxedlist), [Schema0BoxedMap](#schema0boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema0BoxedVoid -public static final class Schema0BoxedVoid
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedVoid
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedBoolean -public static final class Schema0BoxedBoolean
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedBoolean
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedNumber -public static final class Schema0BoxedNumber
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedNumber
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedString -public static final class Schema0BoxedString
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedString
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedList -public static final class Schema0BoxedList
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedList
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedMap -public static final class Schema0BoxedMap
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedMap
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedMap([Schema0Map](#schema0map) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [Schema0Map](#schema0map) | data
validated payload | +| [Schema0Map](#schema0map) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0 public static class Schema0
@@ -553,7 +576,9 @@ A schema class that validates payloads | [Schema0BoxedBoolean](#schema0boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Schema0BoxedMap](#schema0boxedmap) | validateAndBox([Map<?, ?>](#schema0mapbuilder) arg, SchemaConfiguration configuration) | | [Schema0BoxedList](#schema0boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Schema0Boxed](#schema0boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema0Map0Builder public class Schema0Map0Builder
builder for `Map` @@ -612,27 +637,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## BarBoxed -public static abstract sealed class BarBoxed
+public sealed interface BarBoxed
permits
[BarBoxedNumber](#barboxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## BarBoxedNumber -public static final class BarBoxedNumber
-extends [BarBoxed](#barboxed) +public record BarBoxedNumber
+implements [BarBoxed](#barboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BarBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Bar public static class Bar
diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/AnyofWithBaseSchema.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/AnyofWithBaseSchema.md index 4f9f5d6e379..d0b22fd2a54 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/AnyofWithBaseSchema.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/AnyofWithBaseSchema.md @@ -4,54 +4,55 @@ public class AnyofWithBaseSchema
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [AnyofWithBaseSchema.AnyofWithBaseSchema1Boxed](#anyofwithbaseschema1boxed)
abstract sealed validated payload class | -| static class | [AnyofWithBaseSchema.AnyofWithBaseSchema1BoxedString](#anyofwithbaseschema1boxedstring)
boxed class to store validated String payloads | +| sealed interface | [AnyofWithBaseSchema.AnyofWithBaseSchema1Boxed](#anyofwithbaseschema1boxed)
sealed interface for validated payloads | +| record | [AnyofWithBaseSchema.AnyofWithBaseSchema1BoxedString](#anyofwithbaseschema1boxedstring)
boxed class to store validated String payloads | | static class | [AnyofWithBaseSchema.AnyofWithBaseSchema1](#anyofwithbaseschema1)
schema class | -| static class | [AnyofWithBaseSchema.Schema1Boxed](#schema1boxed)
abstract sealed validated payload class | -| static class | [AnyofWithBaseSchema.Schema1BoxedVoid](#schema1boxedvoid)
boxed class to store validated null payloads | -| static class | [AnyofWithBaseSchema.Schema1BoxedBoolean](#schema1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [AnyofWithBaseSchema.Schema1BoxedNumber](#schema1boxednumber)
boxed class to store validated Number payloads | -| static class | [AnyofWithBaseSchema.Schema1BoxedString](#schema1boxedstring)
boxed class to store validated String payloads | -| static class | [AnyofWithBaseSchema.Schema1BoxedList](#schema1boxedlist)
boxed class to store validated List payloads | -| static class | [AnyofWithBaseSchema.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AnyofWithBaseSchema.Schema1Boxed](#schema1boxed)
sealed interface for validated payloads | +| record | [AnyofWithBaseSchema.Schema1BoxedVoid](#schema1boxedvoid)
boxed class to store validated null payloads | +| record | [AnyofWithBaseSchema.Schema1BoxedBoolean](#schema1boxedboolean)
boxed class to store validated boolean payloads | +| record | [AnyofWithBaseSchema.Schema1BoxedNumber](#schema1boxednumber)
boxed class to store validated Number payloads | +| record | [AnyofWithBaseSchema.Schema1BoxedString](#schema1boxedstring)
boxed class to store validated String payloads | +| record | [AnyofWithBaseSchema.Schema1BoxedList](#schema1boxedlist)
boxed class to store validated List payloads | +| record | [AnyofWithBaseSchema.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | | static class | [AnyofWithBaseSchema.Schema1](#schema1)
schema class | -| static class | [AnyofWithBaseSchema.Schema0Boxed](#schema0boxed)
abstract sealed validated payload class | -| static class | [AnyofWithBaseSchema.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | -| static class | [AnyofWithBaseSchema.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | -| static class | [AnyofWithBaseSchema.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | -| static class | [AnyofWithBaseSchema.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | -| static class | [AnyofWithBaseSchema.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | -| static class | [AnyofWithBaseSchema.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AnyofWithBaseSchema.Schema0Boxed](#schema0boxed)
sealed interface for validated payloads | +| record | [AnyofWithBaseSchema.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | +| record | [AnyofWithBaseSchema.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | +| record | [AnyofWithBaseSchema.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | +| record | [AnyofWithBaseSchema.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | +| record | [AnyofWithBaseSchema.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | +| record | [AnyofWithBaseSchema.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | | static class | [AnyofWithBaseSchema.Schema0](#schema0)
schema class | ## AnyofWithBaseSchema1Boxed -public static abstract sealed class AnyofWithBaseSchema1Boxed
+public sealed interface AnyofWithBaseSchema1Boxed
permits
[AnyofWithBaseSchema1BoxedString](#anyofwithbaseschema1boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AnyofWithBaseSchema1BoxedString -public static final class AnyofWithBaseSchema1BoxedString
-extends [AnyofWithBaseSchema1Boxed](#anyofwithbaseschema1boxed) +public record AnyofWithBaseSchema1BoxedString
+implements [AnyofWithBaseSchema1Boxed](#anyofwithbaseschema1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AnyofWithBaseSchema1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AnyofWithBaseSchema1 public static class AnyofWithBaseSchema1
@@ -92,9 +93,11 @@ String validatedPayload = AnyofWithBaseSchema.AnyofWithBaseSchema1.validate( | ----------------- | ---------------------- | | String | validate(String arg, SchemaConfiguration configuration) | | [AnyofWithBaseSchema1BoxedString](#anyofwithbaseschema1boxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [AnyofWithBaseSchema1Boxed](#anyofwithbaseschema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema1Boxed -public static abstract sealed class Schema1Boxed
+public sealed interface Schema1Boxed
permits
[Schema1BoxedVoid](#schema1boxedvoid), [Schema1BoxedBoolean](#schema1boxedboolean), @@ -103,103 +106,109 @@ permits
[Schema1BoxedList](#schema1boxedlist), [Schema1BoxedMap](#schema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema1BoxedVoid -public static final class Schema1BoxedVoid
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedVoid
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedBoolean -public static final class Schema1BoxedBoolean
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedBoolean
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedNumber -public static final class Schema1BoxedNumber
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedNumber
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedString -public static final class Schema1BoxedString
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedString
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedList -public static final class Schema1BoxedList
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedList
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedMap -public static final class Schema1BoxedMap
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedMap
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1 public static class Schema1
@@ -231,9 +240,11 @@ A schema class that validates payloads | [Schema1BoxedBoolean](#schema1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Schema1BoxedMap](#schema1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [Schema1BoxedList](#schema1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Schema1Boxed](#schema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema0Boxed -public static abstract sealed class Schema0Boxed
+public sealed interface Schema0Boxed
permits
[Schema0BoxedVoid](#schema0boxedvoid), [Schema0BoxedBoolean](#schema0boxedboolean), @@ -242,103 +253,109 @@ permits
[Schema0BoxedList](#schema0boxedlist), [Schema0BoxedMap](#schema0boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema0BoxedVoid -public static final class Schema0BoxedVoid
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedVoid
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedBoolean -public static final class Schema0BoxedBoolean
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedBoolean
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedNumber -public static final class Schema0BoxedNumber
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedNumber
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedString -public static final class Schema0BoxedString
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedString
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedList -public static final class Schema0BoxedList
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedList
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedMap -public static final class Schema0BoxedMap
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedMap
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0 public static class Schema0
@@ -370,5 +387,7 @@ A schema class that validates payloads | [Schema0BoxedBoolean](#schema0boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Schema0BoxedMap](#schema0boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [Schema0BoxedList](#schema0boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Schema0Boxed](#schema0boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/AnyofWithOneEmptySchema.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/AnyofWithOneEmptySchema.md index 420dfa38f67..863a2b98c1b 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/AnyofWithOneEmptySchema.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/AnyofWithOneEmptySchema.md @@ -4,34 +4,34 @@ public class AnyofWithOneEmptySchema
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [AnyofWithOneEmptySchema.AnyofWithOneEmptySchema1Boxed](#anyofwithoneemptyschema1boxed)
abstract sealed validated payload class | -| static class | [AnyofWithOneEmptySchema.AnyofWithOneEmptySchema1BoxedVoid](#anyofwithoneemptyschema1boxedvoid)
boxed class to store validated null payloads | -| static class | [AnyofWithOneEmptySchema.AnyofWithOneEmptySchema1BoxedBoolean](#anyofwithoneemptyschema1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [AnyofWithOneEmptySchema.AnyofWithOneEmptySchema1BoxedNumber](#anyofwithoneemptyschema1boxednumber)
boxed class to store validated Number payloads | -| static class | [AnyofWithOneEmptySchema.AnyofWithOneEmptySchema1BoxedString](#anyofwithoneemptyschema1boxedstring)
boxed class to store validated String payloads | -| static class | [AnyofWithOneEmptySchema.AnyofWithOneEmptySchema1BoxedList](#anyofwithoneemptyschema1boxedlist)
boxed class to store validated List payloads | -| static class | [AnyofWithOneEmptySchema.AnyofWithOneEmptySchema1BoxedMap](#anyofwithoneemptyschema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AnyofWithOneEmptySchema.AnyofWithOneEmptySchema1Boxed](#anyofwithoneemptyschema1boxed)
sealed interface for validated payloads | +| record | [AnyofWithOneEmptySchema.AnyofWithOneEmptySchema1BoxedVoid](#anyofwithoneemptyschema1boxedvoid)
boxed class to store validated null payloads | +| record | [AnyofWithOneEmptySchema.AnyofWithOneEmptySchema1BoxedBoolean](#anyofwithoneemptyschema1boxedboolean)
boxed class to store validated boolean payloads | +| record | [AnyofWithOneEmptySchema.AnyofWithOneEmptySchema1BoxedNumber](#anyofwithoneemptyschema1boxednumber)
boxed class to store validated Number payloads | +| record | [AnyofWithOneEmptySchema.AnyofWithOneEmptySchema1BoxedString](#anyofwithoneemptyschema1boxedstring)
boxed class to store validated String payloads | +| record | [AnyofWithOneEmptySchema.AnyofWithOneEmptySchema1BoxedList](#anyofwithoneemptyschema1boxedlist)
boxed class to store validated List payloads | +| record | [AnyofWithOneEmptySchema.AnyofWithOneEmptySchema1BoxedMap](#anyofwithoneemptyschema1boxedmap)
boxed class to store validated Map payloads | | static class | [AnyofWithOneEmptySchema.AnyofWithOneEmptySchema1](#anyofwithoneemptyschema1)
schema class | -| static class | [AnyofWithOneEmptySchema.Schema1Boxed](#schema1boxed)
abstract sealed validated payload class | -| static class | [AnyofWithOneEmptySchema.Schema1BoxedVoid](#schema1boxedvoid)
boxed class to store validated null payloads | -| static class | [AnyofWithOneEmptySchema.Schema1BoxedBoolean](#schema1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [AnyofWithOneEmptySchema.Schema1BoxedNumber](#schema1boxednumber)
boxed class to store validated Number payloads | -| static class | [AnyofWithOneEmptySchema.Schema1BoxedString](#schema1boxedstring)
boxed class to store validated String payloads | -| static class | [AnyofWithOneEmptySchema.Schema1BoxedList](#schema1boxedlist)
boxed class to store validated List payloads | -| static class | [AnyofWithOneEmptySchema.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AnyofWithOneEmptySchema.Schema1Boxed](#schema1boxed)
sealed interface for validated payloads | +| record | [AnyofWithOneEmptySchema.Schema1BoxedVoid](#schema1boxedvoid)
boxed class to store validated null payloads | +| record | [AnyofWithOneEmptySchema.Schema1BoxedBoolean](#schema1boxedboolean)
boxed class to store validated boolean payloads | +| record | [AnyofWithOneEmptySchema.Schema1BoxedNumber](#schema1boxednumber)
boxed class to store validated Number payloads | +| record | [AnyofWithOneEmptySchema.Schema1BoxedString](#schema1boxedstring)
boxed class to store validated String payloads | +| record | [AnyofWithOneEmptySchema.Schema1BoxedList](#schema1boxedlist)
boxed class to store validated List payloads | +| record | [AnyofWithOneEmptySchema.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | | static class | [AnyofWithOneEmptySchema.Schema1](#schema1)
schema class | -| static class | [AnyofWithOneEmptySchema.Schema0Boxed](#schema0boxed)
abstract sealed validated payload class | -| static class | [AnyofWithOneEmptySchema.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | +| sealed interface | [AnyofWithOneEmptySchema.Schema0Boxed](#schema0boxed)
sealed interface for validated payloads | +| record | [AnyofWithOneEmptySchema.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | | static class | [AnyofWithOneEmptySchema.Schema0](#schema0)
schema class | ## AnyofWithOneEmptySchema1Boxed -public static abstract sealed class AnyofWithOneEmptySchema1Boxed
+public sealed interface AnyofWithOneEmptySchema1Boxed
permits
[AnyofWithOneEmptySchema1BoxedVoid](#anyofwithoneemptyschema1boxedvoid), [AnyofWithOneEmptySchema1BoxedBoolean](#anyofwithoneemptyschema1boxedboolean), @@ -40,103 +40,109 @@ permits
[AnyofWithOneEmptySchema1BoxedList](#anyofwithoneemptyschema1boxedlist), [AnyofWithOneEmptySchema1BoxedMap](#anyofwithoneemptyschema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AnyofWithOneEmptySchema1BoxedVoid -public static final class AnyofWithOneEmptySchema1BoxedVoid
-extends [AnyofWithOneEmptySchema1Boxed](#anyofwithoneemptyschema1boxed) +public record AnyofWithOneEmptySchema1BoxedVoid
+implements [AnyofWithOneEmptySchema1Boxed](#anyofwithoneemptyschema1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AnyofWithOneEmptySchema1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AnyofWithOneEmptySchema1BoxedBoolean -public static final class AnyofWithOneEmptySchema1BoxedBoolean
-extends [AnyofWithOneEmptySchema1Boxed](#anyofwithoneemptyschema1boxed) +public record AnyofWithOneEmptySchema1BoxedBoolean
+implements [AnyofWithOneEmptySchema1Boxed](#anyofwithoneemptyschema1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AnyofWithOneEmptySchema1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AnyofWithOneEmptySchema1BoxedNumber -public static final class AnyofWithOneEmptySchema1BoxedNumber
-extends [AnyofWithOneEmptySchema1Boxed](#anyofwithoneemptyschema1boxed) +public record AnyofWithOneEmptySchema1BoxedNumber
+implements [AnyofWithOneEmptySchema1Boxed](#anyofwithoneemptyschema1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AnyofWithOneEmptySchema1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AnyofWithOneEmptySchema1BoxedString -public static final class AnyofWithOneEmptySchema1BoxedString
-extends [AnyofWithOneEmptySchema1Boxed](#anyofwithoneemptyschema1boxed) +public record AnyofWithOneEmptySchema1BoxedString
+implements [AnyofWithOneEmptySchema1Boxed](#anyofwithoneemptyschema1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AnyofWithOneEmptySchema1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AnyofWithOneEmptySchema1BoxedList -public static final class AnyofWithOneEmptySchema1BoxedList
-extends [AnyofWithOneEmptySchema1Boxed](#anyofwithoneemptyschema1boxed) +public record AnyofWithOneEmptySchema1BoxedList
+implements [AnyofWithOneEmptySchema1Boxed](#anyofwithoneemptyschema1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AnyofWithOneEmptySchema1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AnyofWithOneEmptySchema1BoxedMap -public static final class AnyofWithOneEmptySchema1BoxedMap
-extends [AnyofWithOneEmptySchema1Boxed](#anyofwithoneemptyschema1boxed) +public record AnyofWithOneEmptySchema1BoxedMap
+implements [AnyofWithOneEmptySchema1Boxed](#anyofwithoneemptyschema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AnyofWithOneEmptySchema1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AnyofWithOneEmptySchema1 public static class AnyofWithOneEmptySchema1
@@ -168,9 +174,11 @@ A schema class that validates payloads | [AnyofWithOneEmptySchema1BoxedBoolean](#anyofwithoneemptyschema1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [AnyofWithOneEmptySchema1BoxedMap](#anyofwithoneemptyschema1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [AnyofWithOneEmptySchema1BoxedList](#anyofwithoneemptyschema1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [AnyofWithOneEmptySchema1Boxed](#anyofwithoneemptyschema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema1Boxed -public static abstract sealed class Schema1Boxed
+public sealed interface Schema1Boxed
permits
[Schema1BoxedVoid](#schema1boxedvoid), [Schema1BoxedBoolean](#schema1boxedboolean), @@ -179,103 +187,109 @@ permits
[Schema1BoxedList](#schema1boxedlist), [Schema1BoxedMap](#schema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema1BoxedVoid -public static final class Schema1BoxedVoid
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedVoid
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedBoolean -public static final class Schema1BoxedBoolean
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedBoolean
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedNumber -public static final class Schema1BoxedNumber
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedNumber
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedString -public static final class Schema1BoxedString
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedString
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedList -public static final class Schema1BoxedList
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedList
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedMap -public static final class Schema1BoxedMap
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedMap
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1 public static class Schema1
@@ -289,27 +303,28 @@ A schema class that validates payloads | validateAndBox | ## Schema0Boxed -public static abstract sealed class Schema0Boxed
+public sealed interface Schema0Boxed
permits
[Schema0BoxedNumber](#schema0boxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema0BoxedNumber -public static final class Schema0BoxedNumber
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedNumber
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0 public static class Schema0
diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/ArrayTypeMatchesArrays.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/ArrayTypeMatchesArrays.md index 752c03f7e21..21bdab9c7e9 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/ArrayTypeMatchesArrays.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/ArrayTypeMatchesArrays.md @@ -4,7 +4,7 @@ public class ArrayTypeMatchesArrays
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated list payloads, extends FrozenList - classes to build inputs for list payloads @@ -12,42 +12,43 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ArrayTypeMatchesArrays.ArrayTypeMatchesArrays1Boxed](#arraytypematchesarrays1boxed)
abstract sealed validated payload class | -| static class | [ArrayTypeMatchesArrays.ArrayTypeMatchesArrays1BoxedList](#arraytypematchesarrays1boxedlist)
boxed class to store validated List payloads | +| sealed interface | [ArrayTypeMatchesArrays.ArrayTypeMatchesArrays1Boxed](#arraytypematchesarrays1boxed)
sealed interface for validated payloads | +| record | [ArrayTypeMatchesArrays.ArrayTypeMatchesArrays1BoxedList](#arraytypematchesarrays1boxedlist)
boxed class to store validated List payloads | | static class | [ArrayTypeMatchesArrays.ArrayTypeMatchesArrays1](#arraytypematchesarrays1)
schema class | | static class | [ArrayTypeMatchesArrays.ArrayTypeMatchesArraysListBuilder](#arraytypematchesarrayslistbuilder)
builder for List payloads | | static class | [ArrayTypeMatchesArrays.ArrayTypeMatchesArraysList](#arraytypematchesarrayslist)
output class for List payloads | -| static class | [ArrayTypeMatchesArrays.ItemsBoxed](#itemsboxed)
abstract sealed validated payload class | -| static class | [ArrayTypeMatchesArrays.ItemsBoxedVoid](#itemsboxedvoid)
boxed class to store validated null payloads | -| static class | [ArrayTypeMatchesArrays.ItemsBoxedBoolean](#itemsboxedboolean)
boxed class to store validated boolean payloads | -| static class | [ArrayTypeMatchesArrays.ItemsBoxedNumber](#itemsboxednumber)
boxed class to store validated Number payloads | -| static class | [ArrayTypeMatchesArrays.ItemsBoxedString](#itemsboxedstring)
boxed class to store validated String payloads | -| static class | [ArrayTypeMatchesArrays.ItemsBoxedList](#itemsboxedlist)
boxed class to store validated List payloads | -| static class | [ArrayTypeMatchesArrays.ItemsBoxedMap](#itemsboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ArrayTypeMatchesArrays.ItemsBoxed](#itemsboxed)
sealed interface for validated payloads | +| record | [ArrayTypeMatchesArrays.ItemsBoxedVoid](#itemsboxedvoid)
boxed class to store validated null payloads | +| record | [ArrayTypeMatchesArrays.ItemsBoxedBoolean](#itemsboxedboolean)
boxed class to store validated boolean payloads | +| record | [ArrayTypeMatchesArrays.ItemsBoxedNumber](#itemsboxednumber)
boxed class to store validated Number payloads | +| record | [ArrayTypeMatchesArrays.ItemsBoxedString](#itemsboxedstring)
boxed class to store validated String payloads | +| record | [ArrayTypeMatchesArrays.ItemsBoxedList](#itemsboxedlist)
boxed class to store validated List payloads | +| record | [ArrayTypeMatchesArrays.ItemsBoxedMap](#itemsboxedmap)
boxed class to store validated Map payloads | | static class | [ArrayTypeMatchesArrays.Items](#items)
schema class | ## ArrayTypeMatchesArrays1Boxed -public static abstract sealed class ArrayTypeMatchesArrays1Boxed
+public sealed interface ArrayTypeMatchesArrays1Boxed
permits
[ArrayTypeMatchesArrays1BoxedList](#arraytypematchesarrays1boxedlist) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ArrayTypeMatchesArrays1BoxedList -public static final class ArrayTypeMatchesArrays1BoxedList
-extends [ArrayTypeMatchesArrays1Boxed](#arraytypematchesarrays1boxed) +public record ArrayTypeMatchesArrays1BoxedList
+implements [ArrayTypeMatchesArrays1Boxed](#arraytypematchesarrays1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ArrayTypeMatchesArrays1BoxedList([ArrayTypeMatchesArraysList](#arraytypematchesarrayslist) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [ArrayTypeMatchesArraysList](#arraytypematchesarrayslist) | data
validated payload | +| [ArrayTypeMatchesArraysList](#arraytypematchesarrayslist) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ArrayTypeMatchesArrays1 public static class ArrayTypeMatchesArrays1
@@ -90,7 +91,9 @@ ArrayTypeMatchesArrays.ArrayTypeMatchesArraysList validatedPayload = | ----------------- | ---------------------- | | [ArrayTypeMatchesArraysList](#arraytypematchesarrayslist) | validate([List](#arraytypematchesarrayslistbuilder) arg, SchemaConfiguration configuration) | | [ArrayTypeMatchesArrays1BoxedList](#arraytypematchesarrays1boxedlist) | validateAndBox([List](#arraytypematchesarrayslistbuilder) arg, SchemaConfiguration configuration) | +| [ArrayTypeMatchesArrays1Boxed](#arraytypematchesarrays1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ArrayTypeMatchesArraysListBuilder public class ArrayTypeMatchesArraysListBuilder
builder for `List<@Nullable Object>` @@ -129,7 +132,7 @@ A class to store validated List payloads | static [ArrayTypeMatchesArraysList](#arraytypematchesarrayslist) | of([List](#arraytypematchesarrayslistbuilder) arg, SchemaConfiguration configuration) | ## ItemsBoxed -public static abstract sealed class ItemsBoxed
+public sealed interface ItemsBoxed
permits
[ItemsBoxedVoid](#itemsboxedvoid), [ItemsBoxedBoolean](#itemsboxedboolean), @@ -138,103 +141,109 @@ permits
[ItemsBoxedList](#itemsboxedlist), [ItemsBoxedMap](#itemsboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ItemsBoxedVoid -public static final class ItemsBoxedVoid
-extends [ItemsBoxed](#itemsboxed) +public record ItemsBoxedVoid
+implements [ItemsBoxed](#itemsboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ItemsBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ItemsBoxedBoolean -public static final class ItemsBoxedBoolean
-extends [ItemsBoxed](#itemsboxed) +public record ItemsBoxedBoolean
+implements [ItemsBoxed](#itemsboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ItemsBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ItemsBoxedNumber -public static final class ItemsBoxedNumber
-extends [ItemsBoxed](#itemsboxed) +public record ItemsBoxedNumber
+implements [ItemsBoxed](#itemsboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ItemsBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ItemsBoxedString -public static final class ItemsBoxedString
-extends [ItemsBoxed](#itemsboxed) +public record ItemsBoxedString
+implements [ItemsBoxed](#itemsboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ItemsBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ItemsBoxedList -public static final class ItemsBoxedList
-extends [ItemsBoxed](#itemsboxed) +public record ItemsBoxedList
+implements [ItemsBoxed](#itemsboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ItemsBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ItemsBoxedMap -public static final class ItemsBoxedMap
-extends [ItemsBoxed](#itemsboxed) +public record ItemsBoxedMap
+implements [ItemsBoxed](#itemsboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ItemsBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Items public static class Items
diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/BooleanTypeMatchesBooleans.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/BooleanTypeMatchesBooleans.md index 5b620b259bf..96a41c9abfc 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/BooleanTypeMatchesBooleans.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/BooleanTypeMatchesBooleans.md @@ -4,38 +4,39 @@ public class BooleanTypeMatchesBooleans
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [BooleanTypeMatchesBooleans.BooleanTypeMatchesBooleans1Boxed](#booleantypematchesbooleans1boxed)
abstract sealed validated payload class | -| static class | [BooleanTypeMatchesBooleans.BooleanTypeMatchesBooleans1BoxedBoolean](#booleantypematchesbooleans1boxedboolean)
boxed class to store validated boolean payloads | +| sealed interface | [BooleanTypeMatchesBooleans.BooleanTypeMatchesBooleans1Boxed](#booleantypematchesbooleans1boxed)
sealed interface for validated payloads | +| record | [BooleanTypeMatchesBooleans.BooleanTypeMatchesBooleans1BoxedBoolean](#booleantypematchesbooleans1boxedboolean)
boxed class to store validated boolean payloads | | static class | [BooleanTypeMatchesBooleans.BooleanTypeMatchesBooleans1](#booleantypematchesbooleans1)
schema class | ## BooleanTypeMatchesBooleans1Boxed -public static abstract sealed class BooleanTypeMatchesBooleans1Boxed
+public sealed interface BooleanTypeMatchesBooleans1Boxed
permits
[BooleanTypeMatchesBooleans1BoxedBoolean](#booleantypematchesbooleans1boxedboolean) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## BooleanTypeMatchesBooleans1BoxedBoolean -public static final class BooleanTypeMatchesBooleans1BoxedBoolean
-extends [BooleanTypeMatchesBooleans1Boxed](#booleantypematchesbooleans1boxed) +public record BooleanTypeMatchesBooleans1BoxedBoolean
+implements [BooleanTypeMatchesBooleans1Boxed](#booleantypematchesbooleans1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BooleanTypeMatchesBooleans1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## BooleanTypeMatchesBooleans1 public static class BooleanTypeMatchesBooleans1
diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/ByInt.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/ByInt.md index 377a402b485..a403f2e86af 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/ByInt.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/ByInt.md @@ -4,23 +4,23 @@ public class ByInt
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ByInt.ByInt1Boxed](#byint1boxed)
abstract sealed validated payload class | -| static class | [ByInt.ByInt1BoxedVoid](#byint1boxedvoid)
boxed class to store validated null payloads | -| static class | [ByInt.ByInt1BoxedBoolean](#byint1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [ByInt.ByInt1BoxedNumber](#byint1boxednumber)
boxed class to store validated Number payloads | -| static class | [ByInt.ByInt1BoxedString](#byint1boxedstring)
boxed class to store validated String payloads | -| static class | [ByInt.ByInt1BoxedList](#byint1boxedlist)
boxed class to store validated List payloads | -| static class | [ByInt.ByInt1BoxedMap](#byint1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ByInt.ByInt1Boxed](#byint1boxed)
sealed interface for validated payloads | +| record | [ByInt.ByInt1BoxedVoid](#byint1boxedvoid)
boxed class to store validated null payloads | +| record | [ByInt.ByInt1BoxedBoolean](#byint1boxedboolean)
boxed class to store validated boolean payloads | +| record | [ByInt.ByInt1BoxedNumber](#byint1boxednumber)
boxed class to store validated Number payloads | +| record | [ByInt.ByInt1BoxedString](#byint1boxedstring)
boxed class to store validated String payloads | +| record | [ByInt.ByInt1BoxedList](#byint1boxedlist)
boxed class to store validated List payloads | +| record | [ByInt.ByInt1BoxedMap](#byint1boxedmap)
boxed class to store validated Map payloads | | static class | [ByInt.ByInt1](#byint1)
schema class | ## ByInt1Boxed -public static abstract sealed class ByInt1Boxed
+public sealed interface ByInt1Boxed
permits
[ByInt1BoxedVoid](#byint1boxedvoid), [ByInt1BoxedBoolean](#byint1boxedboolean), @@ -29,103 +29,109 @@ permits
[ByInt1BoxedList](#byint1boxedlist), [ByInt1BoxedMap](#byint1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ByInt1BoxedVoid -public static final class ByInt1BoxedVoid
-extends [ByInt1Boxed](#byint1boxed) +public record ByInt1BoxedVoid
+implements [ByInt1Boxed](#byint1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ByInt1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ByInt1BoxedBoolean -public static final class ByInt1BoxedBoolean
-extends [ByInt1Boxed](#byint1boxed) +public record ByInt1BoxedBoolean
+implements [ByInt1Boxed](#byint1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ByInt1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ByInt1BoxedNumber -public static final class ByInt1BoxedNumber
-extends [ByInt1Boxed](#byint1boxed) +public record ByInt1BoxedNumber
+implements [ByInt1Boxed](#byint1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ByInt1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ByInt1BoxedString -public static final class ByInt1BoxedString
-extends [ByInt1Boxed](#byint1boxed) +public record ByInt1BoxedString
+implements [ByInt1Boxed](#byint1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ByInt1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ByInt1BoxedList -public static final class ByInt1BoxedList
-extends [ByInt1Boxed](#byint1boxed) +public record ByInt1BoxedList
+implements [ByInt1Boxed](#byint1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ByInt1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ByInt1BoxedMap -public static final class ByInt1BoxedMap
-extends [ByInt1Boxed](#byint1boxed) +public record ByInt1BoxedMap
+implements [ByInt1Boxed](#byint1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ByInt1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ByInt1 public static class ByInt1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [ByInt1BoxedBoolean](#byint1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [ByInt1BoxedMap](#byint1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [ByInt1BoxedList](#byint1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [ByInt1Boxed](#byint1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/ByNumber.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/ByNumber.md index 392dc99034c..18757b1d71f 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/ByNumber.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/ByNumber.md @@ -4,23 +4,23 @@ public class ByNumber
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ByNumber.ByNumber1Boxed](#bynumber1boxed)
abstract sealed validated payload class | -| static class | [ByNumber.ByNumber1BoxedVoid](#bynumber1boxedvoid)
boxed class to store validated null payloads | -| static class | [ByNumber.ByNumber1BoxedBoolean](#bynumber1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [ByNumber.ByNumber1BoxedNumber](#bynumber1boxednumber)
boxed class to store validated Number payloads | -| static class | [ByNumber.ByNumber1BoxedString](#bynumber1boxedstring)
boxed class to store validated String payloads | -| static class | [ByNumber.ByNumber1BoxedList](#bynumber1boxedlist)
boxed class to store validated List payloads | -| static class | [ByNumber.ByNumber1BoxedMap](#bynumber1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ByNumber.ByNumber1Boxed](#bynumber1boxed)
sealed interface for validated payloads | +| record | [ByNumber.ByNumber1BoxedVoid](#bynumber1boxedvoid)
boxed class to store validated null payloads | +| record | [ByNumber.ByNumber1BoxedBoolean](#bynumber1boxedboolean)
boxed class to store validated boolean payloads | +| record | [ByNumber.ByNumber1BoxedNumber](#bynumber1boxednumber)
boxed class to store validated Number payloads | +| record | [ByNumber.ByNumber1BoxedString](#bynumber1boxedstring)
boxed class to store validated String payloads | +| record | [ByNumber.ByNumber1BoxedList](#bynumber1boxedlist)
boxed class to store validated List payloads | +| record | [ByNumber.ByNumber1BoxedMap](#bynumber1boxedmap)
boxed class to store validated Map payloads | | static class | [ByNumber.ByNumber1](#bynumber1)
schema class | ## ByNumber1Boxed -public static abstract sealed class ByNumber1Boxed
+public sealed interface ByNumber1Boxed
permits
[ByNumber1BoxedVoid](#bynumber1boxedvoid), [ByNumber1BoxedBoolean](#bynumber1boxedboolean), @@ -29,103 +29,109 @@ permits
[ByNumber1BoxedList](#bynumber1boxedlist), [ByNumber1BoxedMap](#bynumber1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ByNumber1BoxedVoid -public static final class ByNumber1BoxedVoid
-extends [ByNumber1Boxed](#bynumber1boxed) +public record ByNumber1BoxedVoid
+implements [ByNumber1Boxed](#bynumber1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ByNumber1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ByNumber1BoxedBoolean -public static final class ByNumber1BoxedBoolean
-extends [ByNumber1Boxed](#bynumber1boxed) +public record ByNumber1BoxedBoolean
+implements [ByNumber1Boxed](#bynumber1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ByNumber1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ByNumber1BoxedNumber -public static final class ByNumber1BoxedNumber
-extends [ByNumber1Boxed](#bynumber1boxed) +public record ByNumber1BoxedNumber
+implements [ByNumber1Boxed](#bynumber1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ByNumber1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ByNumber1BoxedString -public static final class ByNumber1BoxedString
-extends [ByNumber1Boxed](#bynumber1boxed) +public record ByNumber1BoxedString
+implements [ByNumber1Boxed](#bynumber1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ByNumber1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ByNumber1BoxedList -public static final class ByNumber1BoxedList
-extends [ByNumber1Boxed](#bynumber1boxed) +public record ByNumber1BoxedList
+implements [ByNumber1Boxed](#bynumber1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ByNumber1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ByNumber1BoxedMap -public static final class ByNumber1BoxedMap
-extends [ByNumber1Boxed](#bynumber1boxed) +public record ByNumber1BoxedMap
+implements [ByNumber1Boxed](#bynumber1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ByNumber1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ByNumber1 public static class ByNumber1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [ByNumber1BoxedBoolean](#bynumber1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [ByNumber1BoxedMap](#bynumber1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [ByNumber1BoxedList](#bynumber1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [ByNumber1Boxed](#bynumber1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/BySmallNumber.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/BySmallNumber.md index a611d905af7..db570d6827a 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/BySmallNumber.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/BySmallNumber.md @@ -4,23 +4,23 @@ public class BySmallNumber
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [BySmallNumber.BySmallNumber1Boxed](#bysmallnumber1boxed)
abstract sealed validated payload class | -| static class | [BySmallNumber.BySmallNumber1BoxedVoid](#bysmallnumber1boxedvoid)
boxed class to store validated null payloads | -| static class | [BySmallNumber.BySmallNumber1BoxedBoolean](#bysmallnumber1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [BySmallNumber.BySmallNumber1BoxedNumber](#bysmallnumber1boxednumber)
boxed class to store validated Number payloads | -| static class | [BySmallNumber.BySmallNumber1BoxedString](#bysmallnumber1boxedstring)
boxed class to store validated String payloads | -| static class | [BySmallNumber.BySmallNumber1BoxedList](#bysmallnumber1boxedlist)
boxed class to store validated List payloads | -| static class | [BySmallNumber.BySmallNumber1BoxedMap](#bysmallnumber1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [BySmallNumber.BySmallNumber1Boxed](#bysmallnumber1boxed)
sealed interface for validated payloads | +| record | [BySmallNumber.BySmallNumber1BoxedVoid](#bysmallnumber1boxedvoid)
boxed class to store validated null payloads | +| record | [BySmallNumber.BySmallNumber1BoxedBoolean](#bysmallnumber1boxedboolean)
boxed class to store validated boolean payloads | +| record | [BySmallNumber.BySmallNumber1BoxedNumber](#bysmallnumber1boxednumber)
boxed class to store validated Number payloads | +| record | [BySmallNumber.BySmallNumber1BoxedString](#bysmallnumber1boxedstring)
boxed class to store validated String payloads | +| record | [BySmallNumber.BySmallNumber1BoxedList](#bysmallnumber1boxedlist)
boxed class to store validated List payloads | +| record | [BySmallNumber.BySmallNumber1BoxedMap](#bysmallnumber1boxedmap)
boxed class to store validated Map payloads | | static class | [BySmallNumber.BySmallNumber1](#bysmallnumber1)
schema class | ## BySmallNumber1Boxed -public static abstract sealed class BySmallNumber1Boxed
+public sealed interface BySmallNumber1Boxed
permits
[BySmallNumber1BoxedVoid](#bysmallnumber1boxedvoid), [BySmallNumber1BoxedBoolean](#bysmallnumber1boxedboolean), @@ -29,103 +29,109 @@ permits
[BySmallNumber1BoxedList](#bysmallnumber1boxedlist), [BySmallNumber1BoxedMap](#bysmallnumber1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## BySmallNumber1BoxedVoid -public static final class BySmallNumber1BoxedVoid
-extends [BySmallNumber1Boxed](#bysmallnumber1boxed) +public record BySmallNumber1BoxedVoid
+implements [BySmallNumber1Boxed](#bysmallnumber1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BySmallNumber1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## BySmallNumber1BoxedBoolean -public static final class BySmallNumber1BoxedBoolean
-extends [BySmallNumber1Boxed](#bysmallnumber1boxed) +public record BySmallNumber1BoxedBoolean
+implements [BySmallNumber1Boxed](#bysmallnumber1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BySmallNumber1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## BySmallNumber1BoxedNumber -public static final class BySmallNumber1BoxedNumber
-extends [BySmallNumber1Boxed](#bysmallnumber1boxed) +public record BySmallNumber1BoxedNumber
+implements [BySmallNumber1Boxed](#bysmallnumber1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BySmallNumber1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## BySmallNumber1BoxedString -public static final class BySmallNumber1BoxedString
-extends [BySmallNumber1Boxed](#bysmallnumber1boxed) +public record BySmallNumber1BoxedString
+implements [BySmallNumber1Boxed](#bysmallnumber1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BySmallNumber1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## BySmallNumber1BoxedList -public static final class BySmallNumber1BoxedList
-extends [BySmallNumber1Boxed](#bysmallnumber1boxed) +public record BySmallNumber1BoxedList
+implements [BySmallNumber1Boxed](#bysmallnumber1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BySmallNumber1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## BySmallNumber1BoxedMap -public static final class BySmallNumber1BoxedMap
-extends [BySmallNumber1Boxed](#bysmallnumber1boxed) +public record BySmallNumber1BoxedMap
+implements [BySmallNumber1Boxed](#bysmallnumber1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BySmallNumber1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## BySmallNumber1 public static class BySmallNumber1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [BySmallNumber1BoxedBoolean](#bysmallnumber1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [BySmallNumber1BoxedMap](#bysmallnumber1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [BySmallNumber1BoxedList](#bysmallnumber1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [BySmallNumber1Boxed](#bysmallnumber1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/DateTimeFormat.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/DateTimeFormat.md index 43524236e9c..dc179875fd1 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/DateTimeFormat.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/DateTimeFormat.md @@ -4,23 +4,23 @@ public class DateTimeFormat
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [DateTimeFormat.DateTimeFormat1Boxed](#datetimeformat1boxed)
abstract sealed validated payload class | -| static class | [DateTimeFormat.DateTimeFormat1BoxedVoid](#datetimeformat1boxedvoid)
boxed class to store validated null payloads | -| static class | [DateTimeFormat.DateTimeFormat1BoxedBoolean](#datetimeformat1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [DateTimeFormat.DateTimeFormat1BoxedNumber](#datetimeformat1boxednumber)
boxed class to store validated Number payloads | -| static class | [DateTimeFormat.DateTimeFormat1BoxedString](#datetimeformat1boxedstring)
boxed class to store validated String payloads | -| static class | [DateTimeFormat.DateTimeFormat1BoxedList](#datetimeformat1boxedlist)
boxed class to store validated List payloads | -| static class | [DateTimeFormat.DateTimeFormat1BoxedMap](#datetimeformat1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [DateTimeFormat.DateTimeFormat1Boxed](#datetimeformat1boxed)
sealed interface for validated payloads | +| record | [DateTimeFormat.DateTimeFormat1BoxedVoid](#datetimeformat1boxedvoid)
boxed class to store validated null payloads | +| record | [DateTimeFormat.DateTimeFormat1BoxedBoolean](#datetimeformat1boxedboolean)
boxed class to store validated boolean payloads | +| record | [DateTimeFormat.DateTimeFormat1BoxedNumber](#datetimeformat1boxednumber)
boxed class to store validated Number payloads | +| record | [DateTimeFormat.DateTimeFormat1BoxedString](#datetimeformat1boxedstring)
boxed class to store validated String payloads | +| record | [DateTimeFormat.DateTimeFormat1BoxedList](#datetimeformat1boxedlist)
boxed class to store validated List payloads | +| record | [DateTimeFormat.DateTimeFormat1BoxedMap](#datetimeformat1boxedmap)
boxed class to store validated Map payloads | | static class | [DateTimeFormat.DateTimeFormat1](#datetimeformat1)
schema class | ## DateTimeFormat1Boxed -public static abstract sealed class DateTimeFormat1Boxed
+public sealed interface DateTimeFormat1Boxed
permits
[DateTimeFormat1BoxedVoid](#datetimeformat1boxedvoid), [DateTimeFormat1BoxedBoolean](#datetimeformat1boxedboolean), @@ -29,103 +29,109 @@ permits
[DateTimeFormat1BoxedList](#datetimeformat1boxedlist), [DateTimeFormat1BoxedMap](#datetimeformat1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## DateTimeFormat1BoxedVoid -public static final class DateTimeFormat1BoxedVoid
-extends [DateTimeFormat1Boxed](#datetimeformat1boxed) +public record DateTimeFormat1BoxedVoid
+implements [DateTimeFormat1Boxed](#datetimeformat1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DateTimeFormat1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## DateTimeFormat1BoxedBoolean -public static final class DateTimeFormat1BoxedBoolean
-extends [DateTimeFormat1Boxed](#datetimeformat1boxed) +public record DateTimeFormat1BoxedBoolean
+implements [DateTimeFormat1Boxed](#datetimeformat1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DateTimeFormat1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## DateTimeFormat1BoxedNumber -public static final class DateTimeFormat1BoxedNumber
-extends [DateTimeFormat1Boxed](#datetimeformat1boxed) +public record DateTimeFormat1BoxedNumber
+implements [DateTimeFormat1Boxed](#datetimeformat1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DateTimeFormat1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## DateTimeFormat1BoxedString -public static final class DateTimeFormat1BoxedString
-extends [DateTimeFormat1Boxed](#datetimeformat1boxed) +public record DateTimeFormat1BoxedString
+implements [DateTimeFormat1Boxed](#datetimeformat1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DateTimeFormat1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## DateTimeFormat1BoxedList -public static final class DateTimeFormat1BoxedList
-extends [DateTimeFormat1Boxed](#datetimeformat1boxed) +public record DateTimeFormat1BoxedList
+implements [DateTimeFormat1Boxed](#datetimeformat1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DateTimeFormat1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## DateTimeFormat1BoxedMap -public static final class DateTimeFormat1BoxedMap
-extends [DateTimeFormat1Boxed](#datetimeformat1boxed) +public record DateTimeFormat1BoxedMap
+implements [DateTimeFormat1Boxed](#datetimeformat1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DateTimeFormat1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## DateTimeFormat1 public static class DateTimeFormat1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [DateTimeFormat1BoxedBoolean](#datetimeformat1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [DateTimeFormat1BoxedMap](#datetimeformat1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [DateTimeFormat1BoxedList](#datetimeformat1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [DateTimeFormat1Boxed](#datetimeformat1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/EmailFormat.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/EmailFormat.md index 46f78d993c6..b3448fb331a 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/EmailFormat.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/EmailFormat.md @@ -4,23 +4,23 @@ public class EmailFormat
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [EmailFormat.EmailFormat1Boxed](#emailformat1boxed)
abstract sealed validated payload class | -| static class | [EmailFormat.EmailFormat1BoxedVoid](#emailformat1boxedvoid)
boxed class to store validated null payloads | -| static class | [EmailFormat.EmailFormat1BoxedBoolean](#emailformat1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [EmailFormat.EmailFormat1BoxedNumber](#emailformat1boxednumber)
boxed class to store validated Number payloads | -| static class | [EmailFormat.EmailFormat1BoxedString](#emailformat1boxedstring)
boxed class to store validated String payloads | -| static class | [EmailFormat.EmailFormat1BoxedList](#emailformat1boxedlist)
boxed class to store validated List payloads | -| static class | [EmailFormat.EmailFormat1BoxedMap](#emailformat1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [EmailFormat.EmailFormat1Boxed](#emailformat1boxed)
sealed interface for validated payloads | +| record | [EmailFormat.EmailFormat1BoxedVoid](#emailformat1boxedvoid)
boxed class to store validated null payloads | +| record | [EmailFormat.EmailFormat1BoxedBoolean](#emailformat1boxedboolean)
boxed class to store validated boolean payloads | +| record | [EmailFormat.EmailFormat1BoxedNumber](#emailformat1boxednumber)
boxed class to store validated Number payloads | +| record | [EmailFormat.EmailFormat1BoxedString](#emailformat1boxedstring)
boxed class to store validated String payloads | +| record | [EmailFormat.EmailFormat1BoxedList](#emailformat1boxedlist)
boxed class to store validated List payloads | +| record | [EmailFormat.EmailFormat1BoxedMap](#emailformat1boxedmap)
boxed class to store validated Map payloads | | static class | [EmailFormat.EmailFormat1](#emailformat1)
schema class | ## EmailFormat1Boxed -public static abstract sealed class EmailFormat1Boxed
+public sealed interface EmailFormat1Boxed
permits
[EmailFormat1BoxedVoid](#emailformat1boxedvoid), [EmailFormat1BoxedBoolean](#emailformat1boxedboolean), @@ -29,103 +29,109 @@ permits
[EmailFormat1BoxedList](#emailformat1boxedlist), [EmailFormat1BoxedMap](#emailformat1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## EmailFormat1BoxedVoid -public static final class EmailFormat1BoxedVoid
-extends [EmailFormat1Boxed](#emailformat1boxed) +public record EmailFormat1BoxedVoid
+implements [EmailFormat1Boxed](#emailformat1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | EmailFormat1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## EmailFormat1BoxedBoolean -public static final class EmailFormat1BoxedBoolean
-extends [EmailFormat1Boxed](#emailformat1boxed) +public record EmailFormat1BoxedBoolean
+implements [EmailFormat1Boxed](#emailformat1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | EmailFormat1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## EmailFormat1BoxedNumber -public static final class EmailFormat1BoxedNumber
-extends [EmailFormat1Boxed](#emailformat1boxed) +public record EmailFormat1BoxedNumber
+implements [EmailFormat1Boxed](#emailformat1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | EmailFormat1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## EmailFormat1BoxedString -public static final class EmailFormat1BoxedString
-extends [EmailFormat1Boxed](#emailformat1boxed) +public record EmailFormat1BoxedString
+implements [EmailFormat1Boxed](#emailformat1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | EmailFormat1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## EmailFormat1BoxedList -public static final class EmailFormat1BoxedList
-extends [EmailFormat1Boxed](#emailformat1boxed) +public record EmailFormat1BoxedList
+implements [EmailFormat1Boxed](#emailformat1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | EmailFormat1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## EmailFormat1BoxedMap -public static final class EmailFormat1BoxedMap
-extends [EmailFormat1Boxed](#emailformat1boxed) +public record EmailFormat1BoxedMap
+implements [EmailFormat1Boxed](#emailformat1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | EmailFormat1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## EmailFormat1 public static class EmailFormat1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [EmailFormat1BoxedBoolean](#emailformat1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [EmailFormat1BoxedMap](#emailformat1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [EmailFormat1BoxedList](#emailformat1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [EmailFormat1Boxed](#emailformat1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/EnumWith0DoesNotMatchFalse.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/EnumWith0DoesNotMatchFalse.md index 1ca98c55bac..e3082672184 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/EnumWith0DoesNotMatchFalse.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/EnumWith0DoesNotMatchFalse.md @@ -4,15 +4,15 @@ public class EnumWith0DoesNotMatchFalse
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - enum classes ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [EnumWith0DoesNotMatchFalse.EnumWith0DoesNotMatchFalse1Boxed](#enumwith0doesnotmatchfalse1boxed)
abstract sealed validated payload class | -| static class | [EnumWith0DoesNotMatchFalse.EnumWith0DoesNotMatchFalse1BoxedNumber](#enumwith0doesnotmatchfalse1boxednumber)
boxed class to store validated Number payloads | +| sealed interface | [EnumWith0DoesNotMatchFalse.EnumWith0DoesNotMatchFalse1Boxed](#enumwith0doesnotmatchfalse1boxed)
sealed interface for validated payloads | +| record | [EnumWith0DoesNotMatchFalse.EnumWith0DoesNotMatchFalse1BoxedNumber](#enumwith0doesnotmatchfalse1boxednumber)
boxed class to store validated Number payloads | | static class | [EnumWith0DoesNotMatchFalse.EnumWith0DoesNotMatchFalse1](#enumwith0doesnotmatchfalse1)
schema class | | enum | [EnumWith0DoesNotMatchFalse.IntegerEnumWith0DoesNotMatchFalseEnums](#integerenumwith0doesnotmatchfalseenums)
Integer enum | | enum | [EnumWith0DoesNotMatchFalse.LongEnumWith0DoesNotMatchFalseEnums](#longenumwith0doesnotmatchfalseenums)
Long enum | @@ -20,27 +20,28 @@ A class that contains necessary nested | enum | [EnumWith0DoesNotMatchFalse.DoubleEnumWith0DoesNotMatchFalseEnums](#doubleenumwith0doesnotmatchfalseenums)
Double enum | ## EnumWith0DoesNotMatchFalse1Boxed -public static abstract sealed class EnumWith0DoesNotMatchFalse1Boxed
+public sealed interface EnumWith0DoesNotMatchFalse1Boxed
permits
[EnumWith0DoesNotMatchFalse1BoxedNumber](#enumwith0doesnotmatchfalse1boxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## EnumWith0DoesNotMatchFalse1BoxedNumber -public static final class EnumWith0DoesNotMatchFalse1BoxedNumber
-extends [EnumWith0DoesNotMatchFalse1Boxed](#enumwith0doesnotmatchfalse1boxed) +public record EnumWith0DoesNotMatchFalse1BoxedNumber
+implements [EnumWith0DoesNotMatchFalse1Boxed](#enumwith0doesnotmatchfalse1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | EnumWith0DoesNotMatchFalse1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## EnumWith0DoesNotMatchFalse1 public static class EnumWith0DoesNotMatchFalse1
@@ -81,7 +82,9 @@ int validatedPayload = EnumWith0DoesNotMatchFalse.EnumWith0DoesNotMatchFalse1.va | ----------------- | ---------------------- | | Number | validate(Number arg, SchemaConfiguration configuration) | | [EnumWith0DoesNotMatchFalse1BoxedNumber](#enumwith0doesnotmatchfalse1boxednumber) | validateAndBox(Number arg, SchemaConfiguration configuration) | +| [EnumWith0DoesNotMatchFalse1Boxed](#enumwith0doesnotmatchfalse1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## IntegerEnumWith0DoesNotMatchFalseEnums public enum IntegerEnumWith0DoesNotMatchFalseEnums
extends `Enum` diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/EnumWith1DoesNotMatchTrue.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/EnumWith1DoesNotMatchTrue.md index a19cbe95ca5..f3a46b77a0f 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/EnumWith1DoesNotMatchTrue.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/EnumWith1DoesNotMatchTrue.md @@ -4,15 +4,15 @@ public class EnumWith1DoesNotMatchTrue
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - enum classes ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [EnumWith1DoesNotMatchTrue.EnumWith1DoesNotMatchTrue1Boxed](#enumwith1doesnotmatchtrue1boxed)
abstract sealed validated payload class | -| static class | [EnumWith1DoesNotMatchTrue.EnumWith1DoesNotMatchTrue1BoxedNumber](#enumwith1doesnotmatchtrue1boxednumber)
boxed class to store validated Number payloads | +| sealed interface | [EnumWith1DoesNotMatchTrue.EnumWith1DoesNotMatchTrue1Boxed](#enumwith1doesnotmatchtrue1boxed)
sealed interface for validated payloads | +| record | [EnumWith1DoesNotMatchTrue.EnumWith1DoesNotMatchTrue1BoxedNumber](#enumwith1doesnotmatchtrue1boxednumber)
boxed class to store validated Number payloads | | static class | [EnumWith1DoesNotMatchTrue.EnumWith1DoesNotMatchTrue1](#enumwith1doesnotmatchtrue1)
schema class | | enum | [EnumWith1DoesNotMatchTrue.IntegerEnumWith1DoesNotMatchTrueEnums](#integerenumwith1doesnotmatchtrueenums)
Integer enum | | enum | [EnumWith1DoesNotMatchTrue.LongEnumWith1DoesNotMatchTrueEnums](#longenumwith1doesnotmatchtrueenums)
Long enum | @@ -20,27 +20,28 @@ A class that contains necessary nested | enum | [EnumWith1DoesNotMatchTrue.DoubleEnumWith1DoesNotMatchTrueEnums](#doubleenumwith1doesnotmatchtrueenums)
Double enum | ## EnumWith1DoesNotMatchTrue1Boxed -public static abstract sealed class EnumWith1DoesNotMatchTrue1Boxed
+public sealed interface EnumWith1DoesNotMatchTrue1Boxed
permits
[EnumWith1DoesNotMatchTrue1BoxedNumber](#enumwith1doesnotmatchtrue1boxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## EnumWith1DoesNotMatchTrue1BoxedNumber -public static final class EnumWith1DoesNotMatchTrue1BoxedNumber
-extends [EnumWith1DoesNotMatchTrue1Boxed](#enumwith1doesnotmatchtrue1boxed) +public record EnumWith1DoesNotMatchTrue1BoxedNumber
+implements [EnumWith1DoesNotMatchTrue1Boxed](#enumwith1doesnotmatchtrue1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | EnumWith1DoesNotMatchTrue1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## EnumWith1DoesNotMatchTrue1 public static class EnumWith1DoesNotMatchTrue1
@@ -81,7 +82,9 @@ int validatedPayload = EnumWith1DoesNotMatchTrue.EnumWith1DoesNotMatchTrue1.vali | ----------------- | ---------------------- | | Number | validate(Number arg, SchemaConfiguration configuration) | | [EnumWith1DoesNotMatchTrue1BoxedNumber](#enumwith1doesnotmatchtrue1boxednumber) | validateAndBox(Number arg, SchemaConfiguration configuration) | +| [EnumWith1DoesNotMatchTrue1Boxed](#enumwith1doesnotmatchtrue1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## IntegerEnumWith1DoesNotMatchTrueEnums public enum IntegerEnumWith1DoesNotMatchTrueEnums
extends `Enum` diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/EnumWithEscapedCharacters.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/EnumWithEscapedCharacters.md index e526d2e529e..8c281b72e92 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/EnumWithEscapedCharacters.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/EnumWithEscapedCharacters.md @@ -4,40 +4,41 @@ public class EnumWithEscapedCharacters
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - enum classes ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [EnumWithEscapedCharacters.EnumWithEscapedCharacters1Boxed](#enumwithescapedcharacters1boxed)
abstract sealed validated payload class | -| static class | [EnumWithEscapedCharacters.EnumWithEscapedCharacters1BoxedString](#enumwithescapedcharacters1boxedstring)
boxed class to store validated String payloads | +| sealed interface | [EnumWithEscapedCharacters.EnumWithEscapedCharacters1Boxed](#enumwithescapedcharacters1boxed)
sealed interface for validated payloads | +| record | [EnumWithEscapedCharacters.EnumWithEscapedCharacters1BoxedString](#enumwithescapedcharacters1boxedstring)
boxed class to store validated String payloads | | static class | [EnumWithEscapedCharacters.EnumWithEscapedCharacters1](#enumwithescapedcharacters1)
schema class | | enum | [EnumWithEscapedCharacters.StringEnumWithEscapedCharactersEnums](#stringenumwithescapedcharactersenums)
String enum | ## EnumWithEscapedCharacters1Boxed -public static abstract sealed class EnumWithEscapedCharacters1Boxed
+public sealed interface EnumWithEscapedCharacters1Boxed
permits
[EnumWithEscapedCharacters1BoxedString](#enumwithescapedcharacters1boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## EnumWithEscapedCharacters1BoxedString -public static final class EnumWithEscapedCharacters1BoxedString
-extends [EnumWithEscapedCharacters1Boxed](#enumwithescapedcharacters1boxed) +public record EnumWithEscapedCharacters1BoxedString
+implements [EnumWithEscapedCharacters1Boxed](#enumwithescapedcharacters1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | EnumWithEscapedCharacters1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## EnumWithEscapedCharacters1 public static class EnumWithEscapedCharacters1
@@ -79,7 +80,9 @@ String validatedPayload = EnumWithEscapedCharacters.EnumWithEscapedCharacters1.v | String | validate(String arg, SchemaConfiguration configuration) | | String | validate([StringEnumWithEscapedCharactersEnums](#stringenumwithescapedcharactersenums) arg, SchemaConfiguration configuration) | | [EnumWithEscapedCharacters1BoxedString](#enumwithescapedcharacters1boxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [EnumWithEscapedCharacters1Boxed](#enumwithescapedcharacters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## StringEnumWithEscapedCharactersEnums public enum StringEnumWithEscapedCharactersEnums
extends `Enum` diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/EnumWithFalseDoesNotMatch0.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/EnumWithFalseDoesNotMatch0.md index 49ada19b41f..6e8b2582e42 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/EnumWithFalseDoesNotMatch0.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/EnumWithFalseDoesNotMatch0.md @@ -4,40 +4,41 @@ public class EnumWithFalseDoesNotMatch0
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - enum classes ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [EnumWithFalseDoesNotMatch0.EnumWithFalseDoesNotMatch01Boxed](#enumwithfalsedoesnotmatch01boxed)
abstract sealed validated payload class | -| static class | [EnumWithFalseDoesNotMatch0.EnumWithFalseDoesNotMatch01BoxedBoolean](#enumwithfalsedoesnotmatch01boxedboolean)
boxed class to store validated boolean payloads | +| sealed interface | [EnumWithFalseDoesNotMatch0.EnumWithFalseDoesNotMatch01Boxed](#enumwithfalsedoesnotmatch01boxed)
sealed interface for validated payloads | +| record | [EnumWithFalseDoesNotMatch0.EnumWithFalseDoesNotMatch01BoxedBoolean](#enumwithfalsedoesnotmatch01boxedboolean)
boxed class to store validated boolean payloads | | static class | [EnumWithFalseDoesNotMatch0.EnumWithFalseDoesNotMatch01](#enumwithfalsedoesnotmatch01)
schema class | | enum | [EnumWithFalseDoesNotMatch0.BooleanEnumWithFalseDoesNotMatch0Enums](#booleanenumwithfalsedoesnotmatch0enums)
boolean enum | ## EnumWithFalseDoesNotMatch01Boxed -public static abstract sealed class EnumWithFalseDoesNotMatch01Boxed
+public sealed interface EnumWithFalseDoesNotMatch01Boxed
permits
[EnumWithFalseDoesNotMatch01BoxedBoolean](#enumwithfalsedoesnotmatch01boxedboolean) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## EnumWithFalseDoesNotMatch01BoxedBoolean -public static final class EnumWithFalseDoesNotMatch01BoxedBoolean
-extends [EnumWithFalseDoesNotMatch01Boxed](#enumwithfalsedoesnotmatch01boxed) +public record EnumWithFalseDoesNotMatch01BoxedBoolean
+implements [EnumWithFalseDoesNotMatch01Boxed](#enumwithfalsedoesnotmatch01boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | EnumWithFalseDoesNotMatch01BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## EnumWithFalseDoesNotMatch01 public static class EnumWithFalseDoesNotMatch01
@@ -79,7 +80,9 @@ boolean validatedPayload = EnumWithFalseDoesNotMatch0.EnumWithFalseDoesNotMatch0 | boolean | validate(boolean arg, SchemaConfiguration configuration) | | boolean | validate([BooleanEnumWithFalseDoesNotMatch0Enums](#booleanenumwithfalsedoesnotmatch0enums) arg, SchemaConfiguration configuration) | | [EnumWithFalseDoesNotMatch01BoxedBoolean](#enumwithfalsedoesnotmatch01boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | +| [EnumWithFalseDoesNotMatch01Boxed](#enumwithfalsedoesnotmatch01boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## BooleanEnumWithFalseDoesNotMatch0Enums public enum BooleanEnumWithFalseDoesNotMatch0Enums
extends `Enum` diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/EnumWithTrueDoesNotMatch1.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/EnumWithTrueDoesNotMatch1.md index 2a6d6f9c88d..5902c3f2697 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/EnumWithTrueDoesNotMatch1.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/EnumWithTrueDoesNotMatch1.md @@ -4,40 +4,41 @@ public class EnumWithTrueDoesNotMatch1
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - enum classes ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [EnumWithTrueDoesNotMatch1.EnumWithTrueDoesNotMatch11Boxed](#enumwithtruedoesnotmatch11boxed)
abstract sealed validated payload class | -| static class | [EnumWithTrueDoesNotMatch1.EnumWithTrueDoesNotMatch11BoxedBoolean](#enumwithtruedoesnotmatch11boxedboolean)
boxed class to store validated boolean payloads | +| sealed interface | [EnumWithTrueDoesNotMatch1.EnumWithTrueDoesNotMatch11Boxed](#enumwithtruedoesnotmatch11boxed)
sealed interface for validated payloads | +| record | [EnumWithTrueDoesNotMatch1.EnumWithTrueDoesNotMatch11BoxedBoolean](#enumwithtruedoesnotmatch11boxedboolean)
boxed class to store validated boolean payloads | | static class | [EnumWithTrueDoesNotMatch1.EnumWithTrueDoesNotMatch11](#enumwithtruedoesnotmatch11)
schema class | | enum | [EnumWithTrueDoesNotMatch1.BooleanEnumWithTrueDoesNotMatch1Enums](#booleanenumwithtruedoesnotmatch1enums)
boolean enum | ## EnumWithTrueDoesNotMatch11Boxed -public static abstract sealed class EnumWithTrueDoesNotMatch11Boxed
+public sealed interface EnumWithTrueDoesNotMatch11Boxed
permits
[EnumWithTrueDoesNotMatch11BoxedBoolean](#enumwithtruedoesnotmatch11boxedboolean) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## EnumWithTrueDoesNotMatch11BoxedBoolean -public static final class EnumWithTrueDoesNotMatch11BoxedBoolean
-extends [EnumWithTrueDoesNotMatch11Boxed](#enumwithtruedoesnotmatch11boxed) +public record EnumWithTrueDoesNotMatch11BoxedBoolean
+implements [EnumWithTrueDoesNotMatch11Boxed](#enumwithtruedoesnotmatch11boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | EnumWithTrueDoesNotMatch11BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## EnumWithTrueDoesNotMatch11 public static class EnumWithTrueDoesNotMatch11
@@ -79,7 +80,9 @@ boolean validatedPayload = EnumWithTrueDoesNotMatch1.EnumWithTrueDoesNotMatch11. | boolean | validate(boolean arg, SchemaConfiguration configuration) | | boolean | validate([BooleanEnumWithTrueDoesNotMatch1Enums](#booleanenumwithtruedoesnotmatch1enums) arg, SchemaConfiguration configuration) | | [EnumWithTrueDoesNotMatch11BoxedBoolean](#enumwithtruedoesnotmatch11boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | +| [EnumWithTrueDoesNotMatch11Boxed](#enumwithtruedoesnotmatch11boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## BooleanEnumWithTrueDoesNotMatch1Enums public enum BooleanEnumWithTrueDoesNotMatch1Enums
extends `Enum` diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/EnumsInProperties.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/EnumsInProperties.md index 6b1dbcf30dd..a518254b410 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/EnumsInProperties.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/EnumsInProperties.md @@ -4,7 +4,7 @@ public class EnumsInProperties
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -13,42 +13,43 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [EnumsInProperties.EnumsInProperties1Boxed](#enumsinproperties1boxed)
abstract sealed validated payload class | -| static class | [EnumsInProperties.EnumsInProperties1BoxedMap](#enumsinproperties1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [EnumsInProperties.EnumsInProperties1Boxed](#enumsinproperties1boxed)
sealed interface for validated payloads | +| record | [EnumsInProperties.EnumsInProperties1BoxedMap](#enumsinproperties1boxedmap)
boxed class to store validated Map payloads | | static class | [EnumsInProperties.EnumsInProperties1](#enumsinproperties1)
schema class | | static class | [EnumsInProperties.EnumsInPropertiesMapBuilder](#enumsinpropertiesmapbuilder)
builder for Map payloads | | static class | [EnumsInProperties.EnumsInPropertiesMap](#enumsinpropertiesmap)
output class for Map payloads | -| static class | [EnumsInProperties.BarBoxed](#barboxed)
abstract sealed validated payload class | -| static class | [EnumsInProperties.BarBoxedString](#barboxedstring)
boxed class to store validated String payloads | +| sealed interface | [EnumsInProperties.BarBoxed](#barboxed)
sealed interface for validated payloads | +| record | [EnumsInProperties.BarBoxedString](#barboxedstring)
boxed class to store validated String payloads | | static class | [EnumsInProperties.Bar](#bar)
schema class | | enum | [EnumsInProperties.StringBarEnums](#stringbarenums)
String enum | -| static class | [EnumsInProperties.FooBoxed](#fooboxed)
abstract sealed validated payload class | -| static class | [EnumsInProperties.FooBoxedString](#fooboxedstring)
boxed class to store validated String payloads | +| sealed interface | [EnumsInProperties.FooBoxed](#fooboxed)
sealed interface for validated payloads | +| record | [EnumsInProperties.FooBoxedString](#fooboxedstring)
boxed class to store validated String payloads | | static class | [EnumsInProperties.Foo](#foo)
schema class | | enum | [EnumsInProperties.StringFooEnums](#stringfooenums)
String enum | ## EnumsInProperties1Boxed -public static abstract sealed class EnumsInProperties1Boxed
+public sealed interface EnumsInProperties1Boxed
permits
[EnumsInProperties1BoxedMap](#enumsinproperties1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## EnumsInProperties1BoxedMap -public static final class EnumsInProperties1BoxedMap
-extends [EnumsInProperties1Boxed](#enumsinproperties1boxed) +public record EnumsInProperties1BoxedMap
+implements [EnumsInProperties1Boxed](#enumsinproperties1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | EnumsInProperties1BoxedMap([EnumsInPropertiesMap](#enumsinpropertiesmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [EnumsInPropertiesMap](#enumsinpropertiesmap) | data
validated payload | +| [EnumsInPropertiesMap](#enumsinpropertiesmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## EnumsInProperties1 public static class EnumsInProperties1
@@ -96,7 +97,9 @@ EnumsInProperties.EnumsInPropertiesMap validatedPayload = | ----------------- | ---------------------- | | [EnumsInPropertiesMap](#enumsinpropertiesmap) | validate([Map<?, ?>](#enumsinpropertiesmapbuilder) arg, SchemaConfiguration configuration) | | [EnumsInProperties1BoxedMap](#enumsinproperties1boxedmap) | validateAndBox([Map<?, ?>](#enumsinpropertiesmapbuilder) arg, SchemaConfiguration configuration) | +| [EnumsInProperties1Boxed](#enumsinproperties1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## EnumsInPropertiesMap0Builder public class EnumsInPropertiesMap0Builder
builder for `Map` @@ -156,27 +159,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## BarBoxed -public static abstract sealed class BarBoxed
+public sealed interface BarBoxed
permits
[BarBoxedString](#barboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## BarBoxedString -public static final class BarBoxedString
-extends [BarBoxed](#barboxed) +public record BarBoxedString
+implements [BarBoxed](#barboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BarBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Bar public static class Bar
@@ -218,7 +222,9 @@ String validatedPayload = EnumsInProperties.Bar.validate( | String | validate(String arg, SchemaConfiguration configuration) | | String | validate([StringBarEnums](#stringbarenums) arg, SchemaConfiguration configuration) | | [BarBoxedString](#barboxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [BarBoxed](#barboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## StringBarEnums public enum StringBarEnums
extends `Enum` @@ -231,27 +237,28 @@ A class that stores String enum values | BAR | value = "bar" | ## FooBoxed -public static abstract sealed class FooBoxed
+public sealed interface FooBoxed
permits
[FooBoxedString](#fooboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## FooBoxedString -public static final class FooBoxedString
-extends [FooBoxed](#fooboxed) +public record FooBoxedString
+implements [FooBoxed](#fooboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Foo public static class Foo
@@ -293,7 +300,9 @@ String validatedPayload = EnumsInProperties.Foo.validate( | String | validate(String arg, SchemaConfiguration configuration) | | String | validate([StringFooEnums](#stringfooenums) arg, SchemaConfiguration configuration) | | [FooBoxedString](#fooboxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [FooBoxed](#fooboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## StringFooEnums public enum StringFooEnums
extends `Enum` diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/ForbiddenProperty.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/ForbiddenProperty.md index a2519145771..7a43a5fd737 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/ForbiddenProperty.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/ForbiddenProperty.md @@ -4,7 +4,7 @@ public class ForbiddenProperty
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,27 +12,27 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ForbiddenProperty.ForbiddenProperty1Boxed](#forbiddenproperty1boxed)
abstract sealed validated payload class | -| static class | [ForbiddenProperty.ForbiddenProperty1BoxedVoid](#forbiddenproperty1boxedvoid)
boxed class to store validated null payloads | -| static class | [ForbiddenProperty.ForbiddenProperty1BoxedBoolean](#forbiddenproperty1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [ForbiddenProperty.ForbiddenProperty1BoxedNumber](#forbiddenproperty1boxednumber)
boxed class to store validated Number payloads | -| static class | [ForbiddenProperty.ForbiddenProperty1BoxedString](#forbiddenproperty1boxedstring)
boxed class to store validated String payloads | -| static class | [ForbiddenProperty.ForbiddenProperty1BoxedList](#forbiddenproperty1boxedlist)
boxed class to store validated List payloads | -| static class | [ForbiddenProperty.ForbiddenProperty1BoxedMap](#forbiddenproperty1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ForbiddenProperty.ForbiddenProperty1Boxed](#forbiddenproperty1boxed)
sealed interface for validated payloads | +| record | [ForbiddenProperty.ForbiddenProperty1BoxedVoid](#forbiddenproperty1boxedvoid)
boxed class to store validated null payloads | +| record | [ForbiddenProperty.ForbiddenProperty1BoxedBoolean](#forbiddenproperty1boxedboolean)
boxed class to store validated boolean payloads | +| record | [ForbiddenProperty.ForbiddenProperty1BoxedNumber](#forbiddenproperty1boxednumber)
boxed class to store validated Number payloads | +| record | [ForbiddenProperty.ForbiddenProperty1BoxedString](#forbiddenproperty1boxedstring)
boxed class to store validated String payloads | +| record | [ForbiddenProperty.ForbiddenProperty1BoxedList](#forbiddenproperty1boxedlist)
boxed class to store validated List payloads | +| record | [ForbiddenProperty.ForbiddenProperty1BoxedMap](#forbiddenproperty1boxedmap)
boxed class to store validated Map payloads | | static class | [ForbiddenProperty.ForbiddenProperty1](#forbiddenproperty1)
schema class | | static class | [ForbiddenProperty.ForbiddenPropertyMapBuilder](#forbiddenpropertymapbuilder)
builder for Map payloads | | static class | [ForbiddenProperty.ForbiddenPropertyMap](#forbiddenpropertymap)
output class for Map payloads | -| static class | [ForbiddenProperty.FooBoxed](#fooboxed)
abstract sealed validated payload class | -| static class | [ForbiddenProperty.FooBoxedVoid](#fooboxedvoid)
boxed class to store validated null payloads | -| static class | [ForbiddenProperty.FooBoxedBoolean](#fooboxedboolean)
boxed class to store validated boolean payloads | -| static class | [ForbiddenProperty.FooBoxedNumber](#fooboxednumber)
boxed class to store validated Number payloads | -| static class | [ForbiddenProperty.FooBoxedString](#fooboxedstring)
boxed class to store validated String payloads | -| static class | [ForbiddenProperty.FooBoxedList](#fooboxedlist)
boxed class to store validated List payloads | -| static class | [ForbiddenProperty.FooBoxedMap](#fooboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ForbiddenProperty.FooBoxed](#fooboxed)
sealed interface for validated payloads | +| record | [ForbiddenProperty.FooBoxedVoid](#fooboxedvoid)
boxed class to store validated null payloads | +| record | [ForbiddenProperty.FooBoxedBoolean](#fooboxedboolean)
boxed class to store validated boolean payloads | +| record | [ForbiddenProperty.FooBoxedNumber](#fooboxednumber)
boxed class to store validated Number payloads | +| record | [ForbiddenProperty.FooBoxedString](#fooboxedstring)
boxed class to store validated String payloads | +| record | [ForbiddenProperty.FooBoxedList](#fooboxedlist)
boxed class to store validated List payloads | +| record | [ForbiddenProperty.FooBoxedMap](#fooboxedmap)
boxed class to store validated Map payloads | | static class | [ForbiddenProperty.Foo](#foo)
schema class | ## ForbiddenProperty1Boxed -public static abstract sealed class ForbiddenProperty1Boxed
+public sealed interface ForbiddenProperty1Boxed
permits
[ForbiddenProperty1BoxedVoid](#forbiddenproperty1boxedvoid), [ForbiddenProperty1BoxedBoolean](#forbiddenproperty1boxedboolean), @@ -41,103 +41,109 @@ permits
[ForbiddenProperty1BoxedList](#forbiddenproperty1boxedlist), [ForbiddenProperty1BoxedMap](#forbiddenproperty1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ForbiddenProperty1BoxedVoid -public static final class ForbiddenProperty1BoxedVoid
-extends [ForbiddenProperty1Boxed](#forbiddenproperty1boxed) +public record ForbiddenProperty1BoxedVoid
+implements [ForbiddenProperty1Boxed](#forbiddenproperty1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ForbiddenProperty1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ForbiddenProperty1BoxedBoolean -public static final class ForbiddenProperty1BoxedBoolean
-extends [ForbiddenProperty1Boxed](#forbiddenproperty1boxed) +public record ForbiddenProperty1BoxedBoolean
+implements [ForbiddenProperty1Boxed](#forbiddenproperty1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ForbiddenProperty1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ForbiddenProperty1BoxedNumber -public static final class ForbiddenProperty1BoxedNumber
-extends [ForbiddenProperty1Boxed](#forbiddenproperty1boxed) +public record ForbiddenProperty1BoxedNumber
+implements [ForbiddenProperty1Boxed](#forbiddenproperty1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ForbiddenProperty1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ForbiddenProperty1BoxedString -public static final class ForbiddenProperty1BoxedString
-extends [ForbiddenProperty1Boxed](#forbiddenproperty1boxed) +public record ForbiddenProperty1BoxedString
+implements [ForbiddenProperty1Boxed](#forbiddenproperty1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ForbiddenProperty1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ForbiddenProperty1BoxedList -public static final class ForbiddenProperty1BoxedList
-extends [ForbiddenProperty1Boxed](#forbiddenproperty1boxed) +public record ForbiddenProperty1BoxedList
+implements [ForbiddenProperty1Boxed](#forbiddenproperty1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ForbiddenProperty1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ForbiddenProperty1BoxedMap -public static final class ForbiddenProperty1BoxedMap
-extends [ForbiddenProperty1Boxed](#forbiddenproperty1boxed) +public record ForbiddenProperty1BoxedMap
+implements [ForbiddenProperty1Boxed](#forbiddenproperty1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ForbiddenProperty1BoxedMap([ForbiddenPropertyMap](#forbiddenpropertymap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [ForbiddenPropertyMap](#forbiddenpropertymap) | data
validated payload | +| [ForbiddenPropertyMap](#forbiddenpropertymap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ForbiddenProperty1 public static class ForbiddenProperty1
@@ -169,7 +175,9 @@ A schema class that validates payloads | [ForbiddenProperty1BoxedBoolean](#forbiddenproperty1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [ForbiddenProperty1BoxedMap](#forbiddenproperty1boxedmap) | validateAndBox([Map<?, ?>](#forbiddenpropertymapbuilder) arg, SchemaConfiguration configuration) | | [ForbiddenProperty1BoxedList](#forbiddenproperty1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [ForbiddenProperty1Boxed](#forbiddenproperty1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ForbiddenPropertyMapBuilder public class ForbiddenPropertyMapBuilder
builder for `Map` @@ -218,7 +226,7 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## FooBoxed -public static abstract sealed class FooBoxed
+public sealed interface FooBoxed
permits
[FooBoxedVoid](#fooboxedvoid), [FooBoxedBoolean](#fooboxedboolean), @@ -227,103 +235,109 @@ permits
[FooBoxedList](#fooboxedlist), [FooBoxedMap](#fooboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## FooBoxedVoid -public static final class FooBoxedVoid
-extends [FooBoxed](#fooboxed) +public record FooBoxedVoid
+implements [FooBoxed](#fooboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FooBoxedBoolean -public static final class FooBoxedBoolean
-extends [FooBoxed](#fooboxed) +public record FooBoxedBoolean
+implements [FooBoxed](#fooboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FooBoxedNumber -public static final class FooBoxedNumber
-extends [FooBoxed](#fooboxed) +public record FooBoxedNumber
+implements [FooBoxed](#fooboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FooBoxedString -public static final class FooBoxedString
-extends [FooBoxed](#fooboxed) +public record FooBoxedString
+implements [FooBoxed](#fooboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FooBoxedList -public static final class FooBoxedList
-extends [FooBoxed](#fooboxed) +public record FooBoxedList
+implements [FooBoxed](#fooboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FooBoxedMap -public static final class FooBoxedMap
-extends [FooBoxed](#fooboxed) +public record FooBoxedMap
+implements [FooBoxed](#fooboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Foo public static class Foo
diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/HostnameFormat.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/HostnameFormat.md index 8630d7ab683..085ff0c08a1 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/HostnameFormat.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/HostnameFormat.md @@ -4,23 +4,23 @@ public class HostnameFormat
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [HostnameFormat.HostnameFormat1Boxed](#hostnameformat1boxed)
abstract sealed validated payload class | -| static class | [HostnameFormat.HostnameFormat1BoxedVoid](#hostnameformat1boxedvoid)
boxed class to store validated null payloads | -| static class | [HostnameFormat.HostnameFormat1BoxedBoolean](#hostnameformat1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [HostnameFormat.HostnameFormat1BoxedNumber](#hostnameformat1boxednumber)
boxed class to store validated Number payloads | -| static class | [HostnameFormat.HostnameFormat1BoxedString](#hostnameformat1boxedstring)
boxed class to store validated String payloads | -| static class | [HostnameFormat.HostnameFormat1BoxedList](#hostnameformat1boxedlist)
boxed class to store validated List payloads | -| static class | [HostnameFormat.HostnameFormat1BoxedMap](#hostnameformat1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [HostnameFormat.HostnameFormat1Boxed](#hostnameformat1boxed)
sealed interface for validated payloads | +| record | [HostnameFormat.HostnameFormat1BoxedVoid](#hostnameformat1boxedvoid)
boxed class to store validated null payloads | +| record | [HostnameFormat.HostnameFormat1BoxedBoolean](#hostnameformat1boxedboolean)
boxed class to store validated boolean payloads | +| record | [HostnameFormat.HostnameFormat1BoxedNumber](#hostnameformat1boxednumber)
boxed class to store validated Number payloads | +| record | [HostnameFormat.HostnameFormat1BoxedString](#hostnameformat1boxedstring)
boxed class to store validated String payloads | +| record | [HostnameFormat.HostnameFormat1BoxedList](#hostnameformat1boxedlist)
boxed class to store validated List payloads | +| record | [HostnameFormat.HostnameFormat1BoxedMap](#hostnameformat1boxedmap)
boxed class to store validated Map payloads | | static class | [HostnameFormat.HostnameFormat1](#hostnameformat1)
schema class | ## HostnameFormat1Boxed -public static abstract sealed class HostnameFormat1Boxed
+public sealed interface HostnameFormat1Boxed
permits
[HostnameFormat1BoxedVoid](#hostnameformat1boxedvoid), [HostnameFormat1BoxedBoolean](#hostnameformat1boxedboolean), @@ -29,103 +29,109 @@ permits
[HostnameFormat1BoxedList](#hostnameformat1boxedlist), [HostnameFormat1BoxedMap](#hostnameformat1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## HostnameFormat1BoxedVoid -public static final class HostnameFormat1BoxedVoid
-extends [HostnameFormat1Boxed](#hostnameformat1boxed) +public record HostnameFormat1BoxedVoid
+implements [HostnameFormat1Boxed](#hostnameformat1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | HostnameFormat1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## HostnameFormat1BoxedBoolean -public static final class HostnameFormat1BoxedBoolean
-extends [HostnameFormat1Boxed](#hostnameformat1boxed) +public record HostnameFormat1BoxedBoolean
+implements [HostnameFormat1Boxed](#hostnameformat1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | HostnameFormat1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## HostnameFormat1BoxedNumber -public static final class HostnameFormat1BoxedNumber
-extends [HostnameFormat1Boxed](#hostnameformat1boxed) +public record HostnameFormat1BoxedNumber
+implements [HostnameFormat1Boxed](#hostnameformat1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | HostnameFormat1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## HostnameFormat1BoxedString -public static final class HostnameFormat1BoxedString
-extends [HostnameFormat1Boxed](#hostnameformat1boxed) +public record HostnameFormat1BoxedString
+implements [HostnameFormat1Boxed](#hostnameformat1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | HostnameFormat1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## HostnameFormat1BoxedList -public static final class HostnameFormat1BoxedList
-extends [HostnameFormat1Boxed](#hostnameformat1boxed) +public record HostnameFormat1BoxedList
+implements [HostnameFormat1Boxed](#hostnameformat1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | HostnameFormat1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## HostnameFormat1BoxedMap -public static final class HostnameFormat1BoxedMap
-extends [HostnameFormat1Boxed](#hostnameformat1boxed) +public record HostnameFormat1BoxedMap
+implements [HostnameFormat1Boxed](#hostnameformat1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | HostnameFormat1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## HostnameFormat1 public static class HostnameFormat1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [HostnameFormat1BoxedBoolean](#hostnameformat1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [HostnameFormat1BoxedMap](#hostnameformat1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [HostnameFormat1BoxedList](#hostnameformat1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [HostnameFormat1Boxed](#hostnameformat1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/IntegerTypeMatchesIntegers.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/IntegerTypeMatchesIntegers.md index bcd9231a5c0..1e84368f22a 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/IntegerTypeMatchesIntegers.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/IntegerTypeMatchesIntegers.md @@ -4,38 +4,39 @@ public class IntegerTypeMatchesIntegers
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [IntegerTypeMatchesIntegers.IntegerTypeMatchesIntegers1Boxed](#integertypematchesintegers1boxed)
abstract sealed validated payload class | -| static class | [IntegerTypeMatchesIntegers.IntegerTypeMatchesIntegers1BoxedNumber](#integertypematchesintegers1boxednumber)
boxed class to store validated Number payloads | +| sealed interface | [IntegerTypeMatchesIntegers.IntegerTypeMatchesIntegers1Boxed](#integertypematchesintegers1boxed)
sealed interface for validated payloads | +| record | [IntegerTypeMatchesIntegers.IntegerTypeMatchesIntegers1BoxedNumber](#integertypematchesintegers1boxednumber)
boxed class to store validated Number payloads | | static class | [IntegerTypeMatchesIntegers.IntegerTypeMatchesIntegers1](#integertypematchesintegers1)
schema class | ## IntegerTypeMatchesIntegers1Boxed -public static abstract sealed class IntegerTypeMatchesIntegers1Boxed
+public sealed interface IntegerTypeMatchesIntegers1Boxed
permits
[IntegerTypeMatchesIntegers1BoxedNumber](#integertypematchesintegers1boxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## IntegerTypeMatchesIntegers1BoxedNumber -public static final class IntegerTypeMatchesIntegers1BoxedNumber
-extends [IntegerTypeMatchesIntegers1Boxed](#integertypematchesintegers1boxed) +public record IntegerTypeMatchesIntegers1BoxedNumber
+implements [IntegerTypeMatchesIntegers1Boxed](#integertypematchesintegers1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IntegerTypeMatchesIntegers1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IntegerTypeMatchesIntegers1 public static class IntegerTypeMatchesIntegers1
diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf.md index b8fa0b1813d..5a77e718b4d 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf.md @@ -4,38 +4,39 @@ public class InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf.InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf1Boxed](#invalidinstanceshouldnotraiseerrorwhenfloatdivisioninf1boxed)
abstract sealed validated payload class | -| static class | [InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf.InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf1BoxedNumber](#invalidinstanceshouldnotraiseerrorwhenfloatdivisioninf1boxednumber)
boxed class to store validated Number payloads | +| sealed interface | [InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf.InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf1Boxed](#invalidinstanceshouldnotraiseerrorwhenfloatdivisioninf1boxed)
sealed interface for validated payloads | +| record | [InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf.InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf1BoxedNumber](#invalidinstanceshouldnotraiseerrorwhenfloatdivisioninf1boxednumber)
boxed class to store validated Number payloads | | static class | [InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf.InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf1](#invalidinstanceshouldnotraiseerrorwhenfloatdivisioninf1)
schema class | ## InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf1Boxed -public static abstract sealed class InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf1Boxed
+public sealed interface InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf1Boxed
permits
[InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf1BoxedNumber](#invalidinstanceshouldnotraiseerrorwhenfloatdivisioninf1boxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf1BoxedNumber -public static final class InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf1BoxedNumber
-extends [InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf1Boxed](#invalidinstanceshouldnotraiseerrorwhenfloatdivisioninf1boxed) +public record InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf1BoxedNumber
+implements [InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf1Boxed](#invalidinstanceshouldnotraiseerrorwhenfloatdivisioninf1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf1 public static class InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf1
@@ -77,5 +78,7 @@ int validatedPayload = InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf.In | ----------------- | ---------------------- | | long | validate(long arg, SchemaConfiguration configuration) | | [InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf1BoxedNumber](#invalidinstanceshouldnotraiseerrorwhenfloatdivisioninf1boxednumber) | validateAndBox(Number arg, SchemaConfiguration configuration) | +| [InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf1Boxed](#invalidinstanceshouldnotraiseerrorwhenfloatdivisioninf1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/InvalidStringValueForDefault.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/InvalidStringValueForDefault.md index d5fa26edd0f..5cd8f51bb0a 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/InvalidStringValueForDefault.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/InvalidStringValueForDefault.md @@ -4,7 +4,7 @@ public class InvalidStringValueForDefault
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,22 +12,22 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [InvalidStringValueForDefault.InvalidStringValueForDefault1Boxed](#invalidstringvaluefordefault1boxed)
abstract sealed validated payload class | -| static class | [InvalidStringValueForDefault.InvalidStringValueForDefault1BoxedVoid](#invalidstringvaluefordefault1boxedvoid)
boxed class to store validated null payloads | -| static class | [InvalidStringValueForDefault.InvalidStringValueForDefault1BoxedBoolean](#invalidstringvaluefordefault1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [InvalidStringValueForDefault.InvalidStringValueForDefault1BoxedNumber](#invalidstringvaluefordefault1boxednumber)
boxed class to store validated Number payloads | -| static class | [InvalidStringValueForDefault.InvalidStringValueForDefault1BoxedString](#invalidstringvaluefordefault1boxedstring)
boxed class to store validated String payloads | -| static class | [InvalidStringValueForDefault.InvalidStringValueForDefault1BoxedList](#invalidstringvaluefordefault1boxedlist)
boxed class to store validated List payloads | -| static class | [InvalidStringValueForDefault.InvalidStringValueForDefault1BoxedMap](#invalidstringvaluefordefault1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [InvalidStringValueForDefault.InvalidStringValueForDefault1Boxed](#invalidstringvaluefordefault1boxed)
sealed interface for validated payloads | +| record | [InvalidStringValueForDefault.InvalidStringValueForDefault1BoxedVoid](#invalidstringvaluefordefault1boxedvoid)
boxed class to store validated null payloads | +| record | [InvalidStringValueForDefault.InvalidStringValueForDefault1BoxedBoolean](#invalidstringvaluefordefault1boxedboolean)
boxed class to store validated boolean payloads | +| record | [InvalidStringValueForDefault.InvalidStringValueForDefault1BoxedNumber](#invalidstringvaluefordefault1boxednumber)
boxed class to store validated Number payloads | +| record | [InvalidStringValueForDefault.InvalidStringValueForDefault1BoxedString](#invalidstringvaluefordefault1boxedstring)
boxed class to store validated String payloads | +| record | [InvalidStringValueForDefault.InvalidStringValueForDefault1BoxedList](#invalidstringvaluefordefault1boxedlist)
boxed class to store validated List payloads | +| record | [InvalidStringValueForDefault.InvalidStringValueForDefault1BoxedMap](#invalidstringvaluefordefault1boxedmap)
boxed class to store validated Map payloads | | static class | [InvalidStringValueForDefault.InvalidStringValueForDefault1](#invalidstringvaluefordefault1)
schema class | | static class | [InvalidStringValueForDefault.InvalidStringValueForDefaultMapBuilder](#invalidstringvaluefordefaultmapbuilder)
builder for Map payloads | | static class | [InvalidStringValueForDefault.InvalidStringValueForDefaultMap](#invalidstringvaluefordefaultmap)
output class for Map payloads | -| static class | [InvalidStringValueForDefault.BarBoxed](#barboxed)
abstract sealed validated payload class | -| static class | [InvalidStringValueForDefault.BarBoxedString](#barboxedstring)
boxed class to store validated String payloads | +| sealed interface | [InvalidStringValueForDefault.BarBoxed](#barboxed)
sealed interface for validated payloads | +| record | [InvalidStringValueForDefault.BarBoxedString](#barboxedstring)
boxed class to store validated String payloads | | static class | [InvalidStringValueForDefault.Bar](#bar)
schema class | ## InvalidStringValueForDefault1Boxed -public static abstract sealed class InvalidStringValueForDefault1Boxed
+public sealed interface InvalidStringValueForDefault1Boxed
permits
[InvalidStringValueForDefault1BoxedVoid](#invalidstringvaluefordefault1boxedvoid), [InvalidStringValueForDefault1BoxedBoolean](#invalidstringvaluefordefault1boxedboolean), @@ -36,103 +36,109 @@ permits
[InvalidStringValueForDefault1BoxedList](#invalidstringvaluefordefault1boxedlist), [InvalidStringValueForDefault1BoxedMap](#invalidstringvaluefordefault1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## InvalidStringValueForDefault1BoxedVoid -public static final class InvalidStringValueForDefault1BoxedVoid
-extends [InvalidStringValueForDefault1Boxed](#invalidstringvaluefordefault1boxed) +public record InvalidStringValueForDefault1BoxedVoid
+implements [InvalidStringValueForDefault1Boxed](#invalidstringvaluefordefault1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | InvalidStringValueForDefault1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## InvalidStringValueForDefault1BoxedBoolean -public static final class InvalidStringValueForDefault1BoxedBoolean
-extends [InvalidStringValueForDefault1Boxed](#invalidstringvaluefordefault1boxed) +public record InvalidStringValueForDefault1BoxedBoolean
+implements [InvalidStringValueForDefault1Boxed](#invalidstringvaluefordefault1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | InvalidStringValueForDefault1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## InvalidStringValueForDefault1BoxedNumber -public static final class InvalidStringValueForDefault1BoxedNumber
-extends [InvalidStringValueForDefault1Boxed](#invalidstringvaluefordefault1boxed) +public record InvalidStringValueForDefault1BoxedNumber
+implements [InvalidStringValueForDefault1Boxed](#invalidstringvaluefordefault1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | InvalidStringValueForDefault1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## InvalidStringValueForDefault1BoxedString -public static final class InvalidStringValueForDefault1BoxedString
-extends [InvalidStringValueForDefault1Boxed](#invalidstringvaluefordefault1boxed) +public record InvalidStringValueForDefault1BoxedString
+implements [InvalidStringValueForDefault1Boxed](#invalidstringvaluefordefault1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | InvalidStringValueForDefault1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## InvalidStringValueForDefault1BoxedList -public static final class InvalidStringValueForDefault1BoxedList
-extends [InvalidStringValueForDefault1Boxed](#invalidstringvaluefordefault1boxed) +public record InvalidStringValueForDefault1BoxedList
+implements [InvalidStringValueForDefault1Boxed](#invalidstringvaluefordefault1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | InvalidStringValueForDefault1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## InvalidStringValueForDefault1BoxedMap -public static final class InvalidStringValueForDefault1BoxedMap
-extends [InvalidStringValueForDefault1Boxed](#invalidstringvaluefordefault1boxed) +public record InvalidStringValueForDefault1BoxedMap
+implements [InvalidStringValueForDefault1Boxed](#invalidstringvaluefordefault1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | InvalidStringValueForDefault1BoxedMap([InvalidStringValueForDefaultMap](#invalidstringvaluefordefaultmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [InvalidStringValueForDefaultMap](#invalidstringvaluefordefaultmap) | data
validated payload | +| [InvalidStringValueForDefaultMap](#invalidstringvaluefordefaultmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## InvalidStringValueForDefault1 public static class InvalidStringValueForDefault1
@@ -164,7 +170,9 @@ A schema class that validates payloads | [InvalidStringValueForDefault1BoxedBoolean](#invalidstringvaluefordefault1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [InvalidStringValueForDefault1BoxedMap](#invalidstringvaluefordefault1boxedmap) | validateAndBox([Map<?, ?>](#invalidstringvaluefordefaultmapbuilder) arg, SchemaConfiguration configuration) | | [InvalidStringValueForDefault1BoxedList](#invalidstringvaluefordefault1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [InvalidStringValueForDefault1Boxed](#invalidstringvaluefordefault1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## InvalidStringValueForDefaultMapBuilder public class InvalidStringValueForDefaultMapBuilder
builder for `Map` @@ -205,27 +213,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## BarBoxed -public static abstract sealed class BarBoxed
+public sealed interface BarBoxed
permits
[BarBoxedString](#barboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## BarBoxedString -public static final class BarBoxedString
-extends [BarBoxed](#barboxed) +public record BarBoxedString
+implements [BarBoxed](#barboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BarBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Bar public static class Bar
@@ -267,5 +276,7 @@ String validatedPayload = InvalidStringValueForDefault.Bar.validate( | ----------------- | ---------------------- | | String | validate(String arg, SchemaConfiguration configuration) | | [BarBoxedString](#barboxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [BarBoxed](#barboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/Ipv4Format.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/Ipv4Format.md index 5ee841749a5..fc4821b8b70 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/Ipv4Format.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/Ipv4Format.md @@ -4,23 +4,23 @@ public class Ipv4Format
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Ipv4Format.Ipv4Format1Boxed](#ipv4format1boxed)
abstract sealed validated payload class | -| static class | [Ipv4Format.Ipv4Format1BoxedVoid](#ipv4format1boxedvoid)
boxed class to store validated null payloads | -| static class | [Ipv4Format.Ipv4Format1BoxedBoolean](#ipv4format1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [Ipv4Format.Ipv4Format1BoxedNumber](#ipv4format1boxednumber)
boxed class to store validated Number payloads | -| static class | [Ipv4Format.Ipv4Format1BoxedString](#ipv4format1boxedstring)
boxed class to store validated String payloads | -| static class | [Ipv4Format.Ipv4Format1BoxedList](#ipv4format1boxedlist)
boxed class to store validated List payloads | -| static class | [Ipv4Format.Ipv4Format1BoxedMap](#ipv4format1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [Ipv4Format.Ipv4Format1Boxed](#ipv4format1boxed)
sealed interface for validated payloads | +| record | [Ipv4Format.Ipv4Format1BoxedVoid](#ipv4format1boxedvoid)
boxed class to store validated null payloads | +| record | [Ipv4Format.Ipv4Format1BoxedBoolean](#ipv4format1boxedboolean)
boxed class to store validated boolean payloads | +| record | [Ipv4Format.Ipv4Format1BoxedNumber](#ipv4format1boxednumber)
boxed class to store validated Number payloads | +| record | [Ipv4Format.Ipv4Format1BoxedString](#ipv4format1boxedstring)
boxed class to store validated String payloads | +| record | [Ipv4Format.Ipv4Format1BoxedList](#ipv4format1boxedlist)
boxed class to store validated List payloads | +| record | [Ipv4Format.Ipv4Format1BoxedMap](#ipv4format1boxedmap)
boxed class to store validated Map payloads | | static class | [Ipv4Format.Ipv4Format1](#ipv4format1)
schema class | ## Ipv4Format1Boxed -public static abstract sealed class Ipv4Format1Boxed
+public sealed interface Ipv4Format1Boxed
permits
[Ipv4Format1BoxedVoid](#ipv4format1boxedvoid), [Ipv4Format1BoxedBoolean](#ipv4format1boxedboolean), @@ -29,103 +29,109 @@ permits
[Ipv4Format1BoxedList](#ipv4format1boxedlist), [Ipv4Format1BoxedMap](#ipv4format1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Ipv4Format1BoxedVoid -public static final class Ipv4Format1BoxedVoid
-extends [Ipv4Format1Boxed](#ipv4format1boxed) +public record Ipv4Format1BoxedVoid
+implements [Ipv4Format1Boxed](#ipv4format1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Ipv4Format1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Ipv4Format1BoxedBoolean -public static final class Ipv4Format1BoxedBoolean
-extends [Ipv4Format1Boxed](#ipv4format1boxed) +public record Ipv4Format1BoxedBoolean
+implements [Ipv4Format1Boxed](#ipv4format1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Ipv4Format1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Ipv4Format1BoxedNumber -public static final class Ipv4Format1BoxedNumber
-extends [Ipv4Format1Boxed](#ipv4format1boxed) +public record Ipv4Format1BoxedNumber
+implements [Ipv4Format1Boxed](#ipv4format1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Ipv4Format1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Ipv4Format1BoxedString -public static final class Ipv4Format1BoxedString
-extends [Ipv4Format1Boxed](#ipv4format1boxed) +public record Ipv4Format1BoxedString
+implements [Ipv4Format1Boxed](#ipv4format1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Ipv4Format1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Ipv4Format1BoxedList -public static final class Ipv4Format1BoxedList
-extends [Ipv4Format1Boxed](#ipv4format1boxed) +public record Ipv4Format1BoxedList
+implements [Ipv4Format1Boxed](#ipv4format1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Ipv4Format1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Ipv4Format1BoxedMap -public static final class Ipv4Format1BoxedMap
-extends [Ipv4Format1Boxed](#ipv4format1boxed) +public record Ipv4Format1BoxedMap
+implements [Ipv4Format1Boxed](#ipv4format1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Ipv4Format1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Ipv4Format1 public static class Ipv4Format1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [Ipv4Format1BoxedBoolean](#ipv4format1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Ipv4Format1BoxedMap](#ipv4format1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [Ipv4Format1BoxedList](#ipv4format1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Ipv4Format1Boxed](#ipv4format1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/Ipv6Format.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/Ipv6Format.md index e6d1b20816b..b7e6fa306b8 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/Ipv6Format.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/Ipv6Format.md @@ -4,23 +4,23 @@ public class Ipv6Format
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Ipv6Format.Ipv6Format1Boxed](#ipv6format1boxed)
abstract sealed validated payload class | -| static class | [Ipv6Format.Ipv6Format1BoxedVoid](#ipv6format1boxedvoid)
boxed class to store validated null payloads | -| static class | [Ipv6Format.Ipv6Format1BoxedBoolean](#ipv6format1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [Ipv6Format.Ipv6Format1BoxedNumber](#ipv6format1boxednumber)
boxed class to store validated Number payloads | -| static class | [Ipv6Format.Ipv6Format1BoxedString](#ipv6format1boxedstring)
boxed class to store validated String payloads | -| static class | [Ipv6Format.Ipv6Format1BoxedList](#ipv6format1boxedlist)
boxed class to store validated List payloads | -| static class | [Ipv6Format.Ipv6Format1BoxedMap](#ipv6format1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [Ipv6Format.Ipv6Format1Boxed](#ipv6format1boxed)
sealed interface for validated payloads | +| record | [Ipv6Format.Ipv6Format1BoxedVoid](#ipv6format1boxedvoid)
boxed class to store validated null payloads | +| record | [Ipv6Format.Ipv6Format1BoxedBoolean](#ipv6format1boxedboolean)
boxed class to store validated boolean payloads | +| record | [Ipv6Format.Ipv6Format1BoxedNumber](#ipv6format1boxednumber)
boxed class to store validated Number payloads | +| record | [Ipv6Format.Ipv6Format1BoxedString](#ipv6format1boxedstring)
boxed class to store validated String payloads | +| record | [Ipv6Format.Ipv6Format1BoxedList](#ipv6format1boxedlist)
boxed class to store validated List payloads | +| record | [Ipv6Format.Ipv6Format1BoxedMap](#ipv6format1boxedmap)
boxed class to store validated Map payloads | | static class | [Ipv6Format.Ipv6Format1](#ipv6format1)
schema class | ## Ipv6Format1Boxed -public static abstract sealed class Ipv6Format1Boxed
+public sealed interface Ipv6Format1Boxed
permits
[Ipv6Format1BoxedVoid](#ipv6format1boxedvoid), [Ipv6Format1BoxedBoolean](#ipv6format1boxedboolean), @@ -29,103 +29,109 @@ permits
[Ipv6Format1BoxedList](#ipv6format1boxedlist), [Ipv6Format1BoxedMap](#ipv6format1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Ipv6Format1BoxedVoid -public static final class Ipv6Format1BoxedVoid
-extends [Ipv6Format1Boxed](#ipv6format1boxed) +public record Ipv6Format1BoxedVoid
+implements [Ipv6Format1Boxed](#ipv6format1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Ipv6Format1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Ipv6Format1BoxedBoolean -public static final class Ipv6Format1BoxedBoolean
-extends [Ipv6Format1Boxed](#ipv6format1boxed) +public record Ipv6Format1BoxedBoolean
+implements [Ipv6Format1Boxed](#ipv6format1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Ipv6Format1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Ipv6Format1BoxedNumber -public static final class Ipv6Format1BoxedNumber
-extends [Ipv6Format1Boxed](#ipv6format1boxed) +public record Ipv6Format1BoxedNumber
+implements [Ipv6Format1Boxed](#ipv6format1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Ipv6Format1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Ipv6Format1BoxedString -public static final class Ipv6Format1BoxedString
-extends [Ipv6Format1Boxed](#ipv6format1boxed) +public record Ipv6Format1BoxedString
+implements [Ipv6Format1Boxed](#ipv6format1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Ipv6Format1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Ipv6Format1BoxedList -public static final class Ipv6Format1BoxedList
-extends [Ipv6Format1Boxed](#ipv6format1boxed) +public record Ipv6Format1BoxedList
+implements [Ipv6Format1Boxed](#ipv6format1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Ipv6Format1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Ipv6Format1BoxedMap -public static final class Ipv6Format1BoxedMap
-extends [Ipv6Format1Boxed](#ipv6format1boxed) +public record Ipv6Format1BoxedMap
+implements [Ipv6Format1Boxed](#ipv6format1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Ipv6Format1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Ipv6Format1 public static class Ipv6Format1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [Ipv6Format1BoxedBoolean](#ipv6format1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Ipv6Format1BoxedMap](#ipv6format1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [Ipv6Format1BoxedList](#ipv6format1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Ipv6Format1Boxed](#ipv6format1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/JsonPointerFormat.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/JsonPointerFormat.md index 0bf84047e03..65c23c09e6c 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/JsonPointerFormat.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/JsonPointerFormat.md @@ -4,23 +4,23 @@ public class JsonPointerFormat
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [JsonPointerFormat.JsonPointerFormat1Boxed](#jsonpointerformat1boxed)
abstract sealed validated payload class | -| static class | [JsonPointerFormat.JsonPointerFormat1BoxedVoid](#jsonpointerformat1boxedvoid)
boxed class to store validated null payloads | -| static class | [JsonPointerFormat.JsonPointerFormat1BoxedBoolean](#jsonpointerformat1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [JsonPointerFormat.JsonPointerFormat1BoxedNumber](#jsonpointerformat1boxednumber)
boxed class to store validated Number payloads | -| static class | [JsonPointerFormat.JsonPointerFormat1BoxedString](#jsonpointerformat1boxedstring)
boxed class to store validated String payloads | -| static class | [JsonPointerFormat.JsonPointerFormat1BoxedList](#jsonpointerformat1boxedlist)
boxed class to store validated List payloads | -| static class | [JsonPointerFormat.JsonPointerFormat1BoxedMap](#jsonpointerformat1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [JsonPointerFormat.JsonPointerFormat1Boxed](#jsonpointerformat1boxed)
sealed interface for validated payloads | +| record | [JsonPointerFormat.JsonPointerFormat1BoxedVoid](#jsonpointerformat1boxedvoid)
boxed class to store validated null payloads | +| record | [JsonPointerFormat.JsonPointerFormat1BoxedBoolean](#jsonpointerformat1boxedboolean)
boxed class to store validated boolean payloads | +| record | [JsonPointerFormat.JsonPointerFormat1BoxedNumber](#jsonpointerformat1boxednumber)
boxed class to store validated Number payloads | +| record | [JsonPointerFormat.JsonPointerFormat1BoxedString](#jsonpointerformat1boxedstring)
boxed class to store validated String payloads | +| record | [JsonPointerFormat.JsonPointerFormat1BoxedList](#jsonpointerformat1boxedlist)
boxed class to store validated List payloads | +| record | [JsonPointerFormat.JsonPointerFormat1BoxedMap](#jsonpointerformat1boxedmap)
boxed class to store validated Map payloads | | static class | [JsonPointerFormat.JsonPointerFormat1](#jsonpointerformat1)
schema class | ## JsonPointerFormat1Boxed -public static abstract sealed class JsonPointerFormat1Boxed
+public sealed interface JsonPointerFormat1Boxed
permits
[JsonPointerFormat1BoxedVoid](#jsonpointerformat1boxedvoid), [JsonPointerFormat1BoxedBoolean](#jsonpointerformat1boxedboolean), @@ -29,103 +29,109 @@ permits
[JsonPointerFormat1BoxedList](#jsonpointerformat1boxedlist), [JsonPointerFormat1BoxedMap](#jsonpointerformat1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## JsonPointerFormat1BoxedVoid -public static final class JsonPointerFormat1BoxedVoid
-extends [JsonPointerFormat1Boxed](#jsonpointerformat1boxed) +public record JsonPointerFormat1BoxedVoid
+implements [JsonPointerFormat1Boxed](#jsonpointerformat1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | JsonPointerFormat1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## JsonPointerFormat1BoxedBoolean -public static final class JsonPointerFormat1BoxedBoolean
-extends [JsonPointerFormat1Boxed](#jsonpointerformat1boxed) +public record JsonPointerFormat1BoxedBoolean
+implements [JsonPointerFormat1Boxed](#jsonpointerformat1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | JsonPointerFormat1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## JsonPointerFormat1BoxedNumber -public static final class JsonPointerFormat1BoxedNumber
-extends [JsonPointerFormat1Boxed](#jsonpointerformat1boxed) +public record JsonPointerFormat1BoxedNumber
+implements [JsonPointerFormat1Boxed](#jsonpointerformat1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | JsonPointerFormat1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## JsonPointerFormat1BoxedString -public static final class JsonPointerFormat1BoxedString
-extends [JsonPointerFormat1Boxed](#jsonpointerformat1boxed) +public record JsonPointerFormat1BoxedString
+implements [JsonPointerFormat1Boxed](#jsonpointerformat1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | JsonPointerFormat1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## JsonPointerFormat1BoxedList -public static final class JsonPointerFormat1BoxedList
-extends [JsonPointerFormat1Boxed](#jsonpointerformat1boxed) +public record JsonPointerFormat1BoxedList
+implements [JsonPointerFormat1Boxed](#jsonpointerformat1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | JsonPointerFormat1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## JsonPointerFormat1BoxedMap -public static final class JsonPointerFormat1BoxedMap
-extends [JsonPointerFormat1Boxed](#jsonpointerformat1boxed) +public record JsonPointerFormat1BoxedMap
+implements [JsonPointerFormat1Boxed](#jsonpointerformat1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | JsonPointerFormat1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## JsonPointerFormat1 public static class JsonPointerFormat1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [JsonPointerFormat1BoxedBoolean](#jsonpointerformat1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [JsonPointerFormat1BoxedMap](#jsonpointerformat1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [JsonPointerFormat1BoxedList](#jsonpointerformat1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [JsonPointerFormat1Boxed](#jsonpointerformat1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/MaximumValidation.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/MaximumValidation.md index 8d3299d1f57..ea90b82fd0b 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/MaximumValidation.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/MaximumValidation.md @@ -4,23 +4,23 @@ public class MaximumValidation
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [MaximumValidation.MaximumValidation1Boxed](#maximumvalidation1boxed)
abstract sealed validated payload class | -| static class | [MaximumValidation.MaximumValidation1BoxedVoid](#maximumvalidation1boxedvoid)
boxed class to store validated null payloads | -| static class | [MaximumValidation.MaximumValidation1BoxedBoolean](#maximumvalidation1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [MaximumValidation.MaximumValidation1BoxedNumber](#maximumvalidation1boxednumber)
boxed class to store validated Number payloads | -| static class | [MaximumValidation.MaximumValidation1BoxedString](#maximumvalidation1boxedstring)
boxed class to store validated String payloads | -| static class | [MaximumValidation.MaximumValidation1BoxedList](#maximumvalidation1boxedlist)
boxed class to store validated List payloads | -| static class | [MaximumValidation.MaximumValidation1BoxedMap](#maximumvalidation1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [MaximumValidation.MaximumValidation1Boxed](#maximumvalidation1boxed)
sealed interface for validated payloads | +| record | [MaximumValidation.MaximumValidation1BoxedVoid](#maximumvalidation1boxedvoid)
boxed class to store validated null payloads | +| record | [MaximumValidation.MaximumValidation1BoxedBoolean](#maximumvalidation1boxedboolean)
boxed class to store validated boolean payloads | +| record | [MaximumValidation.MaximumValidation1BoxedNumber](#maximumvalidation1boxednumber)
boxed class to store validated Number payloads | +| record | [MaximumValidation.MaximumValidation1BoxedString](#maximumvalidation1boxedstring)
boxed class to store validated String payloads | +| record | [MaximumValidation.MaximumValidation1BoxedList](#maximumvalidation1boxedlist)
boxed class to store validated List payloads | +| record | [MaximumValidation.MaximumValidation1BoxedMap](#maximumvalidation1boxedmap)
boxed class to store validated Map payloads | | static class | [MaximumValidation.MaximumValidation1](#maximumvalidation1)
schema class | ## MaximumValidation1Boxed -public static abstract sealed class MaximumValidation1Boxed
+public sealed interface MaximumValidation1Boxed
permits
[MaximumValidation1BoxedVoid](#maximumvalidation1boxedvoid), [MaximumValidation1BoxedBoolean](#maximumvalidation1boxedboolean), @@ -29,103 +29,109 @@ permits
[MaximumValidation1BoxedList](#maximumvalidation1boxedlist), [MaximumValidation1BoxedMap](#maximumvalidation1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## MaximumValidation1BoxedVoid -public static final class MaximumValidation1BoxedVoid
-extends [MaximumValidation1Boxed](#maximumvalidation1boxed) +public record MaximumValidation1BoxedVoid
+implements [MaximumValidation1Boxed](#maximumvalidation1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MaximumValidation1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MaximumValidation1BoxedBoolean -public static final class MaximumValidation1BoxedBoolean
-extends [MaximumValidation1Boxed](#maximumvalidation1boxed) +public record MaximumValidation1BoxedBoolean
+implements [MaximumValidation1Boxed](#maximumvalidation1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MaximumValidation1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MaximumValidation1BoxedNumber -public static final class MaximumValidation1BoxedNumber
-extends [MaximumValidation1Boxed](#maximumvalidation1boxed) +public record MaximumValidation1BoxedNumber
+implements [MaximumValidation1Boxed](#maximumvalidation1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MaximumValidation1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MaximumValidation1BoxedString -public static final class MaximumValidation1BoxedString
-extends [MaximumValidation1Boxed](#maximumvalidation1boxed) +public record MaximumValidation1BoxedString
+implements [MaximumValidation1Boxed](#maximumvalidation1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MaximumValidation1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MaximumValidation1BoxedList -public static final class MaximumValidation1BoxedList
-extends [MaximumValidation1Boxed](#maximumvalidation1boxed) +public record MaximumValidation1BoxedList
+implements [MaximumValidation1Boxed](#maximumvalidation1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MaximumValidation1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MaximumValidation1BoxedMap -public static final class MaximumValidation1BoxedMap
-extends [MaximumValidation1Boxed](#maximumvalidation1boxed) +public record MaximumValidation1BoxedMap
+implements [MaximumValidation1Boxed](#maximumvalidation1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MaximumValidation1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MaximumValidation1 public static class MaximumValidation1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [MaximumValidation1BoxedBoolean](#maximumvalidation1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [MaximumValidation1BoxedMap](#maximumvalidation1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [MaximumValidation1BoxedList](#maximumvalidation1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [MaximumValidation1Boxed](#maximumvalidation1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/MaximumValidationWithUnsignedInteger.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/MaximumValidationWithUnsignedInteger.md index 98e8b63439d..319d16fd33e 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/MaximumValidationWithUnsignedInteger.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/MaximumValidationWithUnsignedInteger.md @@ -4,23 +4,23 @@ public class MaximumValidationWithUnsignedInteger
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [MaximumValidationWithUnsignedInteger.MaximumValidationWithUnsignedInteger1Boxed](#maximumvalidationwithunsignedinteger1boxed)
abstract sealed validated payload class | -| static class | [MaximumValidationWithUnsignedInteger.MaximumValidationWithUnsignedInteger1BoxedVoid](#maximumvalidationwithunsignedinteger1boxedvoid)
boxed class to store validated null payloads | -| static class | [MaximumValidationWithUnsignedInteger.MaximumValidationWithUnsignedInteger1BoxedBoolean](#maximumvalidationwithunsignedinteger1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [MaximumValidationWithUnsignedInteger.MaximumValidationWithUnsignedInteger1BoxedNumber](#maximumvalidationwithunsignedinteger1boxednumber)
boxed class to store validated Number payloads | -| static class | [MaximumValidationWithUnsignedInteger.MaximumValidationWithUnsignedInteger1BoxedString](#maximumvalidationwithunsignedinteger1boxedstring)
boxed class to store validated String payloads | -| static class | [MaximumValidationWithUnsignedInteger.MaximumValidationWithUnsignedInteger1BoxedList](#maximumvalidationwithunsignedinteger1boxedlist)
boxed class to store validated List payloads | -| static class | [MaximumValidationWithUnsignedInteger.MaximumValidationWithUnsignedInteger1BoxedMap](#maximumvalidationwithunsignedinteger1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [MaximumValidationWithUnsignedInteger.MaximumValidationWithUnsignedInteger1Boxed](#maximumvalidationwithunsignedinteger1boxed)
sealed interface for validated payloads | +| record | [MaximumValidationWithUnsignedInteger.MaximumValidationWithUnsignedInteger1BoxedVoid](#maximumvalidationwithunsignedinteger1boxedvoid)
boxed class to store validated null payloads | +| record | [MaximumValidationWithUnsignedInteger.MaximumValidationWithUnsignedInteger1BoxedBoolean](#maximumvalidationwithunsignedinteger1boxedboolean)
boxed class to store validated boolean payloads | +| record | [MaximumValidationWithUnsignedInteger.MaximumValidationWithUnsignedInteger1BoxedNumber](#maximumvalidationwithunsignedinteger1boxednumber)
boxed class to store validated Number payloads | +| record | [MaximumValidationWithUnsignedInteger.MaximumValidationWithUnsignedInteger1BoxedString](#maximumvalidationwithunsignedinteger1boxedstring)
boxed class to store validated String payloads | +| record | [MaximumValidationWithUnsignedInteger.MaximumValidationWithUnsignedInteger1BoxedList](#maximumvalidationwithunsignedinteger1boxedlist)
boxed class to store validated List payloads | +| record | [MaximumValidationWithUnsignedInteger.MaximumValidationWithUnsignedInteger1BoxedMap](#maximumvalidationwithunsignedinteger1boxedmap)
boxed class to store validated Map payloads | | static class | [MaximumValidationWithUnsignedInteger.MaximumValidationWithUnsignedInteger1](#maximumvalidationwithunsignedinteger1)
schema class | ## MaximumValidationWithUnsignedInteger1Boxed -public static abstract sealed class MaximumValidationWithUnsignedInteger1Boxed
+public sealed interface MaximumValidationWithUnsignedInteger1Boxed
permits
[MaximumValidationWithUnsignedInteger1BoxedVoid](#maximumvalidationwithunsignedinteger1boxedvoid), [MaximumValidationWithUnsignedInteger1BoxedBoolean](#maximumvalidationwithunsignedinteger1boxedboolean), @@ -29,103 +29,109 @@ permits
[MaximumValidationWithUnsignedInteger1BoxedList](#maximumvalidationwithunsignedinteger1boxedlist), [MaximumValidationWithUnsignedInteger1BoxedMap](#maximumvalidationwithunsignedinteger1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## MaximumValidationWithUnsignedInteger1BoxedVoid -public static final class MaximumValidationWithUnsignedInteger1BoxedVoid
-extends [MaximumValidationWithUnsignedInteger1Boxed](#maximumvalidationwithunsignedinteger1boxed) +public record MaximumValidationWithUnsignedInteger1BoxedVoid
+implements [MaximumValidationWithUnsignedInteger1Boxed](#maximumvalidationwithunsignedinteger1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MaximumValidationWithUnsignedInteger1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MaximumValidationWithUnsignedInteger1BoxedBoolean -public static final class MaximumValidationWithUnsignedInteger1BoxedBoolean
-extends [MaximumValidationWithUnsignedInteger1Boxed](#maximumvalidationwithunsignedinteger1boxed) +public record MaximumValidationWithUnsignedInteger1BoxedBoolean
+implements [MaximumValidationWithUnsignedInteger1Boxed](#maximumvalidationwithunsignedinteger1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MaximumValidationWithUnsignedInteger1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MaximumValidationWithUnsignedInteger1BoxedNumber -public static final class MaximumValidationWithUnsignedInteger1BoxedNumber
-extends [MaximumValidationWithUnsignedInteger1Boxed](#maximumvalidationwithunsignedinteger1boxed) +public record MaximumValidationWithUnsignedInteger1BoxedNumber
+implements [MaximumValidationWithUnsignedInteger1Boxed](#maximumvalidationwithunsignedinteger1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MaximumValidationWithUnsignedInteger1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MaximumValidationWithUnsignedInteger1BoxedString -public static final class MaximumValidationWithUnsignedInteger1BoxedString
-extends [MaximumValidationWithUnsignedInteger1Boxed](#maximumvalidationwithunsignedinteger1boxed) +public record MaximumValidationWithUnsignedInteger1BoxedString
+implements [MaximumValidationWithUnsignedInteger1Boxed](#maximumvalidationwithunsignedinteger1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MaximumValidationWithUnsignedInteger1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MaximumValidationWithUnsignedInteger1BoxedList -public static final class MaximumValidationWithUnsignedInteger1BoxedList
-extends [MaximumValidationWithUnsignedInteger1Boxed](#maximumvalidationwithunsignedinteger1boxed) +public record MaximumValidationWithUnsignedInteger1BoxedList
+implements [MaximumValidationWithUnsignedInteger1Boxed](#maximumvalidationwithunsignedinteger1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MaximumValidationWithUnsignedInteger1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MaximumValidationWithUnsignedInteger1BoxedMap -public static final class MaximumValidationWithUnsignedInteger1BoxedMap
-extends [MaximumValidationWithUnsignedInteger1Boxed](#maximumvalidationwithunsignedinteger1boxed) +public record MaximumValidationWithUnsignedInteger1BoxedMap
+implements [MaximumValidationWithUnsignedInteger1Boxed](#maximumvalidationwithunsignedinteger1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MaximumValidationWithUnsignedInteger1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MaximumValidationWithUnsignedInteger1 public static class MaximumValidationWithUnsignedInteger1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [MaximumValidationWithUnsignedInteger1BoxedBoolean](#maximumvalidationwithunsignedinteger1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [MaximumValidationWithUnsignedInteger1BoxedMap](#maximumvalidationwithunsignedinteger1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [MaximumValidationWithUnsignedInteger1BoxedList](#maximumvalidationwithunsignedinteger1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [MaximumValidationWithUnsignedInteger1Boxed](#maximumvalidationwithunsignedinteger1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/MaxitemsValidation.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/MaxitemsValidation.md index 98523745270..1fd4640fa8a 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/MaxitemsValidation.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/MaxitemsValidation.md @@ -4,23 +4,23 @@ public class MaxitemsValidation
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [MaxitemsValidation.MaxitemsValidation1Boxed](#maxitemsvalidation1boxed)
abstract sealed validated payload class | -| static class | [MaxitemsValidation.MaxitemsValidation1BoxedVoid](#maxitemsvalidation1boxedvoid)
boxed class to store validated null payloads | -| static class | [MaxitemsValidation.MaxitemsValidation1BoxedBoolean](#maxitemsvalidation1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [MaxitemsValidation.MaxitemsValidation1BoxedNumber](#maxitemsvalidation1boxednumber)
boxed class to store validated Number payloads | -| static class | [MaxitemsValidation.MaxitemsValidation1BoxedString](#maxitemsvalidation1boxedstring)
boxed class to store validated String payloads | -| static class | [MaxitemsValidation.MaxitemsValidation1BoxedList](#maxitemsvalidation1boxedlist)
boxed class to store validated List payloads | -| static class | [MaxitemsValidation.MaxitemsValidation1BoxedMap](#maxitemsvalidation1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [MaxitemsValidation.MaxitemsValidation1Boxed](#maxitemsvalidation1boxed)
sealed interface for validated payloads | +| record | [MaxitemsValidation.MaxitemsValidation1BoxedVoid](#maxitemsvalidation1boxedvoid)
boxed class to store validated null payloads | +| record | [MaxitemsValidation.MaxitemsValidation1BoxedBoolean](#maxitemsvalidation1boxedboolean)
boxed class to store validated boolean payloads | +| record | [MaxitemsValidation.MaxitemsValidation1BoxedNumber](#maxitemsvalidation1boxednumber)
boxed class to store validated Number payloads | +| record | [MaxitemsValidation.MaxitemsValidation1BoxedString](#maxitemsvalidation1boxedstring)
boxed class to store validated String payloads | +| record | [MaxitemsValidation.MaxitemsValidation1BoxedList](#maxitemsvalidation1boxedlist)
boxed class to store validated List payloads | +| record | [MaxitemsValidation.MaxitemsValidation1BoxedMap](#maxitemsvalidation1boxedmap)
boxed class to store validated Map payloads | | static class | [MaxitemsValidation.MaxitemsValidation1](#maxitemsvalidation1)
schema class | ## MaxitemsValidation1Boxed -public static abstract sealed class MaxitemsValidation1Boxed
+public sealed interface MaxitemsValidation1Boxed
permits
[MaxitemsValidation1BoxedVoid](#maxitemsvalidation1boxedvoid), [MaxitemsValidation1BoxedBoolean](#maxitemsvalidation1boxedboolean), @@ -29,103 +29,109 @@ permits
[MaxitemsValidation1BoxedList](#maxitemsvalidation1boxedlist), [MaxitemsValidation1BoxedMap](#maxitemsvalidation1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## MaxitemsValidation1BoxedVoid -public static final class MaxitemsValidation1BoxedVoid
-extends [MaxitemsValidation1Boxed](#maxitemsvalidation1boxed) +public record MaxitemsValidation1BoxedVoid
+implements [MaxitemsValidation1Boxed](#maxitemsvalidation1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MaxitemsValidation1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MaxitemsValidation1BoxedBoolean -public static final class MaxitemsValidation1BoxedBoolean
-extends [MaxitemsValidation1Boxed](#maxitemsvalidation1boxed) +public record MaxitemsValidation1BoxedBoolean
+implements [MaxitemsValidation1Boxed](#maxitemsvalidation1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MaxitemsValidation1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MaxitemsValidation1BoxedNumber -public static final class MaxitemsValidation1BoxedNumber
-extends [MaxitemsValidation1Boxed](#maxitemsvalidation1boxed) +public record MaxitemsValidation1BoxedNumber
+implements [MaxitemsValidation1Boxed](#maxitemsvalidation1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MaxitemsValidation1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MaxitemsValidation1BoxedString -public static final class MaxitemsValidation1BoxedString
-extends [MaxitemsValidation1Boxed](#maxitemsvalidation1boxed) +public record MaxitemsValidation1BoxedString
+implements [MaxitemsValidation1Boxed](#maxitemsvalidation1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MaxitemsValidation1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MaxitemsValidation1BoxedList -public static final class MaxitemsValidation1BoxedList
-extends [MaxitemsValidation1Boxed](#maxitemsvalidation1boxed) +public record MaxitemsValidation1BoxedList
+implements [MaxitemsValidation1Boxed](#maxitemsvalidation1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MaxitemsValidation1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MaxitemsValidation1BoxedMap -public static final class MaxitemsValidation1BoxedMap
-extends [MaxitemsValidation1Boxed](#maxitemsvalidation1boxed) +public record MaxitemsValidation1BoxedMap
+implements [MaxitemsValidation1Boxed](#maxitemsvalidation1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MaxitemsValidation1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MaxitemsValidation1 public static class MaxitemsValidation1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [MaxitemsValidation1BoxedBoolean](#maxitemsvalidation1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [MaxitemsValidation1BoxedMap](#maxitemsvalidation1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [MaxitemsValidation1BoxedList](#maxitemsvalidation1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [MaxitemsValidation1Boxed](#maxitemsvalidation1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/MaxlengthValidation.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/MaxlengthValidation.md index 7aa1d4b333d..e828355331e 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/MaxlengthValidation.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/MaxlengthValidation.md @@ -4,23 +4,23 @@ public class MaxlengthValidation
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [MaxlengthValidation.MaxlengthValidation1Boxed](#maxlengthvalidation1boxed)
abstract sealed validated payload class | -| static class | [MaxlengthValidation.MaxlengthValidation1BoxedVoid](#maxlengthvalidation1boxedvoid)
boxed class to store validated null payloads | -| static class | [MaxlengthValidation.MaxlengthValidation1BoxedBoolean](#maxlengthvalidation1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [MaxlengthValidation.MaxlengthValidation1BoxedNumber](#maxlengthvalidation1boxednumber)
boxed class to store validated Number payloads | -| static class | [MaxlengthValidation.MaxlengthValidation1BoxedString](#maxlengthvalidation1boxedstring)
boxed class to store validated String payloads | -| static class | [MaxlengthValidation.MaxlengthValidation1BoxedList](#maxlengthvalidation1boxedlist)
boxed class to store validated List payloads | -| static class | [MaxlengthValidation.MaxlengthValidation1BoxedMap](#maxlengthvalidation1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [MaxlengthValidation.MaxlengthValidation1Boxed](#maxlengthvalidation1boxed)
sealed interface for validated payloads | +| record | [MaxlengthValidation.MaxlengthValidation1BoxedVoid](#maxlengthvalidation1boxedvoid)
boxed class to store validated null payloads | +| record | [MaxlengthValidation.MaxlengthValidation1BoxedBoolean](#maxlengthvalidation1boxedboolean)
boxed class to store validated boolean payloads | +| record | [MaxlengthValidation.MaxlengthValidation1BoxedNumber](#maxlengthvalidation1boxednumber)
boxed class to store validated Number payloads | +| record | [MaxlengthValidation.MaxlengthValidation1BoxedString](#maxlengthvalidation1boxedstring)
boxed class to store validated String payloads | +| record | [MaxlengthValidation.MaxlengthValidation1BoxedList](#maxlengthvalidation1boxedlist)
boxed class to store validated List payloads | +| record | [MaxlengthValidation.MaxlengthValidation1BoxedMap](#maxlengthvalidation1boxedmap)
boxed class to store validated Map payloads | | static class | [MaxlengthValidation.MaxlengthValidation1](#maxlengthvalidation1)
schema class | ## MaxlengthValidation1Boxed -public static abstract sealed class MaxlengthValidation1Boxed
+public sealed interface MaxlengthValidation1Boxed
permits
[MaxlengthValidation1BoxedVoid](#maxlengthvalidation1boxedvoid), [MaxlengthValidation1BoxedBoolean](#maxlengthvalidation1boxedboolean), @@ -29,103 +29,109 @@ permits
[MaxlengthValidation1BoxedList](#maxlengthvalidation1boxedlist), [MaxlengthValidation1BoxedMap](#maxlengthvalidation1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## MaxlengthValidation1BoxedVoid -public static final class MaxlengthValidation1BoxedVoid
-extends [MaxlengthValidation1Boxed](#maxlengthvalidation1boxed) +public record MaxlengthValidation1BoxedVoid
+implements [MaxlengthValidation1Boxed](#maxlengthvalidation1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MaxlengthValidation1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MaxlengthValidation1BoxedBoolean -public static final class MaxlengthValidation1BoxedBoolean
-extends [MaxlengthValidation1Boxed](#maxlengthvalidation1boxed) +public record MaxlengthValidation1BoxedBoolean
+implements [MaxlengthValidation1Boxed](#maxlengthvalidation1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MaxlengthValidation1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MaxlengthValidation1BoxedNumber -public static final class MaxlengthValidation1BoxedNumber
-extends [MaxlengthValidation1Boxed](#maxlengthvalidation1boxed) +public record MaxlengthValidation1BoxedNumber
+implements [MaxlengthValidation1Boxed](#maxlengthvalidation1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MaxlengthValidation1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MaxlengthValidation1BoxedString -public static final class MaxlengthValidation1BoxedString
-extends [MaxlengthValidation1Boxed](#maxlengthvalidation1boxed) +public record MaxlengthValidation1BoxedString
+implements [MaxlengthValidation1Boxed](#maxlengthvalidation1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MaxlengthValidation1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MaxlengthValidation1BoxedList -public static final class MaxlengthValidation1BoxedList
-extends [MaxlengthValidation1Boxed](#maxlengthvalidation1boxed) +public record MaxlengthValidation1BoxedList
+implements [MaxlengthValidation1Boxed](#maxlengthvalidation1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MaxlengthValidation1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MaxlengthValidation1BoxedMap -public static final class MaxlengthValidation1BoxedMap
-extends [MaxlengthValidation1Boxed](#maxlengthvalidation1boxed) +public record MaxlengthValidation1BoxedMap
+implements [MaxlengthValidation1Boxed](#maxlengthvalidation1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MaxlengthValidation1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MaxlengthValidation1 public static class MaxlengthValidation1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [MaxlengthValidation1BoxedBoolean](#maxlengthvalidation1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [MaxlengthValidation1BoxedMap](#maxlengthvalidation1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [MaxlengthValidation1BoxedList](#maxlengthvalidation1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [MaxlengthValidation1Boxed](#maxlengthvalidation1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/Maxproperties0MeansTheObjectIsEmpty.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/Maxproperties0MeansTheObjectIsEmpty.md index 36d25749476..0f8c895fdcd 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/Maxproperties0MeansTheObjectIsEmpty.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/Maxproperties0MeansTheObjectIsEmpty.md @@ -4,23 +4,23 @@ public class Maxproperties0MeansTheObjectIsEmpty
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Maxproperties0MeansTheObjectIsEmpty.Maxproperties0MeansTheObjectIsEmpty1Boxed](#maxproperties0meanstheobjectisempty1boxed)
abstract sealed validated payload class | -| static class | [Maxproperties0MeansTheObjectIsEmpty.Maxproperties0MeansTheObjectIsEmpty1BoxedVoid](#maxproperties0meanstheobjectisempty1boxedvoid)
boxed class to store validated null payloads | -| static class | [Maxproperties0MeansTheObjectIsEmpty.Maxproperties0MeansTheObjectIsEmpty1BoxedBoolean](#maxproperties0meanstheobjectisempty1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [Maxproperties0MeansTheObjectIsEmpty.Maxproperties0MeansTheObjectIsEmpty1BoxedNumber](#maxproperties0meanstheobjectisempty1boxednumber)
boxed class to store validated Number payloads | -| static class | [Maxproperties0MeansTheObjectIsEmpty.Maxproperties0MeansTheObjectIsEmpty1BoxedString](#maxproperties0meanstheobjectisempty1boxedstring)
boxed class to store validated String payloads | -| static class | [Maxproperties0MeansTheObjectIsEmpty.Maxproperties0MeansTheObjectIsEmpty1BoxedList](#maxproperties0meanstheobjectisempty1boxedlist)
boxed class to store validated List payloads | -| static class | [Maxproperties0MeansTheObjectIsEmpty.Maxproperties0MeansTheObjectIsEmpty1BoxedMap](#maxproperties0meanstheobjectisempty1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [Maxproperties0MeansTheObjectIsEmpty.Maxproperties0MeansTheObjectIsEmpty1Boxed](#maxproperties0meanstheobjectisempty1boxed)
sealed interface for validated payloads | +| record | [Maxproperties0MeansTheObjectIsEmpty.Maxproperties0MeansTheObjectIsEmpty1BoxedVoid](#maxproperties0meanstheobjectisempty1boxedvoid)
boxed class to store validated null payloads | +| record | [Maxproperties0MeansTheObjectIsEmpty.Maxproperties0MeansTheObjectIsEmpty1BoxedBoolean](#maxproperties0meanstheobjectisempty1boxedboolean)
boxed class to store validated boolean payloads | +| record | [Maxproperties0MeansTheObjectIsEmpty.Maxproperties0MeansTheObjectIsEmpty1BoxedNumber](#maxproperties0meanstheobjectisempty1boxednumber)
boxed class to store validated Number payloads | +| record | [Maxproperties0MeansTheObjectIsEmpty.Maxproperties0MeansTheObjectIsEmpty1BoxedString](#maxproperties0meanstheobjectisempty1boxedstring)
boxed class to store validated String payloads | +| record | [Maxproperties0MeansTheObjectIsEmpty.Maxproperties0MeansTheObjectIsEmpty1BoxedList](#maxproperties0meanstheobjectisempty1boxedlist)
boxed class to store validated List payloads | +| record | [Maxproperties0MeansTheObjectIsEmpty.Maxproperties0MeansTheObjectIsEmpty1BoxedMap](#maxproperties0meanstheobjectisempty1boxedmap)
boxed class to store validated Map payloads | | static class | [Maxproperties0MeansTheObjectIsEmpty.Maxproperties0MeansTheObjectIsEmpty1](#maxproperties0meanstheobjectisempty1)
schema class | ## Maxproperties0MeansTheObjectIsEmpty1Boxed -public static abstract sealed class Maxproperties0MeansTheObjectIsEmpty1Boxed
+public sealed interface Maxproperties0MeansTheObjectIsEmpty1Boxed
permits
[Maxproperties0MeansTheObjectIsEmpty1BoxedVoid](#maxproperties0meanstheobjectisempty1boxedvoid), [Maxproperties0MeansTheObjectIsEmpty1BoxedBoolean](#maxproperties0meanstheobjectisempty1boxedboolean), @@ -29,103 +29,109 @@ permits
[Maxproperties0MeansTheObjectIsEmpty1BoxedList](#maxproperties0meanstheobjectisempty1boxedlist), [Maxproperties0MeansTheObjectIsEmpty1BoxedMap](#maxproperties0meanstheobjectisempty1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Maxproperties0MeansTheObjectIsEmpty1BoxedVoid -public static final class Maxproperties0MeansTheObjectIsEmpty1BoxedVoid
-extends [Maxproperties0MeansTheObjectIsEmpty1Boxed](#maxproperties0meanstheobjectisempty1boxed) +public record Maxproperties0MeansTheObjectIsEmpty1BoxedVoid
+implements [Maxproperties0MeansTheObjectIsEmpty1Boxed](#maxproperties0meanstheobjectisempty1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Maxproperties0MeansTheObjectIsEmpty1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Maxproperties0MeansTheObjectIsEmpty1BoxedBoolean -public static final class Maxproperties0MeansTheObjectIsEmpty1BoxedBoolean
-extends [Maxproperties0MeansTheObjectIsEmpty1Boxed](#maxproperties0meanstheobjectisempty1boxed) +public record Maxproperties0MeansTheObjectIsEmpty1BoxedBoolean
+implements [Maxproperties0MeansTheObjectIsEmpty1Boxed](#maxproperties0meanstheobjectisempty1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Maxproperties0MeansTheObjectIsEmpty1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Maxproperties0MeansTheObjectIsEmpty1BoxedNumber -public static final class Maxproperties0MeansTheObjectIsEmpty1BoxedNumber
-extends [Maxproperties0MeansTheObjectIsEmpty1Boxed](#maxproperties0meanstheobjectisempty1boxed) +public record Maxproperties0MeansTheObjectIsEmpty1BoxedNumber
+implements [Maxproperties0MeansTheObjectIsEmpty1Boxed](#maxproperties0meanstheobjectisempty1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Maxproperties0MeansTheObjectIsEmpty1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Maxproperties0MeansTheObjectIsEmpty1BoxedString -public static final class Maxproperties0MeansTheObjectIsEmpty1BoxedString
-extends [Maxproperties0MeansTheObjectIsEmpty1Boxed](#maxproperties0meanstheobjectisempty1boxed) +public record Maxproperties0MeansTheObjectIsEmpty1BoxedString
+implements [Maxproperties0MeansTheObjectIsEmpty1Boxed](#maxproperties0meanstheobjectisempty1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Maxproperties0MeansTheObjectIsEmpty1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Maxproperties0MeansTheObjectIsEmpty1BoxedList -public static final class Maxproperties0MeansTheObjectIsEmpty1BoxedList
-extends [Maxproperties0MeansTheObjectIsEmpty1Boxed](#maxproperties0meanstheobjectisempty1boxed) +public record Maxproperties0MeansTheObjectIsEmpty1BoxedList
+implements [Maxproperties0MeansTheObjectIsEmpty1Boxed](#maxproperties0meanstheobjectisempty1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Maxproperties0MeansTheObjectIsEmpty1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Maxproperties0MeansTheObjectIsEmpty1BoxedMap -public static final class Maxproperties0MeansTheObjectIsEmpty1BoxedMap
-extends [Maxproperties0MeansTheObjectIsEmpty1Boxed](#maxproperties0meanstheobjectisempty1boxed) +public record Maxproperties0MeansTheObjectIsEmpty1BoxedMap
+implements [Maxproperties0MeansTheObjectIsEmpty1Boxed](#maxproperties0meanstheobjectisempty1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Maxproperties0MeansTheObjectIsEmpty1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Maxproperties0MeansTheObjectIsEmpty1 public static class Maxproperties0MeansTheObjectIsEmpty1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [Maxproperties0MeansTheObjectIsEmpty1BoxedBoolean](#maxproperties0meanstheobjectisempty1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Maxproperties0MeansTheObjectIsEmpty1BoxedMap](#maxproperties0meanstheobjectisempty1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [Maxproperties0MeansTheObjectIsEmpty1BoxedList](#maxproperties0meanstheobjectisempty1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Maxproperties0MeansTheObjectIsEmpty1Boxed](#maxproperties0meanstheobjectisempty1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/MaxpropertiesValidation.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/MaxpropertiesValidation.md index 7c12d46e04b..0ee228096d5 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/MaxpropertiesValidation.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/MaxpropertiesValidation.md @@ -4,23 +4,23 @@ public class MaxpropertiesValidation
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [MaxpropertiesValidation.MaxpropertiesValidation1Boxed](#maxpropertiesvalidation1boxed)
abstract sealed validated payload class | -| static class | [MaxpropertiesValidation.MaxpropertiesValidation1BoxedVoid](#maxpropertiesvalidation1boxedvoid)
boxed class to store validated null payloads | -| static class | [MaxpropertiesValidation.MaxpropertiesValidation1BoxedBoolean](#maxpropertiesvalidation1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [MaxpropertiesValidation.MaxpropertiesValidation1BoxedNumber](#maxpropertiesvalidation1boxednumber)
boxed class to store validated Number payloads | -| static class | [MaxpropertiesValidation.MaxpropertiesValidation1BoxedString](#maxpropertiesvalidation1boxedstring)
boxed class to store validated String payloads | -| static class | [MaxpropertiesValidation.MaxpropertiesValidation1BoxedList](#maxpropertiesvalidation1boxedlist)
boxed class to store validated List payloads | -| static class | [MaxpropertiesValidation.MaxpropertiesValidation1BoxedMap](#maxpropertiesvalidation1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [MaxpropertiesValidation.MaxpropertiesValidation1Boxed](#maxpropertiesvalidation1boxed)
sealed interface for validated payloads | +| record | [MaxpropertiesValidation.MaxpropertiesValidation1BoxedVoid](#maxpropertiesvalidation1boxedvoid)
boxed class to store validated null payloads | +| record | [MaxpropertiesValidation.MaxpropertiesValidation1BoxedBoolean](#maxpropertiesvalidation1boxedboolean)
boxed class to store validated boolean payloads | +| record | [MaxpropertiesValidation.MaxpropertiesValidation1BoxedNumber](#maxpropertiesvalidation1boxednumber)
boxed class to store validated Number payloads | +| record | [MaxpropertiesValidation.MaxpropertiesValidation1BoxedString](#maxpropertiesvalidation1boxedstring)
boxed class to store validated String payloads | +| record | [MaxpropertiesValidation.MaxpropertiesValidation1BoxedList](#maxpropertiesvalidation1boxedlist)
boxed class to store validated List payloads | +| record | [MaxpropertiesValidation.MaxpropertiesValidation1BoxedMap](#maxpropertiesvalidation1boxedmap)
boxed class to store validated Map payloads | | static class | [MaxpropertiesValidation.MaxpropertiesValidation1](#maxpropertiesvalidation1)
schema class | ## MaxpropertiesValidation1Boxed -public static abstract sealed class MaxpropertiesValidation1Boxed
+public sealed interface MaxpropertiesValidation1Boxed
permits
[MaxpropertiesValidation1BoxedVoid](#maxpropertiesvalidation1boxedvoid), [MaxpropertiesValidation1BoxedBoolean](#maxpropertiesvalidation1boxedboolean), @@ -29,103 +29,109 @@ permits
[MaxpropertiesValidation1BoxedList](#maxpropertiesvalidation1boxedlist), [MaxpropertiesValidation1BoxedMap](#maxpropertiesvalidation1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## MaxpropertiesValidation1BoxedVoid -public static final class MaxpropertiesValidation1BoxedVoid
-extends [MaxpropertiesValidation1Boxed](#maxpropertiesvalidation1boxed) +public record MaxpropertiesValidation1BoxedVoid
+implements [MaxpropertiesValidation1Boxed](#maxpropertiesvalidation1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MaxpropertiesValidation1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MaxpropertiesValidation1BoxedBoolean -public static final class MaxpropertiesValidation1BoxedBoolean
-extends [MaxpropertiesValidation1Boxed](#maxpropertiesvalidation1boxed) +public record MaxpropertiesValidation1BoxedBoolean
+implements [MaxpropertiesValidation1Boxed](#maxpropertiesvalidation1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MaxpropertiesValidation1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MaxpropertiesValidation1BoxedNumber -public static final class MaxpropertiesValidation1BoxedNumber
-extends [MaxpropertiesValidation1Boxed](#maxpropertiesvalidation1boxed) +public record MaxpropertiesValidation1BoxedNumber
+implements [MaxpropertiesValidation1Boxed](#maxpropertiesvalidation1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MaxpropertiesValidation1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MaxpropertiesValidation1BoxedString -public static final class MaxpropertiesValidation1BoxedString
-extends [MaxpropertiesValidation1Boxed](#maxpropertiesvalidation1boxed) +public record MaxpropertiesValidation1BoxedString
+implements [MaxpropertiesValidation1Boxed](#maxpropertiesvalidation1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MaxpropertiesValidation1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MaxpropertiesValidation1BoxedList -public static final class MaxpropertiesValidation1BoxedList
-extends [MaxpropertiesValidation1Boxed](#maxpropertiesvalidation1boxed) +public record MaxpropertiesValidation1BoxedList
+implements [MaxpropertiesValidation1Boxed](#maxpropertiesvalidation1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MaxpropertiesValidation1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MaxpropertiesValidation1BoxedMap -public static final class MaxpropertiesValidation1BoxedMap
-extends [MaxpropertiesValidation1Boxed](#maxpropertiesvalidation1boxed) +public record MaxpropertiesValidation1BoxedMap
+implements [MaxpropertiesValidation1Boxed](#maxpropertiesvalidation1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MaxpropertiesValidation1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MaxpropertiesValidation1 public static class MaxpropertiesValidation1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [MaxpropertiesValidation1BoxedBoolean](#maxpropertiesvalidation1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [MaxpropertiesValidation1BoxedMap](#maxpropertiesvalidation1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [MaxpropertiesValidation1BoxedList](#maxpropertiesvalidation1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [MaxpropertiesValidation1Boxed](#maxpropertiesvalidation1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/MinimumValidation.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/MinimumValidation.md index d08a4b87b8d..26df31b73bd 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/MinimumValidation.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/MinimumValidation.md @@ -4,23 +4,23 @@ public class MinimumValidation
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [MinimumValidation.MinimumValidation1Boxed](#minimumvalidation1boxed)
abstract sealed validated payload class | -| static class | [MinimumValidation.MinimumValidation1BoxedVoid](#minimumvalidation1boxedvoid)
boxed class to store validated null payloads | -| static class | [MinimumValidation.MinimumValidation1BoxedBoolean](#minimumvalidation1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [MinimumValidation.MinimumValidation1BoxedNumber](#minimumvalidation1boxednumber)
boxed class to store validated Number payloads | -| static class | [MinimumValidation.MinimumValidation1BoxedString](#minimumvalidation1boxedstring)
boxed class to store validated String payloads | -| static class | [MinimumValidation.MinimumValidation1BoxedList](#minimumvalidation1boxedlist)
boxed class to store validated List payloads | -| static class | [MinimumValidation.MinimumValidation1BoxedMap](#minimumvalidation1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [MinimumValidation.MinimumValidation1Boxed](#minimumvalidation1boxed)
sealed interface for validated payloads | +| record | [MinimumValidation.MinimumValidation1BoxedVoid](#minimumvalidation1boxedvoid)
boxed class to store validated null payloads | +| record | [MinimumValidation.MinimumValidation1BoxedBoolean](#minimumvalidation1boxedboolean)
boxed class to store validated boolean payloads | +| record | [MinimumValidation.MinimumValidation1BoxedNumber](#minimumvalidation1boxednumber)
boxed class to store validated Number payloads | +| record | [MinimumValidation.MinimumValidation1BoxedString](#minimumvalidation1boxedstring)
boxed class to store validated String payloads | +| record | [MinimumValidation.MinimumValidation1BoxedList](#minimumvalidation1boxedlist)
boxed class to store validated List payloads | +| record | [MinimumValidation.MinimumValidation1BoxedMap](#minimumvalidation1boxedmap)
boxed class to store validated Map payloads | | static class | [MinimumValidation.MinimumValidation1](#minimumvalidation1)
schema class | ## MinimumValidation1Boxed -public static abstract sealed class MinimumValidation1Boxed
+public sealed interface MinimumValidation1Boxed
permits
[MinimumValidation1BoxedVoid](#minimumvalidation1boxedvoid), [MinimumValidation1BoxedBoolean](#minimumvalidation1boxedboolean), @@ -29,103 +29,109 @@ permits
[MinimumValidation1BoxedList](#minimumvalidation1boxedlist), [MinimumValidation1BoxedMap](#minimumvalidation1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## MinimumValidation1BoxedVoid -public static final class MinimumValidation1BoxedVoid
-extends [MinimumValidation1Boxed](#minimumvalidation1boxed) +public record MinimumValidation1BoxedVoid
+implements [MinimumValidation1Boxed](#minimumvalidation1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MinimumValidation1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MinimumValidation1BoxedBoolean -public static final class MinimumValidation1BoxedBoolean
-extends [MinimumValidation1Boxed](#minimumvalidation1boxed) +public record MinimumValidation1BoxedBoolean
+implements [MinimumValidation1Boxed](#minimumvalidation1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MinimumValidation1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MinimumValidation1BoxedNumber -public static final class MinimumValidation1BoxedNumber
-extends [MinimumValidation1Boxed](#minimumvalidation1boxed) +public record MinimumValidation1BoxedNumber
+implements [MinimumValidation1Boxed](#minimumvalidation1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MinimumValidation1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MinimumValidation1BoxedString -public static final class MinimumValidation1BoxedString
-extends [MinimumValidation1Boxed](#minimumvalidation1boxed) +public record MinimumValidation1BoxedString
+implements [MinimumValidation1Boxed](#minimumvalidation1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MinimumValidation1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MinimumValidation1BoxedList -public static final class MinimumValidation1BoxedList
-extends [MinimumValidation1Boxed](#minimumvalidation1boxed) +public record MinimumValidation1BoxedList
+implements [MinimumValidation1Boxed](#minimumvalidation1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MinimumValidation1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MinimumValidation1BoxedMap -public static final class MinimumValidation1BoxedMap
-extends [MinimumValidation1Boxed](#minimumvalidation1boxed) +public record MinimumValidation1BoxedMap
+implements [MinimumValidation1Boxed](#minimumvalidation1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MinimumValidation1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MinimumValidation1 public static class MinimumValidation1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [MinimumValidation1BoxedBoolean](#minimumvalidation1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [MinimumValidation1BoxedMap](#minimumvalidation1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [MinimumValidation1BoxedList](#minimumvalidation1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [MinimumValidation1Boxed](#minimumvalidation1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/MinimumValidationWithSignedInteger.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/MinimumValidationWithSignedInteger.md index d0e27071bf5..8cf8b08f2a7 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/MinimumValidationWithSignedInteger.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/MinimumValidationWithSignedInteger.md @@ -4,23 +4,23 @@ public class MinimumValidationWithSignedInteger
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [MinimumValidationWithSignedInteger.MinimumValidationWithSignedInteger1Boxed](#minimumvalidationwithsignedinteger1boxed)
abstract sealed validated payload class | -| static class | [MinimumValidationWithSignedInteger.MinimumValidationWithSignedInteger1BoxedVoid](#minimumvalidationwithsignedinteger1boxedvoid)
boxed class to store validated null payloads | -| static class | [MinimumValidationWithSignedInteger.MinimumValidationWithSignedInteger1BoxedBoolean](#minimumvalidationwithsignedinteger1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [MinimumValidationWithSignedInteger.MinimumValidationWithSignedInteger1BoxedNumber](#minimumvalidationwithsignedinteger1boxednumber)
boxed class to store validated Number payloads | -| static class | [MinimumValidationWithSignedInteger.MinimumValidationWithSignedInteger1BoxedString](#minimumvalidationwithsignedinteger1boxedstring)
boxed class to store validated String payloads | -| static class | [MinimumValidationWithSignedInteger.MinimumValidationWithSignedInteger1BoxedList](#minimumvalidationwithsignedinteger1boxedlist)
boxed class to store validated List payloads | -| static class | [MinimumValidationWithSignedInteger.MinimumValidationWithSignedInteger1BoxedMap](#minimumvalidationwithsignedinteger1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [MinimumValidationWithSignedInteger.MinimumValidationWithSignedInteger1Boxed](#minimumvalidationwithsignedinteger1boxed)
sealed interface for validated payloads | +| record | [MinimumValidationWithSignedInteger.MinimumValidationWithSignedInteger1BoxedVoid](#minimumvalidationwithsignedinteger1boxedvoid)
boxed class to store validated null payloads | +| record | [MinimumValidationWithSignedInteger.MinimumValidationWithSignedInteger1BoxedBoolean](#minimumvalidationwithsignedinteger1boxedboolean)
boxed class to store validated boolean payloads | +| record | [MinimumValidationWithSignedInteger.MinimumValidationWithSignedInteger1BoxedNumber](#minimumvalidationwithsignedinteger1boxednumber)
boxed class to store validated Number payloads | +| record | [MinimumValidationWithSignedInteger.MinimumValidationWithSignedInteger1BoxedString](#minimumvalidationwithsignedinteger1boxedstring)
boxed class to store validated String payloads | +| record | [MinimumValidationWithSignedInteger.MinimumValidationWithSignedInteger1BoxedList](#minimumvalidationwithsignedinteger1boxedlist)
boxed class to store validated List payloads | +| record | [MinimumValidationWithSignedInteger.MinimumValidationWithSignedInteger1BoxedMap](#minimumvalidationwithsignedinteger1boxedmap)
boxed class to store validated Map payloads | | static class | [MinimumValidationWithSignedInteger.MinimumValidationWithSignedInteger1](#minimumvalidationwithsignedinteger1)
schema class | ## MinimumValidationWithSignedInteger1Boxed -public static abstract sealed class MinimumValidationWithSignedInteger1Boxed
+public sealed interface MinimumValidationWithSignedInteger1Boxed
permits
[MinimumValidationWithSignedInteger1BoxedVoid](#minimumvalidationwithsignedinteger1boxedvoid), [MinimumValidationWithSignedInteger1BoxedBoolean](#minimumvalidationwithsignedinteger1boxedboolean), @@ -29,103 +29,109 @@ permits
[MinimumValidationWithSignedInteger1BoxedList](#minimumvalidationwithsignedinteger1boxedlist), [MinimumValidationWithSignedInteger1BoxedMap](#minimumvalidationwithsignedinteger1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## MinimumValidationWithSignedInteger1BoxedVoid -public static final class MinimumValidationWithSignedInteger1BoxedVoid
-extends [MinimumValidationWithSignedInteger1Boxed](#minimumvalidationwithsignedinteger1boxed) +public record MinimumValidationWithSignedInteger1BoxedVoid
+implements [MinimumValidationWithSignedInteger1Boxed](#minimumvalidationwithsignedinteger1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MinimumValidationWithSignedInteger1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MinimumValidationWithSignedInteger1BoxedBoolean -public static final class MinimumValidationWithSignedInteger1BoxedBoolean
-extends [MinimumValidationWithSignedInteger1Boxed](#minimumvalidationwithsignedinteger1boxed) +public record MinimumValidationWithSignedInteger1BoxedBoolean
+implements [MinimumValidationWithSignedInteger1Boxed](#minimumvalidationwithsignedinteger1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MinimumValidationWithSignedInteger1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MinimumValidationWithSignedInteger1BoxedNumber -public static final class MinimumValidationWithSignedInteger1BoxedNumber
-extends [MinimumValidationWithSignedInteger1Boxed](#minimumvalidationwithsignedinteger1boxed) +public record MinimumValidationWithSignedInteger1BoxedNumber
+implements [MinimumValidationWithSignedInteger1Boxed](#minimumvalidationwithsignedinteger1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MinimumValidationWithSignedInteger1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MinimumValidationWithSignedInteger1BoxedString -public static final class MinimumValidationWithSignedInteger1BoxedString
-extends [MinimumValidationWithSignedInteger1Boxed](#minimumvalidationwithsignedinteger1boxed) +public record MinimumValidationWithSignedInteger1BoxedString
+implements [MinimumValidationWithSignedInteger1Boxed](#minimumvalidationwithsignedinteger1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MinimumValidationWithSignedInteger1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MinimumValidationWithSignedInteger1BoxedList -public static final class MinimumValidationWithSignedInteger1BoxedList
-extends [MinimumValidationWithSignedInteger1Boxed](#minimumvalidationwithsignedinteger1boxed) +public record MinimumValidationWithSignedInteger1BoxedList
+implements [MinimumValidationWithSignedInteger1Boxed](#minimumvalidationwithsignedinteger1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MinimumValidationWithSignedInteger1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MinimumValidationWithSignedInteger1BoxedMap -public static final class MinimumValidationWithSignedInteger1BoxedMap
-extends [MinimumValidationWithSignedInteger1Boxed](#minimumvalidationwithsignedinteger1boxed) +public record MinimumValidationWithSignedInteger1BoxedMap
+implements [MinimumValidationWithSignedInteger1Boxed](#minimumvalidationwithsignedinteger1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MinimumValidationWithSignedInteger1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MinimumValidationWithSignedInteger1 public static class MinimumValidationWithSignedInteger1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [MinimumValidationWithSignedInteger1BoxedBoolean](#minimumvalidationwithsignedinteger1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [MinimumValidationWithSignedInteger1BoxedMap](#minimumvalidationwithsignedinteger1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [MinimumValidationWithSignedInteger1BoxedList](#minimumvalidationwithsignedinteger1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [MinimumValidationWithSignedInteger1Boxed](#minimumvalidationwithsignedinteger1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/MinitemsValidation.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/MinitemsValidation.md index 64dda8d0ea0..0f8a46474b2 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/MinitemsValidation.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/MinitemsValidation.md @@ -4,23 +4,23 @@ public class MinitemsValidation
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [MinitemsValidation.MinitemsValidation1Boxed](#minitemsvalidation1boxed)
abstract sealed validated payload class | -| static class | [MinitemsValidation.MinitemsValidation1BoxedVoid](#minitemsvalidation1boxedvoid)
boxed class to store validated null payloads | -| static class | [MinitemsValidation.MinitemsValidation1BoxedBoolean](#minitemsvalidation1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [MinitemsValidation.MinitemsValidation1BoxedNumber](#minitemsvalidation1boxednumber)
boxed class to store validated Number payloads | -| static class | [MinitemsValidation.MinitemsValidation1BoxedString](#minitemsvalidation1boxedstring)
boxed class to store validated String payloads | -| static class | [MinitemsValidation.MinitemsValidation1BoxedList](#minitemsvalidation1boxedlist)
boxed class to store validated List payloads | -| static class | [MinitemsValidation.MinitemsValidation1BoxedMap](#minitemsvalidation1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [MinitemsValidation.MinitemsValidation1Boxed](#minitemsvalidation1boxed)
sealed interface for validated payloads | +| record | [MinitemsValidation.MinitemsValidation1BoxedVoid](#minitemsvalidation1boxedvoid)
boxed class to store validated null payloads | +| record | [MinitemsValidation.MinitemsValidation1BoxedBoolean](#minitemsvalidation1boxedboolean)
boxed class to store validated boolean payloads | +| record | [MinitemsValidation.MinitemsValidation1BoxedNumber](#minitemsvalidation1boxednumber)
boxed class to store validated Number payloads | +| record | [MinitemsValidation.MinitemsValidation1BoxedString](#minitemsvalidation1boxedstring)
boxed class to store validated String payloads | +| record | [MinitemsValidation.MinitemsValidation1BoxedList](#minitemsvalidation1boxedlist)
boxed class to store validated List payloads | +| record | [MinitemsValidation.MinitemsValidation1BoxedMap](#minitemsvalidation1boxedmap)
boxed class to store validated Map payloads | | static class | [MinitemsValidation.MinitemsValidation1](#minitemsvalidation1)
schema class | ## MinitemsValidation1Boxed -public static abstract sealed class MinitemsValidation1Boxed
+public sealed interface MinitemsValidation1Boxed
permits
[MinitemsValidation1BoxedVoid](#minitemsvalidation1boxedvoid), [MinitemsValidation1BoxedBoolean](#minitemsvalidation1boxedboolean), @@ -29,103 +29,109 @@ permits
[MinitemsValidation1BoxedList](#minitemsvalidation1boxedlist), [MinitemsValidation1BoxedMap](#minitemsvalidation1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## MinitemsValidation1BoxedVoid -public static final class MinitemsValidation1BoxedVoid
-extends [MinitemsValidation1Boxed](#minitemsvalidation1boxed) +public record MinitemsValidation1BoxedVoid
+implements [MinitemsValidation1Boxed](#minitemsvalidation1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MinitemsValidation1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MinitemsValidation1BoxedBoolean -public static final class MinitemsValidation1BoxedBoolean
-extends [MinitemsValidation1Boxed](#minitemsvalidation1boxed) +public record MinitemsValidation1BoxedBoolean
+implements [MinitemsValidation1Boxed](#minitemsvalidation1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MinitemsValidation1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MinitemsValidation1BoxedNumber -public static final class MinitemsValidation1BoxedNumber
-extends [MinitemsValidation1Boxed](#minitemsvalidation1boxed) +public record MinitemsValidation1BoxedNumber
+implements [MinitemsValidation1Boxed](#minitemsvalidation1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MinitemsValidation1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MinitemsValidation1BoxedString -public static final class MinitemsValidation1BoxedString
-extends [MinitemsValidation1Boxed](#minitemsvalidation1boxed) +public record MinitemsValidation1BoxedString
+implements [MinitemsValidation1Boxed](#minitemsvalidation1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MinitemsValidation1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MinitemsValidation1BoxedList -public static final class MinitemsValidation1BoxedList
-extends [MinitemsValidation1Boxed](#minitemsvalidation1boxed) +public record MinitemsValidation1BoxedList
+implements [MinitemsValidation1Boxed](#minitemsvalidation1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MinitemsValidation1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MinitemsValidation1BoxedMap -public static final class MinitemsValidation1BoxedMap
-extends [MinitemsValidation1Boxed](#minitemsvalidation1boxed) +public record MinitemsValidation1BoxedMap
+implements [MinitemsValidation1Boxed](#minitemsvalidation1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MinitemsValidation1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MinitemsValidation1 public static class MinitemsValidation1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [MinitemsValidation1BoxedBoolean](#minitemsvalidation1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [MinitemsValidation1BoxedMap](#minitemsvalidation1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [MinitemsValidation1BoxedList](#minitemsvalidation1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [MinitemsValidation1Boxed](#minitemsvalidation1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/MinlengthValidation.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/MinlengthValidation.md index 90c47d11e25..bf689a4ffa4 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/MinlengthValidation.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/MinlengthValidation.md @@ -4,23 +4,23 @@ public class MinlengthValidation
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [MinlengthValidation.MinlengthValidation1Boxed](#minlengthvalidation1boxed)
abstract sealed validated payload class | -| static class | [MinlengthValidation.MinlengthValidation1BoxedVoid](#minlengthvalidation1boxedvoid)
boxed class to store validated null payloads | -| static class | [MinlengthValidation.MinlengthValidation1BoxedBoolean](#minlengthvalidation1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [MinlengthValidation.MinlengthValidation1BoxedNumber](#minlengthvalidation1boxednumber)
boxed class to store validated Number payloads | -| static class | [MinlengthValidation.MinlengthValidation1BoxedString](#minlengthvalidation1boxedstring)
boxed class to store validated String payloads | -| static class | [MinlengthValidation.MinlengthValidation1BoxedList](#minlengthvalidation1boxedlist)
boxed class to store validated List payloads | -| static class | [MinlengthValidation.MinlengthValidation1BoxedMap](#minlengthvalidation1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [MinlengthValidation.MinlengthValidation1Boxed](#minlengthvalidation1boxed)
sealed interface for validated payloads | +| record | [MinlengthValidation.MinlengthValidation1BoxedVoid](#minlengthvalidation1boxedvoid)
boxed class to store validated null payloads | +| record | [MinlengthValidation.MinlengthValidation1BoxedBoolean](#minlengthvalidation1boxedboolean)
boxed class to store validated boolean payloads | +| record | [MinlengthValidation.MinlengthValidation1BoxedNumber](#minlengthvalidation1boxednumber)
boxed class to store validated Number payloads | +| record | [MinlengthValidation.MinlengthValidation1BoxedString](#minlengthvalidation1boxedstring)
boxed class to store validated String payloads | +| record | [MinlengthValidation.MinlengthValidation1BoxedList](#minlengthvalidation1boxedlist)
boxed class to store validated List payloads | +| record | [MinlengthValidation.MinlengthValidation1BoxedMap](#minlengthvalidation1boxedmap)
boxed class to store validated Map payloads | | static class | [MinlengthValidation.MinlengthValidation1](#minlengthvalidation1)
schema class | ## MinlengthValidation1Boxed -public static abstract sealed class MinlengthValidation1Boxed
+public sealed interface MinlengthValidation1Boxed
permits
[MinlengthValidation1BoxedVoid](#minlengthvalidation1boxedvoid), [MinlengthValidation1BoxedBoolean](#minlengthvalidation1boxedboolean), @@ -29,103 +29,109 @@ permits
[MinlengthValidation1BoxedList](#minlengthvalidation1boxedlist), [MinlengthValidation1BoxedMap](#minlengthvalidation1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## MinlengthValidation1BoxedVoid -public static final class MinlengthValidation1BoxedVoid
-extends [MinlengthValidation1Boxed](#minlengthvalidation1boxed) +public record MinlengthValidation1BoxedVoid
+implements [MinlengthValidation1Boxed](#minlengthvalidation1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MinlengthValidation1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MinlengthValidation1BoxedBoolean -public static final class MinlengthValidation1BoxedBoolean
-extends [MinlengthValidation1Boxed](#minlengthvalidation1boxed) +public record MinlengthValidation1BoxedBoolean
+implements [MinlengthValidation1Boxed](#minlengthvalidation1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MinlengthValidation1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MinlengthValidation1BoxedNumber -public static final class MinlengthValidation1BoxedNumber
-extends [MinlengthValidation1Boxed](#minlengthvalidation1boxed) +public record MinlengthValidation1BoxedNumber
+implements [MinlengthValidation1Boxed](#minlengthvalidation1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MinlengthValidation1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MinlengthValidation1BoxedString -public static final class MinlengthValidation1BoxedString
-extends [MinlengthValidation1Boxed](#minlengthvalidation1boxed) +public record MinlengthValidation1BoxedString
+implements [MinlengthValidation1Boxed](#minlengthvalidation1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MinlengthValidation1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MinlengthValidation1BoxedList -public static final class MinlengthValidation1BoxedList
-extends [MinlengthValidation1Boxed](#minlengthvalidation1boxed) +public record MinlengthValidation1BoxedList
+implements [MinlengthValidation1Boxed](#minlengthvalidation1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MinlengthValidation1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MinlengthValidation1BoxedMap -public static final class MinlengthValidation1BoxedMap
-extends [MinlengthValidation1Boxed](#minlengthvalidation1boxed) +public record MinlengthValidation1BoxedMap
+implements [MinlengthValidation1Boxed](#minlengthvalidation1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MinlengthValidation1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MinlengthValidation1 public static class MinlengthValidation1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [MinlengthValidation1BoxedBoolean](#minlengthvalidation1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [MinlengthValidation1BoxedMap](#minlengthvalidation1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [MinlengthValidation1BoxedList](#minlengthvalidation1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [MinlengthValidation1Boxed](#minlengthvalidation1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/MinpropertiesValidation.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/MinpropertiesValidation.md index a93e08d7d8f..43f7370e423 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/MinpropertiesValidation.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/MinpropertiesValidation.md @@ -4,23 +4,23 @@ public class MinpropertiesValidation
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [MinpropertiesValidation.MinpropertiesValidation1Boxed](#minpropertiesvalidation1boxed)
abstract sealed validated payload class | -| static class | [MinpropertiesValidation.MinpropertiesValidation1BoxedVoid](#minpropertiesvalidation1boxedvoid)
boxed class to store validated null payloads | -| static class | [MinpropertiesValidation.MinpropertiesValidation1BoxedBoolean](#minpropertiesvalidation1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [MinpropertiesValidation.MinpropertiesValidation1BoxedNumber](#minpropertiesvalidation1boxednumber)
boxed class to store validated Number payloads | -| static class | [MinpropertiesValidation.MinpropertiesValidation1BoxedString](#minpropertiesvalidation1boxedstring)
boxed class to store validated String payloads | -| static class | [MinpropertiesValidation.MinpropertiesValidation1BoxedList](#minpropertiesvalidation1boxedlist)
boxed class to store validated List payloads | -| static class | [MinpropertiesValidation.MinpropertiesValidation1BoxedMap](#minpropertiesvalidation1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [MinpropertiesValidation.MinpropertiesValidation1Boxed](#minpropertiesvalidation1boxed)
sealed interface for validated payloads | +| record | [MinpropertiesValidation.MinpropertiesValidation1BoxedVoid](#minpropertiesvalidation1boxedvoid)
boxed class to store validated null payloads | +| record | [MinpropertiesValidation.MinpropertiesValidation1BoxedBoolean](#minpropertiesvalidation1boxedboolean)
boxed class to store validated boolean payloads | +| record | [MinpropertiesValidation.MinpropertiesValidation1BoxedNumber](#minpropertiesvalidation1boxednumber)
boxed class to store validated Number payloads | +| record | [MinpropertiesValidation.MinpropertiesValidation1BoxedString](#minpropertiesvalidation1boxedstring)
boxed class to store validated String payloads | +| record | [MinpropertiesValidation.MinpropertiesValidation1BoxedList](#minpropertiesvalidation1boxedlist)
boxed class to store validated List payloads | +| record | [MinpropertiesValidation.MinpropertiesValidation1BoxedMap](#minpropertiesvalidation1boxedmap)
boxed class to store validated Map payloads | | static class | [MinpropertiesValidation.MinpropertiesValidation1](#minpropertiesvalidation1)
schema class | ## MinpropertiesValidation1Boxed -public static abstract sealed class MinpropertiesValidation1Boxed
+public sealed interface MinpropertiesValidation1Boxed
permits
[MinpropertiesValidation1BoxedVoid](#minpropertiesvalidation1boxedvoid), [MinpropertiesValidation1BoxedBoolean](#minpropertiesvalidation1boxedboolean), @@ -29,103 +29,109 @@ permits
[MinpropertiesValidation1BoxedList](#minpropertiesvalidation1boxedlist), [MinpropertiesValidation1BoxedMap](#minpropertiesvalidation1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## MinpropertiesValidation1BoxedVoid -public static final class MinpropertiesValidation1BoxedVoid
-extends [MinpropertiesValidation1Boxed](#minpropertiesvalidation1boxed) +public record MinpropertiesValidation1BoxedVoid
+implements [MinpropertiesValidation1Boxed](#minpropertiesvalidation1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MinpropertiesValidation1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MinpropertiesValidation1BoxedBoolean -public static final class MinpropertiesValidation1BoxedBoolean
-extends [MinpropertiesValidation1Boxed](#minpropertiesvalidation1boxed) +public record MinpropertiesValidation1BoxedBoolean
+implements [MinpropertiesValidation1Boxed](#minpropertiesvalidation1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MinpropertiesValidation1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MinpropertiesValidation1BoxedNumber -public static final class MinpropertiesValidation1BoxedNumber
-extends [MinpropertiesValidation1Boxed](#minpropertiesvalidation1boxed) +public record MinpropertiesValidation1BoxedNumber
+implements [MinpropertiesValidation1Boxed](#minpropertiesvalidation1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MinpropertiesValidation1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MinpropertiesValidation1BoxedString -public static final class MinpropertiesValidation1BoxedString
-extends [MinpropertiesValidation1Boxed](#minpropertiesvalidation1boxed) +public record MinpropertiesValidation1BoxedString
+implements [MinpropertiesValidation1Boxed](#minpropertiesvalidation1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MinpropertiesValidation1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MinpropertiesValidation1BoxedList -public static final class MinpropertiesValidation1BoxedList
-extends [MinpropertiesValidation1Boxed](#minpropertiesvalidation1boxed) +public record MinpropertiesValidation1BoxedList
+implements [MinpropertiesValidation1Boxed](#minpropertiesvalidation1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MinpropertiesValidation1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MinpropertiesValidation1BoxedMap -public static final class MinpropertiesValidation1BoxedMap
-extends [MinpropertiesValidation1Boxed](#minpropertiesvalidation1boxed) +public record MinpropertiesValidation1BoxedMap
+implements [MinpropertiesValidation1Boxed](#minpropertiesvalidation1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MinpropertiesValidation1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MinpropertiesValidation1 public static class MinpropertiesValidation1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [MinpropertiesValidation1BoxedBoolean](#minpropertiesvalidation1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [MinpropertiesValidation1BoxedMap](#minpropertiesvalidation1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [MinpropertiesValidation1BoxedList](#minpropertiesvalidation1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [MinpropertiesValidation1Boxed](#minpropertiesvalidation1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/NestedAllofToCheckValidationSemantics.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/NestedAllofToCheckValidationSemantics.md index d02f03d3c8b..ebf65ca84c7 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/NestedAllofToCheckValidationSemantics.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/NestedAllofToCheckValidationSemantics.md @@ -4,34 +4,34 @@ public class NestedAllofToCheckValidationSemantics
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [NestedAllofToCheckValidationSemantics.NestedAllofToCheckValidationSemantics1Boxed](#nestedalloftocheckvalidationsemantics1boxed)
abstract sealed validated payload class | -| static class | [NestedAllofToCheckValidationSemantics.NestedAllofToCheckValidationSemantics1BoxedVoid](#nestedalloftocheckvalidationsemantics1boxedvoid)
boxed class to store validated null payloads | -| static class | [NestedAllofToCheckValidationSemantics.NestedAllofToCheckValidationSemantics1BoxedBoolean](#nestedalloftocheckvalidationsemantics1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [NestedAllofToCheckValidationSemantics.NestedAllofToCheckValidationSemantics1BoxedNumber](#nestedalloftocheckvalidationsemantics1boxednumber)
boxed class to store validated Number payloads | -| static class | [NestedAllofToCheckValidationSemantics.NestedAllofToCheckValidationSemantics1BoxedString](#nestedalloftocheckvalidationsemantics1boxedstring)
boxed class to store validated String payloads | -| static class | [NestedAllofToCheckValidationSemantics.NestedAllofToCheckValidationSemantics1BoxedList](#nestedalloftocheckvalidationsemantics1boxedlist)
boxed class to store validated List payloads | -| static class | [NestedAllofToCheckValidationSemantics.NestedAllofToCheckValidationSemantics1BoxedMap](#nestedalloftocheckvalidationsemantics1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [NestedAllofToCheckValidationSemantics.NestedAllofToCheckValidationSemantics1Boxed](#nestedalloftocheckvalidationsemantics1boxed)
sealed interface for validated payloads | +| record | [NestedAllofToCheckValidationSemantics.NestedAllofToCheckValidationSemantics1BoxedVoid](#nestedalloftocheckvalidationsemantics1boxedvoid)
boxed class to store validated null payloads | +| record | [NestedAllofToCheckValidationSemantics.NestedAllofToCheckValidationSemantics1BoxedBoolean](#nestedalloftocheckvalidationsemantics1boxedboolean)
boxed class to store validated boolean payloads | +| record | [NestedAllofToCheckValidationSemantics.NestedAllofToCheckValidationSemantics1BoxedNumber](#nestedalloftocheckvalidationsemantics1boxednumber)
boxed class to store validated Number payloads | +| record | [NestedAllofToCheckValidationSemantics.NestedAllofToCheckValidationSemantics1BoxedString](#nestedalloftocheckvalidationsemantics1boxedstring)
boxed class to store validated String payloads | +| record | [NestedAllofToCheckValidationSemantics.NestedAllofToCheckValidationSemantics1BoxedList](#nestedalloftocheckvalidationsemantics1boxedlist)
boxed class to store validated List payloads | +| record | [NestedAllofToCheckValidationSemantics.NestedAllofToCheckValidationSemantics1BoxedMap](#nestedalloftocheckvalidationsemantics1boxedmap)
boxed class to store validated Map payloads | | static class | [NestedAllofToCheckValidationSemantics.NestedAllofToCheckValidationSemantics1](#nestedalloftocheckvalidationsemantics1)
schema class | -| static class | [NestedAllofToCheckValidationSemantics.Schema0Boxed](#schema0boxed)
abstract sealed validated payload class | -| static class | [NestedAllofToCheckValidationSemantics.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | -| static class | [NestedAllofToCheckValidationSemantics.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | -| static class | [NestedAllofToCheckValidationSemantics.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | -| static class | [NestedAllofToCheckValidationSemantics.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | -| static class | [NestedAllofToCheckValidationSemantics.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | -| static class | [NestedAllofToCheckValidationSemantics.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [NestedAllofToCheckValidationSemantics.Schema0Boxed](#schema0boxed)
sealed interface for validated payloads | +| record | [NestedAllofToCheckValidationSemantics.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | +| record | [NestedAllofToCheckValidationSemantics.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | +| record | [NestedAllofToCheckValidationSemantics.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | +| record | [NestedAllofToCheckValidationSemantics.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | +| record | [NestedAllofToCheckValidationSemantics.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | +| record | [NestedAllofToCheckValidationSemantics.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | | static class | [NestedAllofToCheckValidationSemantics.Schema0](#schema0)
schema class | -| static class | [NestedAllofToCheckValidationSemantics.Schema01Boxed](#schema01boxed)
abstract sealed validated payload class | -| static class | [NestedAllofToCheckValidationSemantics.Schema01BoxedVoid](#schema01boxedvoid)
boxed class to store validated null payloads | +| sealed interface | [NestedAllofToCheckValidationSemantics.Schema01Boxed](#schema01boxed)
sealed interface for validated payloads | +| record | [NestedAllofToCheckValidationSemantics.Schema01BoxedVoid](#schema01boxedvoid)
boxed class to store validated null payloads | | static class | [NestedAllofToCheckValidationSemantics.Schema01](#schema01)
schema class | ## NestedAllofToCheckValidationSemantics1Boxed -public static abstract sealed class NestedAllofToCheckValidationSemantics1Boxed
+public sealed interface NestedAllofToCheckValidationSemantics1Boxed
permits
[NestedAllofToCheckValidationSemantics1BoxedVoid](#nestedalloftocheckvalidationsemantics1boxedvoid), [NestedAllofToCheckValidationSemantics1BoxedBoolean](#nestedalloftocheckvalidationsemantics1boxedboolean), @@ -40,103 +40,109 @@ permits
[NestedAllofToCheckValidationSemantics1BoxedList](#nestedalloftocheckvalidationsemantics1boxedlist), [NestedAllofToCheckValidationSemantics1BoxedMap](#nestedalloftocheckvalidationsemantics1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## NestedAllofToCheckValidationSemantics1BoxedVoid -public static final class NestedAllofToCheckValidationSemantics1BoxedVoid
-extends [NestedAllofToCheckValidationSemantics1Boxed](#nestedalloftocheckvalidationsemantics1boxed) +public record NestedAllofToCheckValidationSemantics1BoxedVoid
+implements [NestedAllofToCheckValidationSemantics1Boxed](#nestedalloftocheckvalidationsemantics1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NestedAllofToCheckValidationSemantics1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NestedAllofToCheckValidationSemantics1BoxedBoolean -public static final class NestedAllofToCheckValidationSemantics1BoxedBoolean
-extends [NestedAllofToCheckValidationSemantics1Boxed](#nestedalloftocheckvalidationsemantics1boxed) +public record NestedAllofToCheckValidationSemantics1BoxedBoolean
+implements [NestedAllofToCheckValidationSemantics1Boxed](#nestedalloftocheckvalidationsemantics1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NestedAllofToCheckValidationSemantics1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NestedAllofToCheckValidationSemantics1BoxedNumber -public static final class NestedAllofToCheckValidationSemantics1BoxedNumber
-extends [NestedAllofToCheckValidationSemantics1Boxed](#nestedalloftocheckvalidationsemantics1boxed) +public record NestedAllofToCheckValidationSemantics1BoxedNumber
+implements [NestedAllofToCheckValidationSemantics1Boxed](#nestedalloftocheckvalidationsemantics1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NestedAllofToCheckValidationSemantics1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NestedAllofToCheckValidationSemantics1BoxedString -public static final class NestedAllofToCheckValidationSemantics1BoxedString
-extends [NestedAllofToCheckValidationSemantics1Boxed](#nestedalloftocheckvalidationsemantics1boxed) +public record NestedAllofToCheckValidationSemantics1BoxedString
+implements [NestedAllofToCheckValidationSemantics1Boxed](#nestedalloftocheckvalidationsemantics1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NestedAllofToCheckValidationSemantics1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NestedAllofToCheckValidationSemantics1BoxedList -public static final class NestedAllofToCheckValidationSemantics1BoxedList
-extends [NestedAllofToCheckValidationSemantics1Boxed](#nestedalloftocheckvalidationsemantics1boxed) +public record NestedAllofToCheckValidationSemantics1BoxedList
+implements [NestedAllofToCheckValidationSemantics1Boxed](#nestedalloftocheckvalidationsemantics1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NestedAllofToCheckValidationSemantics1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NestedAllofToCheckValidationSemantics1BoxedMap -public static final class NestedAllofToCheckValidationSemantics1BoxedMap
-extends [NestedAllofToCheckValidationSemantics1Boxed](#nestedalloftocheckvalidationsemantics1boxed) +public record NestedAllofToCheckValidationSemantics1BoxedMap
+implements [NestedAllofToCheckValidationSemantics1Boxed](#nestedalloftocheckvalidationsemantics1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NestedAllofToCheckValidationSemantics1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NestedAllofToCheckValidationSemantics1 public static class NestedAllofToCheckValidationSemantics1
@@ -168,9 +174,11 @@ A schema class that validates payloads | [NestedAllofToCheckValidationSemantics1BoxedBoolean](#nestedalloftocheckvalidationsemantics1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [NestedAllofToCheckValidationSemantics1BoxedMap](#nestedalloftocheckvalidationsemantics1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [NestedAllofToCheckValidationSemantics1BoxedList](#nestedalloftocheckvalidationsemantics1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [NestedAllofToCheckValidationSemantics1Boxed](#nestedalloftocheckvalidationsemantics1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema0Boxed -public static abstract sealed class Schema0Boxed
+public sealed interface Schema0Boxed
permits
[Schema0BoxedVoid](#schema0boxedvoid), [Schema0BoxedBoolean](#schema0boxedboolean), @@ -179,103 +187,109 @@ permits
[Schema0BoxedList](#schema0boxedlist), [Schema0BoxedMap](#schema0boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema0BoxedVoid -public static final class Schema0BoxedVoid
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedVoid
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedBoolean -public static final class Schema0BoxedBoolean
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedBoolean
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedNumber -public static final class Schema0BoxedNumber
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedNumber
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedString -public static final class Schema0BoxedString
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedString
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedList -public static final class Schema0BoxedList
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedList
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedMap -public static final class Schema0BoxedMap
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedMap
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0 public static class Schema0
@@ -307,29 +321,32 @@ A schema class that validates payloads | [Schema0BoxedBoolean](#schema0boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Schema0BoxedMap](#schema0boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [Schema0BoxedList](#schema0boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Schema0Boxed](#schema0boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema01Boxed -public static abstract sealed class Schema01Boxed
+public sealed interface Schema01Boxed
permits
[Schema01BoxedVoid](#schema01boxedvoid) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema01BoxedVoid -public static final class Schema01BoxedVoid
-extends [Schema01Boxed](#schema01boxed) +public record Schema01BoxedVoid
+implements [Schema01Boxed](#schema01boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema01BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema01 public static class Schema01
diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/NestedAnyofToCheckValidationSemantics.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/NestedAnyofToCheckValidationSemantics.md index 61a43526623..dc2de71feb0 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/NestedAnyofToCheckValidationSemantics.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/NestedAnyofToCheckValidationSemantics.md @@ -4,34 +4,34 @@ public class NestedAnyofToCheckValidationSemantics
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [NestedAnyofToCheckValidationSemantics.NestedAnyofToCheckValidationSemantics1Boxed](#nestedanyoftocheckvalidationsemantics1boxed)
abstract sealed validated payload class | -| static class | [NestedAnyofToCheckValidationSemantics.NestedAnyofToCheckValidationSemantics1BoxedVoid](#nestedanyoftocheckvalidationsemantics1boxedvoid)
boxed class to store validated null payloads | -| static class | [NestedAnyofToCheckValidationSemantics.NestedAnyofToCheckValidationSemantics1BoxedBoolean](#nestedanyoftocheckvalidationsemantics1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [NestedAnyofToCheckValidationSemantics.NestedAnyofToCheckValidationSemantics1BoxedNumber](#nestedanyoftocheckvalidationsemantics1boxednumber)
boxed class to store validated Number payloads | -| static class | [NestedAnyofToCheckValidationSemantics.NestedAnyofToCheckValidationSemantics1BoxedString](#nestedanyoftocheckvalidationsemantics1boxedstring)
boxed class to store validated String payloads | -| static class | [NestedAnyofToCheckValidationSemantics.NestedAnyofToCheckValidationSemantics1BoxedList](#nestedanyoftocheckvalidationsemantics1boxedlist)
boxed class to store validated List payloads | -| static class | [NestedAnyofToCheckValidationSemantics.NestedAnyofToCheckValidationSemantics1BoxedMap](#nestedanyoftocheckvalidationsemantics1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [NestedAnyofToCheckValidationSemantics.NestedAnyofToCheckValidationSemantics1Boxed](#nestedanyoftocheckvalidationsemantics1boxed)
sealed interface for validated payloads | +| record | [NestedAnyofToCheckValidationSemantics.NestedAnyofToCheckValidationSemantics1BoxedVoid](#nestedanyoftocheckvalidationsemantics1boxedvoid)
boxed class to store validated null payloads | +| record | [NestedAnyofToCheckValidationSemantics.NestedAnyofToCheckValidationSemantics1BoxedBoolean](#nestedanyoftocheckvalidationsemantics1boxedboolean)
boxed class to store validated boolean payloads | +| record | [NestedAnyofToCheckValidationSemantics.NestedAnyofToCheckValidationSemantics1BoxedNumber](#nestedanyoftocheckvalidationsemantics1boxednumber)
boxed class to store validated Number payloads | +| record | [NestedAnyofToCheckValidationSemantics.NestedAnyofToCheckValidationSemantics1BoxedString](#nestedanyoftocheckvalidationsemantics1boxedstring)
boxed class to store validated String payloads | +| record | [NestedAnyofToCheckValidationSemantics.NestedAnyofToCheckValidationSemantics1BoxedList](#nestedanyoftocheckvalidationsemantics1boxedlist)
boxed class to store validated List payloads | +| record | [NestedAnyofToCheckValidationSemantics.NestedAnyofToCheckValidationSemantics1BoxedMap](#nestedanyoftocheckvalidationsemantics1boxedmap)
boxed class to store validated Map payloads | | static class | [NestedAnyofToCheckValidationSemantics.NestedAnyofToCheckValidationSemantics1](#nestedanyoftocheckvalidationsemantics1)
schema class | -| static class | [NestedAnyofToCheckValidationSemantics.Schema0Boxed](#schema0boxed)
abstract sealed validated payload class | -| static class | [NestedAnyofToCheckValidationSemantics.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | -| static class | [NestedAnyofToCheckValidationSemantics.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | -| static class | [NestedAnyofToCheckValidationSemantics.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | -| static class | [NestedAnyofToCheckValidationSemantics.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | -| static class | [NestedAnyofToCheckValidationSemantics.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | -| static class | [NestedAnyofToCheckValidationSemantics.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [NestedAnyofToCheckValidationSemantics.Schema0Boxed](#schema0boxed)
sealed interface for validated payloads | +| record | [NestedAnyofToCheckValidationSemantics.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | +| record | [NestedAnyofToCheckValidationSemantics.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | +| record | [NestedAnyofToCheckValidationSemantics.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | +| record | [NestedAnyofToCheckValidationSemantics.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | +| record | [NestedAnyofToCheckValidationSemantics.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | +| record | [NestedAnyofToCheckValidationSemantics.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | | static class | [NestedAnyofToCheckValidationSemantics.Schema0](#schema0)
schema class | -| static class | [NestedAnyofToCheckValidationSemantics.Schema01Boxed](#schema01boxed)
abstract sealed validated payload class | -| static class | [NestedAnyofToCheckValidationSemantics.Schema01BoxedVoid](#schema01boxedvoid)
boxed class to store validated null payloads | +| sealed interface | [NestedAnyofToCheckValidationSemantics.Schema01Boxed](#schema01boxed)
sealed interface for validated payloads | +| record | [NestedAnyofToCheckValidationSemantics.Schema01BoxedVoid](#schema01boxedvoid)
boxed class to store validated null payloads | | static class | [NestedAnyofToCheckValidationSemantics.Schema01](#schema01)
schema class | ## NestedAnyofToCheckValidationSemantics1Boxed -public static abstract sealed class NestedAnyofToCheckValidationSemantics1Boxed
+public sealed interface NestedAnyofToCheckValidationSemantics1Boxed
permits
[NestedAnyofToCheckValidationSemantics1BoxedVoid](#nestedanyoftocheckvalidationsemantics1boxedvoid), [NestedAnyofToCheckValidationSemantics1BoxedBoolean](#nestedanyoftocheckvalidationsemantics1boxedboolean), @@ -40,103 +40,109 @@ permits
[NestedAnyofToCheckValidationSemantics1BoxedList](#nestedanyoftocheckvalidationsemantics1boxedlist), [NestedAnyofToCheckValidationSemantics1BoxedMap](#nestedanyoftocheckvalidationsemantics1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## NestedAnyofToCheckValidationSemantics1BoxedVoid -public static final class NestedAnyofToCheckValidationSemantics1BoxedVoid
-extends [NestedAnyofToCheckValidationSemantics1Boxed](#nestedanyoftocheckvalidationsemantics1boxed) +public record NestedAnyofToCheckValidationSemantics1BoxedVoid
+implements [NestedAnyofToCheckValidationSemantics1Boxed](#nestedanyoftocheckvalidationsemantics1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NestedAnyofToCheckValidationSemantics1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NestedAnyofToCheckValidationSemantics1BoxedBoolean -public static final class NestedAnyofToCheckValidationSemantics1BoxedBoolean
-extends [NestedAnyofToCheckValidationSemantics1Boxed](#nestedanyoftocheckvalidationsemantics1boxed) +public record NestedAnyofToCheckValidationSemantics1BoxedBoolean
+implements [NestedAnyofToCheckValidationSemantics1Boxed](#nestedanyoftocheckvalidationsemantics1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NestedAnyofToCheckValidationSemantics1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NestedAnyofToCheckValidationSemantics1BoxedNumber -public static final class NestedAnyofToCheckValidationSemantics1BoxedNumber
-extends [NestedAnyofToCheckValidationSemantics1Boxed](#nestedanyoftocheckvalidationsemantics1boxed) +public record NestedAnyofToCheckValidationSemantics1BoxedNumber
+implements [NestedAnyofToCheckValidationSemantics1Boxed](#nestedanyoftocheckvalidationsemantics1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NestedAnyofToCheckValidationSemantics1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NestedAnyofToCheckValidationSemantics1BoxedString -public static final class NestedAnyofToCheckValidationSemantics1BoxedString
-extends [NestedAnyofToCheckValidationSemantics1Boxed](#nestedanyoftocheckvalidationsemantics1boxed) +public record NestedAnyofToCheckValidationSemantics1BoxedString
+implements [NestedAnyofToCheckValidationSemantics1Boxed](#nestedanyoftocheckvalidationsemantics1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NestedAnyofToCheckValidationSemantics1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NestedAnyofToCheckValidationSemantics1BoxedList -public static final class NestedAnyofToCheckValidationSemantics1BoxedList
-extends [NestedAnyofToCheckValidationSemantics1Boxed](#nestedanyoftocheckvalidationsemantics1boxed) +public record NestedAnyofToCheckValidationSemantics1BoxedList
+implements [NestedAnyofToCheckValidationSemantics1Boxed](#nestedanyoftocheckvalidationsemantics1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NestedAnyofToCheckValidationSemantics1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NestedAnyofToCheckValidationSemantics1BoxedMap -public static final class NestedAnyofToCheckValidationSemantics1BoxedMap
-extends [NestedAnyofToCheckValidationSemantics1Boxed](#nestedanyoftocheckvalidationsemantics1boxed) +public record NestedAnyofToCheckValidationSemantics1BoxedMap
+implements [NestedAnyofToCheckValidationSemantics1Boxed](#nestedanyoftocheckvalidationsemantics1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NestedAnyofToCheckValidationSemantics1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NestedAnyofToCheckValidationSemantics1 public static class NestedAnyofToCheckValidationSemantics1
@@ -168,9 +174,11 @@ A schema class that validates payloads | [NestedAnyofToCheckValidationSemantics1BoxedBoolean](#nestedanyoftocheckvalidationsemantics1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [NestedAnyofToCheckValidationSemantics1BoxedMap](#nestedanyoftocheckvalidationsemantics1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [NestedAnyofToCheckValidationSemantics1BoxedList](#nestedanyoftocheckvalidationsemantics1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [NestedAnyofToCheckValidationSemantics1Boxed](#nestedanyoftocheckvalidationsemantics1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema0Boxed -public static abstract sealed class Schema0Boxed
+public sealed interface Schema0Boxed
permits
[Schema0BoxedVoid](#schema0boxedvoid), [Schema0BoxedBoolean](#schema0boxedboolean), @@ -179,103 +187,109 @@ permits
[Schema0BoxedList](#schema0boxedlist), [Schema0BoxedMap](#schema0boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema0BoxedVoid -public static final class Schema0BoxedVoid
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedVoid
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedBoolean -public static final class Schema0BoxedBoolean
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedBoolean
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedNumber -public static final class Schema0BoxedNumber
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedNumber
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedString -public static final class Schema0BoxedString
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedString
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedList -public static final class Schema0BoxedList
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedList
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedMap -public static final class Schema0BoxedMap
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedMap
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0 public static class Schema0
@@ -307,29 +321,32 @@ A schema class that validates payloads | [Schema0BoxedBoolean](#schema0boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Schema0BoxedMap](#schema0boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [Schema0BoxedList](#schema0boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Schema0Boxed](#schema0boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema01Boxed -public static abstract sealed class Schema01Boxed
+public sealed interface Schema01Boxed
permits
[Schema01BoxedVoid](#schema01boxedvoid) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema01BoxedVoid -public static final class Schema01BoxedVoid
-extends [Schema01Boxed](#schema01boxed) +public record Schema01BoxedVoid
+implements [Schema01Boxed](#schema01boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema01BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema01 public static class Schema01
diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/NestedItems.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/NestedItems.md index 36a26e8d039..7f7efb8dd5f 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/NestedItems.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/NestedItems.md @@ -4,7 +4,7 @@ public class NestedItems
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated list payloads, extends FrozenList - classes to build inputs for list payloads @@ -12,52 +12,53 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [NestedItems.NestedItems1Boxed](#nesteditems1boxed)
abstract sealed validated payload class | -| static class | [NestedItems.NestedItems1BoxedList](#nesteditems1boxedlist)
boxed class to store validated List payloads | +| sealed interface | [NestedItems.NestedItems1Boxed](#nesteditems1boxed)
sealed interface for validated payloads | +| record | [NestedItems.NestedItems1BoxedList](#nesteditems1boxedlist)
boxed class to store validated List payloads | | static class | [NestedItems.NestedItems1](#nesteditems1)
schema class | | static class | [NestedItems.NestedItemsListBuilder](#nesteditemslistbuilder)
builder for List payloads | | static class | [NestedItems.NestedItemsList](#nesteditemslist)
output class for List payloads | -| static class | [NestedItems.ItemsBoxed](#itemsboxed)
abstract sealed validated payload class | -| static class | [NestedItems.ItemsBoxedList](#itemsboxedlist)
boxed class to store validated List payloads | +| sealed interface | [NestedItems.ItemsBoxed](#itemsboxed)
sealed interface for validated payloads | +| record | [NestedItems.ItemsBoxedList](#itemsboxedlist)
boxed class to store validated List payloads | | static class | [NestedItems.Items](#items)
schema class | | static class | [NestedItems.ItemsListBuilder2](#itemslistbuilder2)
builder for List payloads | | static class | [NestedItems.ItemsList2](#itemslist2)
output class for List payloads | -| static class | [NestedItems.Items1Boxed](#items1boxed)
abstract sealed validated payload class | -| static class | [NestedItems.Items1BoxedList](#items1boxedlist)
boxed class to store validated List payloads | +| sealed interface | [NestedItems.Items1Boxed](#items1boxed)
sealed interface for validated payloads | +| record | [NestedItems.Items1BoxedList](#items1boxedlist)
boxed class to store validated List payloads | | static class | [NestedItems.Items1](#items1)
schema class | | static class | [NestedItems.ItemsListBuilder1](#itemslistbuilder1)
builder for List payloads | | static class | [NestedItems.ItemsList1](#itemslist1)
output class for List payloads | -| static class | [NestedItems.Items2Boxed](#items2boxed)
abstract sealed validated payload class | -| static class | [NestedItems.Items2BoxedList](#items2boxedlist)
boxed class to store validated List payloads | +| sealed interface | [NestedItems.Items2Boxed](#items2boxed)
sealed interface for validated payloads | +| record | [NestedItems.Items2BoxedList](#items2boxedlist)
boxed class to store validated List payloads | | static class | [NestedItems.Items2](#items2)
schema class | | static class | [NestedItems.ItemsListBuilder](#itemslistbuilder)
builder for List payloads | | static class | [NestedItems.ItemsList](#itemslist)
output class for List payloads | -| static class | [NestedItems.Items3Boxed](#items3boxed)
abstract sealed validated payload class | -| static class | [NestedItems.Items3BoxedNumber](#items3boxednumber)
boxed class to store validated Number payloads | +| sealed interface | [NestedItems.Items3Boxed](#items3boxed)
sealed interface for validated payloads | +| record | [NestedItems.Items3BoxedNumber](#items3boxednumber)
boxed class to store validated Number payloads | | static class | [NestedItems.Items3](#items3)
schema class | ## NestedItems1Boxed -public static abstract sealed class NestedItems1Boxed
+public sealed interface NestedItems1Boxed
permits
[NestedItems1BoxedList](#nesteditems1boxedlist) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## NestedItems1BoxedList -public static final class NestedItems1BoxedList
-extends [NestedItems1Boxed](#nesteditems1boxed) +public record NestedItems1BoxedList
+implements [NestedItems1Boxed](#nesteditems1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NestedItems1BoxedList([NestedItemsList](#nesteditemslist) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [NestedItemsList](#nesteditemslist) | data
validated payload | +| [NestedItemsList](#nesteditemslist) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NestedItems1 public static class NestedItems1
@@ -109,7 +110,9 @@ NestedItems.NestedItemsList validatedPayload = | ----------------- | ---------------------- | | [NestedItemsList](#nesteditemslist) | validate([List](#nesteditemslistbuilder) arg, SchemaConfiguration configuration) | | [NestedItems1BoxedList](#nesteditems1boxedlist) | validateAndBox([List](#nesteditemslistbuilder) arg, SchemaConfiguration configuration) | +| [NestedItems1Boxed](#nesteditems1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## NestedItemsListBuilder public class NestedItemsListBuilder
builder for `List>>>` @@ -140,27 +143,28 @@ A class to store validated List payloads | static [NestedItemsList](#nesteditemslist) | of([List>>>](#nesteditemslistbuilder) arg, SchemaConfiguration configuration) | ## ItemsBoxed -public static abstract sealed class ItemsBoxed
+public sealed interface ItemsBoxed
permits
[ItemsBoxedList](#itemsboxedlist) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ItemsBoxedList -public static final class ItemsBoxedList
-extends [ItemsBoxed](#itemsboxed) +public record ItemsBoxedList
+implements [ItemsBoxed](#itemsboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ItemsBoxedList([ItemsList2](#itemslist2) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [ItemsList2](#itemslist2) | data
validated payload | +| [ItemsList2](#itemslist2) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Items public static class Items
@@ -210,7 +214,9 @@ NestedItems.ItemsList2 validatedPayload = | ----------------- | ---------------------- | | [ItemsList2](#itemslist2) | validate([List](#itemslistbuilder2) arg, SchemaConfiguration configuration) | | [ItemsBoxedList](#itemsboxedlist) | validateAndBox([List](#itemslistbuilder2) arg, SchemaConfiguration configuration) | +| [ItemsBoxed](#itemsboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ItemsListBuilder2 public class ItemsListBuilder2
builder for `List>>` @@ -241,27 +247,28 @@ A class to store validated List payloads | static [ItemsList2](#itemslist2) | of([List>>](#itemslistbuilder2) arg, SchemaConfiguration configuration) | ## Items1Boxed -public static abstract sealed class Items1Boxed
+public sealed interface Items1Boxed
permits
[Items1BoxedList](#items1boxedlist) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Items1BoxedList -public static final class Items1BoxedList
-extends [Items1Boxed](#items1boxed) +public record Items1BoxedList
+implements [Items1Boxed](#items1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Items1BoxedList([ItemsList1](#itemslist1) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [ItemsList1](#itemslist1) | data
validated payload | +| [ItemsList1](#itemslist1) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Items1 public static class Items1
@@ -309,7 +316,9 @@ NestedItems.ItemsList1 validatedPayload = | ----------------- | ---------------------- | | [ItemsList1](#itemslist1) | validate([List](#itemslistbuilder1) arg, SchemaConfiguration configuration) | | [Items1BoxedList](#items1boxedlist) | validateAndBox([List](#itemslistbuilder1) arg, SchemaConfiguration configuration) | +| [Items1Boxed](#items1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ItemsListBuilder1 public class ItemsListBuilder1
builder for `List>` @@ -340,27 +349,28 @@ A class to store validated List payloads | static [ItemsList1](#itemslist1) | of([List>](#itemslistbuilder1) arg, SchemaConfiguration configuration) | ## Items2Boxed -public static abstract sealed class Items2Boxed
+public sealed interface Items2Boxed
permits
[Items2BoxedList](#items2boxedlist) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Items2BoxedList -public static final class Items2BoxedList
-extends [Items2Boxed](#items2boxed) +public record Items2BoxedList
+implements [Items2Boxed](#items2boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Items2BoxedList([ItemsList](#itemslist) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [ItemsList](#itemslist) | data
validated payload | +| [ItemsList](#itemslist) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Items2 public static class Items2
@@ -405,7 +415,9 @@ NestedItems.ItemsList validatedPayload = | ----------------- | ---------------------- | | [ItemsList](#itemslist) | validate([List](#itemslistbuilder) arg, SchemaConfiguration configuration) | | [Items2BoxedList](#items2boxedlist) | validateAndBox([List](#itemslistbuilder) arg, SchemaConfiguration configuration) | +| [Items2Boxed](#items2boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ItemsListBuilder public class ItemsListBuilder
builder for `List` @@ -439,27 +451,28 @@ A class to store validated List payloads | static [ItemsList](#itemslist) | of([List](#itemslistbuilder) arg, SchemaConfiguration configuration) | ## Items3Boxed -public static abstract sealed class Items3Boxed
+public sealed interface Items3Boxed
permits
[Items3BoxedNumber](#items3boxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Items3BoxedNumber -public static final class Items3BoxedNumber
-extends [Items3Boxed](#items3boxed) +public record Items3BoxedNumber
+implements [Items3Boxed](#items3boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Items3BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Items3 public static class Items3
diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/NestedOneofToCheckValidationSemantics.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/NestedOneofToCheckValidationSemantics.md index 0bf18e4dad3..ee3e1712834 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/NestedOneofToCheckValidationSemantics.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/NestedOneofToCheckValidationSemantics.md @@ -4,34 +4,34 @@ public class NestedOneofToCheckValidationSemantics
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [NestedOneofToCheckValidationSemantics.NestedOneofToCheckValidationSemantics1Boxed](#nestedoneoftocheckvalidationsemantics1boxed)
abstract sealed validated payload class | -| static class | [NestedOneofToCheckValidationSemantics.NestedOneofToCheckValidationSemantics1BoxedVoid](#nestedoneoftocheckvalidationsemantics1boxedvoid)
boxed class to store validated null payloads | -| static class | [NestedOneofToCheckValidationSemantics.NestedOneofToCheckValidationSemantics1BoxedBoolean](#nestedoneoftocheckvalidationsemantics1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [NestedOneofToCheckValidationSemantics.NestedOneofToCheckValidationSemantics1BoxedNumber](#nestedoneoftocheckvalidationsemantics1boxednumber)
boxed class to store validated Number payloads | -| static class | [NestedOneofToCheckValidationSemantics.NestedOneofToCheckValidationSemantics1BoxedString](#nestedoneoftocheckvalidationsemantics1boxedstring)
boxed class to store validated String payloads | -| static class | [NestedOneofToCheckValidationSemantics.NestedOneofToCheckValidationSemantics1BoxedList](#nestedoneoftocheckvalidationsemantics1boxedlist)
boxed class to store validated List payloads | -| static class | [NestedOneofToCheckValidationSemantics.NestedOneofToCheckValidationSemantics1BoxedMap](#nestedoneoftocheckvalidationsemantics1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [NestedOneofToCheckValidationSemantics.NestedOneofToCheckValidationSemantics1Boxed](#nestedoneoftocheckvalidationsemantics1boxed)
sealed interface for validated payloads | +| record | [NestedOneofToCheckValidationSemantics.NestedOneofToCheckValidationSemantics1BoxedVoid](#nestedoneoftocheckvalidationsemantics1boxedvoid)
boxed class to store validated null payloads | +| record | [NestedOneofToCheckValidationSemantics.NestedOneofToCheckValidationSemantics1BoxedBoolean](#nestedoneoftocheckvalidationsemantics1boxedboolean)
boxed class to store validated boolean payloads | +| record | [NestedOneofToCheckValidationSemantics.NestedOneofToCheckValidationSemantics1BoxedNumber](#nestedoneoftocheckvalidationsemantics1boxednumber)
boxed class to store validated Number payloads | +| record | [NestedOneofToCheckValidationSemantics.NestedOneofToCheckValidationSemantics1BoxedString](#nestedoneoftocheckvalidationsemantics1boxedstring)
boxed class to store validated String payloads | +| record | [NestedOneofToCheckValidationSemantics.NestedOneofToCheckValidationSemantics1BoxedList](#nestedoneoftocheckvalidationsemantics1boxedlist)
boxed class to store validated List payloads | +| record | [NestedOneofToCheckValidationSemantics.NestedOneofToCheckValidationSemantics1BoxedMap](#nestedoneoftocheckvalidationsemantics1boxedmap)
boxed class to store validated Map payloads | | static class | [NestedOneofToCheckValidationSemantics.NestedOneofToCheckValidationSemantics1](#nestedoneoftocheckvalidationsemantics1)
schema class | -| static class | [NestedOneofToCheckValidationSemantics.Schema0Boxed](#schema0boxed)
abstract sealed validated payload class | -| static class | [NestedOneofToCheckValidationSemantics.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | -| static class | [NestedOneofToCheckValidationSemantics.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | -| static class | [NestedOneofToCheckValidationSemantics.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | -| static class | [NestedOneofToCheckValidationSemantics.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | -| static class | [NestedOneofToCheckValidationSemantics.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | -| static class | [NestedOneofToCheckValidationSemantics.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [NestedOneofToCheckValidationSemantics.Schema0Boxed](#schema0boxed)
sealed interface for validated payloads | +| record | [NestedOneofToCheckValidationSemantics.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | +| record | [NestedOneofToCheckValidationSemantics.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | +| record | [NestedOneofToCheckValidationSemantics.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | +| record | [NestedOneofToCheckValidationSemantics.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | +| record | [NestedOneofToCheckValidationSemantics.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | +| record | [NestedOneofToCheckValidationSemantics.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | | static class | [NestedOneofToCheckValidationSemantics.Schema0](#schema0)
schema class | -| static class | [NestedOneofToCheckValidationSemantics.Schema01Boxed](#schema01boxed)
abstract sealed validated payload class | -| static class | [NestedOneofToCheckValidationSemantics.Schema01BoxedVoid](#schema01boxedvoid)
boxed class to store validated null payloads | +| sealed interface | [NestedOneofToCheckValidationSemantics.Schema01Boxed](#schema01boxed)
sealed interface for validated payloads | +| record | [NestedOneofToCheckValidationSemantics.Schema01BoxedVoid](#schema01boxedvoid)
boxed class to store validated null payloads | | static class | [NestedOneofToCheckValidationSemantics.Schema01](#schema01)
schema class | ## NestedOneofToCheckValidationSemantics1Boxed -public static abstract sealed class NestedOneofToCheckValidationSemantics1Boxed
+public sealed interface NestedOneofToCheckValidationSemantics1Boxed
permits
[NestedOneofToCheckValidationSemantics1BoxedVoid](#nestedoneoftocheckvalidationsemantics1boxedvoid), [NestedOneofToCheckValidationSemantics1BoxedBoolean](#nestedoneoftocheckvalidationsemantics1boxedboolean), @@ -40,103 +40,109 @@ permits
[NestedOneofToCheckValidationSemantics1BoxedList](#nestedoneoftocheckvalidationsemantics1boxedlist), [NestedOneofToCheckValidationSemantics1BoxedMap](#nestedoneoftocheckvalidationsemantics1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## NestedOneofToCheckValidationSemantics1BoxedVoid -public static final class NestedOneofToCheckValidationSemantics1BoxedVoid
-extends [NestedOneofToCheckValidationSemantics1Boxed](#nestedoneoftocheckvalidationsemantics1boxed) +public record NestedOneofToCheckValidationSemantics1BoxedVoid
+implements [NestedOneofToCheckValidationSemantics1Boxed](#nestedoneoftocheckvalidationsemantics1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NestedOneofToCheckValidationSemantics1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NestedOneofToCheckValidationSemantics1BoxedBoolean -public static final class NestedOneofToCheckValidationSemantics1BoxedBoolean
-extends [NestedOneofToCheckValidationSemantics1Boxed](#nestedoneoftocheckvalidationsemantics1boxed) +public record NestedOneofToCheckValidationSemantics1BoxedBoolean
+implements [NestedOneofToCheckValidationSemantics1Boxed](#nestedoneoftocheckvalidationsemantics1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NestedOneofToCheckValidationSemantics1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NestedOneofToCheckValidationSemantics1BoxedNumber -public static final class NestedOneofToCheckValidationSemantics1BoxedNumber
-extends [NestedOneofToCheckValidationSemantics1Boxed](#nestedoneoftocheckvalidationsemantics1boxed) +public record NestedOneofToCheckValidationSemantics1BoxedNumber
+implements [NestedOneofToCheckValidationSemantics1Boxed](#nestedoneoftocheckvalidationsemantics1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NestedOneofToCheckValidationSemantics1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NestedOneofToCheckValidationSemantics1BoxedString -public static final class NestedOneofToCheckValidationSemantics1BoxedString
-extends [NestedOneofToCheckValidationSemantics1Boxed](#nestedoneoftocheckvalidationsemantics1boxed) +public record NestedOneofToCheckValidationSemantics1BoxedString
+implements [NestedOneofToCheckValidationSemantics1Boxed](#nestedoneoftocheckvalidationsemantics1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NestedOneofToCheckValidationSemantics1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NestedOneofToCheckValidationSemantics1BoxedList -public static final class NestedOneofToCheckValidationSemantics1BoxedList
-extends [NestedOneofToCheckValidationSemantics1Boxed](#nestedoneoftocheckvalidationsemantics1boxed) +public record NestedOneofToCheckValidationSemantics1BoxedList
+implements [NestedOneofToCheckValidationSemantics1Boxed](#nestedoneoftocheckvalidationsemantics1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NestedOneofToCheckValidationSemantics1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NestedOneofToCheckValidationSemantics1BoxedMap -public static final class NestedOneofToCheckValidationSemantics1BoxedMap
-extends [NestedOneofToCheckValidationSemantics1Boxed](#nestedoneoftocheckvalidationsemantics1boxed) +public record NestedOneofToCheckValidationSemantics1BoxedMap
+implements [NestedOneofToCheckValidationSemantics1Boxed](#nestedoneoftocheckvalidationsemantics1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NestedOneofToCheckValidationSemantics1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NestedOneofToCheckValidationSemantics1 public static class NestedOneofToCheckValidationSemantics1
@@ -168,9 +174,11 @@ A schema class that validates payloads | [NestedOneofToCheckValidationSemantics1BoxedBoolean](#nestedoneoftocheckvalidationsemantics1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [NestedOneofToCheckValidationSemantics1BoxedMap](#nestedoneoftocheckvalidationsemantics1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [NestedOneofToCheckValidationSemantics1BoxedList](#nestedoneoftocheckvalidationsemantics1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [NestedOneofToCheckValidationSemantics1Boxed](#nestedoneoftocheckvalidationsemantics1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema0Boxed -public static abstract sealed class Schema0Boxed
+public sealed interface Schema0Boxed
permits
[Schema0BoxedVoid](#schema0boxedvoid), [Schema0BoxedBoolean](#schema0boxedboolean), @@ -179,103 +187,109 @@ permits
[Schema0BoxedList](#schema0boxedlist), [Schema0BoxedMap](#schema0boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema0BoxedVoid -public static final class Schema0BoxedVoid
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedVoid
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedBoolean -public static final class Schema0BoxedBoolean
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedBoolean
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedNumber -public static final class Schema0BoxedNumber
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedNumber
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedString -public static final class Schema0BoxedString
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedString
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedList -public static final class Schema0BoxedList
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedList
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedMap -public static final class Schema0BoxedMap
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedMap
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0 public static class Schema0
@@ -307,29 +321,32 @@ A schema class that validates payloads | [Schema0BoxedBoolean](#schema0boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Schema0BoxedMap](#schema0boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [Schema0BoxedList](#schema0boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Schema0Boxed](#schema0boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema01Boxed -public static abstract sealed class Schema01Boxed
+public sealed interface Schema01Boxed
permits
[Schema01BoxedVoid](#schema01boxedvoid) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema01BoxedVoid -public static final class Schema01BoxedVoid
-extends [Schema01Boxed](#schema01boxed) +public record Schema01BoxedVoid
+implements [Schema01Boxed](#schema01boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema01BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema01 public static class Schema01
diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/Not.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/Not.md index e5bf572f8bd..8358d5d2f6e 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/Not.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/Not.md @@ -4,26 +4,26 @@ public class Not
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Not.Not1Boxed](#not1boxed)
abstract sealed validated payload class | -| static class | [Not.Not1BoxedVoid](#not1boxedvoid)
boxed class to store validated null payloads | -| static class | [Not.Not1BoxedBoolean](#not1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [Not.Not1BoxedNumber](#not1boxednumber)
boxed class to store validated Number payloads | -| static class | [Not.Not1BoxedString](#not1boxedstring)
boxed class to store validated String payloads | -| static class | [Not.Not1BoxedList](#not1boxedlist)
boxed class to store validated List payloads | -| static class | [Not.Not1BoxedMap](#not1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [Not.Not1Boxed](#not1boxed)
sealed interface for validated payloads | +| record | [Not.Not1BoxedVoid](#not1boxedvoid)
boxed class to store validated null payloads | +| record | [Not.Not1BoxedBoolean](#not1boxedboolean)
boxed class to store validated boolean payloads | +| record | [Not.Not1BoxedNumber](#not1boxednumber)
boxed class to store validated Number payloads | +| record | [Not.Not1BoxedString](#not1boxedstring)
boxed class to store validated String payloads | +| record | [Not.Not1BoxedList](#not1boxedlist)
boxed class to store validated List payloads | +| record | [Not.Not1BoxedMap](#not1boxedmap)
boxed class to store validated Map payloads | | static class | [Not.Not1](#not1)
schema class | -| static class | [Not.Not2Boxed](#not2boxed)
abstract sealed validated payload class | -| static class | [Not.Not2BoxedNumber](#not2boxednumber)
boxed class to store validated Number payloads | +| sealed interface | [Not.Not2Boxed](#not2boxed)
sealed interface for validated payloads | +| record | [Not.Not2BoxedNumber](#not2boxednumber)
boxed class to store validated Number payloads | | static class | [Not.Not2](#not2)
schema class | ## Not1Boxed -public static abstract sealed class Not1Boxed
+public sealed interface Not1Boxed
permits
[Not1BoxedVoid](#not1boxedvoid), [Not1BoxedBoolean](#not1boxedboolean), @@ -32,103 +32,109 @@ permits
[Not1BoxedList](#not1boxedlist), [Not1BoxedMap](#not1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Not1BoxedVoid -public static final class Not1BoxedVoid
-extends [Not1Boxed](#not1boxed) +public record Not1BoxedVoid
+implements [Not1Boxed](#not1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Not1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Not1BoxedBoolean -public static final class Not1BoxedBoolean
-extends [Not1Boxed](#not1boxed) +public record Not1BoxedBoolean
+implements [Not1Boxed](#not1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Not1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Not1BoxedNumber -public static final class Not1BoxedNumber
-extends [Not1Boxed](#not1boxed) +public record Not1BoxedNumber
+implements [Not1Boxed](#not1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Not1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Not1BoxedString -public static final class Not1BoxedString
-extends [Not1Boxed](#not1boxed) +public record Not1BoxedString
+implements [Not1Boxed](#not1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Not1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Not1BoxedList -public static final class Not1BoxedList
-extends [Not1Boxed](#not1boxed) +public record Not1BoxedList
+implements [Not1Boxed](#not1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Not1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Not1BoxedMap -public static final class Not1BoxedMap
-extends [Not1Boxed](#not1boxed) +public record Not1BoxedMap
+implements [Not1Boxed](#not1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Not1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Not1 public static class Not1
@@ -160,29 +166,32 @@ A schema class that validates payloads | [Not1BoxedBoolean](#not1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Not1BoxedMap](#not1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [Not1BoxedList](#not1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Not1Boxed](#not1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Not2Boxed -public static abstract sealed class Not2Boxed
+public sealed interface Not2Boxed
permits
[Not2BoxedNumber](#not2boxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Not2BoxedNumber -public static final class Not2BoxedNumber
-extends [Not2Boxed](#not2boxed) +public record Not2BoxedNumber
+implements [Not2Boxed](#not2boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Not2BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Not2 public static class Not2
diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/NotMoreComplexSchema.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/NotMoreComplexSchema.md index 3e0871f1245..3b1f33fa85c 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/NotMoreComplexSchema.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/NotMoreComplexSchema.md @@ -4,7 +4,7 @@ public class NotMoreComplexSchema
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,25 +12,25 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [NotMoreComplexSchema.NotMoreComplexSchema1Boxed](#notmorecomplexschema1boxed)
abstract sealed validated payload class | -| static class | [NotMoreComplexSchema.NotMoreComplexSchema1BoxedVoid](#notmorecomplexschema1boxedvoid)
boxed class to store validated null payloads | -| static class | [NotMoreComplexSchema.NotMoreComplexSchema1BoxedBoolean](#notmorecomplexschema1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [NotMoreComplexSchema.NotMoreComplexSchema1BoxedNumber](#notmorecomplexschema1boxednumber)
boxed class to store validated Number payloads | -| static class | [NotMoreComplexSchema.NotMoreComplexSchema1BoxedString](#notmorecomplexschema1boxedstring)
boxed class to store validated String payloads | -| static class | [NotMoreComplexSchema.NotMoreComplexSchema1BoxedList](#notmorecomplexschema1boxedlist)
boxed class to store validated List payloads | -| static class | [NotMoreComplexSchema.NotMoreComplexSchema1BoxedMap](#notmorecomplexschema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [NotMoreComplexSchema.NotMoreComplexSchema1Boxed](#notmorecomplexschema1boxed)
sealed interface for validated payloads | +| record | [NotMoreComplexSchema.NotMoreComplexSchema1BoxedVoid](#notmorecomplexschema1boxedvoid)
boxed class to store validated null payloads | +| record | [NotMoreComplexSchema.NotMoreComplexSchema1BoxedBoolean](#notmorecomplexschema1boxedboolean)
boxed class to store validated boolean payloads | +| record | [NotMoreComplexSchema.NotMoreComplexSchema1BoxedNumber](#notmorecomplexschema1boxednumber)
boxed class to store validated Number payloads | +| record | [NotMoreComplexSchema.NotMoreComplexSchema1BoxedString](#notmorecomplexschema1boxedstring)
boxed class to store validated String payloads | +| record | [NotMoreComplexSchema.NotMoreComplexSchema1BoxedList](#notmorecomplexschema1boxedlist)
boxed class to store validated List payloads | +| record | [NotMoreComplexSchema.NotMoreComplexSchema1BoxedMap](#notmorecomplexschema1boxedmap)
boxed class to store validated Map payloads | | static class | [NotMoreComplexSchema.NotMoreComplexSchema1](#notmorecomplexschema1)
schema class | -| static class | [NotMoreComplexSchema.NotBoxed](#notboxed)
abstract sealed validated payload class | -| static class | [NotMoreComplexSchema.NotBoxedMap](#notboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [NotMoreComplexSchema.NotBoxed](#notboxed)
sealed interface for validated payloads | +| record | [NotMoreComplexSchema.NotBoxedMap](#notboxedmap)
boxed class to store validated Map payloads | | static class | [NotMoreComplexSchema.Not](#not)
schema class | | static class | [NotMoreComplexSchema.NotMapBuilder](#notmapbuilder)
builder for Map payloads | | static class | [NotMoreComplexSchema.NotMap](#notmap)
output class for Map payloads | -| static class | [NotMoreComplexSchema.FooBoxed](#fooboxed)
abstract sealed validated payload class | -| static class | [NotMoreComplexSchema.FooBoxedString](#fooboxedstring)
boxed class to store validated String payloads | +| sealed interface | [NotMoreComplexSchema.FooBoxed](#fooboxed)
sealed interface for validated payloads | +| record | [NotMoreComplexSchema.FooBoxedString](#fooboxedstring)
boxed class to store validated String payloads | | static class | [NotMoreComplexSchema.Foo](#foo)
schema class | ## NotMoreComplexSchema1Boxed -public static abstract sealed class NotMoreComplexSchema1Boxed
+public sealed interface NotMoreComplexSchema1Boxed
permits
[NotMoreComplexSchema1BoxedVoid](#notmorecomplexschema1boxedvoid), [NotMoreComplexSchema1BoxedBoolean](#notmorecomplexschema1boxedboolean), @@ -39,103 +39,109 @@ permits
[NotMoreComplexSchema1BoxedList](#notmorecomplexschema1boxedlist), [NotMoreComplexSchema1BoxedMap](#notmorecomplexschema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## NotMoreComplexSchema1BoxedVoid -public static final class NotMoreComplexSchema1BoxedVoid
-extends [NotMoreComplexSchema1Boxed](#notmorecomplexschema1boxed) +public record NotMoreComplexSchema1BoxedVoid
+implements [NotMoreComplexSchema1Boxed](#notmorecomplexschema1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NotMoreComplexSchema1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NotMoreComplexSchema1BoxedBoolean -public static final class NotMoreComplexSchema1BoxedBoolean
-extends [NotMoreComplexSchema1Boxed](#notmorecomplexschema1boxed) +public record NotMoreComplexSchema1BoxedBoolean
+implements [NotMoreComplexSchema1Boxed](#notmorecomplexschema1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NotMoreComplexSchema1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NotMoreComplexSchema1BoxedNumber -public static final class NotMoreComplexSchema1BoxedNumber
-extends [NotMoreComplexSchema1Boxed](#notmorecomplexschema1boxed) +public record NotMoreComplexSchema1BoxedNumber
+implements [NotMoreComplexSchema1Boxed](#notmorecomplexschema1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NotMoreComplexSchema1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NotMoreComplexSchema1BoxedString -public static final class NotMoreComplexSchema1BoxedString
-extends [NotMoreComplexSchema1Boxed](#notmorecomplexschema1boxed) +public record NotMoreComplexSchema1BoxedString
+implements [NotMoreComplexSchema1Boxed](#notmorecomplexschema1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NotMoreComplexSchema1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NotMoreComplexSchema1BoxedList -public static final class NotMoreComplexSchema1BoxedList
-extends [NotMoreComplexSchema1Boxed](#notmorecomplexschema1boxed) +public record NotMoreComplexSchema1BoxedList
+implements [NotMoreComplexSchema1Boxed](#notmorecomplexschema1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NotMoreComplexSchema1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NotMoreComplexSchema1BoxedMap -public static final class NotMoreComplexSchema1BoxedMap
-extends [NotMoreComplexSchema1Boxed](#notmorecomplexschema1boxed) +public record NotMoreComplexSchema1BoxedMap
+implements [NotMoreComplexSchema1Boxed](#notmorecomplexschema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NotMoreComplexSchema1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NotMoreComplexSchema1 public static class NotMoreComplexSchema1
@@ -167,29 +173,32 @@ A schema class that validates payloads | [NotMoreComplexSchema1BoxedBoolean](#notmorecomplexschema1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [NotMoreComplexSchema1BoxedMap](#notmorecomplexschema1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [NotMoreComplexSchema1BoxedList](#notmorecomplexschema1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [NotMoreComplexSchema1Boxed](#notmorecomplexschema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## NotBoxed -public static abstract sealed class NotBoxed
+public sealed interface NotBoxed
permits
[NotBoxedMap](#notboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## NotBoxedMap -public static final class NotBoxedMap
-extends [NotBoxed](#notboxed) +public record NotBoxedMap
+implements [NotBoxed](#notboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NotBoxedMap([NotMap](#notmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [NotMap](#notmap) | data
validated payload | +| [NotMap](#notmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Not public static class Not
@@ -234,7 +243,9 @@ NotMoreComplexSchema.NotMap validatedPayload = | ----------------- | ---------------------- | | [NotMap](#notmap) | validate([Map<?, ?>](#notmapbuilder) arg, SchemaConfiguration configuration) | | [NotBoxedMap](#notboxedmap) | validateAndBox([Map<?, ?>](#notmapbuilder) arg, SchemaConfiguration configuration) | +| [NotBoxed](#notboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## NotMapBuilder public class NotMapBuilder
builder for `Map` @@ -275,27 +286,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## FooBoxed -public static abstract sealed class FooBoxed
+public sealed interface FooBoxed
permits
[FooBoxedString](#fooboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## FooBoxedString -public static final class FooBoxedString
-extends [FooBoxed](#fooboxed) +public record FooBoxedString
+implements [FooBoxed](#fooboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Foo public static class Foo
diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/NulCharactersInStrings.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/NulCharactersInStrings.md index eb1cfff98ed..78007c6f372 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/NulCharactersInStrings.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/NulCharactersInStrings.md @@ -4,40 +4,41 @@ public class NulCharactersInStrings
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - enum classes ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [NulCharactersInStrings.NulCharactersInStrings1Boxed](#nulcharactersinstrings1boxed)
abstract sealed validated payload class | -| static class | [NulCharactersInStrings.NulCharactersInStrings1BoxedString](#nulcharactersinstrings1boxedstring)
boxed class to store validated String payloads | +| sealed interface | [NulCharactersInStrings.NulCharactersInStrings1Boxed](#nulcharactersinstrings1boxed)
sealed interface for validated payloads | +| record | [NulCharactersInStrings.NulCharactersInStrings1BoxedString](#nulcharactersinstrings1boxedstring)
boxed class to store validated String payloads | | static class | [NulCharactersInStrings.NulCharactersInStrings1](#nulcharactersinstrings1)
schema class | | enum | [NulCharactersInStrings.StringNulCharactersInStringsEnums](#stringnulcharactersinstringsenums)
String enum | ## NulCharactersInStrings1Boxed -public static abstract sealed class NulCharactersInStrings1Boxed
+public sealed interface NulCharactersInStrings1Boxed
permits
[NulCharactersInStrings1BoxedString](#nulcharactersinstrings1boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## NulCharactersInStrings1BoxedString -public static final class NulCharactersInStrings1BoxedString
-extends [NulCharactersInStrings1Boxed](#nulcharactersinstrings1boxed) +public record NulCharactersInStrings1BoxedString
+implements [NulCharactersInStrings1Boxed](#nulcharactersinstrings1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NulCharactersInStrings1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NulCharactersInStrings1 public static class NulCharactersInStrings1
@@ -79,7 +80,9 @@ String validatedPayload = NulCharactersInStrings.NulCharactersInStrings1.validat | String | validate(String arg, SchemaConfiguration configuration) | | String | validate([StringNulCharactersInStringsEnums](#stringnulcharactersinstringsenums) arg, SchemaConfiguration configuration) | | [NulCharactersInStrings1BoxedString](#nulcharactersinstrings1boxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [NulCharactersInStrings1Boxed](#nulcharactersinstrings1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## StringNulCharactersInStringsEnums public enum StringNulCharactersInStringsEnums
extends `Enum` diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/NullTypeMatchesOnlyTheNullObject.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/NullTypeMatchesOnlyTheNullObject.md index ac85cb6749c..a7bf060e212 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/NullTypeMatchesOnlyTheNullObject.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/NullTypeMatchesOnlyTheNullObject.md @@ -4,38 +4,39 @@ public class NullTypeMatchesOnlyTheNullObject
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [NullTypeMatchesOnlyTheNullObject.NullTypeMatchesOnlyTheNullObject1Boxed](#nulltypematchesonlythenullobject1boxed)
abstract sealed validated payload class | -| static class | [NullTypeMatchesOnlyTheNullObject.NullTypeMatchesOnlyTheNullObject1BoxedVoid](#nulltypematchesonlythenullobject1boxedvoid)
boxed class to store validated null payloads | +| sealed interface | [NullTypeMatchesOnlyTheNullObject.NullTypeMatchesOnlyTheNullObject1Boxed](#nulltypematchesonlythenullobject1boxed)
sealed interface for validated payloads | +| record | [NullTypeMatchesOnlyTheNullObject.NullTypeMatchesOnlyTheNullObject1BoxedVoid](#nulltypematchesonlythenullobject1boxedvoid)
boxed class to store validated null payloads | | static class | [NullTypeMatchesOnlyTheNullObject.NullTypeMatchesOnlyTheNullObject1](#nulltypematchesonlythenullobject1)
schema class | ## NullTypeMatchesOnlyTheNullObject1Boxed -public static abstract sealed class NullTypeMatchesOnlyTheNullObject1Boxed
+public sealed interface NullTypeMatchesOnlyTheNullObject1Boxed
permits
[NullTypeMatchesOnlyTheNullObject1BoxedVoid](#nulltypematchesonlythenullobject1boxedvoid) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## NullTypeMatchesOnlyTheNullObject1BoxedVoid -public static final class NullTypeMatchesOnlyTheNullObject1BoxedVoid
-extends [NullTypeMatchesOnlyTheNullObject1Boxed](#nulltypematchesonlythenullobject1boxed) +public record NullTypeMatchesOnlyTheNullObject1BoxedVoid
+implements [NullTypeMatchesOnlyTheNullObject1Boxed](#nulltypematchesonlythenullobject1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NullTypeMatchesOnlyTheNullObject1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NullTypeMatchesOnlyTheNullObject1 public static class NullTypeMatchesOnlyTheNullObject1
diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/NumberTypeMatchesNumbers.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/NumberTypeMatchesNumbers.md index d668c33c2de..76a1b65da1a 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/NumberTypeMatchesNumbers.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/NumberTypeMatchesNumbers.md @@ -4,38 +4,39 @@ public class NumberTypeMatchesNumbers
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [NumberTypeMatchesNumbers.NumberTypeMatchesNumbers1Boxed](#numbertypematchesnumbers1boxed)
abstract sealed validated payload class | -| static class | [NumberTypeMatchesNumbers.NumberTypeMatchesNumbers1BoxedNumber](#numbertypematchesnumbers1boxednumber)
boxed class to store validated Number payloads | +| sealed interface | [NumberTypeMatchesNumbers.NumberTypeMatchesNumbers1Boxed](#numbertypematchesnumbers1boxed)
sealed interface for validated payloads | +| record | [NumberTypeMatchesNumbers.NumberTypeMatchesNumbers1BoxedNumber](#numbertypematchesnumbers1boxednumber)
boxed class to store validated Number payloads | | static class | [NumberTypeMatchesNumbers.NumberTypeMatchesNumbers1](#numbertypematchesnumbers1)
schema class | ## NumberTypeMatchesNumbers1Boxed -public static abstract sealed class NumberTypeMatchesNumbers1Boxed
+public sealed interface NumberTypeMatchesNumbers1Boxed
permits
[NumberTypeMatchesNumbers1BoxedNumber](#numbertypematchesnumbers1boxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## NumberTypeMatchesNumbers1BoxedNumber -public static final class NumberTypeMatchesNumbers1BoxedNumber
-extends [NumberTypeMatchesNumbers1Boxed](#numbertypematchesnumbers1boxed) +public record NumberTypeMatchesNumbers1BoxedNumber
+implements [NumberTypeMatchesNumbers1Boxed](#numbertypematchesnumbers1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NumberTypeMatchesNumbers1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NumberTypeMatchesNumbers1 public static class NumberTypeMatchesNumbers1
diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/ObjectPropertiesValidation.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/ObjectPropertiesValidation.md index caba7bd3cae..2427b5219d5 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/ObjectPropertiesValidation.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/ObjectPropertiesValidation.md @@ -4,7 +4,7 @@ public class ObjectPropertiesValidation
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,25 +12,25 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ObjectPropertiesValidation.ObjectPropertiesValidation1Boxed](#objectpropertiesvalidation1boxed)
abstract sealed validated payload class | -| static class | [ObjectPropertiesValidation.ObjectPropertiesValidation1BoxedVoid](#objectpropertiesvalidation1boxedvoid)
boxed class to store validated null payloads | -| static class | [ObjectPropertiesValidation.ObjectPropertiesValidation1BoxedBoolean](#objectpropertiesvalidation1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [ObjectPropertiesValidation.ObjectPropertiesValidation1BoxedNumber](#objectpropertiesvalidation1boxednumber)
boxed class to store validated Number payloads | -| static class | [ObjectPropertiesValidation.ObjectPropertiesValidation1BoxedString](#objectpropertiesvalidation1boxedstring)
boxed class to store validated String payloads | -| static class | [ObjectPropertiesValidation.ObjectPropertiesValidation1BoxedList](#objectpropertiesvalidation1boxedlist)
boxed class to store validated List payloads | -| static class | [ObjectPropertiesValidation.ObjectPropertiesValidation1BoxedMap](#objectpropertiesvalidation1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ObjectPropertiesValidation.ObjectPropertiesValidation1Boxed](#objectpropertiesvalidation1boxed)
sealed interface for validated payloads | +| record | [ObjectPropertiesValidation.ObjectPropertiesValidation1BoxedVoid](#objectpropertiesvalidation1boxedvoid)
boxed class to store validated null payloads | +| record | [ObjectPropertiesValidation.ObjectPropertiesValidation1BoxedBoolean](#objectpropertiesvalidation1boxedboolean)
boxed class to store validated boolean payloads | +| record | [ObjectPropertiesValidation.ObjectPropertiesValidation1BoxedNumber](#objectpropertiesvalidation1boxednumber)
boxed class to store validated Number payloads | +| record | [ObjectPropertiesValidation.ObjectPropertiesValidation1BoxedString](#objectpropertiesvalidation1boxedstring)
boxed class to store validated String payloads | +| record | [ObjectPropertiesValidation.ObjectPropertiesValidation1BoxedList](#objectpropertiesvalidation1boxedlist)
boxed class to store validated List payloads | +| record | [ObjectPropertiesValidation.ObjectPropertiesValidation1BoxedMap](#objectpropertiesvalidation1boxedmap)
boxed class to store validated Map payloads | | static class | [ObjectPropertiesValidation.ObjectPropertiesValidation1](#objectpropertiesvalidation1)
schema class | | static class | [ObjectPropertiesValidation.ObjectPropertiesValidationMapBuilder](#objectpropertiesvalidationmapbuilder)
builder for Map payloads | | static class | [ObjectPropertiesValidation.ObjectPropertiesValidationMap](#objectpropertiesvalidationmap)
output class for Map payloads | -| static class | [ObjectPropertiesValidation.BarBoxed](#barboxed)
abstract sealed validated payload class | -| static class | [ObjectPropertiesValidation.BarBoxedString](#barboxedstring)
boxed class to store validated String payloads | +| sealed interface | [ObjectPropertiesValidation.BarBoxed](#barboxed)
sealed interface for validated payloads | +| record | [ObjectPropertiesValidation.BarBoxedString](#barboxedstring)
boxed class to store validated String payloads | | static class | [ObjectPropertiesValidation.Bar](#bar)
schema class | -| static class | [ObjectPropertiesValidation.FooBoxed](#fooboxed)
abstract sealed validated payload class | -| static class | [ObjectPropertiesValidation.FooBoxedNumber](#fooboxednumber)
boxed class to store validated Number payloads | +| sealed interface | [ObjectPropertiesValidation.FooBoxed](#fooboxed)
sealed interface for validated payloads | +| record | [ObjectPropertiesValidation.FooBoxedNumber](#fooboxednumber)
boxed class to store validated Number payloads | | static class | [ObjectPropertiesValidation.Foo](#foo)
schema class | ## ObjectPropertiesValidation1Boxed -public static abstract sealed class ObjectPropertiesValidation1Boxed
+public sealed interface ObjectPropertiesValidation1Boxed
permits
[ObjectPropertiesValidation1BoxedVoid](#objectpropertiesvalidation1boxedvoid), [ObjectPropertiesValidation1BoxedBoolean](#objectpropertiesvalidation1boxedboolean), @@ -39,103 +39,109 @@ permits
[ObjectPropertiesValidation1BoxedList](#objectpropertiesvalidation1boxedlist), [ObjectPropertiesValidation1BoxedMap](#objectpropertiesvalidation1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ObjectPropertiesValidation1BoxedVoid -public static final class ObjectPropertiesValidation1BoxedVoid
-extends [ObjectPropertiesValidation1Boxed](#objectpropertiesvalidation1boxed) +public record ObjectPropertiesValidation1BoxedVoid
+implements [ObjectPropertiesValidation1Boxed](#objectpropertiesvalidation1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ObjectPropertiesValidation1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ObjectPropertiesValidation1BoxedBoolean -public static final class ObjectPropertiesValidation1BoxedBoolean
-extends [ObjectPropertiesValidation1Boxed](#objectpropertiesvalidation1boxed) +public record ObjectPropertiesValidation1BoxedBoolean
+implements [ObjectPropertiesValidation1Boxed](#objectpropertiesvalidation1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ObjectPropertiesValidation1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ObjectPropertiesValidation1BoxedNumber -public static final class ObjectPropertiesValidation1BoxedNumber
-extends [ObjectPropertiesValidation1Boxed](#objectpropertiesvalidation1boxed) +public record ObjectPropertiesValidation1BoxedNumber
+implements [ObjectPropertiesValidation1Boxed](#objectpropertiesvalidation1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ObjectPropertiesValidation1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ObjectPropertiesValidation1BoxedString -public static final class ObjectPropertiesValidation1BoxedString
-extends [ObjectPropertiesValidation1Boxed](#objectpropertiesvalidation1boxed) +public record ObjectPropertiesValidation1BoxedString
+implements [ObjectPropertiesValidation1Boxed](#objectpropertiesvalidation1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ObjectPropertiesValidation1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ObjectPropertiesValidation1BoxedList -public static final class ObjectPropertiesValidation1BoxedList
-extends [ObjectPropertiesValidation1Boxed](#objectpropertiesvalidation1boxed) +public record ObjectPropertiesValidation1BoxedList
+implements [ObjectPropertiesValidation1Boxed](#objectpropertiesvalidation1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ObjectPropertiesValidation1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ObjectPropertiesValidation1BoxedMap -public static final class ObjectPropertiesValidation1BoxedMap
-extends [ObjectPropertiesValidation1Boxed](#objectpropertiesvalidation1boxed) +public record ObjectPropertiesValidation1BoxedMap
+implements [ObjectPropertiesValidation1Boxed](#objectpropertiesvalidation1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ObjectPropertiesValidation1BoxedMap([ObjectPropertiesValidationMap](#objectpropertiesvalidationmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [ObjectPropertiesValidationMap](#objectpropertiesvalidationmap) | data
validated payload | +| [ObjectPropertiesValidationMap](#objectpropertiesvalidationmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ObjectPropertiesValidation1 public static class ObjectPropertiesValidation1
@@ -167,7 +173,9 @@ A schema class that validates payloads | [ObjectPropertiesValidation1BoxedBoolean](#objectpropertiesvalidation1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [ObjectPropertiesValidation1BoxedMap](#objectpropertiesvalidation1boxedmap) | validateAndBox([Map<?, ?>](#objectpropertiesvalidationmapbuilder) arg, SchemaConfiguration configuration) | | [ObjectPropertiesValidation1BoxedList](#objectpropertiesvalidation1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [ObjectPropertiesValidation1Boxed](#objectpropertiesvalidation1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ObjectPropertiesValidationMapBuilder public class ObjectPropertiesValidationMapBuilder
builder for `Map` @@ -213,27 +221,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## BarBoxed -public static abstract sealed class BarBoxed
+public sealed interface BarBoxed
permits
[BarBoxedString](#barboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## BarBoxedString -public static final class BarBoxedString
-extends [BarBoxed](#barboxed) +public record BarBoxedString
+implements [BarBoxed](#barboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BarBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Bar public static class Bar
@@ -247,27 +256,28 @@ A schema class that validates payloads | validateAndBox | ## FooBoxed -public static abstract sealed class FooBoxed
+public sealed interface FooBoxed
permits
[FooBoxedNumber](#fooboxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## FooBoxedNumber -public static final class FooBoxedNumber
-extends [FooBoxed](#fooboxed) +public record FooBoxedNumber
+implements [FooBoxed](#fooboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Foo public static class Foo
diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/ObjectTypeMatchesObjects.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/ObjectTypeMatchesObjects.md index 1e9b8c9a96d..f169645577b 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/ObjectTypeMatchesObjects.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/ObjectTypeMatchesObjects.md @@ -4,38 +4,39 @@ public class ObjectTypeMatchesObjects
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ObjectTypeMatchesObjects.ObjectTypeMatchesObjects1Boxed](#objecttypematchesobjects1boxed)
abstract sealed validated payload class | -| static class | [ObjectTypeMatchesObjects.ObjectTypeMatchesObjects1BoxedMap](#objecttypematchesobjects1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ObjectTypeMatchesObjects.ObjectTypeMatchesObjects1Boxed](#objecttypematchesobjects1boxed)
sealed interface for validated payloads | +| record | [ObjectTypeMatchesObjects.ObjectTypeMatchesObjects1BoxedMap](#objecttypematchesobjects1boxedmap)
boxed class to store validated Map payloads | | static class | [ObjectTypeMatchesObjects.ObjectTypeMatchesObjects1](#objecttypematchesobjects1)
schema class | ## ObjectTypeMatchesObjects1Boxed -public static abstract sealed class ObjectTypeMatchesObjects1Boxed
+public sealed interface ObjectTypeMatchesObjects1Boxed
permits
[ObjectTypeMatchesObjects1BoxedMap](#objecttypematchesobjects1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ObjectTypeMatchesObjects1BoxedMap -public static final class ObjectTypeMatchesObjects1BoxedMap
-extends [ObjectTypeMatchesObjects1Boxed](#objecttypematchesobjects1boxed) +public record ObjectTypeMatchesObjects1BoxedMap
+implements [ObjectTypeMatchesObjects1Boxed](#objecttypematchesobjects1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ObjectTypeMatchesObjects1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ObjectTypeMatchesObjects1 public static class ObjectTypeMatchesObjects1
diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/Oneof.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/Oneof.md index 2b209414821..f4c0b682e27 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/Oneof.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/Oneof.md @@ -4,34 +4,34 @@ public class Oneof
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Oneof.Oneof1Boxed](#oneof1boxed)
abstract sealed validated payload class | -| static class | [Oneof.Oneof1BoxedVoid](#oneof1boxedvoid)
boxed class to store validated null payloads | -| static class | [Oneof.Oneof1BoxedBoolean](#oneof1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [Oneof.Oneof1BoxedNumber](#oneof1boxednumber)
boxed class to store validated Number payloads | -| static class | [Oneof.Oneof1BoxedString](#oneof1boxedstring)
boxed class to store validated String payloads | -| static class | [Oneof.Oneof1BoxedList](#oneof1boxedlist)
boxed class to store validated List payloads | -| static class | [Oneof.Oneof1BoxedMap](#oneof1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [Oneof.Oneof1Boxed](#oneof1boxed)
sealed interface for validated payloads | +| record | [Oneof.Oneof1BoxedVoid](#oneof1boxedvoid)
boxed class to store validated null payloads | +| record | [Oneof.Oneof1BoxedBoolean](#oneof1boxedboolean)
boxed class to store validated boolean payloads | +| record | [Oneof.Oneof1BoxedNumber](#oneof1boxednumber)
boxed class to store validated Number payloads | +| record | [Oneof.Oneof1BoxedString](#oneof1boxedstring)
boxed class to store validated String payloads | +| record | [Oneof.Oneof1BoxedList](#oneof1boxedlist)
boxed class to store validated List payloads | +| record | [Oneof.Oneof1BoxedMap](#oneof1boxedmap)
boxed class to store validated Map payloads | | static class | [Oneof.Oneof1](#oneof1)
schema class | -| static class | [Oneof.Schema1Boxed](#schema1boxed)
abstract sealed validated payload class | -| static class | [Oneof.Schema1BoxedVoid](#schema1boxedvoid)
boxed class to store validated null payloads | -| static class | [Oneof.Schema1BoxedBoolean](#schema1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [Oneof.Schema1BoxedNumber](#schema1boxednumber)
boxed class to store validated Number payloads | -| static class | [Oneof.Schema1BoxedString](#schema1boxedstring)
boxed class to store validated String payloads | -| static class | [Oneof.Schema1BoxedList](#schema1boxedlist)
boxed class to store validated List payloads | -| static class | [Oneof.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [Oneof.Schema1Boxed](#schema1boxed)
sealed interface for validated payloads | +| record | [Oneof.Schema1BoxedVoid](#schema1boxedvoid)
boxed class to store validated null payloads | +| record | [Oneof.Schema1BoxedBoolean](#schema1boxedboolean)
boxed class to store validated boolean payloads | +| record | [Oneof.Schema1BoxedNumber](#schema1boxednumber)
boxed class to store validated Number payloads | +| record | [Oneof.Schema1BoxedString](#schema1boxedstring)
boxed class to store validated String payloads | +| record | [Oneof.Schema1BoxedList](#schema1boxedlist)
boxed class to store validated List payloads | +| record | [Oneof.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | | static class | [Oneof.Schema1](#schema1)
schema class | -| static class | [Oneof.Schema0Boxed](#schema0boxed)
abstract sealed validated payload class | -| static class | [Oneof.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | +| sealed interface | [Oneof.Schema0Boxed](#schema0boxed)
sealed interface for validated payloads | +| record | [Oneof.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | | static class | [Oneof.Schema0](#schema0)
schema class | ## Oneof1Boxed -public static abstract sealed class Oneof1Boxed
+public sealed interface Oneof1Boxed
permits
[Oneof1BoxedVoid](#oneof1boxedvoid), [Oneof1BoxedBoolean](#oneof1boxedboolean), @@ -40,103 +40,109 @@ permits
[Oneof1BoxedList](#oneof1boxedlist), [Oneof1BoxedMap](#oneof1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Oneof1BoxedVoid -public static final class Oneof1BoxedVoid
-extends [Oneof1Boxed](#oneof1boxed) +public record Oneof1BoxedVoid
+implements [Oneof1Boxed](#oneof1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Oneof1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Oneof1BoxedBoolean -public static final class Oneof1BoxedBoolean
-extends [Oneof1Boxed](#oneof1boxed) +public record Oneof1BoxedBoolean
+implements [Oneof1Boxed](#oneof1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Oneof1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Oneof1BoxedNumber -public static final class Oneof1BoxedNumber
-extends [Oneof1Boxed](#oneof1boxed) +public record Oneof1BoxedNumber
+implements [Oneof1Boxed](#oneof1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Oneof1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Oneof1BoxedString -public static final class Oneof1BoxedString
-extends [Oneof1Boxed](#oneof1boxed) +public record Oneof1BoxedString
+implements [Oneof1Boxed](#oneof1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Oneof1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Oneof1BoxedList -public static final class Oneof1BoxedList
-extends [Oneof1Boxed](#oneof1boxed) +public record Oneof1BoxedList
+implements [Oneof1Boxed](#oneof1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Oneof1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Oneof1BoxedMap -public static final class Oneof1BoxedMap
-extends [Oneof1Boxed](#oneof1boxed) +public record Oneof1BoxedMap
+implements [Oneof1Boxed](#oneof1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Oneof1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Oneof1 public static class Oneof1
@@ -168,9 +174,11 @@ A schema class that validates payloads | [Oneof1BoxedBoolean](#oneof1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Oneof1BoxedMap](#oneof1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [Oneof1BoxedList](#oneof1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Oneof1Boxed](#oneof1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema1Boxed -public static abstract sealed class Schema1Boxed
+public sealed interface Schema1Boxed
permits
[Schema1BoxedVoid](#schema1boxedvoid), [Schema1BoxedBoolean](#schema1boxedboolean), @@ -179,103 +187,109 @@ permits
[Schema1BoxedList](#schema1boxedlist), [Schema1BoxedMap](#schema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema1BoxedVoid -public static final class Schema1BoxedVoid
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedVoid
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedBoolean -public static final class Schema1BoxedBoolean
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedBoolean
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedNumber -public static final class Schema1BoxedNumber
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedNumber
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedString -public static final class Schema1BoxedString
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedString
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedList -public static final class Schema1BoxedList
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedList
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedMap -public static final class Schema1BoxedMap
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedMap
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1 public static class Schema1
@@ -307,29 +321,32 @@ A schema class that validates payloads | [Schema1BoxedBoolean](#schema1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Schema1BoxedMap](#schema1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [Schema1BoxedList](#schema1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Schema1Boxed](#schema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema0Boxed -public static abstract sealed class Schema0Boxed
+public sealed interface Schema0Boxed
permits
[Schema0BoxedNumber](#schema0boxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema0BoxedNumber -public static final class Schema0BoxedNumber
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedNumber
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0 public static class Schema0
diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/OneofComplexTypes.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/OneofComplexTypes.md index 5c4ed6bcf33..182a53d6956 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/OneofComplexTypes.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/OneofComplexTypes.md @@ -4,7 +4,7 @@ public class OneofComplexTypes
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,43 +12,43 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [OneofComplexTypes.OneofComplexTypes1Boxed](#oneofcomplextypes1boxed)
abstract sealed validated payload class | -| static class | [OneofComplexTypes.OneofComplexTypes1BoxedVoid](#oneofcomplextypes1boxedvoid)
boxed class to store validated null payloads | -| static class | [OneofComplexTypes.OneofComplexTypes1BoxedBoolean](#oneofcomplextypes1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [OneofComplexTypes.OneofComplexTypes1BoxedNumber](#oneofcomplextypes1boxednumber)
boxed class to store validated Number payloads | -| static class | [OneofComplexTypes.OneofComplexTypes1BoxedString](#oneofcomplextypes1boxedstring)
boxed class to store validated String payloads | -| static class | [OneofComplexTypes.OneofComplexTypes1BoxedList](#oneofcomplextypes1boxedlist)
boxed class to store validated List payloads | -| static class | [OneofComplexTypes.OneofComplexTypes1BoxedMap](#oneofcomplextypes1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [OneofComplexTypes.OneofComplexTypes1Boxed](#oneofcomplextypes1boxed)
sealed interface for validated payloads | +| record | [OneofComplexTypes.OneofComplexTypes1BoxedVoid](#oneofcomplextypes1boxedvoid)
boxed class to store validated null payloads | +| record | [OneofComplexTypes.OneofComplexTypes1BoxedBoolean](#oneofcomplextypes1boxedboolean)
boxed class to store validated boolean payloads | +| record | [OneofComplexTypes.OneofComplexTypes1BoxedNumber](#oneofcomplextypes1boxednumber)
boxed class to store validated Number payloads | +| record | [OneofComplexTypes.OneofComplexTypes1BoxedString](#oneofcomplextypes1boxedstring)
boxed class to store validated String payloads | +| record | [OneofComplexTypes.OneofComplexTypes1BoxedList](#oneofcomplextypes1boxedlist)
boxed class to store validated List payloads | +| record | [OneofComplexTypes.OneofComplexTypes1BoxedMap](#oneofcomplextypes1boxedmap)
boxed class to store validated Map payloads | | static class | [OneofComplexTypes.OneofComplexTypes1](#oneofcomplextypes1)
schema class | -| static class | [OneofComplexTypes.Schema1Boxed](#schema1boxed)
abstract sealed validated payload class | -| static class | [OneofComplexTypes.Schema1BoxedVoid](#schema1boxedvoid)
boxed class to store validated null payloads | -| static class | [OneofComplexTypes.Schema1BoxedBoolean](#schema1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [OneofComplexTypes.Schema1BoxedNumber](#schema1boxednumber)
boxed class to store validated Number payloads | -| static class | [OneofComplexTypes.Schema1BoxedString](#schema1boxedstring)
boxed class to store validated String payloads | -| static class | [OneofComplexTypes.Schema1BoxedList](#schema1boxedlist)
boxed class to store validated List payloads | -| static class | [OneofComplexTypes.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [OneofComplexTypes.Schema1Boxed](#schema1boxed)
sealed interface for validated payloads | +| record | [OneofComplexTypes.Schema1BoxedVoid](#schema1boxedvoid)
boxed class to store validated null payloads | +| record | [OneofComplexTypes.Schema1BoxedBoolean](#schema1boxedboolean)
boxed class to store validated boolean payloads | +| record | [OneofComplexTypes.Schema1BoxedNumber](#schema1boxednumber)
boxed class to store validated Number payloads | +| record | [OneofComplexTypes.Schema1BoxedString](#schema1boxedstring)
boxed class to store validated String payloads | +| record | [OneofComplexTypes.Schema1BoxedList](#schema1boxedlist)
boxed class to store validated List payloads | +| record | [OneofComplexTypes.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | | static class | [OneofComplexTypes.Schema1](#schema1)
schema class | | static class | [OneofComplexTypes.Schema1MapBuilder](#schema1mapbuilder)
builder for Map payloads | | static class | [OneofComplexTypes.Schema1Map](#schema1map)
output class for Map payloads | -| static class | [OneofComplexTypes.FooBoxed](#fooboxed)
abstract sealed validated payload class | -| static class | [OneofComplexTypes.FooBoxedString](#fooboxedstring)
boxed class to store validated String payloads | +| sealed interface | [OneofComplexTypes.FooBoxed](#fooboxed)
sealed interface for validated payloads | +| record | [OneofComplexTypes.FooBoxedString](#fooboxedstring)
boxed class to store validated String payloads | | static class | [OneofComplexTypes.Foo](#foo)
schema class | -| static class | [OneofComplexTypes.Schema0Boxed](#schema0boxed)
abstract sealed validated payload class | -| static class | [OneofComplexTypes.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | -| static class | [OneofComplexTypes.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | -| static class | [OneofComplexTypes.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | -| static class | [OneofComplexTypes.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | -| static class | [OneofComplexTypes.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | -| static class | [OneofComplexTypes.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [OneofComplexTypes.Schema0Boxed](#schema0boxed)
sealed interface for validated payloads | +| record | [OneofComplexTypes.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | +| record | [OneofComplexTypes.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | +| record | [OneofComplexTypes.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | +| record | [OneofComplexTypes.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | +| record | [OneofComplexTypes.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | +| record | [OneofComplexTypes.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | | static class | [OneofComplexTypes.Schema0](#schema0)
schema class | | static class | [OneofComplexTypes.Schema0MapBuilder](#schema0mapbuilder)
builder for Map payloads | | static class | [OneofComplexTypes.Schema0Map](#schema0map)
output class for Map payloads | -| static class | [OneofComplexTypes.BarBoxed](#barboxed)
abstract sealed validated payload class | -| static class | [OneofComplexTypes.BarBoxedNumber](#barboxednumber)
boxed class to store validated Number payloads | +| sealed interface | [OneofComplexTypes.BarBoxed](#barboxed)
sealed interface for validated payloads | +| record | [OneofComplexTypes.BarBoxedNumber](#barboxednumber)
boxed class to store validated Number payloads | | static class | [OneofComplexTypes.Bar](#bar)
schema class | ## OneofComplexTypes1Boxed -public static abstract sealed class OneofComplexTypes1Boxed
+public sealed interface OneofComplexTypes1Boxed
permits
[OneofComplexTypes1BoxedVoid](#oneofcomplextypes1boxedvoid), [OneofComplexTypes1BoxedBoolean](#oneofcomplextypes1boxedboolean), @@ -57,103 +57,109 @@ permits
[OneofComplexTypes1BoxedList](#oneofcomplextypes1boxedlist), [OneofComplexTypes1BoxedMap](#oneofcomplextypes1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## OneofComplexTypes1BoxedVoid -public static final class OneofComplexTypes1BoxedVoid
-extends [OneofComplexTypes1Boxed](#oneofcomplextypes1boxed) +public record OneofComplexTypes1BoxedVoid
+implements [OneofComplexTypes1Boxed](#oneofcomplextypes1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | OneofComplexTypes1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## OneofComplexTypes1BoxedBoolean -public static final class OneofComplexTypes1BoxedBoolean
-extends [OneofComplexTypes1Boxed](#oneofcomplextypes1boxed) +public record OneofComplexTypes1BoxedBoolean
+implements [OneofComplexTypes1Boxed](#oneofcomplextypes1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | OneofComplexTypes1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## OneofComplexTypes1BoxedNumber -public static final class OneofComplexTypes1BoxedNumber
-extends [OneofComplexTypes1Boxed](#oneofcomplextypes1boxed) +public record OneofComplexTypes1BoxedNumber
+implements [OneofComplexTypes1Boxed](#oneofcomplextypes1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | OneofComplexTypes1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## OneofComplexTypes1BoxedString -public static final class OneofComplexTypes1BoxedString
-extends [OneofComplexTypes1Boxed](#oneofcomplextypes1boxed) +public record OneofComplexTypes1BoxedString
+implements [OneofComplexTypes1Boxed](#oneofcomplextypes1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | OneofComplexTypes1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## OneofComplexTypes1BoxedList -public static final class OneofComplexTypes1BoxedList
-extends [OneofComplexTypes1Boxed](#oneofcomplextypes1boxed) +public record OneofComplexTypes1BoxedList
+implements [OneofComplexTypes1Boxed](#oneofcomplextypes1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | OneofComplexTypes1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## OneofComplexTypes1BoxedMap -public static final class OneofComplexTypes1BoxedMap
-extends [OneofComplexTypes1Boxed](#oneofcomplextypes1boxed) +public record OneofComplexTypes1BoxedMap
+implements [OneofComplexTypes1Boxed](#oneofcomplextypes1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | OneofComplexTypes1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## OneofComplexTypes1 public static class OneofComplexTypes1
@@ -185,9 +191,11 @@ A schema class that validates payloads | [OneofComplexTypes1BoxedBoolean](#oneofcomplextypes1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [OneofComplexTypes1BoxedMap](#oneofcomplextypes1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [OneofComplexTypes1BoxedList](#oneofcomplextypes1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [OneofComplexTypes1Boxed](#oneofcomplextypes1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema1Boxed -public static abstract sealed class Schema1Boxed
+public sealed interface Schema1Boxed
permits
[Schema1BoxedVoid](#schema1boxedvoid), [Schema1BoxedBoolean](#schema1boxedboolean), @@ -196,103 +204,109 @@ permits
[Schema1BoxedList](#schema1boxedlist), [Schema1BoxedMap](#schema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema1BoxedVoid -public static final class Schema1BoxedVoid
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedVoid
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedBoolean -public static final class Schema1BoxedBoolean
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedBoolean
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedNumber -public static final class Schema1BoxedNumber
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedNumber
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedString -public static final class Schema1BoxedString
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedString
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedList -public static final class Schema1BoxedList
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedList
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedMap -public static final class Schema1BoxedMap
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedMap
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedMap([Schema1Map](#schema1map) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [Schema1Map](#schema1map) | data
validated payload | +| [Schema1Map](#schema1map) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1 public static class Schema1
@@ -325,7 +339,9 @@ A schema class that validates payloads | [Schema1BoxedBoolean](#schema1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Schema1BoxedMap](#schema1boxedmap) | validateAndBox([Map<?, ?>](#schema1mapbuilder) arg, SchemaConfiguration configuration) | | [Schema1BoxedList](#schema1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Schema1Boxed](#schema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema1Map0Builder public class Schema1Map0Builder
builder for `Map` @@ -381,27 +397,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## FooBoxed -public static abstract sealed class FooBoxed
+public sealed interface FooBoxed
permits
[FooBoxedString](#fooboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## FooBoxedString -public static final class FooBoxedString
-extends [FooBoxed](#fooboxed) +public record FooBoxedString
+implements [FooBoxed](#fooboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Foo public static class Foo
@@ -415,7 +432,7 @@ A schema class that validates payloads | validateAndBox | ## Schema0Boxed -public static abstract sealed class Schema0Boxed
+public sealed interface Schema0Boxed
permits
[Schema0BoxedVoid](#schema0boxedvoid), [Schema0BoxedBoolean](#schema0boxedboolean), @@ -424,103 +441,109 @@ permits
[Schema0BoxedList](#schema0boxedlist), [Schema0BoxedMap](#schema0boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema0BoxedVoid -public static final class Schema0BoxedVoid
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedVoid
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedBoolean -public static final class Schema0BoxedBoolean
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedBoolean
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedNumber -public static final class Schema0BoxedNumber
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedNumber
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedString -public static final class Schema0BoxedString
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedString
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedList -public static final class Schema0BoxedList
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedList
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedMap -public static final class Schema0BoxedMap
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedMap
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedMap([Schema0Map](#schema0map) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [Schema0Map](#schema0map) | data
validated payload | +| [Schema0Map](#schema0map) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0 public static class Schema0
@@ -553,7 +576,9 @@ A schema class that validates payloads | [Schema0BoxedBoolean](#schema0boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Schema0BoxedMap](#schema0boxedmap) | validateAndBox([Map<?, ?>](#schema0mapbuilder) arg, SchemaConfiguration configuration) | | [Schema0BoxedList](#schema0boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Schema0Boxed](#schema0boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema0Map0Builder public class Schema0Map0Builder
builder for `Map` @@ -612,27 +637,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## BarBoxed -public static abstract sealed class BarBoxed
+public sealed interface BarBoxed
permits
[BarBoxedNumber](#barboxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## BarBoxedNumber -public static final class BarBoxedNumber
-extends [BarBoxed](#barboxed) +public record BarBoxedNumber
+implements [BarBoxed](#barboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BarBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Bar public static class Bar
diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/OneofWithBaseSchema.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/OneofWithBaseSchema.md index f122b9e0462..176ea9e3a54 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/OneofWithBaseSchema.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/OneofWithBaseSchema.md @@ -4,54 +4,55 @@ public class OneofWithBaseSchema
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [OneofWithBaseSchema.OneofWithBaseSchema1Boxed](#oneofwithbaseschema1boxed)
abstract sealed validated payload class | -| static class | [OneofWithBaseSchema.OneofWithBaseSchema1BoxedString](#oneofwithbaseschema1boxedstring)
boxed class to store validated String payloads | +| sealed interface | [OneofWithBaseSchema.OneofWithBaseSchema1Boxed](#oneofwithbaseschema1boxed)
sealed interface for validated payloads | +| record | [OneofWithBaseSchema.OneofWithBaseSchema1BoxedString](#oneofwithbaseschema1boxedstring)
boxed class to store validated String payloads | | static class | [OneofWithBaseSchema.OneofWithBaseSchema1](#oneofwithbaseschema1)
schema class | -| static class | [OneofWithBaseSchema.Schema1Boxed](#schema1boxed)
abstract sealed validated payload class | -| static class | [OneofWithBaseSchema.Schema1BoxedVoid](#schema1boxedvoid)
boxed class to store validated null payloads | -| static class | [OneofWithBaseSchema.Schema1BoxedBoolean](#schema1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [OneofWithBaseSchema.Schema1BoxedNumber](#schema1boxednumber)
boxed class to store validated Number payloads | -| static class | [OneofWithBaseSchema.Schema1BoxedString](#schema1boxedstring)
boxed class to store validated String payloads | -| static class | [OneofWithBaseSchema.Schema1BoxedList](#schema1boxedlist)
boxed class to store validated List payloads | -| static class | [OneofWithBaseSchema.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [OneofWithBaseSchema.Schema1Boxed](#schema1boxed)
sealed interface for validated payloads | +| record | [OneofWithBaseSchema.Schema1BoxedVoid](#schema1boxedvoid)
boxed class to store validated null payloads | +| record | [OneofWithBaseSchema.Schema1BoxedBoolean](#schema1boxedboolean)
boxed class to store validated boolean payloads | +| record | [OneofWithBaseSchema.Schema1BoxedNumber](#schema1boxednumber)
boxed class to store validated Number payloads | +| record | [OneofWithBaseSchema.Schema1BoxedString](#schema1boxedstring)
boxed class to store validated String payloads | +| record | [OneofWithBaseSchema.Schema1BoxedList](#schema1boxedlist)
boxed class to store validated List payloads | +| record | [OneofWithBaseSchema.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | | static class | [OneofWithBaseSchema.Schema1](#schema1)
schema class | -| static class | [OneofWithBaseSchema.Schema0Boxed](#schema0boxed)
abstract sealed validated payload class | -| static class | [OneofWithBaseSchema.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | -| static class | [OneofWithBaseSchema.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | -| static class | [OneofWithBaseSchema.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | -| static class | [OneofWithBaseSchema.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | -| static class | [OneofWithBaseSchema.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | -| static class | [OneofWithBaseSchema.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [OneofWithBaseSchema.Schema0Boxed](#schema0boxed)
sealed interface for validated payloads | +| record | [OneofWithBaseSchema.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | +| record | [OneofWithBaseSchema.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | +| record | [OneofWithBaseSchema.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | +| record | [OneofWithBaseSchema.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | +| record | [OneofWithBaseSchema.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | +| record | [OneofWithBaseSchema.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | | static class | [OneofWithBaseSchema.Schema0](#schema0)
schema class | ## OneofWithBaseSchema1Boxed -public static abstract sealed class OneofWithBaseSchema1Boxed
+public sealed interface OneofWithBaseSchema1Boxed
permits
[OneofWithBaseSchema1BoxedString](#oneofwithbaseschema1boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## OneofWithBaseSchema1BoxedString -public static final class OneofWithBaseSchema1BoxedString
-extends [OneofWithBaseSchema1Boxed](#oneofwithbaseschema1boxed) +public record OneofWithBaseSchema1BoxedString
+implements [OneofWithBaseSchema1Boxed](#oneofwithbaseschema1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | OneofWithBaseSchema1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## OneofWithBaseSchema1 public static class OneofWithBaseSchema1
@@ -92,9 +93,11 @@ String validatedPayload = OneofWithBaseSchema.OneofWithBaseSchema1.validate( | ----------------- | ---------------------- | | String | validate(String arg, SchemaConfiguration configuration) | | [OneofWithBaseSchema1BoxedString](#oneofwithbaseschema1boxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [OneofWithBaseSchema1Boxed](#oneofwithbaseschema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema1Boxed -public static abstract sealed class Schema1Boxed
+public sealed interface Schema1Boxed
permits
[Schema1BoxedVoid](#schema1boxedvoid), [Schema1BoxedBoolean](#schema1boxedboolean), @@ -103,103 +106,109 @@ permits
[Schema1BoxedList](#schema1boxedlist), [Schema1BoxedMap](#schema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema1BoxedVoid -public static final class Schema1BoxedVoid
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedVoid
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedBoolean -public static final class Schema1BoxedBoolean
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedBoolean
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedNumber -public static final class Schema1BoxedNumber
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedNumber
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedString -public static final class Schema1BoxedString
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedString
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedList -public static final class Schema1BoxedList
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedList
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedMap -public static final class Schema1BoxedMap
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedMap
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1 public static class Schema1
@@ -231,9 +240,11 @@ A schema class that validates payloads | [Schema1BoxedBoolean](#schema1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Schema1BoxedMap](#schema1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [Schema1BoxedList](#schema1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Schema1Boxed](#schema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema0Boxed -public static abstract sealed class Schema0Boxed
+public sealed interface Schema0Boxed
permits
[Schema0BoxedVoid](#schema0boxedvoid), [Schema0BoxedBoolean](#schema0boxedboolean), @@ -242,103 +253,109 @@ permits
[Schema0BoxedList](#schema0boxedlist), [Schema0BoxedMap](#schema0boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema0BoxedVoid -public static final class Schema0BoxedVoid
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedVoid
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedBoolean -public static final class Schema0BoxedBoolean
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedBoolean
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedNumber -public static final class Schema0BoxedNumber
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedNumber
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedString -public static final class Schema0BoxedString
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedString
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedList -public static final class Schema0BoxedList
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedList
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedMap -public static final class Schema0BoxedMap
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedMap
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0 public static class Schema0
@@ -370,5 +387,7 @@ A schema class that validates payloads | [Schema0BoxedBoolean](#schema0boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Schema0BoxedMap](#schema0boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [Schema0BoxedList](#schema0boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Schema0Boxed](#schema0boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/OneofWithEmptySchema.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/OneofWithEmptySchema.md index 9129b14859b..a3b4f2933cb 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/OneofWithEmptySchema.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/OneofWithEmptySchema.md @@ -4,34 +4,34 @@ public class OneofWithEmptySchema
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [OneofWithEmptySchema.OneofWithEmptySchema1Boxed](#oneofwithemptyschema1boxed)
abstract sealed validated payload class | -| static class | [OneofWithEmptySchema.OneofWithEmptySchema1BoxedVoid](#oneofwithemptyschema1boxedvoid)
boxed class to store validated null payloads | -| static class | [OneofWithEmptySchema.OneofWithEmptySchema1BoxedBoolean](#oneofwithemptyschema1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [OneofWithEmptySchema.OneofWithEmptySchema1BoxedNumber](#oneofwithemptyschema1boxednumber)
boxed class to store validated Number payloads | -| static class | [OneofWithEmptySchema.OneofWithEmptySchema1BoxedString](#oneofwithemptyschema1boxedstring)
boxed class to store validated String payloads | -| static class | [OneofWithEmptySchema.OneofWithEmptySchema1BoxedList](#oneofwithemptyschema1boxedlist)
boxed class to store validated List payloads | -| static class | [OneofWithEmptySchema.OneofWithEmptySchema1BoxedMap](#oneofwithemptyschema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [OneofWithEmptySchema.OneofWithEmptySchema1Boxed](#oneofwithemptyschema1boxed)
sealed interface for validated payloads | +| record | [OneofWithEmptySchema.OneofWithEmptySchema1BoxedVoid](#oneofwithemptyschema1boxedvoid)
boxed class to store validated null payloads | +| record | [OneofWithEmptySchema.OneofWithEmptySchema1BoxedBoolean](#oneofwithemptyschema1boxedboolean)
boxed class to store validated boolean payloads | +| record | [OneofWithEmptySchema.OneofWithEmptySchema1BoxedNumber](#oneofwithemptyschema1boxednumber)
boxed class to store validated Number payloads | +| record | [OneofWithEmptySchema.OneofWithEmptySchema1BoxedString](#oneofwithemptyschema1boxedstring)
boxed class to store validated String payloads | +| record | [OneofWithEmptySchema.OneofWithEmptySchema1BoxedList](#oneofwithemptyschema1boxedlist)
boxed class to store validated List payloads | +| record | [OneofWithEmptySchema.OneofWithEmptySchema1BoxedMap](#oneofwithemptyschema1boxedmap)
boxed class to store validated Map payloads | | static class | [OneofWithEmptySchema.OneofWithEmptySchema1](#oneofwithemptyschema1)
schema class | -| static class | [OneofWithEmptySchema.Schema1Boxed](#schema1boxed)
abstract sealed validated payload class | -| static class | [OneofWithEmptySchema.Schema1BoxedVoid](#schema1boxedvoid)
boxed class to store validated null payloads | -| static class | [OneofWithEmptySchema.Schema1BoxedBoolean](#schema1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [OneofWithEmptySchema.Schema1BoxedNumber](#schema1boxednumber)
boxed class to store validated Number payloads | -| static class | [OneofWithEmptySchema.Schema1BoxedString](#schema1boxedstring)
boxed class to store validated String payloads | -| static class | [OneofWithEmptySchema.Schema1BoxedList](#schema1boxedlist)
boxed class to store validated List payloads | -| static class | [OneofWithEmptySchema.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [OneofWithEmptySchema.Schema1Boxed](#schema1boxed)
sealed interface for validated payloads | +| record | [OneofWithEmptySchema.Schema1BoxedVoid](#schema1boxedvoid)
boxed class to store validated null payloads | +| record | [OneofWithEmptySchema.Schema1BoxedBoolean](#schema1boxedboolean)
boxed class to store validated boolean payloads | +| record | [OneofWithEmptySchema.Schema1BoxedNumber](#schema1boxednumber)
boxed class to store validated Number payloads | +| record | [OneofWithEmptySchema.Schema1BoxedString](#schema1boxedstring)
boxed class to store validated String payloads | +| record | [OneofWithEmptySchema.Schema1BoxedList](#schema1boxedlist)
boxed class to store validated List payloads | +| record | [OneofWithEmptySchema.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | | static class | [OneofWithEmptySchema.Schema1](#schema1)
schema class | -| static class | [OneofWithEmptySchema.Schema0Boxed](#schema0boxed)
abstract sealed validated payload class | -| static class | [OneofWithEmptySchema.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | +| sealed interface | [OneofWithEmptySchema.Schema0Boxed](#schema0boxed)
sealed interface for validated payloads | +| record | [OneofWithEmptySchema.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | | static class | [OneofWithEmptySchema.Schema0](#schema0)
schema class | ## OneofWithEmptySchema1Boxed -public static abstract sealed class OneofWithEmptySchema1Boxed
+public sealed interface OneofWithEmptySchema1Boxed
permits
[OneofWithEmptySchema1BoxedVoid](#oneofwithemptyschema1boxedvoid), [OneofWithEmptySchema1BoxedBoolean](#oneofwithemptyschema1boxedboolean), @@ -40,103 +40,109 @@ permits
[OneofWithEmptySchema1BoxedList](#oneofwithemptyschema1boxedlist), [OneofWithEmptySchema1BoxedMap](#oneofwithemptyschema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## OneofWithEmptySchema1BoxedVoid -public static final class OneofWithEmptySchema1BoxedVoid
-extends [OneofWithEmptySchema1Boxed](#oneofwithemptyschema1boxed) +public record OneofWithEmptySchema1BoxedVoid
+implements [OneofWithEmptySchema1Boxed](#oneofwithemptyschema1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | OneofWithEmptySchema1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## OneofWithEmptySchema1BoxedBoolean -public static final class OneofWithEmptySchema1BoxedBoolean
-extends [OneofWithEmptySchema1Boxed](#oneofwithemptyschema1boxed) +public record OneofWithEmptySchema1BoxedBoolean
+implements [OneofWithEmptySchema1Boxed](#oneofwithemptyschema1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | OneofWithEmptySchema1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## OneofWithEmptySchema1BoxedNumber -public static final class OneofWithEmptySchema1BoxedNumber
-extends [OneofWithEmptySchema1Boxed](#oneofwithemptyschema1boxed) +public record OneofWithEmptySchema1BoxedNumber
+implements [OneofWithEmptySchema1Boxed](#oneofwithemptyschema1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | OneofWithEmptySchema1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## OneofWithEmptySchema1BoxedString -public static final class OneofWithEmptySchema1BoxedString
-extends [OneofWithEmptySchema1Boxed](#oneofwithemptyschema1boxed) +public record OneofWithEmptySchema1BoxedString
+implements [OneofWithEmptySchema1Boxed](#oneofwithemptyschema1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | OneofWithEmptySchema1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## OneofWithEmptySchema1BoxedList -public static final class OneofWithEmptySchema1BoxedList
-extends [OneofWithEmptySchema1Boxed](#oneofwithemptyschema1boxed) +public record OneofWithEmptySchema1BoxedList
+implements [OneofWithEmptySchema1Boxed](#oneofwithemptyschema1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | OneofWithEmptySchema1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## OneofWithEmptySchema1BoxedMap -public static final class OneofWithEmptySchema1BoxedMap
-extends [OneofWithEmptySchema1Boxed](#oneofwithemptyschema1boxed) +public record OneofWithEmptySchema1BoxedMap
+implements [OneofWithEmptySchema1Boxed](#oneofwithemptyschema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | OneofWithEmptySchema1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## OneofWithEmptySchema1 public static class OneofWithEmptySchema1
@@ -168,9 +174,11 @@ A schema class that validates payloads | [OneofWithEmptySchema1BoxedBoolean](#oneofwithemptyschema1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [OneofWithEmptySchema1BoxedMap](#oneofwithemptyschema1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [OneofWithEmptySchema1BoxedList](#oneofwithemptyschema1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [OneofWithEmptySchema1Boxed](#oneofwithemptyschema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema1Boxed -public static abstract sealed class Schema1Boxed
+public sealed interface Schema1Boxed
permits
[Schema1BoxedVoid](#schema1boxedvoid), [Schema1BoxedBoolean](#schema1boxedboolean), @@ -179,103 +187,109 @@ permits
[Schema1BoxedList](#schema1boxedlist), [Schema1BoxedMap](#schema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema1BoxedVoid -public static final class Schema1BoxedVoid
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedVoid
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedBoolean -public static final class Schema1BoxedBoolean
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedBoolean
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedNumber -public static final class Schema1BoxedNumber
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedNumber
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedString -public static final class Schema1BoxedString
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedString
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedList -public static final class Schema1BoxedList
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedList
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedMap -public static final class Schema1BoxedMap
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedMap
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1 public static class Schema1
@@ -289,27 +303,28 @@ A schema class that validates payloads | validateAndBox | ## Schema0Boxed -public static abstract sealed class Schema0Boxed
+public sealed interface Schema0Boxed
permits
[Schema0BoxedNumber](#schema0boxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema0BoxedNumber -public static final class Schema0BoxedNumber
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedNumber
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0 public static class Schema0
diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/OneofWithRequired.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/OneofWithRequired.md index 78f1deb2646..b5daaad8023 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/OneofWithRequired.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/OneofWithRequired.md @@ -4,7 +4,7 @@ public class OneofWithRequired
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,52 +12,53 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [OneofWithRequired.OneofWithRequired1Boxed](#oneofwithrequired1boxed)
abstract sealed validated payload class | -| static class | [OneofWithRequired.OneofWithRequired1BoxedMap](#oneofwithrequired1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [OneofWithRequired.OneofWithRequired1Boxed](#oneofwithrequired1boxed)
sealed interface for validated payloads | +| record | [OneofWithRequired.OneofWithRequired1BoxedMap](#oneofwithrequired1boxedmap)
boxed class to store validated Map payloads | | static class | [OneofWithRequired.OneofWithRequired1](#oneofwithrequired1)
schema class | -| static class | [OneofWithRequired.Schema1Boxed](#schema1boxed)
abstract sealed validated payload class | -| static class | [OneofWithRequired.Schema1BoxedVoid](#schema1boxedvoid)
boxed class to store validated null payloads | -| static class | [OneofWithRequired.Schema1BoxedBoolean](#schema1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [OneofWithRequired.Schema1BoxedNumber](#schema1boxednumber)
boxed class to store validated Number payloads | -| static class | [OneofWithRequired.Schema1BoxedString](#schema1boxedstring)
boxed class to store validated String payloads | -| static class | [OneofWithRequired.Schema1BoxedList](#schema1boxedlist)
boxed class to store validated List payloads | -| static class | [OneofWithRequired.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [OneofWithRequired.Schema1Boxed](#schema1boxed)
sealed interface for validated payloads | +| record | [OneofWithRequired.Schema1BoxedVoid](#schema1boxedvoid)
boxed class to store validated null payloads | +| record | [OneofWithRequired.Schema1BoxedBoolean](#schema1boxedboolean)
boxed class to store validated boolean payloads | +| record | [OneofWithRequired.Schema1BoxedNumber](#schema1boxednumber)
boxed class to store validated Number payloads | +| record | [OneofWithRequired.Schema1BoxedString](#schema1boxedstring)
boxed class to store validated String payloads | +| record | [OneofWithRequired.Schema1BoxedList](#schema1boxedlist)
boxed class to store validated List payloads | +| record | [OneofWithRequired.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | | static class | [OneofWithRequired.Schema1](#schema1)
schema class | | static class | [OneofWithRequired.Schema1MapBuilder](#schema1mapbuilder)
builder for Map payloads | | static class | [OneofWithRequired.Schema1Map](#schema1map)
output class for Map payloads | -| static class | [OneofWithRequired.Schema0Boxed](#schema0boxed)
abstract sealed validated payload class | -| static class | [OneofWithRequired.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | -| static class | [OneofWithRequired.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | -| static class | [OneofWithRequired.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | -| static class | [OneofWithRequired.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | -| static class | [OneofWithRequired.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | -| static class | [OneofWithRequired.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [OneofWithRequired.Schema0Boxed](#schema0boxed)
sealed interface for validated payloads | +| record | [OneofWithRequired.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | +| record | [OneofWithRequired.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | +| record | [OneofWithRequired.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | +| record | [OneofWithRequired.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | +| record | [OneofWithRequired.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | +| record | [OneofWithRequired.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | | static class | [OneofWithRequired.Schema0](#schema0)
schema class | | static class | [OneofWithRequired.Schema0MapBuilder](#schema0mapbuilder)
builder for Map payloads | | static class | [OneofWithRequired.Schema0Map](#schema0map)
output class for Map payloads | ## OneofWithRequired1Boxed -public static abstract sealed class OneofWithRequired1Boxed
+public sealed interface OneofWithRequired1Boxed
permits
[OneofWithRequired1BoxedMap](#oneofwithrequired1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## OneofWithRequired1BoxedMap -public static final class OneofWithRequired1BoxedMap
-extends [OneofWithRequired1Boxed](#oneofwithrequired1boxed) +public record OneofWithRequired1BoxedMap
+implements [OneofWithRequired1Boxed](#oneofwithrequired1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | OneofWithRequired1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## OneofWithRequired1 public static class OneofWithRequired1
@@ -76,9 +77,11 @@ A schema class that validates payloads | ----------------- | ---------------------- | | FrozenMap | validate(Map<?, ?> arg, SchemaConfiguration configuration) | | [OneofWithRequired1BoxedMap](#oneofwithrequired1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | +| [OneofWithRequired1Boxed](#oneofwithrequired1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema1Boxed -public static abstract sealed class Schema1Boxed
+public sealed interface Schema1Boxed
permits
[Schema1BoxedVoid](#schema1boxedvoid), [Schema1BoxedBoolean](#schema1boxedboolean), @@ -87,103 +90,109 @@ permits
[Schema1BoxedList](#schema1boxedlist), [Schema1BoxedMap](#schema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema1BoxedVoid -public static final class Schema1BoxedVoid
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedVoid
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedBoolean -public static final class Schema1BoxedBoolean
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedBoolean
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedNumber -public static final class Schema1BoxedNumber
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedNumber
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedString -public static final class Schema1BoxedString
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedString
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedList -public static final class Schema1BoxedList
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedList
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedMap -public static final class Schema1BoxedMap
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedMap
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedMap([Schema1Map](#schema1map) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [Schema1Map](#schema1map) | data
validated payload | +| [Schema1Map](#schema1map) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1 public static class Schema1
@@ -215,7 +224,9 @@ A schema class that validates payloads | [Schema1BoxedBoolean](#schema1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Schema1BoxedMap](#schema1boxedmap) | validateAndBox([Map<?, ?>](#schema1mapbuilder) arg, SchemaConfiguration configuration) | | [Schema1BoxedList](#schema1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Schema1Boxed](#schema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema1Map00Builder public class Schema1Map00Builder
builder for `Map` @@ -337,7 +348,7 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## Schema0Boxed -public static abstract sealed class Schema0Boxed
+public sealed interface Schema0Boxed
permits
[Schema0BoxedVoid](#schema0boxedvoid), [Schema0BoxedBoolean](#schema0boxedboolean), @@ -346,103 +357,109 @@ permits
[Schema0BoxedList](#schema0boxedlist), [Schema0BoxedMap](#schema0boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema0BoxedVoid -public static final class Schema0BoxedVoid
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedVoid
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedBoolean -public static final class Schema0BoxedBoolean
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedBoolean
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedNumber -public static final class Schema0BoxedNumber
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedNumber
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedString -public static final class Schema0BoxedString
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedString
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedList -public static final class Schema0BoxedList
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedList
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedMap -public static final class Schema0BoxedMap
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedMap
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedMap([Schema0Map](#schema0map) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [Schema0Map](#schema0map) | data
validated payload | +| [Schema0Map](#schema0map) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0 public static class Schema0
@@ -474,7 +491,9 @@ A schema class that validates payloads | [Schema0BoxedBoolean](#schema0boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Schema0BoxedMap](#schema0boxedmap) | validateAndBox([Map<?, ?>](#schema0mapbuilder) arg, SchemaConfiguration configuration) | | [Schema0BoxedList](#schema0boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Schema0Boxed](#schema0boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema0Map00Builder public class Schema0Map00Builder
builder for `Map` diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/PatternIsNotAnchored.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/PatternIsNotAnchored.md index 09b6b5b6cc3..15a76dd0a5d 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/PatternIsNotAnchored.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/PatternIsNotAnchored.md @@ -4,23 +4,23 @@ public class PatternIsNotAnchored
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [PatternIsNotAnchored.PatternIsNotAnchored1Boxed](#patternisnotanchored1boxed)
abstract sealed validated payload class | -| static class | [PatternIsNotAnchored.PatternIsNotAnchored1BoxedVoid](#patternisnotanchored1boxedvoid)
boxed class to store validated null payloads | -| static class | [PatternIsNotAnchored.PatternIsNotAnchored1BoxedBoolean](#patternisnotanchored1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [PatternIsNotAnchored.PatternIsNotAnchored1BoxedNumber](#patternisnotanchored1boxednumber)
boxed class to store validated Number payloads | -| static class | [PatternIsNotAnchored.PatternIsNotAnchored1BoxedString](#patternisnotanchored1boxedstring)
boxed class to store validated String payloads | -| static class | [PatternIsNotAnchored.PatternIsNotAnchored1BoxedList](#patternisnotanchored1boxedlist)
boxed class to store validated List payloads | -| static class | [PatternIsNotAnchored.PatternIsNotAnchored1BoxedMap](#patternisnotanchored1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [PatternIsNotAnchored.PatternIsNotAnchored1Boxed](#patternisnotanchored1boxed)
sealed interface for validated payloads | +| record | [PatternIsNotAnchored.PatternIsNotAnchored1BoxedVoid](#patternisnotanchored1boxedvoid)
boxed class to store validated null payloads | +| record | [PatternIsNotAnchored.PatternIsNotAnchored1BoxedBoolean](#patternisnotanchored1boxedboolean)
boxed class to store validated boolean payloads | +| record | [PatternIsNotAnchored.PatternIsNotAnchored1BoxedNumber](#patternisnotanchored1boxednumber)
boxed class to store validated Number payloads | +| record | [PatternIsNotAnchored.PatternIsNotAnchored1BoxedString](#patternisnotanchored1boxedstring)
boxed class to store validated String payloads | +| record | [PatternIsNotAnchored.PatternIsNotAnchored1BoxedList](#patternisnotanchored1boxedlist)
boxed class to store validated List payloads | +| record | [PatternIsNotAnchored.PatternIsNotAnchored1BoxedMap](#patternisnotanchored1boxedmap)
boxed class to store validated Map payloads | | static class | [PatternIsNotAnchored.PatternIsNotAnchored1](#patternisnotanchored1)
schema class | ## PatternIsNotAnchored1Boxed -public static abstract sealed class PatternIsNotAnchored1Boxed
+public sealed interface PatternIsNotAnchored1Boxed
permits
[PatternIsNotAnchored1BoxedVoid](#patternisnotanchored1boxedvoid), [PatternIsNotAnchored1BoxedBoolean](#patternisnotanchored1boxedboolean), @@ -29,103 +29,109 @@ permits
[PatternIsNotAnchored1BoxedList](#patternisnotanchored1boxedlist), [PatternIsNotAnchored1BoxedMap](#patternisnotanchored1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## PatternIsNotAnchored1BoxedVoid -public static final class PatternIsNotAnchored1BoxedVoid
-extends [PatternIsNotAnchored1Boxed](#patternisnotanchored1boxed) +public record PatternIsNotAnchored1BoxedVoid
+implements [PatternIsNotAnchored1Boxed](#patternisnotanchored1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PatternIsNotAnchored1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PatternIsNotAnchored1BoxedBoolean -public static final class PatternIsNotAnchored1BoxedBoolean
-extends [PatternIsNotAnchored1Boxed](#patternisnotanchored1boxed) +public record PatternIsNotAnchored1BoxedBoolean
+implements [PatternIsNotAnchored1Boxed](#patternisnotanchored1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PatternIsNotAnchored1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PatternIsNotAnchored1BoxedNumber -public static final class PatternIsNotAnchored1BoxedNumber
-extends [PatternIsNotAnchored1Boxed](#patternisnotanchored1boxed) +public record PatternIsNotAnchored1BoxedNumber
+implements [PatternIsNotAnchored1Boxed](#patternisnotanchored1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PatternIsNotAnchored1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PatternIsNotAnchored1BoxedString -public static final class PatternIsNotAnchored1BoxedString
-extends [PatternIsNotAnchored1Boxed](#patternisnotanchored1boxed) +public record PatternIsNotAnchored1BoxedString
+implements [PatternIsNotAnchored1Boxed](#patternisnotanchored1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PatternIsNotAnchored1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PatternIsNotAnchored1BoxedList -public static final class PatternIsNotAnchored1BoxedList
-extends [PatternIsNotAnchored1Boxed](#patternisnotanchored1boxed) +public record PatternIsNotAnchored1BoxedList
+implements [PatternIsNotAnchored1Boxed](#patternisnotanchored1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PatternIsNotAnchored1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PatternIsNotAnchored1BoxedMap -public static final class PatternIsNotAnchored1BoxedMap
-extends [PatternIsNotAnchored1Boxed](#patternisnotanchored1boxed) +public record PatternIsNotAnchored1BoxedMap
+implements [PatternIsNotAnchored1Boxed](#patternisnotanchored1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PatternIsNotAnchored1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PatternIsNotAnchored1 public static class PatternIsNotAnchored1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [PatternIsNotAnchored1BoxedBoolean](#patternisnotanchored1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [PatternIsNotAnchored1BoxedMap](#patternisnotanchored1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [PatternIsNotAnchored1BoxedList](#patternisnotanchored1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [PatternIsNotAnchored1Boxed](#patternisnotanchored1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/PatternValidation.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/PatternValidation.md index 7a47b6b1945..ddec1547b2a 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/PatternValidation.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/PatternValidation.md @@ -4,23 +4,23 @@ public class PatternValidation
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [PatternValidation.PatternValidation1Boxed](#patternvalidation1boxed)
abstract sealed validated payload class | -| static class | [PatternValidation.PatternValidation1BoxedVoid](#patternvalidation1boxedvoid)
boxed class to store validated null payloads | -| static class | [PatternValidation.PatternValidation1BoxedBoolean](#patternvalidation1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [PatternValidation.PatternValidation1BoxedNumber](#patternvalidation1boxednumber)
boxed class to store validated Number payloads | -| static class | [PatternValidation.PatternValidation1BoxedString](#patternvalidation1boxedstring)
boxed class to store validated String payloads | -| static class | [PatternValidation.PatternValidation1BoxedList](#patternvalidation1boxedlist)
boxed class to store validated List payloads | -| static class | [PatternValidation.PatternValidation1BoxedMap](#patternvalidation1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [PatternValidation.PatternValidation1Boxed](#patternvalidation1boxed)
sealed interface for validated payloads | +| record | [PatternValidation.PatternValidation1BoxedVoid](#patternvalidation1boxedvoid)
boxed class to store validated null payloads | +| record | [PatternValidation.PatternValidation1BoxedBoolean](#patternvalidation1boxedboolean)
boxed class to store validated boolean payloads | +| record | [PatternValidation.PatternValidation1BoxedNumber](#patternvalidation1boxednumber)
boxed class to store validated Number payloads | +| record | [PatternValidation.PatternValidation1BoxedString](#patternvalidation1boxedstring)
boxed class to store validated String payloads | +| record | [PatternValidation.PatternValidation1BoxedList](#patternvalidation1boxedlist)
boxed class to store validated List payloads | +| record | [PatternValidation.PatternValidation1BoxedMap](#patternvalidation1boxedmap)
boxed class to store validated Map payloads | | static class | [PatternValidation.PatternValidation1](#patternvalidation1)
schema class | ## PatternValidation1Boxed -public static abstract sealed class PatternValidation1Boxed
+public sealed interface PatternValidation1Boxed
permits
[PatternValidation1BoxedVoid](#patternvalidation1boxedvoid), [PatternValidation1BoxedBoolean](#patternvalidation1boxedboolean), @@ -29,103 +29,109 @@ permits
[PatternValidation1BoxedList](#patternvalidation1boxedlist), [PatternValidation1BoxedMap](#patternvalidation1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## PatternValidation1BoxedVoid -public static final class PatternValidation1BoxedVoid
-extends [PatternValidation1Boxed](#patternvalidation1boxed) +public record PatternValidation1BoxedVoid
+implements [PatternValidation1Boxed](#patternvalidation1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PatternValidation1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PatternValidation1BoxedBoolean -public static final class PatternValidation1BoxedBoolean
-extends [PatternValidation1Boxed](#patternvalidation1boxed) +public record PatternValidation1BoxedBoolean
+implements [PatternValidation1Boxed](#patternvalidation1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PatternValidation1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PatternValidation1BoxedNumber -public static final class PatternValidation1BoxedNumber
-extends [PatternValidation1Boxed](#patternvalidation1boxed) +public record PatternValidation1BoxedNumber
+implements [PatternValidation1Boxed](#patternvalidation1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PatternValidation1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PatternValidation1BoxedString -public static final class PatternValidation1BoxedString
-extends [PatternValidation1Boxed](#patternvalidation1boxed) +public record PatternValidation1BoxedString
+implements [PatternValidation1Boxed](#patternvalidation1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PatternValidation1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PatternValidation1BoxedList -public static final class PatternValidation1BoxedList
-extends [PatternValidation1Boxed](#patternvalidation1boxed) +public record PatternValidation1BoxedList
+implements [PatternValidation1Boxed](#patternvalidation1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PatternValidation1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PatternValidation1BoxedMap -public static final class PatternValidation1BoxedMap
-extends [PatternValidation1Boxed](#patternvalidation1boxed) +public record PatternValidation1BoxedMap
+implements [PatternValidation1Boxed](#patternvalidation1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PatternValidation1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PatternValidation1 public static class PatternValidation1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [PatternValidation1BoxedBoolean](#patternvalidation1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [PatternValidation1BoxedMap](#patternvalidation1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [PatternValidation1BoxedList](#patternvalidation1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [PatternValidation1Boxed](#patternvalidation1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/PropertiesWithEscapedCharacters.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/PropertiesWithEscapedCharacters.md index d2af863280c..a34e94b8786 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/PropertiesWithEscapedCharacters.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/PropertiesWithEscapedCharacters.md @@ -4,7 +4,7 @@ public class PropertiesWithEscapedCharacters
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,37 +12,37 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [PropertiesWithEscapedCharacters.PropertiesWithEscapedCharacters1Boxed](#propertieswithescapedcharacters1boxed)
abstract sealed validated payload class | -| static class | [PropertiesWithEscapedCharacters.PropertiesWithEscapedCharacters1BoxedVoid](#propertieswithescapedcharacters1boxedvoid)
boxed class to store validated null payloads | -| static class | [PropertiesWithEscapedCharacters.PropertiesWithEscapedCharacters1BoxedBoolean](#propertieswithescapedcharacters1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [PropertiesWithEscapedCharacters.PropertiesWithEscapedCharacters1BoxedNumber](#propertieswithescapedcharacters1boxednumber)
boxed class to store validated Number payloads | -| static class | [PropertiesWithEscapedCharacters.PropertiesWithEscapedCharacters1BoxedString](#propertieswithescapedcharacters1boxedstring)
boxed class to store validated String payloads | -| static class | [PropertiesWithEscapedCharacters.PropertiesWithEscapedCharacters1BoxedList](#propertieswithescapedcharacters1boxedlist)
boxed class to store validated List payloads | -| static class | [PropertiesWithEscapedCharacters.PropertiesWithEscapedCharacters1BoxedMap](#propertieswithescapedcharacters1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [PropertiesWithEscapedCharacters.PropertiesWithEscapedCharacters1Boxed](#propertieswithescapedcharacters1boxed)
sealed interface for validated payloads | +| record | [PropertiesWithEscapedCharacters.PropertiesWithEscapedCharacters1BoxedVoid](#propertieswithescapedcharacters1boxedvoid)
boxed class to store validated null payloads | +| record | [PropertiesWithEscapedCharacters.PropertiesWithEscapedCharacters1BoxedBoolean](#propertieswithescapedcharacters1boxedboolean)
boxed class to store validated boolean payloads | +| record | [PropertiesWithEscapedCharacters.PropertiesWithEscapedCharacters1BoxedNumber](#propertieswithescapedcharacters1boxednumber)
boxed class to store validated Number payloads | +| record | [PropertiesWithEscapedCharacters.PropertiesWithEscapedCharacters1BoxedString](#propertieswithescapedcharacters1boxedstring)
boxed class to store validated String payloads | +| record | [PropertiesWithEscapedCharacters.PropertiesWithEscapedCharacters1BoxedList](#propertieswithescapedcharacters1boxedlist)
boxed class to store validated List payloads | +| record | [PropertiesWithEscapedCharacters.PropertiesWithEscapedCharacters1BoxedMap](#propertieswithescapedcharacters1boxedmap)
boxed class to store validated Map payloads | | static class | [PropertiesWithEscapedCharacters.PropertiesWithEscapedCharacters1](#propertieswithescapedcharacters1)
schema class | | static class | [PropertiesWithEscapedCharacters.PropertiesWithEscapedCharactersMapBuilder](#propertieswithescapedcharactersmapbuilder)
builder for Map payloads | | static class | [PropertiesWithEscapedCharacters.PropertiesWithEscapedCharactersMap](#propertieswithescapedcharactersmap)
output class for Map payloads | -| static class | [PropertiesWithEscapedCharacters.FoofbarBoxed](#foofbarboxed)
abstract sealed validated payload class | -| static class | [PropertiesWithEscapedCharacters.FoofbarBoxedNumber](#foofbarboxednumber)
boxed class to store validated Number payloads | +| sealed interface | [PropertiesWithEscapedCharacters.FoofbarBoxed](#foofbarboxed)
sealed interface for validated payloads | +| record | [PropertiesWithEscapedCharacters.FoofbarBoxedNumber](#foofbarboxednumber)
boxed class to store validated Number payloads | | static class | [PropertiesWithEscapedCharacters.Foofbar](#foofbar)
schema class | -| static class | [PropertiesWithEscapedCharacters.FootbarBoxed](#footbarboxed)
abstract sealed validated payload class | -| static class | [PropertiesWithEscapedCharacters.FootbarBoxedNumber](#footbarboxednumber)
boxed class to store validated Number payloads | +| sealed interface | [PropertiesWithEscapedCharacters.FootbarBoxed](#footbarboxed)
sealed interface for validated payloads | +| record | [PropertiesWithEscapedCharacters.FootbarBoxedNumber](#footbarboxednumber)
boxed class to store validated Number payloads | | static class | [PropertiesWithEscapedCharacters.Footbar](#footbar)
schema class | -| static class | [PropertiesWithEscapedCharacters.FoorbarBoxed](#foorbarboxed)
abstract sealed validated payload class | -| static class | [PropertiesWithEscapedCharacters.FoorbarBoxedNumber](#foorbarboxednumber)
boxed class to store validated Number payloads | +| sealed interface | [PropertiesWithEscapedCharacters.FoorbarBoxed](#foorbarboxed)
sealed interface for validated payloads | +| record | [PropertiesWithEscapedCharacters.FoorbarBoxedNumber](#foorbarboxednumber)
boxed class to store validated Number payloads | | static class | [PropertiesWithEscapedCharacters.Foorbar](#foorbar)
schema class | -| static class | [PropertiesWithEscapedCharacters.Foobar1Boxed](#foobar1boxed)
abstract sealed validated payload class | -| static class | [PropertiesWithEscapedCharacters.Foobar1BoxedNumber](#foobar1boxednumber)
boxed class to store validated Number payloads | +| sealed interface | [PropertiesWithEscapedCharacters.Foobar1Boxed](#foobar1boxed)
sealed interface for validated payloads | +| record | [PropertiesWithEscapedCharacters.Foobar1BoxedNumber](#foobar1boxednumber)
boxed class to store validated Number payloads | | static class | [PropertiesWithEscapedCharacters.Foobar1](#foobar1)
schema class | -| static class | [PropertiesWithEscapedCharacters.FoobarBoxed](#foobarboxed)
abstract sealed validated payload class | -| static class | [PropertiesWithEscapedCharacters.FoobarBoxedNumber](#foobarboxednumber)
boxed class to store validated Number payloads | +| sealed interface | [PropertiesWithEscapedCharacters.FoobarBoxed](#foobarboxed)
sealed interface for validated payloads | +| record | [PropertiesWithEscapedCharacters.FoobarBoxedNumber](#foobarboxednumber)
boxed class to store validated Number payloads | | static class | [PropertiesWithEscapedCharacters.Foobar](#foobar)
schema class | -| static class | [PropertiesWithEscapedCharacters.FoonbarBoxed](#foonbarboxed)
abstract sealed validated payload class | -| static class | [PropertiesWithEscapedCharacters.FoonbarBoxedNumber](#foonbarboxednumber)
boxed class to store validated Number payloads | +| sealed interface | [PropertiesWithEscapedCharacters.FoonbarBoxed](#foonbarboxed)
sealed interface for validated payloads | +| record | [PropertiesWithEscapedCharacters.FoonbarBoxedNumber](#foonbarboxednumber)
boxed class to store validated Number payloads | | static class | [PropertiesWithEscapedCharacters.Foonbar](#foonbar)
schema class | ## PropertiesWithEscapedCharacters1Boxed -public static abstract sealed class PropertiesWithEscapedCharacters1Boxed
+public sealed interface PropertiesWithEscapedCharacters1Boxed
permits
[PropertiesWithEscapedCharacters1BoxedVoid](#propertieswithescapedcharacters1boxedvoid), [PropertiesWithEscapedCharacters1BoxedBoolean](#propertieswithescapedcharacters1boxedboolean), @@ -51,103 +51,109 @@ permits
[PropertiesWithEscapedCharacters1BoxedList](#propertieswithescapedcharacters1boxedlist), [PropertiesWithEscapedCharacters1BoxedMap](#propertieswithescapedcharacters1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## PropertiesWithEscapedCharacters1BoxedVoid -public static final class PropertiesWithEscapedCharacters1BoxedVoid
-extends [PropertiesWithEscapedCharacters1Boxed](#propertieswithescapedcharacters1boxed) +public record PropertiesWithEscapedCharacters1BoxedVoid
+implements [PropertiesWithEscapedCharacters1Boxed](#propertieswithescapedcharacters1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PropertiesWithEscapedCharacters1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PropertiesWithEscapedCharacters1BoxedBoolean -public static final class PropertiesWithEscapedCharacters1BoxedBoolean
-extends [PropertiesWithEscapedCharacters1Boxed](#propertieswithescapedcharacters1boxed) +public record PropertiesWithEscapedCharacters1BoxedBoolean
+implements [PropertiesWithEscapedCharacters1Boxed](#propertieswithescapedcharacters1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PropertiesWithEscapedCharacters1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PropertiesWithEscapedCharacters1BoxedNumber -public static final class PropertiesWithEscapedCharacters1BoxedNumber
-extends [PropertiesWithEscapedCharacters1Boxed](#propertieswithescapedcharacters1boxed) +public record PropertiesWithEscapedCharacters1BoxedNumber
+implements [PropertiesWithEscapedCharacters1Boxed](#propertieswithescapedcharacters1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PropertiesWithEscapedCharacters1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PropertiesWithEscapedCharacters1BoxedString -public static final class PropertiesWithEscapedCharacters1BoxedString
-extends [PropertiesWithEscapedCharacters1Boxed](#propertieswithescapedcharacters1boxed) +public record PropertiesWithEscapedCharacters1BoxedString
+implements [PropertiesWithEscapedCharacters1Boxed](#propertieswithescapedcharacters1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PropertiesWithEscapedCharacters1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PropertiesWithEscapedCharacters1BoxedList -public static final class PropertiesWithEscapedCharacters1BoxedList
-extends [PropertiesWithEscapedCharacters1Boxed](#propertieswithescapedcharacters1boxed) +public record PropertiesWithEscapedCharacters1BoxedList
+implements [PropertiesWithEscapedCharacters1Boxed](#propertieswithescapedcharacters1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PropertiesWithEscapedCharacters1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PropertiesWithEscapedCharacters1BoxedMap -public static final class PropertiesWithEscapedCharacters1BoxedMap
-extends [PropertiesWithEscapedCharacters1Boxed](#propertieswithescapedcharacters1boxed) +public record PropertiesWithEscapedCharacters1BoxedMap
+implements [PropertiesWithEscapedCharacters1Boxed](#propertieswithescapedcharacters1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PropertiesWithEscapedCharacters1BoxedMap([PropertiesWithEscapedCharactersMap](#propertieswithescapedcharactersmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [PropertiesWithEscapedCharactersMap](#propertieswithescapedcharactersmap) | data
validated payload | +| [PropertiesWithEscapedCharactersMap](#propertieswithescapedcharactersmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PropertiesWithEscapedCharacters1 public static class PropertiesWithEscapedCharacters1
@@ -179,7 +185,9 @@ A schema class that validates payloads | [PropertiesWithEscapedCharacters1BoxedBoolean](#propertieswithescapedcharacters1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [PropertiesWithEscapedCharacters1BoxedMap](#propertieswithescapedcharacters1boxedmap) | validateAndBox([Map<?, ?>](#propertieswithescapedcharactersmapbuilder) arg, SchemaConfiguration configuration) | | [PropertiesWithEscapedCharacters1BoxedList](#propertieswithescapedcharacters1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [PropertiesWithEscapedCharacters1Boxed](#propertieswithescapedcharacters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## PropertiesWithEscapedCharactersMapBuilder public class PropertiesWithEscapedCharactersMapBuilder
builder for `Map` @@ -243,27 +251,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## FoofbarBoxed -public static abstract sealed class FoofbarBoxed
+public sealed interface FoofbarBoxed
permits
[FoofbarBoxedNumber](#foofbarboxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## FoofbarBoxedNumber -public static final class FoofbarBoxedNumber
-extends [FoofbarBoxed](#foofbarboxed) +public record FoofbarBoxedNumber
+implements [FoofbarBoxed](#foofbarboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FoofbarBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Foofbar public static class Foofbar
@@ -277,27 +286,28 @@ A schema class that validates payloads | validateAndBox | ## FootbarBoxed -public static abstract sealed class FootbarBoxed
+public sealed interface FootbarBoxed
permits
[FootbarBoxedNumber](#footbarboxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## FootbarBoxedNumber -public static final class FootbarBoxedNumber
-extends [FootbarBoxed](#footbarboxed) +public record FootbarBoxedNumber
+implements [FootbarBoxed](#footbarboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FootbarBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Footbar public static class Footbar
@@ -311,27 +321,28 @@ A schema class that validates payloads | validateAndBox | ## FoorbarBoxed -public static abstract sealed class FoorbarBoxed
+public sealed interface FoorbarBoxed
permits
[FoorbarBoxedNumber](#foorbarboxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## FoorbarBoxedNumber -public static final class FoorbarBoxedNumber
-extends [FoorbarBoxed](#foorbarboxed) +public record FoorbarBoxedNumber
+implements [FoorbarBoxed](#foorbarboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FoorbarBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Foorbar public static class Foorbar
@@ -345,27 +356,28 @@ A schema class that validates payloads | validateAndBox | ## Foobar1Boxed -public static abstract sealed class Foobar1Boxed
+public sealed interface Foobar1Boxed
permits
[Foobar1BoxedNumber](#foobar1boxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Foobar1BoxedNumber -public static final class Foobar1BoxedNumber
-extends [Foobar1Boxed](#foobar1boxed) +public record Foobar1BoxedNumber
+implements [Foobar1Boxed](#foobar1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Foobar1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Foobar1 public static class Foobar1
@@ -379,27 +391,28 @@ A schema class that validates payloads | validateAndBox | ## FoobarBoxed -public static abstract sealed class FoobarBoxed
+public sealed interface FoobarBoxed
permits
[FoobarBoxedNumber](#foobarboxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## FoobarBoxedNumber -public static final class FoobarBoxedNumber
-extends [FoobarBoxed](#foobarboxed) +public record FoobarBoxedNumber
+implements [FoobarBoxed](#foobarboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FoobarBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Foobar public static class Foobar
@@ -413,27 +426,28 @@ A schema class that validates payloads | validateAndBox | ## FoonbarBoxed -public static abstract sealed class FoonbarBoxed
+public sealed interface FoonbarBoxed
permits
[FoonbarBoxedNumber](#foonbarboxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## FoonbarBoxedNumber -public static final class FoonbarBoxedNumber
-extends [FoonbarBoxed](#foonbarboxed) +public record FoonbarBoxedNumber
+implements [FoonbarBoxed](#foonbarboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FoonbarBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Foonbar public static class Foonbar
diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/PropertyNamedRefThatIsNotAReference.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/PropertyNamedRefThatIsNotAReference.md index 45748c1d470..1d8a12ff4d3 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/PropertyNamedRefThatIsNotAReference.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/PropertyNamedRefThatIsNotAReference.md @@ -4,7 +4,7 @@ public class PropertyNamedRefThatIsNotAReference
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,22 +12,22 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [PropertyNamedRefThatIsNotAReference.PropertyNamedRefThatIsNotAReference1Boxed](#propertynamedrefthatisnotareference1boxed)
abstract sealed validated payload class | -| static class | [PropertyNamedRefThatIsNotAReference.PropertyNamedRefThatIsNotAReference1BoxedVoid](#propertynamedrefthatisnotareference1boxedvoid)
boxed class to store validated null payloads | -| static class | [PropertyNamedRefThatIsNotAReference.PropertyNamedRefThatIsNotAReference1BoxedBoolean](#propertynamedrefthatisnotareference1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [PropertyNamedRefThatIsNotAReference.PropertyNamedRefThatIsNotAReference1BoxedNumber](#propertynamedrefthatisnotareference1boxednumber)
boxed class to store validated Number payloads | -| static class | [PropertyNamedRefThatIsNotAReference.PropertyNamedRefThatIsNotAReference1BoxedString](#propertynamedrefthatisnotareference1boxedstring)
boxed class to store validated String payloads | -| static class | [PropertyNamedRefThatIsNotAReference.PropertyNamedRefThatIsNotAReference1BoxedList](#propertynamedrefthatisnotareference1boxedlist)
boxed class to store validated List payloads | -| static class | [PropertyNamedRefThatIsNotAReference.PropertyNamedRefThatIsNotAReference1BoxedMap](#propertynamedrefthatisnotareference1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [PropertyNamedRefThatIsNotAReference.PropertyNamedRefThatIsNotAReference1Boxed](#propertynamedrefthatisnotareference1boxed)
sealed interface for validated payloads | +| record | [PropertyNamedRefThatIsNotAReference.PropertyNamedRefThatIsNotAReference1BoxedVoid](#propertynamedrefthatisnotareference1boxedvoid)
boxed class to store validated null payloads | +| record | [PropertyNamedRefThatIsNotAReference.PropertyNamedRefThatIsNotAReference1BoxedBoolean](#propertynamedrefthatisnotareference1boxedboolean)
boxed class to store validated boolean payloads | +| record | [PropertyNamedRefThatIsNotAReference.PropertyNamedRefThatIsNotAReference1BoxedNumber](#propertynamedrefthatisnotareference1boxednumber)
boxed class to store validated Number payloads | +| record | [PropertyNamedRefThatIsNotAReference.PropertyNamedRefThatIsNotAReference1BoxedString](#propertynamedrefthatisnotareference1boxedstring)
boxed class to store validated String payloads | +| record | [PropertyNamedRefThatIsNotAReference.PropertyNamedRefThatIsNotAReference1BoxedList](#propertynamedrefthatisnotareference1boxedlist)
boxed class to store validated List payloads | +| record | [PropertyNamedRefThatIsNotAReference.PropertyNamedRefThatIsNotAReference1BoxedMap](#propertynamedrefthatisnotareference1boxedmap)
boxed class to store validated Map payloads | | static class | [PropertyNamedRefThatIsNotAReference.PropertyNamedRefThatIsNotAReference1](#propertynamedrefthatisnotareference1)
schema class | | static class | [PropertyNamedRefThatIsNotAReference.PropertyNamedRefThatIsNotAReferenceMapBuilder](#propertynamedrefthatisnotareferencemapbuilder)
builder for Map payloads | | static class | [PropertyNamedRefThatIsNotAReference.PropertyNamedRefThatIsNotAReferenceMap](#propertynamedrefthatisnotareferencemap)
output class for Map payloads | -| static class | [PropertyNamedRefThatIsNotAReference.RefBoxed](#refboxed)
abstract sealed validated payload class | -| static class | [PropertyNamedRefThatIsNotAReference.RefBoxedString](#refboxedstring)
boxed class to store validated String payloads | +| sealed interface | [PropertyNamedRefThatIsNotAReference.RefBoxed](#refboxed)
sealed interface for validated payloads | +| record | [PropertyNamedRefThatIsNotAReference.RefBoxedString](#refboxedstring)
boxed class to store validated String payloads | | static class | [PropertyNamedRefThatIsNotAReference.Ref](#ref)
schema class | ## PropertyNamedRefThatIsNotAReference1Boxed -public static abstract sealed class PropertyNamedRefThatIsNotAReference1Boxed
+public sealed interface PropertyNamedRefThatIsNotAReference1Boxed
permits
[PropertyNamedRefThatIsNotAReference1BoxedVoid](#propertynamedrefthatisnotareference1boxedvoid), [PropertyNamedRefThatIsNotAReference1BoxedBoolean](#propertynamedrefthatisnotareference1boxedboolean), @@ -36,103 +36,109 @@ permits
[PropertyNamedRefThatIsNotAReference1BoxedList](#propertynamedrefthatisnotareference1boxedlist), [PropertyNamedRefThatIsNotAReference1BoxedMap](#propertynamedrefthatisnotareference1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## PropertyNamedRefThatIsNotAReference1BoxedVoid -public static final class PropertyNamedRefThatIsNotAReference1BoxedVoid
-extends [PropertyNamedRefThatIsNotAReference1Boxed](#propertynamedrefthatisnotareference1boxed) +public record PropertyNamedRefThatIsNotAReference1BoxedVoid
+implements [PropertyNamedRefThatIsNotAReference1Boxed](#propertynamedrefthatisnotareference1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PropertyNamedRefThatIsNotAReference1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PropertyNamedRefThatIsNotAReference1BoxedBoolean -public static final class PropertyNamedRefThatIsNotAReference1BoxedBoolean
-extends [PropertyNamedRefThatIsNotAReference1Boxed](#propertynamedrefthatisnotareference1boxed) +public record PropertyNamedRefThatIsNotAReference1BoxedBoolean
+implements [PropertyNamedRefThatIsNotAReference1Boxed](#propertynamedrefthatisnotareference1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PropertyNamedRefThatIsNotAReference1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PropertyNamedRefThatIsNotAReference1BoxedNumber -public static final class PropertyNamedRefThatIsNotAReference1BoxedNumber
-extends [PropertyNamedRefThatIsNotAReference1Boxed](#propertynamedrefthatisnotareference1boxed) +public record PropertyNamedRefThatIsNotAReference1BoxedNumber
+implements [PropertyNamedRefThatIsNotAReference1Boxed](#propertynamedrefthatisnotareference1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PropertyNamedRefThatIsNotAReference1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PropertyNamedRefThatIsNotAReference1BoxedString -public static final class PropertyNamedRefThatIsNotAReference1BoxedString
-extends [PropertyNamedRefThatIsNotAReference1Boxed](#propertynamedrefthatisnotareference1boxed) +public record PropertyNamedRefThatIsNotAReference1BoxedString
+implements [PropertyNamedRefThatIsNotAReference1Boxed](#propertynamedrefthatisnotareference1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PropertyNamedRefThatIsNotAReference1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PropertyNamedRefThatIsNotAReference1BoxedList -public static final class PropertyNamedRefThatIsNotAReference1BoxedList
-extends [PropertyNamedRefThatIsNotAReference1Boxed](#propertynamedrefthatisnotareference1boxed) +public record PropertyNamedRefThatIsNotAReference1BoxedList
+implements [PropertyNamedRefThatIsNotAReference1Boxed](#propertynamedrefthatisnotareference1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PropertyNamedRefThatIsNotAReference1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PropertyNamedRefThatIsNotAReference1BoxedMap -public static final class PropertyNamedRefThatIsNotAReference1BoxedMap
-extends [PropertyNamedRefThatIsNotAReference1Boxed](#propertynamedrefthatisnotareference1boxed) +public record PropertyNamedRefThatIsNotAReference1BoxedMap
+implements [PropertyNamedRefThatIsNotAReference1Boxed](#propertynamedrefthatisnotareference1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PropertyNamedRefThatIsNotAReference1BoxedMap([PropertyNamedRefThatIsNotAReferenceMap](#propertynamedrefthatisnotareferencemap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [PropertyNamedRefThatIsNotAReferenceMap](#propertynamedrefthatisnotareferencemap) | data
validated payload | +| [PropertyNamedRefThatIsNotAReferenceMap](#propertynamedrefthatisnotareferencemap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PropertyNamedRefThatIsNotAReference1 public static class PropertyNamedRefThatIsNotAReference1
@@ -164,7 +170,9 @@ A schema class that validates payloads | [PropertyNamedRefThatIsNotAReference1BoxedBoolean](#propertynamedrefthatisnotareference1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [PropertyNamedRefThatIsNotAReference1BoxedMap](#propertynamedrefthatisnotareference1boxedmap) | validateAndBox([Map<?, ?>](#propertynamedrefthatisnotareferencemapbuilder) arg, SchemaConfiguration configuration) | | [PropertyNamedRefThatIsNotAReference1BoxedList](#propertynamedrefthatisnotareference1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [PropertyNamedRefThatIsNotAReference1Boxed](#propertynamedrefthatisnotareference1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## PropertyNamedRefThatIsNotAReferenceMapBuilder public class PropertyNamedRefThatIsNotAReferenceMapBuilder
builder for `Map` @@ -205,27 +213,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## RefBoxed -public static abstract sealed class RefBoxed
+public sealed interface RefBoxed
permits
[RefBoxedString](#refboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## RefBoxedString -public static final class RefBoxedString
-extends [RefBoxed](#refboxed) +public record RefBoxedString
+implements [RefBoxed](#refboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RefBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Ref public static class Ref
diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/RefInAdditionalproperties.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/RefInAdditionalproperties.md index 5278c64a077..e64b1886a04 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/RefInAdditionalproperties.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/RefInAdditionalproperties.md @@ -4,7 +4,7 @@ public class RefInAdditionalproperties
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,34 +12,35 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [RefInAdditionalproperties.RefInAdditionalproperties1Boxed](#refinadditionalproperties1boxed)
abstract sealed validated payload class | -| static class | [RefInAdditionalproperties.RefInAdditionalproperties1BoxedMap](#refinadditionalproperties1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [RefInAdditionalproperties.RefInAdditionalproperties1Boxed](#refinadditionalproperties1boxed)
sealed interface for validated payloads | +| record | [RefInAdditionalproperties.RefInAdditionalproperties1BoxedMap](#refinadditionalproperties1boxedmap)
boxed class to store validated Map payloads | | static class | [RefInAdditionalproperties.RefInAdditionalproperties1](#refinadditionalproperties1)
schema class | | static class | [RefInAdditionalproperties.RefInAdditionalpropertiesMapBuilder](#refinadditionalpropertiesmapbuilder)
builder for Map payloads | | static class | [RefInAdditionalproperties.RefInAdditionalpropertiesMap](#refinadditionalpropertiesmap)
output class for Map payloads | ## RefInAdditionalproperties1Boxed -public static abstract sealed class RefInAdditionalproperties1Boxed
+public sealed interface RefInAdditionalproperties1Boxed
permits
[RefInAdditionalproperties1BoxedMap](#refinadditionalproperties1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## RefInAdditionalproperties1BoxedMap -public static final class RefInAdditionalproperties1BoxedMap
-extends [RefInAdditionalproperties1Boxed](#refinadditionalproperties1boxed) +public record RefInAdditionalproperties1BoxedMap
+implements [RefInAdditionalproperties1Boxed](#refinadditionalproperties1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RefInAdditionalproperties1BoxedMap([RefInAdditionalpropertiesMap](#refinadditionalpropertiesmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [RefInAdditionalpropertiesMap](#refinadditionalpropertiesmap) | data
validated payload | +| [RefInAdditionalpropertiesMap](#refinadditionalpropertiesmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RefInAdditionalproperties1 public static class RefInAdditionalproperties1
@@ -82,7 +83,9 @@ RefInAdditionalproperties.RefInAdditionalpropertiesMap validatedPayload = | ----------------- | ---------------------- | | [RefInAdditionalpropertiesMap](#refinadditionalpropertiesmap) | validate([Map<?, ?>](#refinadditionalpropertiesmapbuilder) arg, SchemaConfiguration configuration) | | [RefInAdditionalproperties1BoxedMap](#refinadditionalproperties1boxedmap) | validateAndBox([Map<?, ?>](#refinadditionalpropertiesmapbuilder) arg, SchemaConfiguration configuration) | +| [RefInAdditionalproperties1Boxed](#refinadditionalproperties1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## RefInAdditionalpropertiesMapBuilder public class RefInAdditionalpropertiesMapBuilder
builder for `Map` diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/RefInAllof.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/RefInAllof.md index c4df02cb2e4..7641a2acac4 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/RefInAllof.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/RefInAllof.md @@ -4,23 +4,23 @@ public class RefInAllof
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [RefInAllof.RefInAllof1Boxed](#refinallof1boxed)
abstract sealed validated payload class | -| static class | [RefInAllof.RefInAllof1BoxedVoid](#refinallof1boxedvoid)
boxed class to store validated null payloads | -| static class | [RefInAllof.RefInAllof1BoxedBoolean](#refinallof1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [RefInAllof.RefInAllof1BoxedNumber](#refinallof1boxednumber)
boxed class to store validated Number payloads | -| static class | [RefInAllof.RefInAllof1BoxedString](#refinallof1boxedstring)
boxed class to store validated String payloads | -| static class | [RefInAllof.RefInAllof1BoxedList](#refinallof1boxedlist)
boxed class to store validated List payloads | -| static class | [RefInAllof.RefInAllof1BoxedMap](#refinallof1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [RefInAllof.RefInAllof1Boxed](#refinallof1boxed)
sealed interface for validated payloads | +| record | [RefInAllof.RefInAllof1BoxedVoid](#refinallof1boxedvoid)
boxed class to store validated null payloads | +| record | [RefInAllof.RefInAllof1BoxedBoolean](#refinallof1boxedboolean)
boxed class to store validated boolean payloads | +| record | [RefInAllof.RefInAllof1BoxedNumber](#refinallof1boxednumber)
boxed class to store validated Number payloads | +| record | [RefInAllof.RefInAllof1BoxedString](#refinallof1boxedstring)
boxed class to store validated String payloads | +| record | [RefInAllof.RefInAllof1BoxedList](#refinallof1boxedlist)
boxed class to store validated List payloads | +| record | [RefInAllof.RefInAllof1BoxedMap](#refinallof1boxedmap)
boxed class to store validated Map payloads | | static class | [RefInAllof.RefInAllof1](#refinallof1)
schema class | ## RefInAllof1Boxed -public static abstract sealed class RefInAllof1Boxed
+public sealed interface RefInAllof1Boxed
permits
[RefInAllof1BoxedVoid](#refinallof1boxedvoid), [RefInAllof1BoxedBoolean](#refinallof1boxedboolean), @@ -29,103 +29,109 @@ permits
[RefInAllof1BoxedList](#refinallof1boxedlist), [RefInAllof1BoxedMap](#refinallof1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## RefInAllof1BoxedVoid -public static final class RefInAllof1BoxedVoid
-extends [RefInAllof1Boxed](#refinallof1boxed) +public record RefInAllof1BoxedVoid
+implements [RefInAllof1Boxed](#refinallof1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RefInAllof1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RefInAllof1BoxedBoolean -public static final class RefInAllof1BoxedBoolean
-extends [RefInAllof1Boxed](#refinallof1boxed) +public record RefInAllof1BoxedBoolean
+implements [RefInAllof1Boxed](#refinallof1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RefInAllof1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RefInAllof1BoxedNumber -public static final class RefInAllof1BoxedNumber
-extends [RefInAllof1Boxed](#refinallof1boxed) +public record RefInAllof1BoxedNumber
+implements [RefInAllof1Boxed](#refinallof1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RefInAllof1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RefInAllof1BoxedString -public static final class RefInAllof1BoxedString
-extends [RefInAllof1Boxed](#refinallof1boxed) +public record RefInAllof1BoxedString
+implements [RefInAllof1Boxed](#refinallof1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RefInAllof1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RefInAllof1BoxedList -public static final class RefInAllof1BoxedList
-extends [RefInAllof1Boxed](#refinallof1boxed) +public record RefInAllof1BoxedList
+implements [RefInAllof1Boxed](#refinallof1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RefInAllof1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RefInAllof1BoxedMap -public static final class RefInAllof1BoxedMap
-extends [RefInAllof1Boxed](#refinallof1boxed) +public record RefInAllof1BoxedMap
+implements [RefInAllof1Boxed](#refinallof1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RefInAllof1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RefInAllof1 public static class RefInAllof1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [RefInAllof1BoxedBoolean](#refinallof1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [RefInAllof1BoxedMap](#refinallof1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [RefInAllof1BoxedList](#refinallof1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [RefInAllof1Boxed](#refinallof1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/RefInAnyof.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/RefInAnyof.md index 86e21540d1a..41635be43d4 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/RefInAnyof.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/RefInAnyof.md @@ -4,23 +4,23 @@ public class RefInAnyof
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [RefInAnyof.RefInAnyof1Boxed](#refinanyof1boxed)
abstract sealed validated payload class | -| static class | [RefInAnyof.RefInAnyof1BoxedVoid](#refinanyof1boxedvoid)
boxed class to store validated null payloads | -| static class | [RefInAnyof.RefInAnyof1BoxedBoolean](#refinanyof1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [RefInAnyof.RefInAnyof1BoxedNumber](#refinanyof1boxednumber)
boxed class to store validated Number payloads | -| static class | [RefInAnyof.RefInAnyof1BoxedString](#refinanyof1boxedstring)
boxed class to store validated String payloads | -| static class | [RefInAnyof.RefInAnyof1BoxedList](#refinanyof1boxedlist)
boxed class to store validated List payloads | -| static class | [RefInAnyof.RefInAnyof1BoxedMap](#refinanyof1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [RefInAnyof.RefInAnyof1Boxed](#refinanyof1boxed)
sealed interface for validated payloads | +| record | [RefInAnyof.RefInAnyof1BoxedVoid](#refinanyof1boxedvoid)
boxed class to store validated null payloads | +| record | [RefInAnyof.RefInAnyof1BoxedBoolean](#refinanyof1boxedboolean)
boxed class to store validated boolean payloads | +| record | [RefInAnyof.RefInAnyof1BoxedNumber](#refinanyof1boxednumber)
boxed class to store validated Number payloads | +| record | [RefInAnyof.RefInAnyof1BoxedString](#refinanyof1boxedstring)
boxed class to store validated String payloads | +| record | [RefInAnyof.RefInAnyof1BoxedList](#refinanyof1boxedlist)
boxed class to store validated List payloads | +| record | [RefInAnyof.RefInAnyof1BoxedMap](#refinanyof1boxedmap)
boxed class to store validated Map payloads | | static class | [RefInAnyof.RefInAnyof1](#refinanyof1)
schema class | ## RefInAnyof1Boxed -public static abstract sealed class RefInAnyof1Boxed
+public sealed interface RefInAnyof1Boxed
permits
[RefInAnyof1BoxedVoid](#refinanyof1boxedvoid), [RefInAnyof1BoxedBoolean](#refinanyof1boxedboolean), @@ -29,103 +29,109 @@ permits
[RefInAnyof1BoxedList](#refinanyof1boxedlist), [RefInAnyof1BoxedMap](#refinanyof1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## RefInAnyof1BoxedVoid -public static final class RefInAnyof1BoxedVoid
-extends [RefInAnyof1Boxed](#refinanyof1boxed) +public record RefInAnyof1BoxedVoid
+implements [RefInAnyof1Boxed](#refinanyof1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RefInAnyof1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RefInAnyof1BoxedBoolean -public static final class RefInAnyof1BoxedBoolean
-extends [RefInAnyof1Boxed](#refinanyof1boxed) +public record RefInAnyof1BoxedBoolean
+implements [RefInAnyof1Boxed](#refinanyof1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RefInAnyof1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RefInAnyof1BoxedNumber -public static final class RefInAnyof1BoxedNumber
-extends [RefInAnyof1Boxed](#refinanyof1boxed) +public record RefInAnyof1BoxedNumber
+implements [RefInAnyof1Boxed](#refinanyof1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RefInAnyof1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RefInAnyof1BoxedString -public static final class RefInAnyof1BoxedString
-extends [RefInAnyof1Boxed](#refinanyof1boxed) +public record RefInAnyof1BoxedString
+implements [RefInAnyof1Boxed](#refinanyof1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RefInAnyof1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RefInAnyof1BoxedList -public static final class RefInAnyof1BoxedList
-extends [RefInAnyof1Boxed](#refinanyof1boxed) +public record RefInAnyof1BoxedList
+implements [RefInAnyof1Boxed](#refinanyof1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RefInAnyof1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RefInAnyof1BoxedMap -public static final class RefInAnyof1BoxedMap
-extends [RefInAnyof1Boxed](#refinanyof1boxed) +public record RefInAnyof1BoxedMap
+implements [RefInAnyof1Boxed](#refinanyof1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RefInAnyof1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RefInAnyof1 public static class RefInAnyof1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [RefInAnyof1BoxedBoolean](#refinanyof1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [RefInAnyof1BoxedMap](#refinanyof1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [RefInAnyof1BoxedList](#refinanyof1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [RefInAnyof1Boxed](#refinanyof1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/RefInItems.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/RefInItems.md index c80ac03580e..6fd5379a910 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/RefInItems.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/RefInItems.md @@ -4,7 +4,7 @@ public class RefInItems
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated list payloads, extends FrozenList - classes to build inputs for list payloads @@ -12,34 +12,35 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [RefInItems.RefInItems1Boxed](#refinitems1boxed)
abstract sealed validated payload class | -| static class | [RefInItems.RefInItems1BoxedList](#refinitems1boxedlist)
boxed class to store validated List payloads | +| sealed interface | [RefInItems.RefInItems1Boxed](#refinitems1boxed)
sealed interface for validated payloads | +| record | [RefInItems.RefInItems1BoxedList](#refinitems1boxedlist)
boxed class to store validated List payloads | | static class | [RefInItems.RefInItems1](#refinitems1)
schema class | | static class | [RefInItems.RefInItemsListBuilder](#refinitemslistbuilder)
builder for List payloads | | static class | [RefInItems.RefInItemsList](#refinitemslist)
output class for List payloads | ## RefInItems1Boxed -public static abstract sealed class RefInItems1Boxed
+public sealed interface RefInItems1Boxed
permits
[RefInItems1BoxedList](#refinitems1boxedlist) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## RefInItems1BoxedList -public static final class RefInItems1BoxedList
-extends [RefInItems1Boxed](#refinitems1boxed) +public record RefInItems1BoxedList
+implements [RefInItems1Boxed](#refinitems1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RefInItems1BoxedList([RefInItemsList](#refinitemslist) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [RefInItemsList](#refinitemslist) | data
validated payload | +| [RefInItemsList](#refinitemslist) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RefInItems1 public static class RefInItems1
@@ -82,7 +83,9 @@ RefInItems.RefInItemsList validatedPayload = | ----------------- | ---------------------- | | [RefInItemsList](#refinitemslist) | validate([List](#refinitemslistbuilder) arg, SchemaConfiguration configuration) | | [RefInItems1BoxedList](#refinitems1boxedlist) | validateAndBox([List](#refinitemslistbuilder) arg, SchemaConfiguration configuration) | +| [RefInItems1Boxed](#refinitems1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## RefInItemsListBuilder public class RefInItemsListBuilder
builder for `List<@Nullable Object>` diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/RefInNot.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/RefInNot.md index 2f2127e82b0..061bbd12510 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/RefInNot.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/RefInNot.md @@ -4,23 +4,23 @@ public class RefInNot
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [RefInNot.RefInNot1Boxed](#refinnot1boxed)
abstract sealed validated payload class | -| static class | [RefInNot.RefInNot1BoxedVoid](#refinnot1boxedvoid)
boxed class to store validated null payloads | -| static class | [RefInNot.RefInNot1BoxedBoolean](#refinnot1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [RefInNot.RefInNot1BoxedNumber](#refinnot1boxednumber)
boxed class to store validated Number payloads | -| static class | [RefInNot.RefInNot1BoxedString](#refinnot1boxedstring)
boxed class to store validated String payloads | -| static class | [RefInNot.RefInNot1BoxedList](#refinnot1boxedlist)
boxed class to store validated List payloads | -| static class | [RefInNot.RefInNot1BoxedMap](#refinnot1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [RefInNot.RefInNot1Boxed](#refinnot1boxed)
sealed interface for validated payloads | +| record | [RefInNot.RefInNot1BoxedVoid](#refinnot1boxedvoid)
boxed class to store validated null payloads | +| record | [RefInNot.RefInNot1BoxedBoolean](#refinnot1boxedboolean)
boxed class to store validated boolean payloads | +| record | [RefInNot.RefInNot1BoxedNumber](#refinnot1boxednumber)
boxed class to store validated Number payloads | +| record | [RefInNot.RefInNot1BoxedString](#refinnot1boxedstring)
boxed class to store validated String payloads | +| record | [RefInNot.RefInNot1BoxedList](#refinnot1boxedlist)
boxed class to store validated List payloads | +| record | [RefInNot.RefInNot1BoxedMap](#refinnot1boxedmap)
boxed class to store validated Map payloads | | static class | [RefInNot.RefInNot1](#refinnot1)
schema class | ## RefInNot1Boxed -public static abstract sealed class RefInNot1Boxed
+public sealed interface RefInNot1Boxed
permits
[RefInNot1BoxedVoid](#refinnot1boxedvoid), [RefInNot1BoxedBoolean](#refinnot1boxedboolean), @@ -29,103 +29,109 @@ permits
[RefInNot1BoxedList](#refinnot1boxedlist), [RefInNot1BoxedMap](#refinnot1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## RefInNot1BoxedVoid -public static final class RefInNot1BoxedVoid
-extends [RefInNot1Boxed](#refinnot1boxed) +public record RefInNot1BoxedVoid
+implements [RefInNot1Boxed](#refinnot1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RefInNot1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RefInNot1BoxedBoolean -public static final class RefInNot1BoxedBoolean
-extends [RefInNot1Boxed](#refinnot1boxed) +public record RefInNot1BoxedBoolean
+implements [RefInNot1Boxed](#refinnot1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RefInNot1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RefInNot1BoxedNumber -public static final class RefInNot1BoxedNumber
-extends [RefInNot1Boxed](#refinnot1boxed) +public record RefInNot1BoxedNumber
+implements [RefInNot1Boxed](#refinnot1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RefInNot1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RefInNot1BoxedString -public static final class RefInNot1BoxedString
-extends [RefInNot1Boxed](#refinnot1boxed) +public record RefInNot1BoxedString
+implements [RefInNot1Boxed](#refinnot1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RefInNot1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RefInNot1BoxedList -public static final class RefInNot1BoxedList
-extends [RefInNot1Boxed](#refinnot1boxed) +public record RefInNot1BoxedList
+implements [RefInNot1Boxed](#refinnot1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RefInNot1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RefInNot1BoxedMap -public static final class RefInNot1BoxedMap
-extends [RefInNot1Boxed](#refinnot1boxed) +public record RefInNot1BoxedMap
+implements [RefInNot1Boxed](#refinnot1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RefInNot1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RefInNot1 public static class RefInNot1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [RefInNot1BoxedBoolean](#refinnot1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [RefInNot1BoxedMap](#refinnot1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [RefInNot1BoxedList](#refinnot1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [RefInNot1Boxed](#refinnot1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/RefInOneof.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/RefInOneof.md index f532a514601..ec5a6fe66ba 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/RefInOneof.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/RefInOneof.md @@ -4,23 +4,23 @@ public class RefInOneof
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [RefInOneof.RefInOneof1Boxed](#refinoneof1boxed)
abstract sealed validated payload class | -| static class | [RefInOneof.RefInOneof1BoxedVoid](#refinoneof1boxedvoid)
boxed class to store validated null payloads | -| static class | [RefInOneof.RefInOneof1BoxedBoolean](#refinoneof1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [RefInOneof.RefInOneof1BoxedNumber](#refinoneof1boxednumber)
boxed class to store validated Number payloads | -| static class | [RefInOneof.RefInOneof1BoxedString](#refinoneof1boxedstring)
boxed class to store validated String payloads | -| static class | [RefInOneof.RefInOneof1BoxedList](#refinoneof1boxedlist)
boxed class to store validated List payloads | -| static class | [RefInOneof.RefInOneof1BoxedMap](#refinoneof1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [RefInOneof.RefInOneof1Boxed](#refinoneof1boxed)
sealed interface for validated payloads | +| record | [RefInOneof.RefInOneof1BoxedVoid](#refinoneof1boxedvoid)
boxed class to store validated null payloads | +| record | [RefInOneof.RefInOneof1BoxedBoolean](#refinoneof1boxedboolean)
boxed class to store validated boolean payloads | +| record | [RefInOneof.RefInOneof1BoxedNumber](#refinoneof1boxednumber)
boxed class to store validated Number payloads | +| record | [RefInOneof.RefInOneof1BoxedString](#refinoneof1boxedstring)
boxed class to store validated String payloads | +| record | [RefInOneof.RefInOneof1BoxedList](#refinoneof1boxedlist)
boxed class to store validated List payloads | +| record | [RefInOneof.RefInOneof1BoxedMap](#refinoneof1boxedmap)
boxed class to store validated Map payloads | | static class | [RefInOneof.RefInOneof1](#refinoneof1)
schema class | ## RefInOneof1Boxed -public static abstract sealed class RefInOneof1Boxed
+public sealed interface RefInOneof1Boxed
permits
[RefInOneof1BoxedVoid](#refinoneof1boxedvoid), [RefInOneof1BoxedBoolean](#refinoneof1boxedboolean), @@ -29,103 +29,109 @@ permits
[RefInOneof1BoxedList](#refinoneof1boxedlist), [RefInOneof1BoxedMap](#refinoneof1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## RefInOneof1BoxedVoid -public static final class RefInOneof1BoxedVoid
-extends [RefInOneof1Boxed](#refinoneof1boxed) +public record RefInOneof1BoxedVoid
+implements [RefInOneof1Boxed](#refinoneof1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RefInOneof1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RefInOneof1BoxedBoolean -public static final class RefInOneof1BoxedBoolean
-extends [RefInOneof1Boxed](#refinoneof1boxed) +public record RefInOneof1BoxedBoolean
+implements [RefInOneof1Boxed](#refinoneof1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RefInOneof1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RefInOneof1BoxedNumber -public static final class RefInOneof1BoxedNumber
-extends [RefInOneof1Boxed](#refinoneof1boxed) +public record RefInOneof1BoxedNumber
+implements [RefInOneof1Boxed](#refinoneof1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RefInOneof1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RefInOneof1BoxedString -public static final class RefInOneof1BoxedString
-extends [RefInOneof1Boxed](#refinoneof1boxed) +public record RefInOneof1BoxedString
+implements [RefInOneof1Boxed](#refinoneof1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RefInOneof1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RefInOneof1BoxedList -public static final class RefInOneof1BoxedList
-extends [RefInOneof1Boxed](#refinoneof1boxed) +public record RefInOneof1BoxedList
+implements [RefInOneof1Boxed](#refinoneof1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RefInOneof1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RefInOneof1BoxedMap -public static final class RefInOneof1BoxedMap
-extends [RefInOneof1Boxed](#refinoneof1boxed) +public record RefInOneof1BoxedMap
+implements [RefInOneof1Boxed](#refinoneof1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RefInOneof1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RefInOneof1 public static class RefInOneof1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [RefInOneof1BoxedBoolean](#refinoneof1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [RefInOneof1BoxedMap](#refinoneof1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [RefInOneof1BoxedList](#refinoneof1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [RefInOneof1Boxed](#refinoneof1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/RefInProperty.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/RefInProperty.md index 96c8267ff2a..63ded6bc398 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/RefInProperty.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/RefInProperty.md @@ -4,7 +4,7 @@ public class RefInProperty
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,19 +12,19 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [RefInProperty.RefInProperty1Boxed](#refinproperty1boxed)
abstract sealed validated payload class | -| static class | [RefInProperty.RefInProperty1BoxedVoid](#refinproperty1boxedvoid)
boxed class to store validated null payloads | -| static class | [RefInProperty.RefInProperty1BoxedBoolean](#refinproperty1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [RefInProperty.RefInProperty1BoxedNumber](#refinproperty1boxednumber)
boxed class to store validated Number payloads | -| static class | [RefInProperty.RefInProperty1BoxedString](#refinproperty1boxedstring)
boxed class to store validated String payloads | -| static class | [RefInProperty.RefInProperty1BoxedList](#refinproperty1boxedlist)
boxed class to store validated List payloads | -| static class | [RefInProperty.RefInProperty1BoxedMap](#refinproperty1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [RefInProperty.RefInProperty1Boxed](#refinproperty1boxed)
sealed interface for validated payloads | +| record | [RefInProperty.RefInProperty1BoxedVoid](#refinproperty1boxedvoid)
boxed class to store validated null payloads | +| record | [RefInProperty.RefInProperty1BoxedBoolean](#refinproperty1boxedboolean)
boxed class to store validated boolean payloads | +| record | [RefInProperty.RefInProperty1BoxedNumber](#refinproperty1boxednumber)
boxed class to store validated Number payloads | +| record | [RefInProperty.RefInProperty1BoxedString](#refinproperty1boxedstring)
boxed class to store validated String payloads | +| record | [RefInProperty.RefInProperty1BoxedList](#refinproperty1boxedlist)
boxed class to store validated List payloads | +| record | [RefInProperty.RefInProperty1BoxedMap](#refinproperty1boxedmap)
boxed class to store validated Map payloads | | static class | [RefInProperty.RefInProperty1](#refinproperty1)
schema class | | static class | [RefInProperty.RefInPropertyMapBuilder](#refinpropertymapbuilder)
builder for Map payloads | | static class | [RefInProperty.RefInPropertyMap](#refinpropertymap)
output class for Map payloads | ## RefInProperty1Boxed -public static abstract sealed class RefInProperty1Boxed
+public sealed interface RefInProperty1Boxed
permits
[RefInProperty1BoxedVoid](#refinproperty1boxedvoid), [RefInProperty1BoxedBoolean](#refinproperty1boxedboolean), @@ -33,103 +33,109 @@ permits
[RefInProperty1BoxedList](#refinproperty1boxedlist), [RefInProperty1BoxedMap](#refinproperty1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## RefInProperty1BoxedVoid -public static final class RefInProperty1BoxedVoid
-extends [RefInProperty1Boxed](#refinproperty1boxed) +public record RefInProperty1BoxedVoid
+implements [RefInProperty1Boxed](#refinproperty1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RefInProperty1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RefInProperty1BoxedBoolean -public static final class RefInProperty1BoxedBoolean
-extends [RefInProperty1Boxed](#refinproperty1boxed) +public record RefInProperty1BoxedBoolean
+implements [RefInProperty1Boxed](#refinproperty1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RefInProperty1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RefInProperty1BoxedNumber -public static final class RefInProperty1BoxedNumber
-extends [RefInProperty1Boxed](#refinproperty1boxed) +public record RefInProperty1BoxedNumber
+implements [RefInProperty1Boxed](#refinproperty1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RefInProperty1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RefInProperty1BoxedString -public static final class RefInProperty1BoxedString
-extends [RefInProperty1Boxed](#refinproperty1boxed) +public record RefInProperty1BoxedString
+implements [RefInProperty1Boxed](#refinproperty1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RefInProperty1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RefInProperty1BoxedList -public static final class RefInProperty1BoxedList
-extends [RefInProperty1Boxed](#refinproperty1boxed) +public record RefInProperty1BoxedList
+implements [RefInProperty1Boxed](#refinproperty1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RefInProperty1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RefInProperty1BoxedMap -public static final class RefInProperty1BoxedMap
-extends [RefInProperty1Boxed](#refinproperty1boxed) +public record RefInProperty1BoxedMap
+implements [RefInProperty1Boxed](#refinproperty1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RefInProperty1BoxedMap([RefInPropertyMap](#refinpropertymap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [RefInPropertyMap](#refinpropertymap) | data
validated payload | +| [RefInPropertyMap](#refinpropertymap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RefInProperty1 public static class RefInProperty1
@@ -161,7 +167,9 @@ A schema class that validates payloads | [RefInProperty1BoxedBoolean](#refinproperty1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [RefInProperty1BoxedMap](#refinproperty1boxedmap) | validateAndBox([Map<?, ?>](#refinpropertymapbuilder) arg, SchemaConfiguration configuration) | | [RefInProperty1BoxedList](#refinproperty1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [RefInProperty1Boxed](#refinproperty1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## RefInPropertyMapBuilder public class RefInPropertyMapBuilder
builder for `Map` diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/RequiredDefaultValidation.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/RequiredDefaultValidation.md index e50e0a3c2e1..365a4f96ff4 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/RequiredDefaultValidation.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/RequiredDefaultValidation.md @@ -4,7 +4,7 @@ public class RequiredDefaultValidation
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,27 +12,27 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [RequiredDefaultValidation.RequiredDefaultValidation1Boxed](#requireddefaultvalidation1boxed)
abstract sealed validated payload class | -| static class | [RequiredDefaultValidation.RequiredDefaultValidation1BoxedVoid](#requireddefaultvalidation1boxedvoid)
boxed class to store validated null payloads | -| static class | [RequiredDefaultValidation.RequiredDefaultValidation1BoxedBoolean](#requireddefaultvalidation1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [RequiredDefaultValidation.RequiredDefaultValidation1BoxedNumber](#requireddefaultvalidation1boxednumber)
boxed class to store validated Number payloads | -| static class | [RequiredDefaultValidation.RequiredDefaultValidation1BoxedString](#requireddefaultvalidation1boxedstring)
boxed class to store validated String payloads | -| static class | [RequiredDefaultValidation.RequiredDefaultValidation1BoxedList](#requireddefaultvalidation1boxedlist)
boxed class to store validated List payloads | -| static class | [RequiredDefaultValidation.RequiredDefaultValidation1BoxedMap](#requireddefaultvalidation1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [RequiredDefaultValidation.RequiredDefaultValidation1Boxed](#requireddefaultvalidation1boxed)
sealed interface for validated payloads | +| record | [RequiredDefaultValidation.RequiredDefaultValidation1BoxedVoid](#requireddefaultvalidation1boxedvoid)
boxed class to store validated null payloads | +| record | [RequiredDefaultValidation.RequiredDefaultValidation1BoxedBoolean](#requireddefaultvalidation1boxedboolean)
boxed class to store validated boolean payloads | +| record | [RequiredDefaultValidation.RequiredDefaultValidation1BoxedNumber](#requireddefaultvalidation1boxednumber)
boxed class to store validated Number payloads | +| record | [RequiredDefaultValidation.RequiredDefaultValidation1BoxedString](#requireddefaultvalidation1boxedstring)
boxed class to store validated String payloads | +| record | [RequiredDefaultValidation.RequiredDefaultValidation1BoxedList](#requireddefaultvalidation1boxedlist)
boxed class to store validated List payloads | +| record | [RequiredDefaultValidation.RequiredDefaultValidation1BoxedMap](#requireddefaultvalidation1boxedmap)
boxed class to store validated Map payloads | | static class | [RequiredDefaultValidation.RequiredDefaultValidation1](#requireddefaultvalidation1)
schema class | | static class | [RequiredDefaultValidation.RequiredDefaultValidationMapBuilder](#requireddefaultvalidationmapbuilder)
builder for Map payloads | | static class | [RequiredDefaultValidation.RequiredDefaultValidationMap](#requireddefaultvalidationmap)
output class for Map payloads | -| static class | [RequiredDefaultValidation.FooBoxed](#fooboxed)
abstract sealed validated payload class | -| static class | [RequiredDefaultValidation.FooBoxedVoid](#fooboxedvoid)
boxed class to store validated null payloads | -| static class | [RequiredDefaultValidation.FooBoxedBoolean](#fooboxedboolean)
boxed class to store validated boolean payloads | -| static class | [RequiredDefaultValidation.FooBoxedNumber](#fooboxednumber)
boxed class to store validated Number payloads | -| static class | [RequiredDefaultValidation.FooBoxedString](#fooboxedstring)
boxed class to store validated String payloads | -| static class | [RequiredDefaultValidation.FooBoxedList](#fooboxedlist)
boxed class to store validated List payloads | -| static class | [RequiredDefaultValidation.FooBoxedMap](#fooboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [RequiredDefaultValidation.FooBoxed](#fooboxed)
sealed interface for validated payloads | +| record | [RequiredDefaultValidation.FooBoxedVoid](#fooboxedvoid)
boxed class to store validated null payloads | +| record | [RequiredDefaultValidation.FooBoxedBoolean](#fooboxedboolean)
boxed class to store validated boolean payloads | +| record | [RequiredDefaultValidation.FooBoxedNumber](#fooboxednumber)
boxed class to store validated Number payloads | +| record | [RequiredDefaultValidation.FooBoxedString](#fooboxedstring)
boxed class to store validated String payloads | +| record | [RequiredDefaultValidation.FooBoxedList](#fooboxedlist)
boxed class to store validated List payloads | +| record | [RequiredDefaultValidation.FooBoxedMap](#fooboxedmap)
boxed class to store validated Map payloads | | static class | [RequiredDefaultValidation.Foo](#foo)
schema class | ## RequiredDefaultValidation1Boxed -public static abstract sealed class RequiredDefaultValidation1Boxed
+public sealed interface RequiredDefaultValidation1Boxed
permits
[RequiredDefaultValidation1BoxedVoid](#requireddefaultvalidation1boxedvoid), [RequiredDefaultValidation1BoxedBoolean](#requireddefaultvalidation1boxedboolean), @@ -41,103 +41,109 @@ permits
[RequiredDefaultValidation1BoxedList](#requireddefaultvalidation1boxedlist), [RequiredDefaultValidation1BoxedMap](#requireddefaultvalidation1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## RequiredDefaultValidation1BoxedVoid -public static final class RequiredDefaultValidation1BoxedVoid
-extends [RequiredDefaultValidation1Boxed](#requireddefaultvalidation1boxed) +public record RequiredDefaultValidation1BoxedVoid
+implements [RequiredDefaultValidation1Boxed](#requireddefaultvalidation1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RequiredDefaultValidation1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RequiredDefaultValidation1BoxedBoolean -public static final class RequiredDefaultValidation1BoxedBoolean
-extends [RequiredDefaultValidation1Boxed](#requireddefaultvalidation1boxed) +public record RequiredDefaultValidation1BoxedBoolean
+implements [RequiredDefaultValidation1Boxed](#requireddefaultvalidation1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RequiredDefaultValidation1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RequiredDefaultValidation1BoxedNumber -public static final class RequiredDefaultValidation1BoxedNumber
-extends [RequiredDefaultValidation1Boxed](#requireddefaultvalidation1boxed) +public record RequiredDefaultValidation1BoxedNumber
+implements [RequiredDefaultValidation1Boxed](#requireddefaultvalidation1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RequiredDefaultValidation1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RequiredDefaultValidation1BoxedString -public static final class RequiredDefaultValidation1BoxedString
-extends [RequiredDefaultValidation1Boxed](#requireddefaultvalidation1boxed) +public record RequiredDefaultValidation1BoxedString
+implements [RequiredDefaultValidation1Boxed](#requireddefaultvalidation1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RequiredDefaultValidation1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RequiredDefaultValidation1BoxedList -public static final class RequiredDefaultValidation1BoxedList
-extends [RequiredDefaultValidation1Boxed](#requireddefaultvalidation1boxed) +public record RequiredDefaultValidation1BoxedList
+implements [RequiredDefaultValidation1Boxed](#requireddefaultvalidation1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RequiredDefaultValidation1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RequiredDefaultValidation1BoxedMap -public static final class RequiredDefaultValidation1BoxedMap
-extends [RequiredDefaultValidation1Boxed](#requireddefaultvalidation1boxed) +public record RequiredDefaultValidation1BoxedMap
+implements [RequiredDefaultValidation1Boxed](#requireddefaultvalidation1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RequiredDefaultValidation1BoxedMap([RequiredDefaultValidationMap](#requireddefaultvalidationmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [RequiredDefaultValidationMap](#requireddefaultvalidationmap) | data
validated payload | +| [RequiredDefaultValidationMap](#requireddefaultvalidationmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RequiredDefaultValidation1 public static class RequiredDefaultValidation1
@@ -169,7 +175,9 @@ A schema class that validates payloads | [RequiredDefaultValidation1BoxedBoolean](#requireddefaultvalidation1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [RequiredDefaultValidation1BoxedMap](#requireddefaultvalidation1boxedmap) | validateAndBox([Map<?, ?>](#requireddefaultvalidationmapbuilder) arg, SchemaConfiguration configuration) | | [RequiredDefaultValidation1BoxedList](#requireddefaultvalidation1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [RequiredDefaultValidation1Boxed](#requireddefaultvalidation1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## RequiredDefaultValidationMapBuilder public class RequiredDefaultValidationMapBuilder
builder for `Map` @@ -218,7 +226,7 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## FooBoxed -public static abstract sealed class FooBoxed
+public sealed interface FooBoxed
permits
[FooBoxedVoid](#fooboxedvoid), [FooBoxedBoolean](#fooboxedboolean), @@ -227,103 +235,109 @@ permits
[FooBoxedList](#fooboxedlist), [FooBoxedMap](#fooboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## FooBoxedVoid -public static final class FooBoxedVoid
-extends [FooBoxed](#fooboxed) +public record FooBoxedVoid
+implements [FooBoxed](#fooboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FooBoxedBoolean -public static final class FooBoxedBoolean
-extends [FooBoxed](#fooboxed) +public record FooBoxedBoolean
+implements [FooBoxed](#fooboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FooBoxedNumber -public static final class FooBoxedNumber
-extends [FooBoxed](#fooboxed) +public record FooBoxedNumber
+implements [FooBoxed](#fooboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FooBoxedString -public static final class FooBoxedString
-extends [FooBoxed](#fooboxed) +public record FooBoxedString
+implements [FooBoxed](#fooboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FooBoxedList -public static final class FooBoxedList
-extends [FooBoxed](#fooboxed) +public record FooBoxedList
+implements [FooBoxed](#fooboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FooBoxedMap -public static final class FooBoxedMap
-extends [FooBoxed](#fooboxed) +public record FooBoxedMap
+implements [FooBoxed](#fooboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Foo public static class Foo
diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/RequiredValidation.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/RequiredValidation.md index 8b9f025df75..8db2b0fbc2b 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/RequiredValidation.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/RequiredValidation.md @@ -4,7 +4,7 @@ public class RequiredValidation
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,35 +12,35 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [RequiredValidation.RequiredValidation1Boxed](#requiredvalidation1boxed)
abstract sealed validated payload class | -| static class | [RequiredValidation.RequiredValidation1BoxedVoid](#requiredvalidation1boxedvoid)
boxed class to store validated null payloads | -| static class | [RequiredValidation.RequiredValidation1BoxedBoolean](#requiredvalidation1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [RequiredValidation.RequiredValidation1BoxedNumber](#requiredvalidation1boxednumber)
boxed class to store validated Number payloads | -| static class | [RequiredValidation.RequiredValidation1BoxedString](#requiredvalidation1boxedstring)
boxed class to store validated String payloads | -| static class | [RequiredValidation.RequiredValidation1BoxedList](#requiredvalidation1boxedlist)
boxed class to store validated List payloads | -| static class | [RequiredValidation.RequiredValidation1BoxedMap](#requiredvalidation1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [RequiredValidation.RequiredValidation1Boxed](#requiredvalidation1boxed)
sealed interface for validated payloads | +| record | [RequiredValidation.RequiredValidation1BoxedVoid](#requiredvalidation1boxedvoid)
boxed class to store validated null payloads | +| record | [RequiredValidation.RequiredValidation1BoxedBoolean](#requiredvalidation1boxedboolean)
boxed class to store validated boolean payloads | +| record | [RequiredValidation.RequiredValidation1BoxedNumber](#requiredvalidation1boxednumber)
boxed class to store validated Number payloads | +| record | [RequiredValidation.RequiredValidation1BoxedString](#requiredvalidation1boxedstring)
boxed class to store validated String payloads | +| record | [RequiredValidation.RequiredValidation1BoxedList](#requiredvalidation1boxedlist)
boxed class to store validated List payloads | +| record | [RequiredValidation.RequiredValidation1BoxedMap](#requiredvalidation1boxedmap)
boxed class to store validated Map payloads | | static class | [RequiredValidation.RequiredValidation1](#requiredvalidation1)
schema class | | static class | [RequiredValidation.RequiredValidationMapBuilder](#requiredvalidationmapbuilder)
builder for Map payloads | | static class | [RequiredValidation.RequiredValidationMap](#requiredvalidationmap)
output class for Map payloads | -| static class | [RequiredValidation.BarBoxed](#barboxed)
abstract sealed validated payload class | -| static class | [RequiredValidation.BarBoxedVoid](#barboxedvoid)
boxed class to store validated null payloads | -| static class | [RequiredValidation.BarBoxedBoolean](#barboxedboolean)
boxed class to store validated boolean payloads | -| static class | [RequiredValidation.BarBoxedNumber](#barboxednumber)
boxed class to store validated Number payloads | -| static class | [RequiredValidation.BarBoxedString](#barboxedstring)
boxed class to store validated String payloads | -| static class | [RequiredValidation.BarBoxedList](#barboxedlist)
boxed class to store validated List payloads | -| static class | [RequiredValidation.BarBoxedMap](#barboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [RequiredValidation.BarBoxed](#barboxed)
sealed interface for validated payloads | +| record | [RequiredValidation.BarBoxedVoid](#barboxedvoid)
boxed class to store validated null payloads | +| record | [RequiredValidation.BarBoxedBoolean](#barboxedboolean)
boxed class to store validated boolean payloads | +| record | [RequiredValidation.BarBoxedNumber](#barboxednumber)
boxed class to store validated Number payloads | +| record | [RequiredValidation.BarBoxedString](#barboxedstring)
boxed class to store validated String payloads | +| record | [RequiredValidation.BarBoxedList](#barboxedlist)
boxed class to store validated List payloads | +| record | [RequiredValidation.BarBoxedMap](#barboxedmap)
boxed class to store validated Map payloads | | static class | [RequiredValidation.Bar](#bar)
schema class | -| static class | [RequiredValidation.FooBoxed](#fooboxed)
abstract sealed validated payload class | -| static class | [RequiredValidation.FooBoxedVoid](#fooboxedvoid)
boxed class to store validated null payloads | -| static class | [RequiredValidation.FooBoxedBoolean](#fooboxedboolean)
boxed class to store validated boolean payloads | -| static class | [RequiredValidation.FooBoxedNumber](#fooboxednumber)
boxed class to store validated Number payloads | -| static class | [RequiredValidation.FooBoxedString](#fooboxedstring)
boxed class to store validated String payloads | -| static class | [RequiredValidation.FooBoxedList](#fooboxedlist)
boxed class to store validated List payloads | -| static class | [RequiredValidation.FooBoxedMap](#fooboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [RequiredValidation.FooBoxed](#fooboxed)
sealed interface for validated payloads | +| record | [RequiredValidation.FooBoxedVoid](#fooboxedvoid)
boxed class to store validated null payloads | +| record | [RequiredValidation.FooBoxedBoolean](#fooboxedboolean)
boxed class to store validated boolean payloads | +| record | [RequiredValidation.FooBoxedNumber](#fooboxednumber)
boxed class to store validated Number payloads | +| record | [RequiredValidation.FooBoxedString](#fooboxedstring)
boxed class to store validated String payloads | +| record | [RequiredValidation.FooBoxedList](#fooboxedlist)
boxed class to store validated List payloads | +| record | [RequiredValidation.FooBoxedMap](#fooboxedmap)
boxed class to store validated Map payloads | | static class | [RequiredValidation.Foo](#foo)
schema class | ## RequiredValidation1Boxed -public static abstract sealed class RequiredValidation1Boxed
+public sealed interface RequiredValidation1Boxed
permits
[RequiredValidation1BoxedVoid](#requiredvalidation1boxedvoid), [RequiredValidation1BoxedBoolean](#requiredvalidation1boxedboolean), @@ -49,103 +49,109 @@ permits
[RequiredValidation1BoxedList](#requiredvalidation1boxedlist), [RequiredValidation1BoxedMap](#requiredvalidation1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## RequiredValidation1BoxedVoid -public static final class RequiredValidation1BoxedVoid
-extends [RequiredValidation1Boxed](#requiredvalidation1boxed) +public record RequiredValidation1BoxedVoid
+implements [RequiredValidation1Boxed](#requiredvalidation1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RequiredValidation1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RequiredValidation1BoxedBoolean -public static final class RequiredValidation1BoxedBoolean
-extends [RequiredValidation1Boxed](#requiredvalidation1boxed) +public record RequiredValidation1BoxedBoolean
+implements [RequiredValidation1Boxed](#requiredvalidation1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RequiredValidation1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RequiredValidation1BoxedNumber -public static final class RequiredValidation1BoxedNumber
-extends [RequiredValidation1Boxed](#requiredvalidation1boxed) +public record RequiredValidation1BoxedNumber
+implements [RequiredValidation1Boxed](#requiredvalidation1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RequiredValidation1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RequiredValidation1BoxedString -public static final class RequiredValidation1BoxedString
-extends [RequiredValidation1Boxed](#requiredvalidation1boxed) +public record RequiredValidation1BoxedString
+implements [RequiredValidation1Boxed](#requiredvalidation1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RequiredValidation1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RequiredValidation1BoxedList -public static final class RequiredValidation1BoxedList
-extends [RequiredValidation1Boxed](#requiredvalidation1boxed) +public record RequiredValidation1BoxedList
+implements [RequiredValidation1Boxed](#requiredvalidation1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RequiredValidation1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RequiredValidation1BoxedMap -public static final class RequiredValidation1BoxedMap
-extends [RequiredValidation1Boxed](#requiredvalidation1boxed) +public record RequiredValidation1BoxedMap
+implements [RequiredValidation1Boxed](#requiredvalidation1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RequiredValidation1BoxedMap([RequiredValidationMap](#requiredvalidationmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [RequiredValidationMap](#requiredvalidationmap) | data
validated payload | +| [RequiredValidationMap](#requiredvalidationmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RequiredValidation1 public static class RequiredValidation1
@@ -178,7 +184,9 @@ A schema class that validates payloads | [RequiredValidation1BoxedBoolean](#requiredvalidation1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [RequiredValidation1BoxedMap](#requiredvalidation1boxedmap) | validateAndBox([Map<?, ?>](#requiredvalidationmapbuilder) arg, SchemaConfiguration configuration) | | [RequiredValidation1BoxedList](#requiredvalidation1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [RequiredValidation1Boxed](#requiredvalidation1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## RequiredValidationMap0Builder public class RequiredValidationMap0Builder
builder for `Map` @@ -252,7 +260,7 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## BarBoxed -public static abstract sealed class BarBoxed
+public sealed interface BarBoxed
permits
[BarBoxedVoid](#barboxedvoid), [BarBoxedBoolean](#barboxedboolean), @@ -261,103 +269,109 @@ permits
[BarBoxedList](#barboxedlist), [BarBoxedMap](#barboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## BarBoxedVoid -public static final class BarBoxedVoid
-extends [BarBoxed](#barboxed) +public record BarBoxedVoid
+implements [BarBoxed](#barboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BarBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## BarBoxedBoolean -public static final class BarBoxedBoolean
-extends [BarBoxed](#barboxed) +public record BarBoxedBoolean
+implements [BarBoxed](#barboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BarBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## BarBoxedNumber -public static final class BarBoxedNumber
-extends [BarBoxed](#barboxed) +public record BarBoxedNumber
+implements [BarBoxed](#barboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BarBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## BarBoxedString -public static final class BarBoxedString
-extends [BarBoxed](#barboxed) +public record BarBoxedString
+implements [BarBoxed](#barboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BarBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## BarBoxedList -public static final class BarBoxedList
-extends [BarBoxed](#barboxed) +public record BarBoxedList
+implements [BarBoxed](#barboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BarBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## BarBoxedMap -public static final class BarBoxedMap
-extends [BarBoxed](#barboxed) +public record BarBoxedMap
+implements [BarBoxed](#barboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BarBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Bar public static class Bar
@@ -371,7 +385,7 @@ A schema class that validates payloads | validateAndBox | ## FooBoxed -public static abstract sealed class FooBoxed
+public sealed interface FooBoxed
permits
[FooBoxedVoid](#fooboxedvoid), [FooBoxedBoolean](#fooboxedboolean), @@ -380,103 +394,109 @@ permits
[FooBoxedList](#fooboxedlist), [FooBoxedMap](#fooboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## FooBoxedVoid -public static final class FooBoxedVoid
-extends [FooBoxed](#fooboxed) +public record FooBoxedVoid
+implements [FooBoxed](#fooboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FooBoxedBoolean -public static final class FooBoxedBoolean
-extends [FooBoxed](#fooboxed) +public record FooBoxedBoolean
+implements [FooBoxed](#fooboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FooBoxedNumber -public static final class FooBoxedNumber
-extends [FooBoxed](#fooboxed) +public record FooBoxedNumber
+implements [FooBoxed](#fooboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FooBoxedString -public static final class FooBoxedString
-extends [FooBoxed](#fooboxed) +public record FooBoxedString
+implements [FooBoxed](#fooboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FooBoxedList -public static final class FooBoxedList
-extends [FooBoxed](#fooboxed) +public record FooBoxedList
+implements [FooBoxed](#fooboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FooBoxedMap -public static final class FooBoxedMap
-extends [FooBoxed](#fooboxed) +public record FooBoxedMap
+implements [FooBoxed](#fooboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Foo public static class Foo
diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/RequiredWithEmptyArray.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/RequiredWithEmptyArray.md index 91edade5906..a1761569c18 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/RequiredWithEmptyArray.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/RequiredWithEmptyArray.md @@ -4,7 +4,7 @@ public class RequiredWithEmptyArray
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,27 +12,27 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [RequiredWithEmptyArray.RequiredWithEmptyArray1Boxed](#requiredwithemptyarray1boxed)
abstract sealed validated payload class | -| static class | [RequiredWithEmptyArray.RequiredWithEmptyArray1BoxedVoid](#requiredwithemptyarray1boxedvoid)
boxed class to store validated null payloads | -| static class | [RequiredWithEmptyArray.RequiredWithEmptyArray1BoxedBoolean](#requiredwithemptyarray1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [RequiredWithEmptyArray.RequiredWithEmptyArray1BoxedNumber](#requiredwithemptyarray1boxednumber)
boxed class to store validated Number payloads | -| static class | [RequiredWithEmptyArray.RequiredWithEmptyArray1BoxedString](#requiredwithemptyarray1boxedstring)
boxed class to store validated String payloads | -| static class | [RequiredWithEmptyArray.RequiredWithEmptyArray1BoxedList](#requiredwithemptyarray1boxedlist)
boxed class to store validated List payloads | -| static class | [RequiredWithEmptyArray.RequiredWithEmptyArray1BoxedMap](#requiredwithemptyarray1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [RequiredWithEmptyArray.RequiredWithEmptyArray1Boxed](#requiredwithemptyarray1boxed)
sealed interface for validated payloads | +| record | [RequiredWithEmptyArray.RequiredWithEmptyArray1BoxedVoid](#requiredwithemptyarray1boxedvoid)
boxed class to store validated null payloads | +| record | [RequiredWithEmptyArray.RequiredWithEmptyArray1BoxedBoolean](#requiredwithemptyarray1boxedboolean)
boxed class to store validated boolean payloads | +| record | [RequiredWithEmptyArray.RequiredWithEmptyArray1BoxedNumber](#requiredwithemptyarray1boxednumber)
boxed class to store validated Number payloads | +| record | [RequiredWithEmptyArray.RequiredWithEmptyArray1BoxedString](#requiredwithemptyarray1boxedstring)
boxed class to store validated String payloads | +| record | [RequiredWithEmptyArray.RequiredWithEmptyArray1BoxedList](#requiredwithemptyarray1boxedlist)
boxed class to store validated List payloads | +| record | [RequiredWithEmptyArray.RequiredWithEmptyArray1BoxedMap](#requiredwithemptyarray1boxedmap)
boxed class to store validated Map payloads | | static class | [RequiredWithEmptyArray.RequiredWithEmptyArray1](#requiredwithemptyarray1)
schema class | | static class | [RequiredWithEmptyArray.RequiredWithEmptyArrayMapBuilder](#requiredwithemptyarraymapbuilder)
builder for Map payloads | | static class | [RequiredWithEmptyArray.RequiredWithEmptyArrayMap](#requiredwithemptyarraymap)
output class for Map payloads | -| static class | [RequiredWithEmptyArray.FooBoxed](#fooboxed)
abstract sealed validated payload class | -| static class | [RequiredWithEmptyArray.FooBoxedVoid](#fooboxedvoid)
boxed class to store validated null payloads | -| static class | [RequiredWithEmptyArray.FooBoxedBoolean](#fooboxedboolean)
boxed class to store validated boolean payloads | -| static class | [RequiredWithEmptyArray.FooBoxedNumber](#fooboxednumber)
boxed class to store validated Number payloads | -| static class | [RequiredWithEmptyArray.FooBoxedString](#fooboxedstring)
boxed class to store validated String payloads | -| static class | [RequiredWithEmptyArray.FooBoxedList](#fooboxedlist)
boxed class to store validated List payloads | -| static class | [RequiredWithEmptyArray.FooBoxedMap](#fooboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [RequiredWithEmptyArray.FooBoxed](#fooboxed)
sealed interface for validated payloads | +| record | [RequiredWithEmptyArray.FooBoxedVoid](#fooboxedvoid)
boxed class to store validated null payloads | +| record | [RequiredWithEmptyArray.FooBoxedBoolean](#fooboxedboolean)
boxed class to store validated boolean payloads | +| record | [RequiredWithEmptyArray.FooBoxedNumber](#fooboxednumber)
boxed class to store validated Number payloads | +| record | [RequiredWithEmptyArray.FooBoxedString](#fooboxedstring)
boxed class to store validated String payloads | +| record | [RequiredWithEmptyArray.FooBoxedList](#fooboxedlist)
boxed class to store validated List payloads | +| record | [RequiredWithEmptyArray.FooBoxedMap](#fooboxedmap)
boxed class to store validated Map payloads | | static class | [RequiredWithEmptyArray.Foo](#foo)
schema class | ## RequiredWithEmptyArray1Boxed -public static abstract sealed class RequiredWithEmptyArray1Boxed
+public sealed interface RequiredWithEmptyArray1Boxed
permits
[RequiredWithEmptyArray1BoxedVoid](#requiredwithemptyarray1boxedvoid), [RequiredWithEmptyArray1BoxedBoolean](#requiredwithemptyarray1boxedboolean), @@ -41,103 +41,109 @@ permits
[RequiredWithEmptyArray1BoxedList](#requiredwithemptyarray1boxedlist), [RequiredWithEmptyArray1BoxedMap](#requiredwithemptyarray1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## RequiredWithEmptyArray1BoxedVoid -public static final class RequiredWithEmptyArray1BoxedVoid
-extends [RequiredWithEmptyArray1Boxed](#requiredwithemptyarray1boxed) +public record RequiredWithEmptyArray1BoxedVoid
+implements [RequiredWithEmptyArray1Boxed](#requiredwithemptyarray1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RequiredWithEmptyArray1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RequiredWithEmptyArray1BoxedBoolean -public static final class RequiredWithEmptyArray1BoxedBoolean
-extends [RequiredWithEmptyArray1Boxed](#requiredwithemptyarray1boxed) +public record RequiredWithEmptyArray1BoxedBoolean
+implements [RequiredWithEmptyArray1Boxed](#requiredwithemptyarray1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RequiredWithEmptyArray1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RequiredWithEmptyArray1BoxedNumber -public static final class RequiredWithEmptyArray1BoxedNumber
-extends [RequiredWithEmptyArray1Boxed](#requiredwithemptyarray1boxed) +public record RequiredWithEmptyArray1BoxedNumber
+implements [RequiredWithEmptyArray1Boxed](#requiredwithemptyarray1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RequiredWithEmptyArray1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RequiredWithEmptyArray1BoxedString -public static final class RequiredWithEmptyArray1BoxedString
-extends [RequiredWithEmptyArray1Boxed](#requiredwithemptyarray1boxed) +public record RequiredWithEmptyArray1BoxedString
+implements [RequiredWithEmptyArray1Boxed](#requiredwithemptyarray1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RequiredWithEmptyArray1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RequiredWithEmptyArray1BoxedList -public static final class RequiredWithEmptyArray1BoxedList
-extends [RequiredWithEmptyArray1Boxed](#requiredwithemptyarray1boxed) +public record RequiredWithEmptyArray1BoxedList
+implements [RequiredWithEmptyArray1Boxed](#requiredwithemptyarray1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RequiredWithEmptyArray1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RequiredWithEmptyArray1BoxedMap -public static final class RequiredWithEmptyArray1BoxedMap
-extends [RequiredWithEmptyArray1Boxed](#requiredwithemptyarray1boxed) +public record RequiredWithEmptyArray1BoxedMap
+implements [RequiredWithEmptyArray1Boxed](#requiredwithemptyarray1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RequiredWithEmptyArray1BoxedMap([RequiredWithEmptyArrayMap](#requiredwithemptyarraymap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [RequiredWithEmptyArrayMap](#requiredwithemptyarraymap) | data
validated payload | +| [RequiredWithEmptyArrayMap](#requiredwithemptyarraymap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RequiredWithEmptyArray1 public static class RequiredWithEmptyArray1
@@ -169,7 +175,9 @@ A schema class that validates payloads | [RequiredWithEmptyArray1BoxedBoolean](#requiredwithemptyarray1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [RequiredWithEmptyArray1BoxedMap](#requiredwithemptyarray1boxedmap) | validateAndBox([Map<?, ?>](#requiredwithemptyarraymapbuilder) arg, SchemaConfiguration configuration) | | [RequiredWithEmptyArray1BoxedList](#requiredwithemptyarray1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [RequiredWithEmptyArray1Boxed](#requiredwithemptyarray1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## RequiredWithEmptyArrayMapBuilder public class RequiredWithEmptyArrayMapBuilder
builder for `Map` @@ -218,7 +226,7 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## FooBoxed -public static abstract sealed class FooBoxed
+public sealed interface FooBoxed
permits
[FooBoxedVoid](#fooboxedvoid), [FooBoxedBoolean](#fooboxedboolean), @@ -227,103 +235,109 @@ permits
[FooBoxedList](#fooboxedlist), [FooBoxedMap](#fooboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## FooBoxedVoid -public static final class FooBoxedVoid
-extends [FooBoxed](#fooboxed) +public record FooBoxedVoid
+implements [FooBoxed](#fooboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FooBoxedBoolean -public static final class FooBoxedBoolean
-extends [FooBoxed](#fooboxed) +public record FooBoxedBoolean
+implements [FooBoxed](#fooboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FooBoxedNumber -public static final class FooBoxedNumber
-extends [FooBoxed](#fooboxed) +public record FooBoxedNumber
+implements [FooBoxed](#fooboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FooBoxedString -public static final class FooBoxedString
-extends [FooBoxed](#fooboxed) +public record FooBoxedString
+implements [FooBoxed](#fooboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FooBoxedList -public static final class FooBoxedList
-extends [FooBoxed](#fooboxed) +public record FooBoxedList
+implements [FooBoxed](#fooboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FooBoxedMap -public static final class FooBoxedMap
-extends [FooBoxed](#fooboxed) +public record FooBoxedMap
+implements [FooBoxed](#fooboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Foo public static class Foo
diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/RequiredWithEscapedCharacters.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/RequiredWithEscapedCharacters.md index 284e500c4d3..753c5d0241d 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/RequiredWithEscapedCharacters.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/RequiredWithEscapedCharacters.md @@ -4,7 +4,7 @@ public class RequiredWithEscapedCharacters
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,19 +12,19 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [RequiredWithEscapedCharacters.RequiredWithEscapedCharacters1Boxed](#requiredwithescapedcharacters1boxed)
abstract sealed validated payload class | -| static class | [RequiredWithEscapedCharacters.RequiredWithEscapedCharacters1BoxedVoid](#requiredwithescapedcharacters1boxedvoid)
boxed class to store validated null payloads | -| static class | [RequiredWithEscapedCharacters.RequiredWithEscapedCharacters1BoxedBoolean](#requiredwithescapedcharacters1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [RequiredWithEscapedCharacters.RequiredWithEscapedCharacters1BoxedNumber](#requiredwithescapedcharacters1boxednumber)
boxed class to store validated Number payloads | -| static class | [RequiredWithEscapedCharacters.RequiredWithEscapedCharacters1BoxedString](#requiredwithescapedcharacters1boxedstring)
boxed class to store validated String payloads | -| static class | [RequiredWithEscapedCharacters.RequiredWithEscapedCharacters1BoxedList](#requiredwithescapedcharacters1boxedlist)
boxed class to store validated List payloads | -| static class | [RequiredWithEscapedCharacters.RequiredWithEscapedCharacters1BoxedMap](#requiredwithescapedcharacters1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [RequiredWithEscapedCharacters.RequiredWithEscapedCharacters1Boxed](#requiredwithescapedcharacters1boxed)
sealed interface for validated payloads | +| record | [RequiredWithEscapedCharacters.RequiredWithEscapedCharacters1BoxedVoid](#requiredwithescapedcharacters1boxedvoid)
boxed class to store validated null payloads | +| record | [RequiredWithEscapedCharacters.RequiredWithEscapedCharacters1BoxedBoolean](#requiredwithescapedcharacters1boxedboolean)
boxed class to store validated boolean payloads | +| record | [RequiredWithEscapedCharacters.RequiredWithEscapedCharacters1BoxedNumber](#requiredwithescapedcharacters1boxednumber)
boxed class to store validated Number payloads | +| record | [RequiredWithEscapedCharacters.RequiredWithEscapedCharacters1BoxedString](#requiredwithescapedcharacters1boxedstring)
boxed class to store validated String payloads | +| record | [RequiredWithEscapedCharacters.RequiredWithEscapedCharacters1BoxedList](#requiredwithescapedcharacters1boxedlist)
boxed class to store validated List payloads | +| record | [RequiredWithEscapedCharacters.RequiredWithEscapedCharacters1BoxedMap](#requiredwithescapedcharacters1boxedmap)
boxed class to store validated Map payloads | | static class | [RequiredWithEscapedCharacters.RequiredWithEscapedCharacters1](#requiredwithescapedcharacters1)
schema class | | static class | [RequiredWithEscapedCharacters.RequiredWithEscapedCharactersMapBuilder](#requiredwithescapedcharactersmapbuilder)
builder for Map payloads | | static class | [RequiredWithEscapedCharacters.RequiredWithEscapedCharactersMap](#requiredwithescapedcharactersmap)
output class for Map payloads | ## RequiredWithEscapedCharacters1Boxed -public static abstract sealed class RequiredWithEscapedCharacters1Boxed
+public sealed interface RequiredWithEscapedCharacters1Boxed
permits
[RequiredWithEscapedCharacters1BoxedVoid](#requiredwithescapedcharacters1boxedvoid), [RequiredWithEscapedCharacters1BoxedBoolean](#requiredwithescapedcharacters1boxedboolean), @@ -33,103 +33,109 @@ permits
[RequiredWithEscapedCharacters1BoxedList](#requiredwithescapedcharacters1boxedlist), [RequiredWithEscapedCharacters1BoxedMap](#requiredwithescapedcharacters1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## RequiredWithEscapedCharacters1BoxedVoid -public static final class RequiredWithEscapedCharacters1BoxedVoid
-extends [RequiredWithEscapedCharacters1Boxed](#requiredwithescapedcharacters1boxed) +public record RequiredWithEscapedCharacters1BoxedVoid
+implements [RequiredWithEscapedCharacters1Boxed](#requiredwithescapedcharacters1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RequiredWithEscapedCharacters1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RequiredWithEscapedCharacters1BoxedBoolean -public static final class RequiredWithEscapedCharacters1BoxedBoolean
-extends [RequiredWithEscapedCharacters1Boxed](#requiredwithescapedcharacters1boxed) +public record RequiredWithEscapedCharacters1BoxedBoolean
+implements [RequiredWithEscapedCharacters1Boxed](#requiredwithescapedcharacters1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RequiredWithEscapedCharacters1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RequiredWithEscapedCharacters1BoxedNumber -public static final class RequiredWithEscapedCharacters1BoxedNumber
-extends [RequiredWithEscapedCharacters1Boxed](#requiredwithescapedcharacters1boxed) +public record RequiredWithEscapedCharacters1BoxedNumber
+implements [RequiredWithEscapedCharacters1Boxed](#requiredwithescapedcharacters1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RequiredWithEscapedCharacters1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RequiredWithEscapedCharacters1BoxedString -public static final class RequiredWithEscapedCharacters1BoxedString
-extends [RequiredWithEscapedCharacters1Boxed](#requiredwithescapedcharacters1boxed) +public record RequiredWithEscapedCharacters1BoxedString
+implements [RequiredWithEscapedCharacters1Boxed](#requiredwithescapedcharacters1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RequiredWithEscapedCharacters1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RequiredWithEscapedCharacters1BoxedList -public static final class RequiredWithEscapedCharacters1BoxedList
-extends [RequiredWithEscapedCharacters1Boxed](#requiredwithescapedcharacters1boxed) +public record RequiredWithEscapedCharacters1BoxedList
+implements [RequiredWithEscapedCharacters1Boxed](#requiredwithescapedcharacters1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RequiredWithEscapedCharacters1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RequiredWithEscapedCharacters1BoxedMap -public static final class RequiredWithEscapedCharacters1BoxedMap
-extends [RequiredWithEscapedCharacters1Boxed](#requiredwithescapedcharacters1boxed) +public record RequiredWithEscapedCharacters1BoxedMap
+implements [RequiredWithEscapedCharacters1Boxed](#requiredwithescapedcharacters1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RequiredWithEscapedCharacters1BoxedMap([RequiredWithEscapedCharactersMap](#requiredwithescapedcharactersmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [RequiredWithEscapedCharactersMap](#requiredwithescapedcharactersmap) | data
validated payload | +| [RequiredWithEscapedCharactersMap](#requiredwithescapedcharactersmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RequiredWithEscapedCharacters1 public static class RequiredWithEscapedCharacters1
@@ -161,7 +167,9 @@ A schema class that validates payloads | [RequiredWithEscapedCharacters1BoxedBoolean](#requiredwithescapedcharacters1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [RequiredWithEscapedCharacters1BoxedMap](#requiredwithescapedcharacters1boxedmap) | validateAndBox([Map<?, ?>](#requiredwithescapedcharactersmapbuilder) arg, SchemaConfiguration configuration) | | [RequiredWithEscapedCharacters1BoxedList](#requiredwithescapedcharacters1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [RequiredWithEscapedCharacters1Boxed](#requiredwithescapedcharacters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## RequiredWithEscapedCharactersMap000000Builder public class RequiredWithEscapedCharactersMap000000Builder
builder for `Map` diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/SimpleEnumValidation.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/SimpleEnumValidation.md index a1927ab15d9..f1b951c38a5 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/SimpleEnumValidation.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/SimpleEnumValidation.md @@ -4,15 +4,15 @@ public class SimpleEnumValidation
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - enum classes ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [SimpleEnumValidation.SimpleEnumValidation1Boxed](#simpleenumvalidation1boxed)
abstract sealed validated payload class | -| static class | [SimpleEnumValidation.SimpleEnumValidation1BoxedNumber](#simpleenumvalidation1boxednumber)
boxed class to store validated Number payloads | +| sealed interface | [SimpleEnumValidation.SimpleEnumValidation1Boxed](#simpleenumvalidation1boxed)
sealed interface for validated payloads | +| record | [SimpleEnumValidation.SimpleEnumValidation1BoxedNumber](#simpleenumvalidation1boxednumber)
boxed class to store validated Number payloads | | static class | [SimpleEnumValidation.SimpleEnumValidation1](#simpleenumvalidation1)
schema class | | enum | [SimpleEnumValidation.IntegerSimpleEnumValidationEnums](#integersimpleenumvalidationenums)
Integer enum | | enum | [SimpleEnumValidation.LongSimpleEnumValidationEnums](#longsimpleenumvalidationenums)
Long enum | @@ -20,27 +20,28 @@ A class that contains necessary nested | enum | [SimpleEnumValidation.DoubleSimpleEnumValidationEnums](#doublesimpleenumvalidationenums)
Double enum | ## SimpleEnumValidation1Boxed -public static abstract sealed class SimpleEnumValidation1Boxed
+public sealed interface SimpleEnumValidation1Boxed
permits
[SimpleEnumValidation1BoxedNumber](#simpleenumvalidation1boxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## SimpleEnumValidation1BoxedNumber -public static final class SimpleEnumValidation1BoxedNumber
-extends [SimpleEnumValidation1Boxed](#simpleenumvalidation1boxed) +public record SimpleEnumValidation1BoxedNumber
+implements [SimpleEnumValidation1Boxed](#simpleenumvalidation1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | SimpleEnumValidation1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## SimpleEnumValidation1 public static class SimpleEnumValidation1
@@ -81,7 +82,9 @@ int validatedPayload = SimpleEnumValidation.SimpleEnumValidation1.validate( | ----------------- | ---------------------- | | Number | validate(Number arg, SchemaConfiguration configuration) | | [SimpleEnumValidation1BoxedNumber](#simpleenumvalidation1boxednumber) | validateAndBox(Number arg, SchemaConfiguration configuration) | +| [SimpleEnumValidation1Boxed](#simpleenumvalidation1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## IntegerSimpleEnumValidationEnums public enum IntegerSimpleEnumValidationEnums
extends `Enum` diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/StringTypeMatchesStrings.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/StringTypeMatchesStrings.md index 3d2c0b40869..5166ec0ed59 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/StringTypeMatchesStrings.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/StringTypeMatchesStrings.md @@ -4,38 +4,39 @@ public class StringTypeMatchesStrings
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [StringTypeMatchesStrings.StringTypeMatchesStrings1Boxed](#stringtypematchesstrings1boxed)
abstract sealed validated payload class | -| static class | [StringTypeMatchesStrings.StringTypeMatchesStrings1BoxedString](#stringtypematchesstrings1boxedstring)
boxed class to store validated String payloads | +| sealed interface | [StringTypeMatchesStrings.StringTypeMatchesStrings1Boxed](#stringtypematchesstrings1boxed)
sealed interface for validated payloads | +| record | [StringTypeMatchesStrings.StringTypeMatchesStrings1BoxedString](#stringtypematchesstrings1boxedstring)
boxed class to store validated String payloads | | static class | [StringTypeMatchesStrings.StringTypeMatchesStrings1](#stringtypematchesstrings1)
schema class | ## StringTypeMatchesStrings1Boxed -public static abstract sealed class StringTypeMatchesStrings1Boxed
+public sealed interface StringTypeMatchesStrings1Boxed
permits
[StringTypeMatchesStrings1BoxedString](#stringtypematchesstrings1boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## StringTypeMatchesStrings1BoxedString -public static final class StringTypeMatchesStrings1BoxedString
-extends [StringTypeMatchesStrings1Boxed](#stringtypematchesstrings1boxed) +public record StringTypeMatchesStrings1BoxedString
+implements [StringTypeMatchesStrings1Boxed](#stringtypematchesstrings1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | StringTypeMatchesStrings1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## StringTypeMatchesStrings1 public static class StringTypeMatchesStrings1
diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.md index c08d63a93dc..7071167ca33 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.md @@ -4,7 +4,7 @@ public class TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,37 +12,38 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing1Boxed](#thedefaultkeyworddoesnotdoanythingifthepropertyismissing1boxed)
abstract sealed validated payload class | -| static class | [TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing1BoxedMap](#thedefaultkeyworddoesnotdoanythingifthepropertyismissing1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing1Boxed](#thedefaultkeyworddoesnotdoanythingifthepropertyismissing1boxed)
sealed interface for validated payloads | +| record | [TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing1BoxedMap](#thedefaultkeyworddoesnotdoanythingifthepropertyismissing1boxedmap)
boxed class to store validated Map payloads | | static class | [TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing1](#thedefaultkeyworddoesnotdoanythingifthepropertyismissing1)
schema class | | static class | [TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingMapBuilder](#thedefaultkeyworddoesnotdoanythingifthepropertyismissingmapbuilder)
builder for Map payloads | | static class | [TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingMap](#thedefaultkeyworddoesnotdoanythingifthepropertyismissingmap)
output class for Map payloads | -| static class | [TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.AlphaBoxed](#alphaboxed)
abstract sealed validated payload class | -| static class | [TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.AlphaBoxedNumber](#alphaboxednumber)
boxed class to store validated Number payloads | +| sealed interface | [TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.AlphaBoxed](#alphaboxed)
sealed interface for validated payloads | +| record | [TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.AlphaBoxedNumber](#alphaboxednumber)
boxed class to store validated Number payloads | | static class | [TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.Alpha](#alpha)
schema class | ## TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing1Boxed -public static abstract sealed class TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing1Boxed
+public sealed interface TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing1Boxed
permits
[TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing1BoxedMap](#thedefaultkeyworddoesnotdoanythingifthepropertyismissing1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing1BoxedMap -public static final class TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing1BoxedMap
-extends [TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing1Boxed](#thedefaultkeyworddoesnotdoanythingifthepropertyismissing1boxed) +public record TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing1BoxedMap
+implements [TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing1Boxed](#thedefaultkeyworddoesnotdoanythingifthepropertyismissing1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing1BoxedMap([TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingMap](#thedefaultkeyworddoesnotdoanythingifthepropertyismissingmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingMap](#thedefaultkeyworddoesnotdoanythingifthepropertyismissingmap) | data
validated payload | +| [TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingMap](#thedefaultkeyworddoesnotdoanythingifthepropertyismissingmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing1 public static class TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing1
@@ -87,7 +88,9 @@ TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.TheDefaultKeywordDoesNo | ----------------- | ---------------------- | | [TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingMap](#thedefaultkeyworddoesnotdoanythingifthepropertyismissingmap) | validate([Map<?, ?>](#thedefaultkeyworddoesnotdoanythingifthepropertyismissingmapbuilder) arg, SchemaConfiguration configuration) | | [TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing1BoxedMap](#thedefaultkeyworddoesnotdoanythingifthepropertyismissing1boxedmap) | validateAndBox([Map<?, ?>](#thedefaultkeyworddoesnotdoanythingifthepropertyismissingmapbuilder) arg, SchemaConfiguration configuration) | +| [TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing1Boxed](#thedefaultkeyworddoesnotdoanythingifthepropertyismissing1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingMapBuilder public class TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingMapBuilder
builder for `Map` @@ -131,27 +134,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## AlphaBoxed -public static abstract sealed class AlphaBoxed
+public sealed interface AlphaBoxed
permits
[AlphaBoxedNumber](#alphaboxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AlphaBoxedNumber -public static final class AlphaBoxedNumber
-extends [AlphaBoxed](#alphaboxed) +public record AlphaBoxedNumber
+implements [AlphaBoxed](#alphaboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AlphaBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Alpha public static class Alpha
@@ -193,5 +197,7 @@ int validatedPayload = TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing. | ----------------- | ---------------------- | | Number | validate(Number arg, SchemaConfiguration configuration) | | [AlphaBoxedNumber](#alphaboxednumber) | validateAndBox(Number arg, SchemaConfiguration configuration) | +| [AlphaBoxed](#alphaboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/UniqueitemsFalseValidation.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/UniqueitemsFalseValidation.md index d535b08ed84..322fd231596 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/UniqueitemsFalseValidation.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/UniqueitemsFalseValidation.md @@ -4,23 +4,23 @@ public class UniqueitemsFalseValidation
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [UniqueitemsFalseValidation.UniqueitemsFalseValidation1Boxed](#uniqueitemsfalsevalidation1boxed)
abstract sealed validated payload class | -| static class | [UniqueitemsFalseValidation.UniqueitemsFalseValidation1BoxedVoid](#uniqueitemsfalsevalidation1boxedvoid)
boxed class to store validated null payloads | -| static class | [UniqueitemsFalseValidation.UniqueitemsFalseValidation1BoxedBoolean](#uniqueitemsfalsevalidation1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [UniqueitemsFalseValidation.UniqueitemsFalseValidation1BoxedNumber](#uniqueitemsfalsevalidation1boxednumber)
boxed class to store validated Number payloads | -| static class | [UniqueitemsFalseValidation.UniqueitemsFalseValidation1BoxedString](#uniqueitemsfalsevalidation1boxedstring)
boxed class to store validated String payloads | -| static class | [UniqueitemsFalseValidation.UniqueitemsFalseValidation1BoxedList](#uniqueitemsfalsevalidation1boxedlist)
boxed class to store validated List payloads | -| static class | [UniqueitemsFalseValidation.UniqueitemsFalseValidation1BoxedMap](#uniqueitemsfalsevalidation1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [UniqueitemsFalseValidation.UniqueitemsFalseValidation1Boxed](#uniqueitemsfalsevalidation1boxed)
sealed interface for validated payloads | +| record | [UniqueitemsFalseValidation.UniqueitemsFalseValidation1BoxedVoid](#uniqueitemsfalsevalidation1boxedvoid)
boxed class to store validated null payloads | +| record | [UniqueitemsFalseValidation.UniqueitemsFalseValidation1BoxedBoolean](#uniqueitemsfalsevalidation1boxedboolean)
boxed class to store validated boolean payloads | +| record | [UniqueitemsFalseValidation.UniqueitemsFalseValidation1BoxedNumber](#uniqueitemsfalsevalidation1boxednumber)
boxed class to store validated Number payloads | +| record | [UniqueitemsFalseValidation.UniqueitemsFalseValidation1BoxedString](#uniqueitemsfalsevalidation1boxedstring)
boxed class to store validated String payloads | +| record | [UniqueitemsFalseValidation.UniqueitemsFalseValidation1BoxedList](#uniqueitemsfalsevalidation1boxedlist)
boxed class to store validated List payloads | +| record | [UniqueitemsFalseValidation.UniqueitemsFalseValidation1BoxedMap](#uniqueitemsfalsevalidation1boxedmap)
boxed class to store validated Map payloads | | static class | [UniqueitemsFalseValidation.UniqueitemsFalseValidation1](#uniqueitemsfalsevalidation1)
schema class | ## UniqueitemsFalseValidation1Boxed -public static abstract sealed class UniqueitemsFalseValidation1Boxed
+public sealed interface UniqueitemsFalseValidation1Boxed
permits
[UniqueitemsFalseValidation1BoxedVoid](#uniqueitemsfalsevalidation1boxedvoid), [UniqueitemsFalseValidation1BoxedBoolean](#uniqueitemsfalsevalidation1boxedboolean), @@ -29,103 +29,109 @@ permits
[UniqueitemsFalseValidation1BoxedList](#uniqueitemsfalsevalidation1boxedlist), [UniqueitemsFalseValidation1BoxedMap](#uniqueitemsfalsevalidation1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## UniqueitemsFalseValidation1BoxedVoid -public static final class UniqueitemsFalseValidation1BoxedVoid
-extends [UniqueitemsFalseValidation1Boxed](#uniqueitemsfalsevalidation1boxed) +public record UniqueitemsFalseValidation1BoxedVoid
+implements [UniqueitemsFalseValidation1Boxed](#uniqueitemsfalsevalidation1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UniqueitemsFalseValidation1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UniqueitemsFalseValidation1BoxedBoolean -public static final class UniqueitemsFalseValidation1BoxedBoolean
-extends [UniqueitemsFalseValidation1Boxed](#uniqueitemsfalsevalidation1boxed) +public record UniqueitemsFalseValidation1BoxedBoolean
+implements [UniqueitemsFalseValidation1Boxed](#uniqueitemsfalsevalidation1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UniqueitemsFalseValidation1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UniqueitemsFalseValidation1BoxedNumber -public static final class UniqueitemsFalseValidation1BoxedNumber
-extends [UniqueitemsFalseValidation1Boxed](#uniqueitemsfalsevalidation1boxed) +public record UniqueitemsFalseValidation1BoxedNumber
+implements [UniqueitemsFalseValidation1Boxed](#uniqueitemsfalsevalidation1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UniqueitemsFalseValidation1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UniqueitemsFalseValidation1BoxedString -public static final class UniqueitemsFalseValidation1BoxedString
-extends [UniqueitemsFalseValidation1Boxed](#uniqueitemsfalsevalidation1boxed) +public record UniqueitemsFalseValidation1BoxedString
+implements [UniqueitemsFalseValidation1Boxed](#uniqueitemsfalsevalidation1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UniqueitemsFalseValidation1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UniqueitemsFalseValidation1BoxedList -public static final class UniqueitemsFalseValidation1BoxedList
-extends [UniqueitemsFalseValidation1Boxed](#uniqueitemsfalsevalidation1boxed) +public record UniqueitemsFalseValidation1BoxedList
+implements [UniqueitemsFalseValidation1Boxed](#uniqueitemsfalsevalidation1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UniqueitemsFalseValidation1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UniqueitemsFalseValidation1BoxedMap -public static final class UniqueitemsFalseValidation1BoxedMap
-extends [UniqueitemsFalseValidation1Boxed](#uniqueitemsfalsevalidation1boxed) +public record UniqueitemsFalseValidation1BoxedMap
+implements [UniqueitemsFalseValidation1Boxed](#uniqueitemsfalsevalidation1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UniqueitemsFalseValidation1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UniqueitemsFalseValidation1 public static class UniqueitemsFalseValidation1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [UniqueitemsFalseValidation1BoxedBoolean](#uniqueitemsfalsevalidation1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [UniqueitemsFalseValidation1BoxedMap](#uniqueitemsfalsevalidation1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [UniqueitemsFalseValidation1BoxedList](#uniqueitemsfalsevalidation1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [UniqueitemsFalseValidation1Boxed](#uniqueitemsfalsevalidation1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/UniqueitemsValidation.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/UniqueitemsValidation.md index ba4c7a9730c..be6b794fe51 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/UniqueitemsValidation.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/UniqueitemsValidation.md @@ -4,23 +4,23 @@ public class UniqueitemsValidation
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [UniqueitemsValidation.UniqueitemsValidation1Boxed](#uniqueitemsvalidation1boxed)
abstract sealed validated payload class | -| static class | [UniqueitemsValidation.UniqueitemsValidation1BoxedVoid](#uniqueitemsvalidation1boxedvoid)
boxed class to store validated null payloads | -| static class | [UniqueitemsValidation.UniqueitemsValidation1BoxedBoolean](#uniqueitemsvalidation1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [UniqueitemsValidation.UniqueitemsValidation1BoxedNumber](#uniqueitemsvalidation1boxednumber)
boxed class to store validated Number payloads | -| static class | [UniqueitemsValidation.UniqueitemsValidation1BoxedString](#uniqueitemsvalidation1boxedstring)
boxed class to store validated String payloads | -| static class | [UniqueitemsValidation.UniqueitemsValidation1BoxedList](#uniqueitemsvalidation1boxedlist)
boxed class to store validated List payloads | -| static class | [UniqueitemsValidation.UniqueitemsValidation1BoxedMap](#uniqueitemsvalidation1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [UniqueitemsValidation.UniqueitemsValidation1Boxed](#uniqueitemsvalidation1boxed)
sealed interface for validated payloads | +| record | [UniqueitemsValidation.UniqueitemsValidation1BoxedVoid](#uniqueitemsvalidation1boxedvoid)
boxed class to store validated null payloads | +| record | [UniqueitemsValidation.UniqueitemsValidation1BoxedBoolean](#uniqueitemsvalidation1boxedboolean)
boxed class to store validated boolean payloads | +| record | [UniqueitemsValidation.UniqueitemsValidation1BoxedNumber](#uniqueitemsvalidation1boxednumber)
boxed class to store validated Number payloads | +| record | [UniqueitemsValidation.UniqueitemsValidation1BoxedString](#uniqueitemsvalidation1boxedstring)
boxed class to store validated String payloads | +| record | [UniqueitemsValidation.UniqueitemsValidation1BoxedList](#uniqueitemsvalidation1boxedlist)
boxed class to store validated List payloads | +| record | [UniqueitemsValidation.UniqueitemsValidation1BoxedMap](#uniqueitemsvalidation1boxedmap)
boxed class to store validated Map payloads | | static class | [UniqueitemsValidation.UniqueitemsValidation1](#uniqueitemsvalidation1)
schema class | ## UniqueitemsValidation1Boxed -public static abstract sealed class UniqueitemsValidation1Boxed
+public sealed interface UniqueitemsValidation1Boxed
permits
[UniqueitemsValidation1BoxedVoid](#uniqueitemsvalidation1boxedvoid), [UniqueitemsValidation1BoxedBoolean](#uniqueitemsvalidation1boxedboolean), @@ -29,103 +29,109 @@ permits
[UniqueitemsValidation1BoxedList](#uniqueitemsvalidation1boxedlist), [UniqueitemsValidation1BoxedMap](#uniqueitemsvalidation1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## UniqueitemsValidation1BoxedVoid -public static final class UniqueitemsValidation1BoxedVoid
-extends [UniqueitemsValidation1Boxed](#uniqueitemsvalidation1boxed) +public record UniqueitemsValidation1BoxedVoid
+implements [UniqueitemsValidation1Boxed](#uniqueitemsvalidation1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UniqueitemsValidation1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UniqueitemsValidation1BoxedBoolean -public static final class UniqueitemsValidation1BoxedBoolean
-extends [UniqueitemsValidation1Boxed](#uniqueitemsvalidation1boxed) +public record UniqueitemsValidation1BoxedBoolean
+implements [UniqueitemsValidation1Boxed](#uniqueitemsvalidation1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UniqueitemsValidation1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UniqueitemsValidation1BoxedNumber -public static final class UniqueitemsValidation1BoxedNumber
-extends [UniqueitemsValidation1Boxed](#uniqueitemsvalidation1boxed) +public record UniqueitemsValidation1BoxedNumber
+implements [UniqueitemsValidation1Boxed](#uniqueitemsvalidation1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UniqueitemsValidation1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UniqueitemsValidation1BoxedString -public static final class UniqueitemsValidation1BoxedString
-extends [UniqueitemsValidation1Boxed](#uniqueitemsvalidation1boxed) +public record UniqueitemsValidation1BoxedString
+implements [UniqueitemsValidation1Boxed](#uniqueitemsvalidation1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UniqueitemsValidation1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UniqueitemsValidation1BoxedList -public static final class UniqueitemsValidation1BoxedList
-extends [UniqueitemsValidation1Boxed](#uniqueitemsvalidation1boxed) +public record UniqueitemsValidation1BoxedList
+implements [UniqueitemsValidation1Boxed](#uniqueitemsvalidation1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UniqueitemsValidation1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UniqueitemsValidation1BoxedMap -public static final class UniqueitemsValidation1BoxedMap
-extends [UniqueitemsValidation1Boxed](#uniqueitemsvalidation1boxed) +public record UniqueitemsValidation1BoxedMap
+implements [UniqueitemsValidation1Boxed](#uniqueitemsvalidation1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UniqueitemsValidation1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UniqueitemsValidation1 public static class UniqueitemsValidation1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [UniqueitemsValidation1BoxedBoolean](#uniqueitemsvalidation1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [UniqueitemsValidation1BoxedMap](#uniqueitemsvalidation1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [UniqueitemsValidation1BoxedList](#uniqueitemsvalidation1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [UniqueitemsValidation1Boxed](#uniqueitemsvalidation1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/UriFormat.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/UriFormat.md index e88ec7c7e06..86070ed0198 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/UriFormat.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/UriFormat.md @@ -4,23 +4,23 @@ public class UriFormat
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [UriFormat.UriFormat1Boxed](#uriformat1boxed)
abstract sealed validated payload class | -| static class | [UriFormat.UriFormat1BoxedVoid](#uriformat1boxedvoid)
boxed class to store validated null payloads | -| static class | [UriFormat.UriFormat1BoxedBoolean](#uriformat1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [UriFormat.UriFormat1BoxedNumber](#uriformat1boxednumber)
boxed class to store validated Number payloads | -| static class | [UriFormat.UriFormat1BoxedString](#uriformat1boxedstring)
boxed class to store validated String payloads | -| static class | [UriFormat.UriFormat1BoxedList](#uriformat1boxedlist)
boxed class to store validated List payloads | -| static class | [UriFormat.UriFormat1BoxedMap](#uriformat1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [UriFormat.UriFormat1Boxed](#uriformat1boxed)
sealed interface for validated payloads | +| record | [UriFormat.UriFormat1BoxedVoid](#uriformat1boxedvoid)
boxed class to store validated null payloads | +| record | [UriFormat.UriFormat1BoxedBoolean](#uriformat1boxedboolean)
boxed class to store validated boolean payloads | +| record | [UriFormat.UriFormat1BoxedNumber](#uriformat1boxednumber)
boxed class to store validated Number payloads | +| record | [UriFormat.UriFormat1BoxedString](#uriformat1boxedstring)
boxed class to store validated String payloads | +| record | [UriFormat.UriFormat1BoxedList](#uriformat1boxedlist)
boxed class to store validated List payloads | +| record | [UriFormat.UriFormat1BoxedMap](#uriformat1boxedmap)
boxed class to store validated Map payloads | | static class | [UriFormat.UriFormat1](#uriformat1)
schema class | ## UriFormat1Boxed -public static abstract sealed class UriFormat1Boxed
+public sealed interface UriFormat1Boxed
permits
[UriFormat1BoxedVoid](#uriformat1boxedvoid), [UriFormat1BoxedBoolean](#uriformat1boxedboolean), @@ -29,103 +29,109 @@ permits
[UriFormat1BoxedList](#uriformat1boxedlist), [UriFormat1BoxedMap](#uriformat1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## UriFormat1BoxedVoid -public static final class UriFormat1BoxedVoid
-extends [UriFormat1Boxed](#uriformat1boxed) +public record UriFormat1BoxedVoid
+implements [UriFormat1Boxed](#uriformat1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UriFormat1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UriFormat1BoxedBoolean -public static final class UriFormat1BoxedBoolean
-extends [UriFormat1Boxed](#uriformat1boxed) +public record UriFormat1BoxedBoolean
+implements [UriFormat1Boxed](#uriformat1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UriFormat1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UriFormat1BoxedNumber -public static final class UriFormat1BoxedNumber
-extends [UriFormat1Boxed](#uriformat1boxed) +public record UriFormat1BoxedNumber
+implements [UriFormat1Boxed](#uriformat1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UriFormat1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UriFormat1BoxedString -public static final class UriFormat1BoxedString
-extends [UriFormat1Boxed](#uriformat1boxed) +public record UriFormat1BoxedString
+implements [UriFormat1Boxed](#uriformat1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UriFormat1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UriFormat1BoxedList -public static final class UriFormat1BoxedList
-extends [UriFormat1Boxed](#uriformat1boxed) +public record UriFormat1BoxedList
+implements [UriFormat1Boxed](#uriformat1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UriFormat1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UriFormat1BoxedMap -public static final class UriFormat1BoxedMap
-extends [UriFormat1Boxed](#uriformat1boxed) +public record UriFormat1BoxedMap
+implements [UriFormat1Boxed](#uriformat1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UriFormat1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UriFormat1 public static class UriFormat1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [UriFormat1BoxedBoolean](#uriformat1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [UriFormat1BoxedMap](#uriformat1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [UriFormat1BoxedList](#uriformat1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [UriFormat1Boxed](#uriformat1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/UriReferenceFormat.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/UriReferenceFormat.md index 6292b784449..9b8f21979a3 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/UriReferenceFormat.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/UriReferenceFormat.md @@ -4,23 +4,23 @@ public class UriReferenceFormat
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [UriReferenceFormat.UriReferenceFormat1Boxed](#urireferenceformat1boxed)
abstract sealed validated payload class | -| static class | [UriReferenceFormat.UriReferenceFormat1BoxedVoid](#urireferenceformat1boxedvoid)
boxed class to store validated null payloads | -| static class | [UriReferenceFormat.UriReferenceFormat1BoxedBoolean](#urireferenceformat1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [UriReferenceFormat.UriReferenceFormat1BoxedNumber](#urireferenceformat1boxednumber)
boxed class to store validated Number payloads | -| static class | [UriReferenceFormat.UriReferenceFormat1BoxedString](#urireferenceformat1boxedstring)
boxed class to store validated String payloads | -| static class | [UriReferenceFormat.UriReferenceFormat1BoxedList](#urireferenceformat1boxedlist)
boxed class to store validated List payloads | -| static class | [UriReferenceFormat.UriReferenceFormat1BoxedMap](#urireferenceformat1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [UriReferenceFormat.UriReferenceFormat1Boxed](#urireferenceformat1boxed)
sealed interface for validated payloads | +| record | [UriReferenceFormat.UriReferenceFormat1BoxedVoid](#urireferenceformat1boxedvoid)
boxed class to store validated null payloads | +| record | [UriReferenceFormat.UriReferenceFormat1BoxedBoolean](#urireferenceformat1boxedboolean)
boxed class to store validated boolean payloads | +| record | [UriReferenceFormat.UriReferenceFormat1BoxedNumber](#urireferenceformat1boxednumber)
boxed class to store validated Number payloads | +| record | [UriReferenceFormat.UriReferenceFormat1BoxedString](#urireferenceformat1boxedstring)
boxed class to store validated String payloads | +| record | [UriReferenceFormat.UriReferenceFormat1BoxedList](#urireferenceformat1boxedlist)
boxed class to store validated List payloads | +| record | [UriReferenceFormat.UriReferenceFormat1BoxedMap](#urireferenceformat1boxedmap)
boxed class to store validated Map payloads | | static class | [UriReferenceFormat.UriReferenceFormat1](#urireferenceformat1)
schema class | ## UriReferenceFormat1Boxed -public static abstract sealed class UriReferenceFormat1Boxed
+public sealed interface UriReferenceFormat1Boxed
permits
[UriReferenceFormat1BoxedVoid](#urireferenceformat1boxedvoid), [UriReferenceFormat1BoxedBoolean](#urireferenceformat1boxedboolean), @@ -29,103 +29,109 @@ permits
[UriReferenceFormat1BoxedList](#urireferenceformat1boxedlist), [UriReferenceFormat1BoxedMap](#urireferenceformat1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## UriReferenceFormat1BoxedVoid -public static final class UriReferenceFormat1BoxedVoid
-extends [UriReferenceFormat1Boxed](#urireferenceformat1boxed) +public record UriReferenceFormat1BoxedVoid
+implements [UriReferenceFormat1Boxed](#urireferenceformat1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UriReferenceFormat1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UriReferenceFormat1BoxedBoolean -public static final class UriReferenceFormat1BoxedBoolean
-extends [UriReferenceFormat1Boxed](#urireferenceformat1boxed) +public record UriReferenceFormat1BoxedBoolean
+implements [UriReferenceFormat1Boxed](#urireferenceformat1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UriReferenceFormat1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UriReferenceFormat1BoxedNumber -public static final class UriReferenceFormat1BoxedNumber
-extends [UriReferenceFormat1Boxed](#urireferenceformat1boxed) +public record UriReferenceFormat1BoxedNumber
+implements [UriReferenceFormat1Boxed](#urireferenceformat1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UriReferenceFormat1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UriReferenceFormat1BoxedString -public static final class UriReferenceFormat1BoxedString
-extends [UriReferenceFormat1Boxed](#urireferenceformat1boxed) +public record UriReferenceFormat1BoxedString
+implements [UriReferenceFormat1Boxed](#urireferenceformat1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UriReferenceFormat1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UriReferenceFormat1BoxedList -public static final class UriReferenceFormat1BoxedList
-extends [UriReferenceFormat1Boxed](#urireferenceformat1boxed) +public record UriReferenceFormat1BoxedList
+implements [UriReferenceFormat1Boxed](#urireferenceformat1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UriReferenceFormat1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UriReferenceFormat1BoxedMap -public static final class UriReferenceFormat1BoxedMap
-extends [UriReferenceFormat1Boxed](#urireferenceformat1boxed) +public record UriReferenceFormat1BoxedMap
+implements [UriReferenceFormat1Boxed](#urireferenceformat1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UriReferenceFormat1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UriReferenceFormat1 public static class UriReferenceFormat1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [UriReferenceFormat1BoxedBoolean](#urireferenceformat1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [UriReferenceFormat1BoxedMap](#urireferenceformat1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [UriReferenceFormat1BoxedList](#urireferenceformat1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [UriReferenceFormat1Boxed](#urireferenceformat1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_0_3_unit_test/java/docs/components/schemas/UriTemplateFormat.md b/samples/client/3_0_3_unit_test/java/docs/components/schemas/UriTemplateFormat.md index 22c921701b2..a95971b7ca9 100644 --- a/samples/client/3_0_3_unit_test/java/docs/components/schemas/UriTemplateFormat.md +++ b/samples/client/3_0_3_unit_test/java/docs/components/schemas/UriTemplateFormat.md @@ -4,23 +4,23 @@ public class UriTemplateFormat
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [UriTemplateFormat.UriTemplateFormat1Boxed](#uritemplateformat1boxed)
abstract sealed validated payload class | -| static class | [UriTemplateFormat.UriTemplateFormat1BoxedVoid](#uritemplateformat1boxedvoid)
boxed class to store validated null payloads | -| static class | [UriTemplateFormat.UriTemplateFormat1BoxedBoolean](#uritemplateformat1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [UriTemplateFormat.UriTemplateFormat1BoxedNumber](#uritemplateformat1boxednumber)
boxed class to store validated Number payloads | -| static class | [UriTemplateFormat.UriTemplateFormat1BoxedString](#uritemplateformat1boxedstring)
boxed class to store validated String payloads | -| static class | [UriTemplateFormat.UriTemplateFormat1BoxedList](#uritemplateformat1boxedlist)
boxed class to store validated List payloads | -| static class | [UriTemplateFormat.UriTemplateFormat1BoxedMap](#uritemplateformat1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [UriTemplateFormat.UriTemplateFormat1Boxed](#uritemplateformat1boxed)
sealed interface for validated payloads | +| record | [UriTemplateFormat.UriTemplateFormat1BoxedVoid](#uritemplateformat1boxedvoid)
boxed class to store validated null payloads | +| record | [UriTemplateFormat.UriTemplateFormat1BoxedBoolean](#uritemplateformat1boxedboolean)
boxed class to store validated boolean payloads | +| record | [UriTemplateFormat.UriTemplateFormat1BoxedNumber](#uritemplateformat1boxednumber)
boxed class to store validated Number payloads | +| record | [UriTemplateFormat.UriTemplateFormat1BoxedString](#uritemplateformat1boxedstring)
boxed class to store validated String payloads | +| record | [UriTemplateFormat.UriTemplateFormat1BoxedList](#uritemplateformat1boxedlist)
boxed class to store validated List payloads | +| record | [UriTemplateFormat.UriTemplateFormat1BoxedMap](#uritemplateformat1boxedmap)
boxed class to store validated Map payloads | | static class | [UriTemplateFormat.UriTemplateFormat1](#uritemplateformat1)
schema class | ## UriTemplateFormat1Boxed -public static abstract sealed class UriTemplateFormat1Boxed
+public sealed interface UriTemplateFormat1Boxed
permits
[UriTemplateFormat1BoxedVoid](#uritemplateformat1boxedvoid), [UriTemplateFormat1BoxedBoolean](#uritemplateformat1boxedboolean), @@ -29,103 +29,109 @@ permits
[UriTemplateFormat1BoxedList](#uritemplateformat1boxedlist), [UriTemplateFormat1BoxedMap](#uritemplateformat1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## UriTemplateFormat1BoxedVoid -public static final class UriTemplateFormat1BoxedVoid
-extends [UriTemplateFormat1Boxed](#uritemplateformat1boxed) +public record UriTemplateFormat1BoxedVoid
+implements [UriTemplateFormat1Boxed](#uritemplateformat1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UriTemplateFormat1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UriTemplateFormat1BoxedBoolean -public static final class UriTemplateFormat1BoxedBoolean
-extends [UriTemplateFormat1Boxed](#uritemplateformat1boxed) +public record UriTemplateFormat1BoxedBoolean
+implements [UriTemplateFormat1Boxed](#uritemplateformat1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UriTemplateFormat1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UriTemplateFormat1BoxedNumber -public static final class UriTemplateFormat1BoxedNumber
-extends [UriTemplateFormat1Boxed](#uritemplateformat1boxed) +public record UriTemplateFormat1BoxedNumber
+implements [UriTemplateFormat1Boxed](#uritemplateformat1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UriTemplateFormat1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UriTemplateFormat1BoxedString -public static final class UriTemplateFormat1BoxedString
-extends [UriTemplateFormat1Boxed](#uritemplateformat1boxed) +public record UriTemplateFormat1BoxedString
+implements [UriTemplateFormat1Boxed](#uritemplateformat1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UriTemplateFormat1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UriTemplateFormat1BoxedList -public static final class UriTemplateFormat1BoxedList
-extends [UriTemplateFormat1Boxed](#uritemplateformat1boxed) +public record UriTemplateFormat1BoxedList
+implements [UriTemplateFormat1Boxed](#uritemplateformat1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UriTemplateFormat1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UriTemplateFormat1BoxedMap -public static final class UriTemplateFormat1BoxedMap
-extends [UriTemplateFormat1Boxed](#uritemplateformat1boxed) +public record UriTemplateFormat1BoxedMap
+implements [UriTemplateFormat1Boxed](#uritemplateformat1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UriTemplateFormat1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UriTemplateFormat1 public static class UriTemplateFormat1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [UriTemplateFormat1BoxedBoolean](#uritemplateformat1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [UriTemplateFormat1BoxedMap](#uritemplateformat1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [UriTemplateFormat1BoxedList](#uritemplateformat1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [UriTemplateFormat1Boxed](#uritemplateformat1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_0_3_unit_test/java/pom.xml b/samples/client/3_0_3_unit_test/java/pom.xml index 0af6a0f12f4..d67521577de 100644 --- a/samples/client/3_0_3_unit_test/java/pom.xml +++ b/samples/client/3_0_3_unit_test/java/pom.xml @@ -94,7 +94,7 @@ org.apache.maven.plugins maven-surefire-plugin - 2.12 + 3.2.5 @@ -103,8 +103,8 @@ -Xms512m -Xmx1500m - methods - pertest + classes + true diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.java index a3acabae850..b91c994ef9b 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.java @@ -255,23 +255,19 @@ public AdditionalpropertiesAllowsASchemaWhichShouldValidateMapBuilder getBuilder } - public static abstract sealed class AdditionalpropertiesAllowsASchemaWhichShouldValidate1Boxed permits AdditionalpropertiesAllowsASchemaWhichShouldValidate1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface AdditionalpropertiesAllowsASchemaWhichShouldValidate1Boxed permits AdditionalpropertiesAllowsASchemaWhichShouldValidate1BoxedMap { + @Nullable Object getData(); } - public static final class AdditionalpropertiesAllowsASchemaWhichShouldValidate1BoxedMap extends AdditionalpropertiesAllowsASchemaWhichShouldValidate1Boxed { - public final AdditionalpropertiesAllowsASchemaWhichShouldValidateMap data; - private AdditionalpropertiesAllowsASchemaWhichShouldValidate1BoxedMap(AdditionalpropertiesAllowsASchemaWhichShouldValidateMap data) { - this.data = data; - } + public record AdditionalpropertiesAllowsASchemaWhichShouldValidate1BoxedMap(AdditionalpropertiesAllowsASchemaWhichShouldValidateMap data) implements AdditionalpropertiesAllowsASchemaWhichShouldValidate1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class AdditionalpropertiesAllowsASchemaWhichShouldValidate1 extends JsonSchema implements MapSchemaValidator { + public static class AdditionalpropertiesAllowsASchemaWhichShouldValidate1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -309,11 +305,11 @@ public AdditionalpropertiesAllowsASchemaWhichShouldValidateMap getNewInstance(Ma List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -350,6 +346,13 @@ public AdditionalpropertiesAllowsASchemaWhichShouldValidateMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new AdditionalpropertiesAllowsASchemaWhichShouldValidate1BoxedMap(validate(arg, configuration)); } + @Override + public AdditionalpropertiesAllowsASchemaWhichShouldValidate1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAreAllowedByDefault.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAreAllowedByDefault.java index f572d0ef637..e6517f75b10 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAreAllowedByDefault.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAreAllowedByDefault.java @@ -236,78 +236,54 @@ public AdditionalpropertiesAreAllowedByDefaultMapBuilder getBuilderAfterAddition } - public static abstract sealed class AdditionalpropertiesAreAllowedByDefault1Boxed permits AdditionalpropertiesAreAllowedByDefault1BoxedVoid, AdditionalpropertiesAreAllowedByDefault1BoxedBoolean, AdditionalpropertiesAreAllowedByDefault1BoxedNumber, AdditionalpropertiesAreAllowedByDefault1BoxedString, AdditionalpropertiesAreAllowedByDefault1BoxedList, AdditionalpropertiesAreAllowedByDefault1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface AdditionalpropertiesAreAllowedByDefault1Boxed permits AdditionalpropertiesAreAllowedByDefault1BoxedVoid, AdditionalpropertiesAreAllowedByDefault1BoxedBoolean, AdditionalpropertiesAreAllowedByDefault1BoxedNumber, AdditionalpropertiesAreAllowedByDefault1BoxedString, AdditionalpropertiesAreAllowedByDefault1BoxedList, AdditionalpropertiesAreAllowedByDefault1BoxedMap { + @Nullable Object getData(); } - public static final class AdditionalpropertiesAreAllowedByDefault1BoxedVoid extends AdditionalpropertiesAreAllowedByDefault1Boxed { - public final Void data; - private AdditionalpropertiesAreAllowedByDefault1BoxedVoid(Void data) { - this.data = data; - } + public record AdditionalpropertiesAreAllowedByDefault1BoxedVoid(Void data) implements AdditionalpropertiesAreAllowedByDefault1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AdditionalpropertiesAreAllowedByDefault1BoxedBoolean extends AdditionalpropertiesAreAllowedByDefault1Boxed { - public final boolean data; - private AdditionalpropertiesAreAllowedByDefault1BoxedBoolean(boolean data) { - this.data = data; - } + public record AdditionalpropertiesAreAllowedByDefault1BoxedBoolean(boolean data) implements AdditionalpropertiesAreAllowedByDefault1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AdditionalpropertiesAreAllowedByDefault1BoxedNumber extends AdditionalpropertiesAreAllowedByDefault1Boxed { - public final Number data; - private AdditionalpropertiesAreAllowedByDefault1BoxedNumber(Number data) { - this.data = data; - } + public record AdditionalpropertiesAreAllowedByDefault1BoxedNumber(Number data) implements AdditionalpropertiesAreAllowedByDefault1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AdditionalpropertiesAreAllowedByDefault1BoxedString extends AdditionalpropertiesAreAllowedByDefault1Boxed { - public final String data; - private AdditionalpropertiesAreAllowedByDefault1BoxedString(String data) { - this.data = data; - } + public record AdditionalpropertiesAreAllowedByDefault1BoxedString(String data) implements AdditionalpropertiesAreAllowedByDefault1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AdditionalpropertiesAreAllowedByDefault1BoxedList extends AdditionalpropertiesAreAllowedByDefault1Boxed { - public final FrozenList<@Nullable Object> data; - private AdditionalpropertiesAreAllowedByDefault1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record AdditionalpropertiesAreAllowedByDefault1BoxedList(FrozenList<@Nullable Object> data) implements AdditionalpropertiesAreAllowedByDefault1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AdditionalpropertiesAreAllowedByDefault1BoxedMap extends AdditionalpropertiesAreAllowedByDefault1Boxed { - public final AdditionalpropertiesAreAllowedByDefaultMap data; - private AdditionalpropertiesAreAllowedByDefault1BoxedMap(AdditionalpropertiesAreAllowedByDefaultMap data) { - this.data = data; - } + public record AdditionalpropertiesAreAllowedByDefault1BoxedMap(AdditionalpropertiesAreAllowedByDefaultMap data) implements AdditionalpropertiesAreAllowedByDefault1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class AdditionalpropertiesAreAllowedByDefault1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, AdditionalpropertiesAreAllowedByDefault1BoxedList>, MapSchemaValidator { + public static class AdditionalpropertiesAreAllowedByDefault1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, AdditionalpropertiesAreAllowedByDefault1BoxedList>, MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -415,11 +391,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -450,11 +426,11 @@ public AdditionalpropertiesAreAllowedByDefaultMap getNewInstance(Map arg, List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -533,5 +509,24 @@ public AdditionalpropertiesAreAllowedByDefault1BoxedList validateAndBox(List public AdditionalpropertiesAreAllowedByDefault1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new AdditionalpropertiesAreAllowedByDefault1BoxedMap(validate(arg, configuration)); } + @Override + public AdditionalpropertiesAreAllowedByDefault1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesCanExistByItself.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesCanExistByItself.java index 3b243ef9a6c..649e69307db 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesCanExistByItself.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesCanExistByItself.java @@ -93,23 +93,19 @@ public AdditionalpropertiesCanExistByItselfMapBuilder getBuilderAfterAdditionalP } - public static abstract sealed class AdditionalpropertiesCanExistByItself1Boxed permits AdditionalpropertiesCanExistByItself1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface AdditionalpropertiesCanExistByItself1Boxed permits AdditionalpropertiesCanExistByItself1BoxedMap { + @Nullable Object getData(); } - public static final class AdditionalpropertiesCanExistByItself1BoxedMap extends AdditionalpropertiesCanExistByItself1Boxed { - public final AdditionalpropertiesCanExistByItselfMap data; - private AdditionalpropertiesCanExistByItself1BoxedMap(AdditionalpropertiesCanExistByItselfMap data) { - this.data = data; - } + public record AdditionalpropertiesCanExistByItself1BoxedMap(AdditionalpropertiesCanExistByItselfMap data) implements AdditionalpropertiesCanExistByItself1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class AdditionalpropertiesCanExistByItself1 extends JsonSchema implements MapSchemaValidator { + public static class AdditionalpropertiesCanExistByItself1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -143,11 +139,11 @@ public AdditionalpropertiesCanExistByItselfMap getNewInstance(Map arg, Lis List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Boolean)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -187,6 +183,13 @@ public AdditionalpropertiesCanExistByItselfMap validate(Map arg, SchemaCon public AdditionalpropertiesCanExistByItself1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new AdditionalpropertiesCanExistByItself1BoxedMap(validate(arg, configuration)); } + @Override + public AdditionalpropertiesCanExistByItself1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.java index a349cc8a73e..46155636adf 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesShouldNotLookInApplicators.java @@ -170,78 +170,54 @@ public Schema0MapBuilder getBuilderAfterAdditionalProperty(Map data; - private Schema0BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Schema0BoxedList(FrozenList<@Nullable Object> data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedMap extends Schema0Boxed { - public final Schema0Map data; - private Schema0BoxedMap(Schema0Map data) { - this.data = data; - } + public record Schema0BoxedMap(Schema0Map data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema0BoxedList>, MapSchemaValidator { + public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema0BoxedList>, MapSchemaValidator { private static @Nullable Schema0 instance = null; protected Schema0() { @@ -342,11 +318,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -377,11 +353,11 @@ public Schema0Map getNewInstance(Map arg, List pathToItem, PathToS List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -460,6 +436,25 @@ public Schema0BoxedList validateAndBox(List arg, SchemaConfiguration configur public Schema0BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema0BoxedMap(validate(arg, configuration)); } + @Override + public Schema0Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class AdditionalpropertiesShouldNotLookInApplicatorsMap extends FrozenMap { @@ -516,78 +511,54 @@ public AdditionalpropertiesShouldNotLookInApplicatorsMapBuilder getBuilderAfterA } - public static abstract sealed class AdditionalpropertiesShouldNotLookInApplicators1Boxed permits AdditionalpropertiesShouldNotLookInApplicators1BoxedVoid, AdditionalpropertiesShouldNotLookInApplicators1BoxedBoolean, AdditionalpropertiesShouldNotLookInApplicators1BoxedNumber, AdditionalpropertiesShouldNotLookInApplicators1BoxedString, AdditionalpropertiesShouldNotLookInApplicators1BoxedList, AdditionalpropertiesShouldNotLookInApplicators1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface AdditionalpropertiesShouldNotLookInApplicators1Boxed permits AdditionalpropertiesShouldNotLookInApplicators1BoxedVoid, AdditionalpropertiesShouldNotLookInApplicators1BoxedBoolean, AdditionalpropertiesShouldNotLookInApplicators1BoxedNumber, AdditionalpropertiesShouldNotLookInApplicators1BoxedString, AdditionalpropertiesShouldNotLookInApplicators1BoxedList, AdditionalpropertiesShouldNotLookInApplicators1BoxedMap { + @Nullable Object getData(); } - public static final class AdditionalpropertiesShouldNotLookInApplicators1BoxedVoid extends AdditionalpropertiesShouldNotLookInApplicators1Boxed { - public final Void data; - private AdditionalpropertiesShouldNotLookInApplicators1BoxedVoid(Void data) { - this.data = data; - } + public record AdditionalpropertiesShouldNotLookInApplicators1BoxedVoid(Void data) implements AdditionalpropertiesShouldNotLookInApplicators1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AdditionalpropertiesShouldNotLookInApplicators1BoxedBoolean extends AdditionalpropertiesShouldNotLookInApplicators1Boxed { - public final boolean data; - private AdditionalpropertiesShouldNotLookInApplicators1BoxedBoolean(boolean data) { - this.data = data; - } + public record AdditionalpropertiesShouldNotLookInApplicators1BoxedBoolean(boolean data) implements AdditionalpropertiesShouldNotLookInApplicators1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AdditionalpropertiesShouldNotLookInApplicators1BoxedNumber extends AdditionalpropertiesShouldNotLookInApplicators1Boxed { - public final Number data; - private AdditionalpropertiesShouldNotLookInApplicators1BoxedNumber(Number data) { - this.data = data; - } + public record AdditionalpropertiesShouldNotLookInApplicators1BoxedNumber(Number data) implements AdditionalpropertiesShouldNotLookInApplicators1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AdditionalpropertiesShouldNotLookInApplicators1BoxedString extends AdditionalpropertiesShouldNotLookInApplicators1Boxed { - public final String data; - private AdditionalpropertiesShouldNotLookInApplicators1BoxedString(String data) { - this.data = data; - } + public record AdditionalpropertiesShouldNotLookInApplicators1BoxedString(String data) implements AdditionalpropertiesShouldNotLookInApplicators1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AdditionalpropertiesShouldNotLookInApplicators1BoxedList extends AdditionalpropertiesShouldNotLookInApplicators1Boxed { - public final FrozenList<@Nullable Object> data; - private AdditionalpropertiesShouldNotLookInApplicators1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record AdditionalpropertiesShouldNotLookInApplicators1BoxedList(FrozenList<@Nullable Object> data) implements AdditionalpropertiesShouldNotLookInApplicators1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AdditionalpropertiesShouldNotLookInApplicators1BoxedMap extends AdditionalpropertiesShouldNotLookInApplicators1Boxed { - public final AdditionalpropertiesShouldNotLookInApplicatorsMap data; - private AdditionalpropertiesShouldNotLookInApplicators1BoxedMap(AdditionalpropertiesShouldNotLookInApplicatorsMap data) { - this.data = data; - } + public record AdditionalpropertiesShouldNotLookInApplicators1BoxedMap(AdditionalpropertiesShouldNotLookInApplicatorsMap data) implements AdditionalpropertiesShouldNotLookInApplicators1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class AdditionalpropertiesShouldNotLookInApplicators1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, AdditionalpropertiesShouldNotLookInApplicators1BoxedList>, MapSchemaValidator { + public static class AdditionalpropertiesShouldNotLookInApplicators1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, AdditionalpropertiesShouldNotLookInApplicators1BoxedList>, MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -695,11 +666,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -730,11 +701,11 @@ public AdditionalpropertiesShouldNotLookInApplicatorsMap getNewInstance(Map propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Boolean)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -816,5 +787,24 @@ public AdditionalpropertiesShouldNotLookInApplicators1BoxedList validateAndBox(L public AdditionalpropertiesShouldNotLookInApplicators1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new AdditionalpropertiesShouldNotLookInApplicators1BoxedMap(validate(arg, configuration)); } + @Override + public AdditionalpropertiesShouldNotLookInApplicators1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java index a21785e89d4..f2c3bac9dfb 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java @@ -142,78 +142,54 @@ public Schema0Map0Builder getBuilderAfterBar(Map insta } - public static abstract sealed class Schema0Boxed permits Schema0BoxedVoid, Schema0BoxedBoolean, Schema0BoxedNumber, Schema0BoxedString, Schema0BoxedList, Schema0BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Schema0Boxed permits Schema0BoxedVoid, Schema0BoxedBoolean, Schema0BoxedNumber, Schema0BoxedString, Schema0BoxedList, Schema0BoxedMap { + @Nullable Object getData(); } - public static final class Schema0BoxedVoid extends Schema0Boxed { - public final Void data; - private Schema0BoxedVoid(Void data) { - this.data = data; - } + public record Schema0BoxedVoid(Void data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedBoolean extends Schema0Boxed { - public final boolean data; - private Schema0BoxedBoolean(boolean data) { - this.data = data; - } + public record Schema0BoxedBoolean(boolean data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedNumber extends Schema0Boxed { - public final Number data; - private Schema0BoxedNumber(Number data) { - this.data = data; - } + public record Schema0BoxedNumber(Number data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedString extends Schema0Boxed { - public final String data; - private Schema0BoxedString(String data) { - this.data = data; - } + public record Schema0BoxedString(String data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedList extends Schema0Boxed { - public final FrozenList<@Nullable Object> data; - private Schema0BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Schema0BoxedList(FrozenList<@Nullable Object> data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedMap extends Schema0Boxed { - public final Schema0Map data; - private Schema0BoxedMap(Schema0Map data) { - this.data = data; - } + public record Schema0BoxedMap(Schema0Map data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema0BoxedList>, MapSchemaValidator { + public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema0BoxedList>, MapSchemaValidator { private static @Nullable Schema0 instance = null; protected Schema0() { @@ -317,11 +293,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -352,11 +328,11 @@ public Schema0Map getNewInstance(Map arg, List pathToItem, PathToS List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -435,6 +411,25 @@ public Schema0BoxedList validateAndBox(List arg, SchemaConfiguration configur public Schema0BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema0BoxedMap(validate(arg, configuration)); } + @Override + public Schema0Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class Foo extends StringJsonSchema.StringJsonSchema1 { @@ -522,78 +517,54 @@ public Schema1Map0Builder getBuilderAfterFoo(Map insta } - public static abstract sealed class Schema1Boxed permits Schema1BoxedVoid, Schema1BoxedBoolean, Schema1BoxedNumber, Schema1BoxedString, Schema1BoxedList, Schema1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Schema1Boxed permits Schema1BoxedVoid, Schema1BoxedBoolean, Schema1BoxedNumber, Schema1BoxedString, Schema1BoxedList, Schema1BoxedMap { + @Nullable Object getData(); } - public static final class Schema1BoxedVoid extends Schema1Boxed { - public final Void data; - private Schema1BoxedVoid(Void data) { - this.data = data; - } + public record Schema1BoxedVoid(Void data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedBoolean extends Schema1Boxed { - public final boolean data; - private Schema1BoxedBoolean(boolean data) { - this.data = data; - } + public record Schema1BoxedBoolean(boolean data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedNumber extends Schema1Boxed { - public final Number data; - private Schema1BoxedNumber(Number data) { - this.data = data; - } + public record Schema1BoxedNumber(Number data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedString extends Schema1Boxed { - public final String data; - private Schema1BoxedString(String data) { - this.data = data; - } + public record Schema1BoxedString(String data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedList extends Schema1Boxed { - public final FrozenList<@Nullable Object> data; - private Schema1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Schema1BoxedList(FrozenList<@Nullable Object> data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedMap extends Schema1Boxed { - public final Schema1Map data; - private Schema1BoxedMap(Schema1Map data) { - this.data = data; - } + public record Schema1BoxedMap(Schema1Map data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema1BoxedList>, MapSchemaValidator { + public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema1BoxedList>, MapSchemaValidator { private static @Nullable Schema1 instance = null; protected Schema1() { @@ -697,11 +668,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -732,11 +703,11 @@ public Schema1Map getNewInstance(Map arg, List pathToItem, PathToS List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -815,80 +786,75 @@ public Schema1BoxedList validateAndBox(List arg, SchemaConfiguration configur public Schema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema1BoxedMap(validate(arg, configuration)); } + @Override + public Schema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class Allof1Boxed permits Allof1BoxedVoid, Allof1BoxedBoolean, Allof1BoxedNumber, Allof1BoxedString, Allof1BoxedList, Allof1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Allof1Boxed permits Allof1BoxedVoid, Allof1BoxedBoolean, Allof1BoxedNumber, Allof1BoxedString, Allof1BoxedList, Allof1BoxedMap { + @Nullable Object getData(); } - public static final class Allof1BoxedVoid extends Allof1Boxed { - public final Void data; - private Allof1BoxedVoid(Void data) { - this.data = data; - } + public record Allof1BoxedVoid(Void data) implements Allof1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Allof1BoxedBoolean extends Allof1Boxed { - public final boolean data; - private Allof1BoxedBoolean(boolean data) { - this.data = data; - } + public record Allof1BoxedBoolean(boolean data) implements Allof1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Allof1BoxedNumber extends Allof1Boxed { - public final Number data; - private Allof1BoxedNumber(Number data) { - this.data = data; - } + public record Allof1BoxedNumber(Number data) implements Allof1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Allof1BoxedString extends Allof1Boxed { - public final String data; - private Allof1BoxedString(String data) { - this.data = data; - } + public record Allof1BoxedString(String data) implements Allof1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Allof1BoxedList extends Allof1Boxed { - public final FrozenList<@Nullable Object> data; - private Allof1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Allof1BoxedList(FrozenList<@Nullable Object> data) implements Allof1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Allof1BoxedMap extends Allof1Boxed { - public final FrozenMap<@Nullable Object> data; - private Allof1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record Allof1BoxedMap(FrozenMap<@Nullable Object> data) implements Allof1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Allof1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Allof1BoxedList>, MapSchemaValidator, Allof1BoxedMap> { + public static class Allof1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Allof1BoxedList>, MapSchemaValidator, Allof1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -996,11 +962,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -1031,11 +997,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -1114,5 +1080,24 @@ public Allof1BoxedList validateAndBox(List arg, SchemaConfiguration configura public Allof1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Allof1BoxedMap(validate(arg, configuration)); } + @Override + public Allof1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofCombinedWithAnyofOneof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofCombinedWithAnyofOneof.java index eb146be7828..e17daac12ce 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofCombinedWithAnyofOneof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofCombinedWithAnyofOneof.java @@ -36,78 +36,54 @@ public class AllofCombinedWithAnyofOneof { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class Schema02Boxed permits Schema02BoxedVoid, Schema02BoxedBoolean, Schema02BoxedNumber, Schema02BoxedString, Schema02BoxedList, Schema02BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Schema02Boxed permits Schema02BoxedVoid, Schema02BoxedBoolean, Schema02BoxedNumber, Schema02BoxedString, Schema02BoxedList, Schema02BoxedMap { + @Nullable Object getData(); } - public static final class Schema02BoxedVoid extends Schema02Boxed { - public final Void data; - private Schema02BoxedVoid(Void data) { - this.data = data; - } + public record Schema02BoxedVoid(Void data) implements Schema02Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema02BoxedBoolean extends Schema02Boxed { - public final boolean data; - private Schema02BoxedBoolean(boolean data) { - this.data = data; - } + public record Schema02BoxedBoolean(boolean data) implements Schema02Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema02BoxedNumber extends Schema02Boxed { - public final Number data; - private Schema02BoxedNumber(Number data) { - this.data = data; - } + public record Schema02BoxedNumber(Number data) implements Schema02Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema02BoxedString extends Schema02Boxed { - public final String data; - private Schema02BoxedString(String data) { - this.data = data; - } + public record Schema02BoxedString(String data) implements Schema02Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema02BoxedList extends Schema02Boxed { - public final FrozenList<@Nullable Object> data; - private Schema02BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Schema02BoxedList(FrozenList<@Nullable Object> data) implements Schema02Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema02BoxedMap extends Schema02Boxed { - public final FrozenMap<@Nullable Object> data; - private Schema02BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record Schema02BoxedMap(FrozenMap<@Nullable Object> data) implements Schema02Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema02 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema02BoxedList>, MapSchemaValidator, Schema02BoxedMap> { + public static class Schema02 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema02BoxedList>, MapSchemaValidator, Schema02BoxedMap> { private static @Nullable Schema02 instance = null; protected Schema02() { @@ -206,11 +182,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -241,11 +217,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -324,80 +300,75 @@ public Schema02BoxedList validateAndBox(List arg, SchemaConfiguration configu public Schema02BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema02BoxedMap(validate(arg, configuration)); } + @Override + public Schema02Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class Schema01Boxed permits Schema01BoxedVoid, Schema01BoxedBoolean, Schema01BoxedNumber, Schema01BoxedString, Schema01BoxedList, Schema01BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Schema01Boxed permits Schema01BoxedVoid, Schema01BoxedBoolean, Schema01BoxedNumber, Schema01BoxedString, Schema01BoxedList, Schema01BoxedMap { + @Nullable Object getData(); } - public static final class Schema01BoxedVoid extends Schema01Boxed { - public final Void data; - private Schema01BoxedVoid(Void data) { - this.data = data; - } + public record Schema01BoxedVoid(Void data) implements Schema01Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema01BoxedBoolean extends Schema01Boxed { - public final boolean data; - private Schema01BoxedBoolean(boolean data) { - this.data = data; - } + public record Schema01BoxedBoolean(boolean data) implements Schema01Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema01BoxedNumber extends Schema01Boxed { - public final Number data; - private Schema01BoxedNumber(Number data) { - this.data = data; - } + public record Schema01BoxedNumber(Number data) implements Schema01Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema01BoxedString extends Schema01Boxed { - public final String data; - private Schema01BoxedString(String data) { - this.data = data; - } + public record Schema01BoxedString(String data) implements Schema01Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema01BoxedList extends Schema01Boxed { - public final FrozenList<@Nullable Object> data; - private Schema01BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Schema01BoxedList(FrozenList<@Nullable Object> data) implements Schema01Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema01BoxedMap extends Schema01Boxed { - public final FrozenMap<@Nullable Object> data; - private Schema01BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record Schema01BoxedMap(FrozenMap<@Nullable Object> data) implements Schema01Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema01 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema01BoxedList>, MapSchemaValidator, Schema01BoxedMap> { + public static class Schema01 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema01BoxedList>, MapSchemaValidator, Schema01BoxedMap> { private static @Nullable Schema01 instance = null; protected Schema01() { @@ -496,11 +467,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -531,11 +502,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -614,80 +585,75 @@ public Schema01BoxedList validateAndBox(List arg, SchemaConfiguration configu public Schema01BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema01BoxedMap(validate(arg, configuration)); } + @Override + public Schema01Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class Schema0Boxed permits Schema0BoxedVoid, Schema0BoxedBoolean, Schema0BoxedNumber, Schema0BoxedString, Schema0BoxedList, Schema0BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Schema0Boxed permits Schema0BoxedVoid, Schema0BoxedBoolean, Schema0BoxedNumber, Schema0BoxedString, Schema0BoxedList, Schema0BoxedMap { + @Nullable Object getData(); } - public static final class Schema0BoxedVoid extends Schema0Boxed { - public final Void data; - private Schema0BoxedVoid(Void data) { - this.data = data; - } + public record Schema0BoxedVoid(Void data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedBoolean extends Schema0Boxed { - public final boolean data; - private Schema0BoxedBoolean(boolean data) { - this.data = data; - } + public record Schema0BoxedBoolean(boolean data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedNumber extends Schema0Boxed { - public final Number data; - private Schema0BoxedNumber(Number data) { - this.data = data; - } + public record Schema0BoxedNumber(Number data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedString extends Schema0Boxed { - public final String data; - private Schema0BoxedString(String data) { - this.data = data; - } + public record Schema0BoxedString(String data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedList extends Schema0Boxed { - public final FrozenList<@Nullable Object> data; - private Schema0BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Schema0BoxedList(FrozenList<@Nullable Object> data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedMap extends Schema0Boxed { - public final FrozenMap<@Nullable Object> data; - private Schema0BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record Schema0BoxedMap(FrozenMap<@Nullable Object> data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema0BoxedList>, MapSchemaValidator, Schema0BoxedMap> { + public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema0BoxedList>, MapSchemaValidator, Schema0BoxedMap> { private static @Nullable Schema0 instance = null; protected Schema0() { @@ -786,11 +752,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -821,11 +787,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -904,80 +870,75 @@ public Schema0BoxedList validateAndBox(List arg, SchemaConfiguration configur public Schema0BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema0BoxedMap(validate(arg, configuration)); } + @Override + public Schema0Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class AllofCombinedWithAnyofOneof1Boxed permits AllofCombinedWithAnyofOneof1BoxedVoid, AllofCombinedWithAnyofOneof1BoxedBoolean, AllofCombinedWithAnyofOneof1BoxedNumber, AllofCombinedWithAnyofOneof1BoxedString, AllofCombinedWithAnyofOneof1BoxedList, AllofCombinedWithAnyofOneof1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface AllofCombinedWithAnyofOneof1Boxed permits AllofCombinedWithAnyofOneof1BoxedVoid, AllofCombinedWithAnyofOneof1BoxedBoolean, AllofCombinedWithAnyofOneof1BoxedNumber, AllofCombinedWithAnyofOneof1BoxedString, AllofCombinedWithAnyofOneof1BoxedList, AllofCombinedWithAnyofOneof1BoxedMap { + @Nullable Object getData(); } - public static final class AllofCombinedWithAnyofOneof1BoxedVoid extends AllofCombinedWithAnyofOneof1Boxed { - public final Void data; - private AllofCombinedWithAnyofOneof1BoxedVoid(Void data) { - this.data = data; - } + public record AllofCombinedWithAnyofOneof1BoxedVoid(Void data) implements AllofCombinedWithAnyofOneof1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AllofCombinedWithAnyofOneof1BoxedBoolean extends AllofCombinedWithAnyofOneof1Boxed { - public final boolean data; - private AllofCombinedWithAnyofOneof1BoxedBoolean(boolean data) { - this.data = data; - } + public record AllofCombinedWithAnyofOneof1BoxedBoolean(boolean data) implements AllofCombinedWithAnyofOneof1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AllofCombinedWithAnyofOneof1BoxedNumber extends AllofCombinedWithAnyofOneof1Boxed { - public final Number data; - private AllofCombinedWithAnyofOneof1BoxedNumber(Number data) { - this.data = data; - } + public record AllofCombinedWithAnyofOneof1BoxedNumber(Number data) implements AllofCombinedWithAnyofOneof1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AllofCombinedWithAnyofOneof1BoxedString extends AllofCombinedWithAnyofOneof1Boxed { - public final String data; - private AllofCombinedWithAnyofOneof1BoxedString(String data) { - this.data = data; - } + public record AllofCombinedWithAnyofOneof1BoxedString(String data) implements AllofCombinedWithAnyofOneof1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AllofCombinedWithAnyofOneof1BoxedList extends AllofCombinedWithAnyofOneof1Boxed { - public final FrozenList<@Nullable Object> data; - private AllofCombinedWithAnyofOneof1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record AllofCombinedWithAnyofOneof1BoxedList(FrozenList<@Nullable Object> data) implements AllofCombinedWithAnyofOneof1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AllofCombinedWithAnyofOneof1BoxedMap extends AllofCombinedWithAnyofOneof1Boxed { - public final FrozenMap<@Nullable Object> data; - private AllofCombinedWithAnyofOneof1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record AllofCombinedWithAnyofOneof1BoxedMap(FrozenMap<@Nullable Object> data) implements AllofCombinedWithAnyofOneof1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class AllofCombinedWithAnyofOneof1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, AllofCombinedWithAnyofOneof1BoxedList>, MapSchemaValidator, AllofCombinedWithAnyofOneof1BoxedMap> { + public static class AllofCombinedWithAnyofOneof1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, AllofCombinedWithAnyofOneof1BoxedList>, MapSchemaValidator, AllofCombinedWithAnyofOneof1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -1090,11 +1051,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -1125,11 +1086,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -1208,5 +1169,24 @@ public AllofCombinedWithAnyofOneof1BoxedList validateAndBox(List arg, SchemaC public AllofCombinedWithAnyofOneof1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new AllofCombinedWithAnyofOneof1BoxedMap(validate(arg, configuration)); } + @Override + public AllofCombinedWithAnyofOneof1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofSimpleTypes.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofSimpleTypes.java index 781a8fc1595..4c9d473a2f9 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofSimpleTypes.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofSimpleTypes.java @@ -35,78 +35,54 @@ public class AllofSimpleTypes { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class Schema0Boxed permits Schema0BoxedVoid, Schema0BoxedBoolean, Schema0BoxedNumber, Schema0BoxedString, Schema0BoxedList, Schema0BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Schema0Boxed permits Schema0BoxedVoid, Schema0BoxedBoolean, Schema0BoxedNumber, Schema0BoxedString, Schema0BoxedList, Schema0BoxedMap { + @Nullable Object getData(); } - public static final class Schema0BoxedVoid extends Schema0Boxed { - public final Void data; - private Schema0BoxedVoid(Void data) { - this.data = data; - } + public record Schema0BoxedVoid(Void data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedBoolean extends Schema0Boxed { - public final boolean data; - private Schema0BoxedBoolean(boolean data) { - this.data = data; - } + public record Schema0BoxedBoolean(boolean data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedNumber extends Schema0Boxed { - public final Number data; - private Schema0BoxedNumber(Number data) { - this.data = data; - } + public record Schema0BoxedNumber(Number data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedString extends Schema0Boxed { - public final String data; - private Schema0BoxedString(String data) { - this.data = data; - } + public record Schema0BoxedString(String data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedList extends Schema0Boxed { - public final FrozenList<@Nullable Object> data; - private Schema0BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Schema0BoxedList(FrozenList<@Nullable Object> data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedMap extends Schema0Boxed { - public final FrozenMap<@Nullable Object> data; - private Schema0BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record Schema0BoxedMap(FrozenMap<@Nullable Object> data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema0BoxedList>, MapSchemaValidator, Schema0BoxedMap> { + public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema0BoxedList>, MapSchemaValidator, Schema0BoxedMap> { private static @Nullable Schema0 instance = null; protected Schema0() { @@ -205,11 +181,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -240,11 +216,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -323,80 +299,75 @@ public Schema0BoxedList validateAndBox(List arg, SchemaConfiguration configur public Schema0BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema0BoxedMap(validate(arg, configuration)); } + @Override + public Schema0Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class Schema1Boxed permits Schema1BoxedVoid, Schema1BoxedBoolean, Schema1BoxedNumber, Schema1BoxedString, Schema1BoxedList, Schema1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Schema1Boxed permits Schema1BoxedVoid, Schema1BoxedBoolean, Schema1BoxedNumber, Schema1BoxedString, Schema1BoxedList, Schema1BoxedMap { + @Nullable Object getData(); } - public static final class Schema1BoxedVoid extends Schema1Boxed { - public final Void data; - private Schema1BoxedVoid(Void data) { - this.data = data; - } + public record Schema1BoxedVoid(Void data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedBoolean extends Schema1Boxed { - public final boolean data; - private Schema1BoxedBoolean(boolean data) { - this.data = data; - } + public record Schema1BoxedBoolean(boolean data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedNumber extends Schema1Boxed { - public final Number data; - private Schema1BoxedNumber(Number data) { - this.data = data; - } + public record Schema1BoxedNumber(Number data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedString extends Schema1Boxed { - public final String data; - private Schema1BoxedString(String data) { - this.data = data; - } + public record Schema1BoxedString(String data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedList extends Schema1Boxed { - public final FrozenList<@Nullable Object> data; - private Schema1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Schema1BoxedList(FrozenList<@Nullable Object> data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedMap extends Schema1Boxed { - public final FrozenMap<@Nullable Object> data; - private Schema1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record Schema1BoxedMap(FrozenMap<@Nullable Object> data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema1BoxedList>, MapSchemaValidator, Schema1BoxedMap> { + public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema1BoxedList>, MapSchemaValidator, Schema1BoxedMap> { private static @Nullable Schema1 instance = null; protected Schema1() { @@ -495,11 +466,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -530,11 +501,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -613,80 +584,75 @@ public Schema1BoxedList validateAndBox(List arg, SchemaConfiguration configur public Schema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema1BoxedMap(validate(arg, configuration)); } + @Override + public Schema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class AllofSimpleTypes1Boxed permits AllofSimpleTypes1BoxedVoid, AllofSimpleTypes1BoxedBoolean, AllofSimpleTypes1BoxedNumber, AllofSimpleTypes1BoxedString, AllofSimpleTypes1BoxedList, AllofSimpleTypes1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface AllofSimpleTypes1Boxed permits AllofSimpleTypes1BoxedVoid, AllofSimpleTypes1BoxedBoolean, AllofSimpleTypes1BoxedNumber, AllofSimpleTypes1BoxedString, AllofSimpleTypes1BoxedList, AllofSimpleTypes1BoxedMap { + @Nullable Object getData(); } - public static final class AllofSimpleTypes1BoxedVoid extends AllofSimpleTypes1Boxed { - public final Void data; - private AllofSimpleTypes1BoxedVoid(Void data) { - this.data = data; - } + public record AllofSimpleTypes1BoxedVoid(Void data) implements AllofSimpleTypes1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AllofSimpleTypes1BoxedBoolean extends AllofSimpleTypes1Boxed { - public final boolean data; - private AllofSimpleTypes1BoxedBoolean(boolean data) { - this.data = data; - } + public record AllofSimpleTypes1BoxedBoolean(boolean data) implements AllofSimpleTypes1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AllofSimpleTypes1BoxedNumber extends AllofSimpleTypes1Boxed { - public final Number data; - private AllofSimpleTypes1BoxedNumber(Number data) { - this.data = data; - } + public record AllofSimpleTypes1BoxedNumber(Number data) implements AllofSimpleTypes1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AllofSimpleTypes1BoxedString extends AllofSimpleTypes1Boxed { - public final String data; - private AllofSimpleTypes1BoxedString(String data) { - this.data = data; - } + public record AllofSimpleTypes1BoxedString(String data) implements AllofSimpleTypes1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AllofSimpleTypes1BoxedList extends AllofSimpleTypes1Boxed { - public final FrozenList<@Nullable Object> data; - private AllofSimpleTypes1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record AllofSimpleTypes1BoxedList(FrozenList<@Nullable Object> data) implements AllofSimpleTypes1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AllofSimpleTypes1BoxedMap extends AllofSimpleTypes1Boxed { - public final FrozenMap<@Nullable Object> data; - private AllofSimpleTypes1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record AllofSimpleTypes1BoxedMap(FrozenMap<@Nullable Object> data) implements AllofSimpleTypes1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class AllofSimpleTypes1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, AllofSimpleTypes1BoxedList>, MapSchemaValidator, AllofSimpleTypes1BoxedMap> { + public static class AllofSimpleTypes1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, AllofSimpleTypes1BoxedList>, MapSchemaValidator, AllofSimpleTypes1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -794,11 +760,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -829,11 +795,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -912,5 +878,24 @@ public AllofSimpleTypes1BoxedList validateAndBox(List arg, SchemaConfiguratio public AllofSimpleTypes1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new AllofSimpleTypes1BoxedMap(validate(arg, configuration)); } + @Override + public AllofSimpleTypes1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java index f640bab85f2..a67e189c9e4 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java @@ -125,78 +125,54 @@ public Schema0Map0Builder getBuilderAfterFoo(Map insta } - public static abstract sealed class Schema0Boxed permits Schema0BoxedVoid, Schema0BoxedBoolean, Schema0BoxedNumber, Schema0BoxedString, Schema0BoxedList, Schema0BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Schema0Boxed permits Schema0BoxedVoid, Schema0BoxedBoolean, Schema0BoxedNumber, Schema0BoxedString, Schema0BoxedList, Schema0BoxedMap { + @Nullable Object getData(); } - public static final class Schema0BoxedVoid extends Schema0Boxed { - public final Void data; - private Schema0BoxedVoid(Void data) { - this.data = data; - } + public record Schema0BoxedVoid(Void data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedBoolean extends Schema0Boxed { - public final boolean data; - private Schema0BoxedBoolean(boolean data) { - this.data = data; - } + public record Schema0BoxedBoolean(boolean data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedNumber extends Schema0Boxed { - public final Number data; - private Schema0BoxedNumber(Number data) { - this.data = data; - } + public record Schema0BoxedNumber(Number data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedString extends Schema0Boxed { - public final String data; - private Schema0BoxedString(String data) { - this.data = data; - } + public record Schema0BoxedString(String data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedList extends Schema0Boxed { - public final FrozenList<@Nullable Object> data; - private Schema0BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Schema0BoxedList(FrozenList<@Nullable Object> data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedMap extends Schema0Boxed { - public final Schema0Map data; - private Schema0BoxedMap(Schema0Map data) { - this.data = data; - } + public record Schema0BoxedMap(Schema0Map data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema0BoxedList>, MapSchemaValidator { + public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema0BoxedList>, MapSchemaValidator { private static @Nullable Schema0 instance = null; protected Schema0() { @@ -300,11 +276,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -335,11 +311,11 @@ public Schema0Map getNewInstance(Map arg, List pathToItem, PathToS List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -418,6 +394,25 @@ public Schema0BoxedList validateAndBox(List arg, SchemaConfiguration configur public Schema0BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema0BoxedMap(validate(arg, configuration)); } + @Override + public Schema0Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class Baz extends NullJsonSchema.NullJsonSchema1 { @@ -505,78 +500,54 @@ public Schema1Map0Builder getBuilderAfterBaz(Map insta } - public static abstract sealed class Schema1Boxed permits Schema1BoxedVoid, Schema1BoxedBoolean, Schema1BoxedNumber, Schema1BoxedString, Schema1BoxedList, Schema1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Schema1Boxed permits Schema1BoxedVoid, Schema1BoxedBoolean, Schema1BoxedNumber, Schema1BoxedString, Schema1BoxedList, Schema1BoxedMap { + @Nullable Object getData(); } - public static final class Schema1BoxedVoid extends Schema1Boxed { - public final Void data; - private Schema1BoxedVoid(Void data) { - this.data = data; - } + public record Schema1BoxedVoid(Void data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedBoolean extends Schema1Boxed { - public final boolean data; - private Schema1BoxedBoolean(boolean data) { - this.data = data; - } + public record Schema1BoxedBoolean(boolean data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedNumber extends Schema1Boxed { - public final Number data; - private Schema1BoxedNumber(Number data) { - this.data = data; - } + public record Schema1BoxedNumber(Number data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedString extends Schema1Boxed { - public final String data; - private Schema1BoxedString(String data) { - this.data = data; - } + public record Schema1BoxedString(String data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedList extends Schema1Boxed { - public final FrozenList<@Nullable Object> data; - private Schema1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Schema1BoxedList(FrozenList<@Nullable Object> data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedMap extends Schema1Boxed { - public final Schema1Map data; - private Schema1BoxedMap(Schema1Map data) { - this.data = data; - } + public record Schema1BoxedMap(Schema1Map data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema1BoxedList>, MapSchemaValidator { + public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema1BoxedList>, MapSchemaValidator { private static @Nullable Schema1 instance = null; protected Schema1() { @@ -680,11 +651,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -715,11 +686,11 @@ public Schema1Map getNewInstance(Map arg, List pathToItem, PathToS List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -798,6 +769,25 @@ public Schema1BoxedList validateAndBox(List arg, SchemaConfiguration configur public Schema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema1BoxedMap(validate(arg, configuration)); } + @Override + public Schema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class Bar extends IntJsonSchema.IntJsonSchema1 { @@ -903,78 +893,54 @@ public AllofWithBaseSchemaMap0Builder getBuilderAfterBar(Map data; - private AllofWithBaseSchema1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record AllofWithBaseSchema1BoxedList(FrozenList<@Nullable Object> data) implements AllofWithBaseSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AllofWithBaseSchema1BoxedMap extends AllofWithBaseSchema1Boxed { - public final AllofWithBaseSchemaMap data; - private AllofWithBaseSchema1BoxedMap(AllofWithBaseSchemaMap data) { - this.data = data; - } + public record AllofWithBaseSchema1BoxedMap(AllofWithBaseSchemaMap data) implements AllofWithBaseSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class AllofWithBaseSchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, AllofWithBaseSchema1BoxedList>, MapSchemaValidator { + public static class AllofWithBaseSchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, AllofWithBaseSchema1BoxedList>, MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -1088,11 +1054,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -1123,11 +1089,11 @@ public AllofWithBaseSchemaMap getNewInstance(Map arg, List pathToI List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -1206,5 +1172,24 @@ public AllofWithBaseSchema1BoxedList validateAndBox(List arg, SchemaConfigura public AllofWithBaseSchema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new AllofWithBaseSchema1BoxedMap(validate(arg, configuration)); } + @Override + public AllofWithBaseSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithOneEmptySchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithOneEmptySchema.java index ba7f3cd1473..6ad17067551 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithOneEmptySchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithOneEmptySchema.java @@ -47,78 +47,54 @@ public static Schema0 getInstance() { } - public static abstract sealed class AllofWithOneEmptySchema1Boxed permits AllofWithOneEmptySchema1BoxedVoid, AllofWithOneEmptySchema1BoxedBoolean, AllofWithOneEmptySchema1BoxedNumber, AllofWithOneEmptySchema1BoxedString, AllofWithOneEmptySchema1BoxedList, AllofWithOneEmptySchema1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface AllofWithOneEmptySchema1Boxed permits AllofWithOneEmptySchema1BoxedVoid, AllofWithOneEmptySchema1BoxedBoolean, AllofWithOneEmptySchema1BoxedNumber, AllofWithOneEmptySchema1BoxedString, AllofWithOneEmptySchema1BoxedList, AllofWithOneEmptySchema1BoxedMap { + @Nullable Object getData(); } - public static final class AllofWithOneEmptySchema1BoxedVoid extends AllofWithOneEmptySchema1Boxed { - public final Void data; - private AllofWithOneEmptySchema1BoxedVoid(Void data) { - this.data = data; - } + public record AllofWithOneEmptySchema1BoxedVoid(Void data) implements AllofWithOneEmptySchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AllofWithOneEmptySchema1BoxedBoolean extends AllofWithOneEmptySchema1Boxed { - public final boolean data; - private AllofWithOneEmptySchema1BoxedBoolean(boolean data) { - this.data = data; - } + public record AllofWithOneEmptySchema1BoxedBoolean(boolean data) implements AllofWithOneEmptySchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AllofWithOneEmptySchema1BoxedNumber extends AllofWithOneEmptySchema1Boxed { - public final Number data; - private AllofWithOneEmptySchema1BoxedNumber(Number data) { - this.data = data; - } + public record AllofWithOneEmptySchema1BoxedNumber(Number data) implements AllofWithOneEmptySchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AllofWithOneEmptySchema1BoxedString extends AllofWithOneEmptySchema1Boxed { - public final String data; - private AllofWithOneEmptySchema1BoxedString(String data) { - this.data = data; - } + public record AllofWithOneEmptySchema1BoxedString(String data) implements AllofWithOneEmptySchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AllofWithOneEmptySchema1BoxedList extends AllofWithOneEmptySchema1Boxed { - public final FrozenList<@Nullable Object> data; - private AllofWithOneEmptySchema1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record AllofWithOneEmptySchema1BoxedList(FrozenList<@Nullable Object> data) implements AllofWithOneEmptySchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AllofWithOneEmptySchema1BoxedMap extends AllofWithOneEmptySchema1Boxed { - public final FrozenMap<@Nullable Object> data; - private AllofWithOneEmptySchema1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record AllofWithOneEmptySchema1BoxedMap(FrozenMap<@Nullable Object> data) implements AllofWithOneEmptySchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class AllofWithOneEmptySchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, AllofWithOneEmptySchema1BoxedList>, MapSchemaValidator, AllofWithOneEmptySchema1BoxedMap> { + public static class AllofWithOneEmptySchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, AllofWithOneEmptySchema1BoxedList>, MapSchemaValidator, AllofWithOneEmptySchema1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -225,11 +201,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -260,11 +236,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -343,5 +319,24 @@ public AllofWithOneEmptySchema1BoxedList validateAndBox(List arg, SchemaConfi public AllofWithOneEmptySchema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new AllofWithOneEmptySchema1BoxedMap(validate(arg, configuration)); } + @Override + public AllofWithOneEmptySchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheFirstEmptySchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheFirstEmptySchema.java index 0a0ea1cf8f4..77063ed5e5c 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheFirstEmptySchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheFirstEmptySchema.java @@ -59,78 +59,54 @@ public static Schema1 getInstance() { } - public static abstract sealed class AllofWithTheFirstEmptySchema1Boxed permits AllofWithTheFirstEmptySchema1BoxedVoid, AllofWithTheFirstEmptySchema1BoxedBoolean, AllofWithTheFirstEmptySchema1BoxedNumber, AllofWithTheFirstEmptySchema1BoxedString, AllofWithTheFirstEmptySchema1BoxedList, AllofWithTheFirstEmptySchema1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface AllofWithTheFirstEmptySchema1Boxed permits AllofWithTheFirstEmptySchema1BoxedVoid, AllofWithTheFirstEmptySchema1BoxedBoolean, AllofWithTheFirstEmptySchema1BoxedNumber, AllofWithTheFirstEmptySchema1BoxedString, AllofWithTheFirstEmptySchema1BoxedList, AllofWithTheFirstEmptySchema1BoxedMap { + @Nullable Object getData(); } - public static final class AllofWithTheFirstEmptySchema1BoxedVoid extends AllofWithTheFirstEmptySchema1Boxed { - public final Void data; - private AllofWithTheFirstEmptySchema1BoxedVoid(Void data) { - this.data = data; - } + public record AllofWithTheFirstEmptySchema1BoxedVoid(Void data) implements AllofWithTheFirstEmptySchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AllofWithTheFirstEmptySchema1BoxedBoolean extends AllofWithTheFirstEmptySchema1Boxed { - public final boolean data; - private AllofWithTheFirstEmptySchema1BoxedBoolean(boolean data) { - this.data = data; - } + public record AllofWithTheFirstEmptySchema1BoxedBoolean(boolean data) implements AllofWithTheFirstEmptySchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AllofWithTheFirstEmptySchema1BoxedNumber extends AllofWithTheFirstEmptySchema1Boxed { - public final Number data; - private AllofWithTheFirstEmptySchema1BoxedNumber(Number data) { - this.data = data; - } + public record AllofWithTheFirstEmptySchema1BoxedNumber(Number data) implements AllofWithTheFirstEmptySchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AllofWithTheFirstEmptySchema1BoxedString extends AllofWithTheFirstEmptySchema1Boxed { - public final String data; - private AllofWithTheFirstEmptySchema1BoxedString(String data) { - this.data = data; - } + public record AllofWithTheFirstEmptySchema1BoxedString(String data) implements AllofWithTheFirstEmptySchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AllofWithTheFirstEmptySchema1BoxedList extends AllofWithTheFirstEmptySchema1Boxed { - public final FrozenList<@Nullable Object> data; - private AllofWithTheFirstEmptySchema1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record AllofWithTheFirstEmptySchema1BoxedList(FrozenList<@Nullable Object> data) implements AllofWithTheFirstEmptySchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AllofWithTheFirstEmptySchema1BoxedMap extends AllofWithTheFirstEmptySchema1Boxed { - public final FrozenMap<@Nullable Object> data; - private AllofWithTheFirstEmptySchema1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record AllofWithTheFirstEmptySchema1BoxedMap(FrozenMap<@Nullable Object> data) implements AllofWithTheFirstEmptySchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class AllofWithTheFirstEmptySchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, AllofWithTheFirstEmptySchema1BoxedList>, MapSchemaValidator, AllofWithTheFirstEmptySchema1BoxedMap> { + public static class AllofWithTheFirstEmptySchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, AllofWithTheFirstEmptySchema1BoxedList>, MapSchemaValidator, AllofWithTheFirstEmptySchema1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -238,11 +214,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -273,11 +249,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -356,5 +332,24 @@ public AllofWithTheFirstEmptySchema1BoxedList validateAndBox(List arg, Schema public AllofWithTheFirstEmptySchema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new AllofWithTheFirstEmptySchema1BoxedMap(validate(arg, configuration)); } + @Override + public AllofWithTheFirstEmptySchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheLastEmptySchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheLastEmptySchema.java index 9f4988b7e52..0ea5f48a712 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheLastEmptySchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheLastEmptySchema.java @@ -59,78 +59,54 @@ public static Schema1 getInstance() { } - public static abstract sealed class AllofWithTheLastEmptySchema1Boxed permits AllofWithTheLastEmptySchema1BoxedVoid, AllofWithTheLastEmptySchema1BoxedBoolean, AllofWithTheLastEmptySchema1BoxedNumber, AllofWithTheLastEmptySchema1BoxedString, AllofWithTheLastEmptySchema1BoxedList, AllofWithTheLastEmptySchema1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface AllofWithTheLastEmptySchema1Boxed permits AllofWithTheLastEmptySchema1BoxedVoid, AllofWithTheLastEmptySchema1BoxedBoolean, AllofWithTheLastEmptySchema1BoxedNumber, AllofWithTheLastEmptySchema1BoxedString, AllofWithTheLastEmptySchema1BoxedList, AllofWithTheLastEmptySchema1BoxedMap { + @Nullable Object getData(); } - public static final class AllofWithTheLastEmptySchema1BoxedVoid extends AllofWithTheLastEmptySchema1Boxed { - public final Void data; - private AllofWithTheLastEmptySchema1BoxedVoid(Void data) { - this.data = data; - } + public record AllofWithTheLastEmptySchema1BoxedVoid(Void data) implements AllofWithTheLastEmptySchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AllofWithTheLastEmptySchema1BoxedBoolean extends AllofWithTheLastEmptySchema1Boxed { - public final boolean data; - private AllofWithTheLastEmptySchema1BoxedBoolean(boolean data) { - this.data = data; - } + public record AllofWithTheLastEmptySchema1BoxedBoolean(boolean data) implements AllofWithTheLastEmptySchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AllofWithTheLastEmptySchema1BoxedNumber extends AllofWithTheLastEmptySchema1Boxed { - public final Number data; - private AllofWithTheLastEmptySchema1BoxedNumber(Number data) { - this.data = data; - } + public record AllofWithTheLastEmptySchema1BoxedNumber(Number data) implements AllofWithTheLastEmptySchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AllofWithTheLastEmptySchema1BoxedString extends AllofWithTheLastEmptySchema1Boxed { - public final String data; - private AllofWithTheLastEmptySchema1BoxedString(String data) { - this.data = data; - } + public record AllofWithTheLastEmptySchema1BoxedString(String data) implements AllofWithTheLastEmptySchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AllofWithTheLastEmptySchema1BoxedList extends AllofWithTheLastEmptySchema1Boxed { - public final FrozenList<@Nullable Object> data; - private AllofWithTheLastEmptySchema1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record AllofWithTheLastEmptySchema1BoxedList(FrozenList<@Nullable Object> data) implements AllofWithTheLastEmptySchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AllofWithTheLastEmptySchema1BoxedMap extends AllofWithTheLastEmptySchema1Boxed { - public final FrozenMap<@Nullable Object> data; - private AllofWithTheLastEmptySchema1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record AllofWithTheLastEmptySchema1BoxedMap(FrozenMap<@Nullable Object> data) implements AllofWithTheLastEmptySchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class AllofWithTheLastEmptySchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, AllofWithTheLastEmptySchema1BoxedList>, MapSchemaValidator, AllofWithTheLastEmptySchema1BoxedMap> { + public static class AllofWithTheLastEmptySchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, AllofWithTheLastEmptySchema1BoxedList>, MapSchemaValidator, AllofWithTheLastEmptySchema1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -238,11 +214,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -273,11 +249,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -356,5 +332,24 @@ public AllofWithTheLastEmptySchema1BoxedList validateAndBox(List arg, SchemaC public AllofWithTheLastEmptySchema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new AllofWithTheLastEmptySchema1BoxedMap(validate(arg, configuration)); } + @Override + public AllofWithTheLastEmptySchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTwoEmptySchemas.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTwoEmptySchemas.java index 5ba07d47c64..6430ce42fd0 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTwoEmptySchemas.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTwoEmptySchemas.java @@ -58,78 +58,54 @@ public static Schema1 getInstance() { } - public static abstract sealed class AllofWithTwoEmptySchemas1Boxed permits AllofWithTwoEmptySchemas1BoxedVoid, AllofWithTwoEmptySchemas1BoxedBoolean, AllofWithTwoEmptySchemas1BoxedNumber, AllofWithTwoEmptySchemas1BoxedString, AllofWithTwoEmptySchemas1BoxedList, AllofWithTwoEmptySchemas1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface AllofWithTwoEmptySchemas1Boxed permits AllofWithTwoEmptySchemas1BoxedVoid, AllofWithTwoEmptySchemas1BoxedBoolean, AllofWithTwoEmptySchemas1BoxedNumber, AllofWithTwoEmptySchemas1BoxedString, AllofWithTwoEmptySchemas1BoxedList, AllofWithTwoEmptySchemas1BoxedMap { + @Nullable Object getData(); } - public static final class AllofWithTwoEmptySchemas1BoxedVoid extends AllofWithTwoEmptySchemas1Boxed { - public final Void data; - private AllofWithTwoEmptySchemas1BoxedVoid(Void data) { - this.data = data; - } + public record AllofWithTwoEmptySchemas1BoxedVoid(Void data) implements AllofWithTwoEmptySchemas1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AllofWithTwoEmptySchemas1BoxedBoolean extends AllofWithTwoEmptySchemas1Boxed { - public final boolean data; - private AllofWithTwoEmptySchemas1BoxedBoolean(boolean data) { - this.data = data; - } + public record AllofWithTwoEmptySchemas1BoxedBoolean(boolean data) implements AllofWithTwoEmptySchemas1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AllofWithTwoEmptySchemas1BoxedNumber extends AllofWithTwoEmptySchemas1Boxed { - public final Number data; - private AllofWithTwoEmptySchemas1BoxedNumber(Number data) { - this.data = data; - } + public record AllofWithTwoEmptySchemas1BoxedNumber(Number data) implements AllofWithTwoEmptySchemas1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AllofWithTwoEmptySchemas1BoxedString extends AllofWithTwoEmptySchemas1Boxed { - public final String data; - private AllofWithTwoEmptySchemas1BoxedString(String data) { - this.data = data; - } + public record AllofWithTwoEmptySchemas1BoxedString(String data) implements AllofWithTwoEmptySchemas1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AllofWithTwoEmptySchemas1BoxedList extends AllofWithTwoEmptySchemas1Boxed { - public final FrozenList<@Nullable Object> data; - private AllofWithTwoEmptySchemas1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record AllofWithTwoEmptySchemas1BoxedList(FrozenList<@Nullable Object> data) implements AllofWithTwoEmptySchemas1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AllofWithTwoEmptySchemas1BoxedMap extends AllofWithTwoEmptySchemas1Boxed { - public final FrozenMap<@Nullable Object> data; - private AllofWithTwoEmptySchemas1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record AllofWithTwoEmptySchemas1BoxedMap(FrozenMap<@Nullable Object> data) implements AllofWithTwoEmptySchemas1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class AllofWithTwoEmptySchemas1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, AllofWithTwoEmptySchemas1BoxedList>, MapSchemaValidator, AllofWithTwoEmptySchemas1BoxedMap> { + public static class AllofWithTwoEmptySchemas1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, AllofWithTwoEmptySchemas1BoxedList>, MapSchemaValidator, AllofWithTwoEmptySchemas1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -237,11 +213,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -272,11 +248,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -355,5 +331,24 @@ public AllofWithTwoEmptySchemas1BoxedList validateAndBox(List arg, SchemaConf public AllofWithTwoEmptySchemas1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new AllofWithTwoEmptySchemas1BoxedMap(validate(arg, configuration)); } + @Override + public AllofWithTwoEmptySchemas1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Anyof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Anyof.java index 12c165c5bf4..901e8939216 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Anyof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Anyof.java @@ -47,78 +47,54 @@ public static Schema0 getInstance() { } - public static abstract sealed class Schema1Boxed permits Schema1BoxedVoid, Schema1BoxedBoolean, Schema1BoxedNumber, Schema1BoxedString, Schema1BoxedList, Schema1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Schema1Boxed permits Schema1BoxedVoid, Schema1BoxedBoolean, Schema1BoxedNumber, Schema1BoxedString, Schema1BoxedList, Schema1BoxedMap { + @Nullable Object getData(); } - public static final class Schema1BoxedVoid extends Schema1Boxed { - public final Void data; - private Schema1BoxedVoid(Void data) { - this.data = data; - } + public record Schema1BoxedVoid(Void data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedBoolean extends Schema1Boxed { - public final boolean data; - private Schema1BoxedBoolean(boolean data) { - this.data = data; - } + public record Schema1BoxedBoolean(boolean data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedNumber extends Schema1Boxed { - public final Number data; - private Schema1BoxedNumber(Number data) { - this.data = data; - } + public record Schema1BoxedNumber(Number data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedString extends Schema1Boxed { - public final String data; - private Schema1BoxedString(String data) { - this.data = data; - } + public record Schema1BoxedString(String data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedList extends Schema1Boxed { - public final FrozenList<@Nullable Object> data; - private Schema1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Schema1BoxedList(FrozenList<@Nullable Object> data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedMap extends Schema1Boxed { - public final FrozenMap<@Nullable Object> data; - private Schema1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record Schema1BoxedMap(FrozenMap<@Nullable Object> data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema1BoxedList>, MapSchemaValidator, Schema1BoxedMap> { + public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema1BoxedList>, MapSchemaValidator, Schema1BoxedMap> { private static @Nullable Schema1 instance = null; protected Schema1() { @@ -217,11 +193,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -252,11 +228,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -335,80 +311,75 @@ public Schema1BoxedList validateAndBox(List arg, SchemaConfiguration configur public Schema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema1BoxedMap(validate(arg, configuration)); } + @Override + public Schema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class Anyof1Boxed permits Anyof1BoxedVoid, Anyof1BoxedBoolean, Anyof1BoxedNumber, Anyof1BoxedString, Anyof1BoxedList, Anyof1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Anyof1Boxed permits Anyof1BoxedVoid, Anyof1BoxedBoolean, Anyof1BoxedNumber, Anyof1BoxedString, Anyof1BoxedList, Anyof1BoxedMap { + @Nullable Object getData(); } - public static final class Anyof1BoxedVoid extends Anyof1Boxed { - public final Void data; - private Anyof1BoxedVoid(Void data) { - this.data = data; - } + public record Anyof1BoxedVoid(Void data) implements Anyof1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Anyof1BoxedBoolean extends Anyof1Boxed { - public final boolean data; - private Anyof1BoxedBoolean(boolean data) { - this.data = data; - } + public record Anyof1BoxedBoolean(boolean data) implements Anyof1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Anyof1BoxedNumber extends Anyof1Boxed { - public final Number data; - private Anyof1BoxedNumber(Number data) { - this.data = data; - } + public record Anyof1BoxedNumber(Number data) implements Anyof1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Anyof1BoxedString extends Anyof1Boxed { - public final String data; - private Anyof1BoxedString(String data) { - this.data = data; - } + public record Anyof1BoxedString(String data) implements Anyof1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Anyof1BoxedList extends Anyof1Boxed { - public final FrozenList<@Nullable Object> data; - private Anyof1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Anyof1BoxedList(FrozenList<@Nullable Object> data) implements Anyof1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Anyof1BoxedMap extends Anyof1Boxed { - public final FrozenMap<@Nullable Object> data; - private Anyof1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record Anyof1BoxedMap(FrozenMap<@Nullable Object> data) implements Anyof1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Anyof1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Anyof1BoxedList>, MapSchemaValidator, Anyof1BoxedMap> { + public static class Anyof1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Anyof1BoxedList>, MapSchemaValidator, Anyof1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -516,11 +487,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -551,11 +522,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -634,5 +605,24 @@ public Anyof1BoxedList validateAndBox(List arg, SchemaConfiguration configura public Anyof1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Anyof1BoxedMap(validate(arg, configuration)); } + @Override + public Anyof1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java index 652c79e8ee9..1057b9bce71 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java @@ -142,78 +142,54 @@ public Schema0Map0Builder getBuilderAfterBar(Map insta } - public static abstract sealed class Schema0Boxed permits Schema0BoxedVoid, Schema0BoxedBoolean, Schema0BoxedNumber, Schema0BoxedString, Schema0BoxedList, Schema0BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Schema0Boxed permits Schema0BoxedVoid, Schema0BoxedBoolean, Schema0BoxedNumber, Schema0BoxedString, Schema0BoxedList, Schema0BoxedMap { + @Nullable Object getData(); } - public static final class Schema0BoxedVoid extends Schema0Boxed { - public final Void data; - private Schema0BoxedVoid(Void data) { - this.data = data; - } + public record Schema0BoxedVoid(Void data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedBoolean extends Schema0Boxed { - public final boolean data; - private Schema0BoxedBoolean(boolean data) { - this.data = data; - } + public record Schema0BoxedBoolean(boolean data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedNumber extends Schema0Boxed { - public final Number data; - private Schema0BoxedNumber(Number data) { - this.data = data; - } + public record Schema0BoxedNumber(Number data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedString extends Schema0Boxed { - public final String data; - private Schema0BoxedString(String data) { - this.data = data; - } + public record Schema0BoxedString(String data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedList extends Schema0Boxed { - public final FrozenList<@Nullable Object> data; - private Schema0BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Schema0BoxedList(FrozenList<@Nullable Object> data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedMap extends Schema0Boxed { - public final Schema0Map data; - private Schema0BoxedMap(Schema0Map data) { - this.data = data; - } + public record Schema0BoxedMap(Schema0Map data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema0BoxedList>, MapSchemaValidator { + public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema0BoxedList>, MapSchemaValidator { private static @Nullable Schema0 instance = null; protected Schema0() { @@ -317,11 +293,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -352,11 +328,11 @@ public Schema0Map getNewInstance(Map arg, List pathToItem, PathToS List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -435,6 +411,25 @@ public Schema0BoxedList validateAndBox(List arg, SchemaConfiguration configur public Schema0BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema0BoxedMap(validate(arg, configuration)); } + @Override + public Schema0Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class Foo extends StringJsonSchema.StringJsonSchema1 { @@ -522,78 +517,54 @@ public Schema1Map0Builder getBuilderAfterFoo(Map insta } - public static abstract sealed class Schema1Boxed permits Schema1BoxedVoid, Schema1BoxedBoolean, Schema1BoxedNumber, Schema1BoxedString, Schema1BoxedList, Schema1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Schema1Boxed permits Schema1BoxedVoid, Schema1BoxedBoolean, Schema1BoxedNumber, Schema1BoxedString, Schema1BoxedList, Schema1BoxedMap { + @Nullable Object getData(); } - public static final class Schema1BoxedVoid extends Schema1Boxed { - public final Void data; - private Schema1BoxedVoid(Void data) { - this.data = data; - } + public record Schema1BoxedVoid(Void data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedBoolean extends Schema1Boxed { - public final boolean data; - private Schema1BoxedBoolean(boolean data) { - this.data = data; - } + public record Schema1BoxedBoolean(boolean data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedNumber extends Schema1Boxed { - public final Number data; - private Schema1BoxedNumber(Number data) { - this.data = data; - } + public record Schema1BoxedNumber(Number data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedString extends Schema1Boxed { - public final String data; - private Schema1BoxedString(String data) { - this.data = data; - } + public record Schema1BoxedString(String data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedList extends Schema1Boxed { - public final FrozenList<@Nullable Object> data; - private Schema1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Schema1BoxedList(FrozenList<@Nullable Object> data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedMap extends Schema1Boxed { - public final Schema1Map data; - private Schema1BoxedMap(Schema1Map data) { - this.data = data; - } + public record Schema1BoxedMap(Schema1Map data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema1BoxedList>, MapSchemaValidator { + public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema1BoxedList>, MapSchemaValidator { private static @Nullable Schema1 instance = null; protected Schema1() { @@ -697,11 +668,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -732,11 +703,11 @@ public Schema1Map getNewInstance(Map arg, List pathToItem, PathToS List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -815,80 +786,75 @@ public Schema1BoxedList validateAndBox(List arg, SchemaConfiguration configur public Schema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema1BoxedMap(validate(arg, configuration)); } + @Override + public Schema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class AnyofComplexTypes1Boxed permits AnyofComplexTypes1BoxedVoid, AnyofComplexTypes1BoxedBoolean, AnyofComplexTypes1BoxedNumber, AnyofComplexTypes1BoxedString, AnyofComplexTypes1BoxedList, AnyofComplexTypes1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface AnyofComplexTypes1Boxed permits AnyofComplexTypes1BoxedVoid, AnyofComplexTypes1BoxedBoolean, AnyofComplexTypes1BoxedNumber, AnyofComplexTypes1BoxedString, AnyofComplexTypes1BoxedList, AnyofComplexTypes1BoxedMap { + @Nullable Object getData(); } - public static final class AnyofComplexTypes1BoxedVoid extends AnyofComplexTypes1Boxed { - public final Void data; - private AnyofComplexTypes1BoxedVoid(Void data) { - this.data = data; - } + public record AnyofComplexTypes1BoxedVoid(Void data) implements AnyofComplexTypes1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AnyofComplexTypes1BoxedBoolean extends AnyofComplexTypes1Boxed { - public final boolean data; - private AnyofComplexTypes1BoxedBoolean(boolean data) { - this.data = data; - } + public record AnyofComplexTypes1BoxedBoolean(boolean data) implements AnyofComplexTypes1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AnyofComplexTypes1BoxedNumber extends AnyofComplexTypes1Boxed { - public final Number data; - private AnyofComplexTypes1BoxedNumber(Number data) { - this.data = data; - } + public record AnyofComplexTypes1BoxedNumber(Number data) implements AnyofComplexTypes1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AnyofComplexTypes1BoxedString extends AnyofComplexTypes1Boxed { - public final String data; - private AnyofComplexTypes1BoxedString(String data) { - this.data = data; - } + public record AnyofComplexTypes1BoxedString(String data) implements AnyofComplexTypes1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AnyofComplexTypes1BoxedList extends AnyofComplexTypes1Boxed { - public final FrozenList<@Nullable Object> data; - private AnyofComplexTypes1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record AnyofComplexTypes1BoxedList(FrozenList<@Nullable Object> data) implements AnyofComplexTypes1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AnyofComplexTypes1BoxedMap extends AnyofComplexTypes1Boxed { - public final FrozenMap<@Nullable Object> data; - private AnyofComplexTypes1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record AnyofComplexTypes1BoxedMap(FrozenMap<@Nullable Object> data) implements AnyofComplexTypes1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class AnyofComplexTypes1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, AnyofComplexTypes1BoxedList>, MapSchemaValidator, AnyofComplexTypes1BoxedMap> { + public static class AnyofComplexTypes1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, AnyofComplexTypes1BoxedList>, MapSchemaValidator, AnyofComplexTypes1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -996,11 +962,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -1031,11 +997,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -1114,5 +1080,24 @@ public AnyofComplexTypes1BoxedList validateAndBox(List arg, SchemaConfigurati public AnyofComplexTypes1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new AnyofComplexTypes1BoxedMap(validate(arg, configuration)); } + @Override + public AnyofComplexTypes1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithBaseSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithBaseSchema.java index 485bb707f91..c3885e3556d 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithBaseSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithBaseSchema.java @@ -35,78 +35,54 @@ public class AnyofWithBaseSchema { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class Schema0Boxed permits Schema0BoxedVoid, Schema0BoxedBoolean, Schema0BoxedNumber, Schema0BoxedString, Schema0BoxedList, Schema0BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Schema0Boxed permits Schema0BoxedVoid, Schema0BoxedBoolean, Schema0BoxedNumber, Schema0BoxedString, Schema0BoxedList, Schema0BoxedMap { + @Nullable Object getData(); } - public static final class Schema0BoxedVoid extends Schema0Boxed { - public final Void data; - private Schema0BoxedVoid(Void data) { - this.data = data; - } + public record Schema0BoxedVoid(Void data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedBoolean extends Schema0Boxed { - public final boolean data; - private Schema0BoxedBoolean(boolean data) { - this.data = data; - } + public record Schema0BoxedBoolean(boolean data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedNumber extends Schema0Boxed { - public final Number data; - private Schema0BoxedNumber(Number data) { - this.data = data; - } + public record Schema0BoxedNumber(Number data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedString extends Schema0Boxed { - public final String data; - private Schema0BoxedString(String data) { - this.data = data; - } + public record Schema0BoxedString(String data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedList extends Schema0Boxed { - public final FrozenList<@Nullable Object> data; - private Schema0BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Schema0BoxedList(FrozenList<@Nullable Object> data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedMap extends Schema0Boxed { - public final FrozenMap<@Nullable Object> data; - private Schema0BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record Schema0BoxedMap(FrozenMap<@Nullable Object> data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema0BoxedList>, MapSchemaValidator, Schema0BoxedMap> { + public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema0BoxedList>, MapSchemaValidator, Schema0BoxedMap> { private static @Nullable Schema0 instance = null; protected Schema0() { @@ -205,11 +181,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -240,11 +216,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -323,80 +299,75 @@ public Schema0BoxedList validateAndBox(List arg, SchemaConfiguration configur public Schema0BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema0BoxedMap(validate(arg, configuration)); } + @Override + public Schema0Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class Schema1Boxed permits Schema1BoxedVoid, Schema1BoxedBoolean, Schema1BoxedNumber, Schema1BoxedString, Schema1BoxedList, Schema1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Schema1Boxed permits Schema1BoxedVoid, Schema1BoxedBoolean, Schema1BoxedNumber, Schema1BoxedString, Schema1BoxedList, Schema1BoxedMap { + @Nullable Object getData(); } - public static final class Schema1BoxedVoid extends Schema1Boxed { - public final Void data; - private Schema1BoxedVoid(Void data) { - this.data = data; - } + public record Schema1BoxedVoid(Void data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedBoolean extends Schema1Boxed { - public final boolean data; - private Schema1BoxedBoolean(boolean data) { - this.data = data; - } + public record Schema1BoxedBoolean(boolean data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedNumber extends Schema1Boxed { - public final Number data; - private Schema1BoxedNumber(Number data) { - this.data = data; - } + public record Schema1BoxedNumber(Number data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedString extends Schema1Boxed { - public final String data; - private Schema1BoxedString(String data) { - this.data = data; - } + public record Schema1BoxedString(String data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedList extends Schema1Boxed { - public final FrozenList<@Nullable Object> data; - private Schema1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Schema1BoxedList(FrozenList<@Nullable Object> data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedMap extends Schema1Boxed { - public final FrozenMap<@Nullable Object> data; - private Schema1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record Schema1BoxedMap(FrozenMap<@Nullable Object> data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema1BoxedList>, MapSchemaValidator, Schema1BoxedMap> { + public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema1BoxedList>, MapSchemaValidator, Schema1BoxedMap> { private static @Nullable Schema1 instance = null; protected Schema1() { @@ -495,11 +466,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -530,11 +501,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -613,26 +584,41 @@ public Schema1BoxedList validateAndBox(List arg, SchemaConfiguration configur public Schema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema1BoxedMap(validate(arg, configuration)); } + @Override + public Schema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class AnyofWithBaseSchema1Boxed permits AnyofWithBaseSchema1BoxedString { - public abstract @Nullable Object data(); + public sealed interface AnyofWithBaseSchema1Boxed permits AnyofWithBaseSchema1BoxedString { + @Nullable Object getData(); } - public static final class AnyofWithBaseSchema1BoxedString extends AnyofWithBaseSchema1Boxed { - public final String data; - private AnyofWithBaseSchema1BoxedString(String data) { - this.data = data; - } + public record AnyofWithBaseSchema1BoxedString(String data) implements AnyofWithBaseSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class AnyofWithBaseSchema1 extends JsonSchema implements StringSchemaValidator { + public static class AnyofWithBaseSchema1 extends JsonSchema implements StringSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -689,5 +675,12 @@ public String validate(String arg, SchemaConfiguration configuration) throws Val public AnyofWithBaseSchema1BoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new AnyofWithBaseSchema1BoxedString(validate(arg, configuration)); } + @Override + public AnyofWithBaseSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithOneEmptySchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithOneEmptySchema.java index fff47f1c4a3..8566d7392b2 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithOneEmptySchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithOneEmptySchema.java @@ -59,78 +59,54 @@ public static Schema1 getInstance() { } - public static abstract sealed class AnyofWithOneEmptySchema1Boxed permits AnyofWithOneEmptySchema1BoxedVoid, AnyofWithOneEmptySchema1BoxedBoolean, AnyofWithOneEmptySchema1BoxedNumber, AnyofWithOneEmptySchema1BoxedString, AnyofWithOneEmptySchema1BoxedList, AnyofWithOneEmptySchema1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface AnyofWithOneEmptySchema1Boxed permits AnyofWithOneEmptySchema1BoxedVoid, AnyofWithOneEmptySchema1BoxedBoolean, AnyofWithOneEmptySchema1BoxedNumber, AnyofWithOneEmptySchema1BoxedString, AnyofWithOneEmptySchema1BoxedList, AnyofWithOneEmptySchema1BoxedMap { + @Nullable Object getData(); } - public static final class AnyofWithOneEmptySchema1BoxedVoid extends AnyofWithOneEmptySchema1Boxed { - public final Void data; - private AnyofWithOneEmptySchema1BoxedVoid(Void data) { - this.data = data; - } + public record AnyofWithOneEmptySchema1BoxedVoid(Void data) implements AnyofWithOneEmptySchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AnyofWithOneEmptySchema1BoxedBoolean extends AnyofWithOneEmptySchema1Boxed { - public final boolean data; - private AnyofWithOneEmptySchema1BoxedBoolean(boolean data) { - this.data = data; - } + public record AnyofWithOneEmptySchema1BoxedBoolean(boolean data) implements AnyofWithOneEmptySchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AnyofWithOneEmptySchema1BoxedNumber extends AnyofWithOneEmptySchema1Boxed { - public final Number data; - private AnyofWithOneEmptySchema1BoxedNumber(Number data) { - this.data = data; - } + public record AnyofWithOneEmptySchema1BoxedNumber(Number data) implements AnyofWithOneEmptySchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AnyofWithOneEmptySchema1BoxedString extends AnyofWithOneEmptySchema1Boxed { - public final String data; - private AnyofWithOneEmptySchema1BoxedString(String data) { - this.data = data; - } + public record AnyofWithOneEmptySchema1BoxedString(String data) implements AnyofWithOneEmptySchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AnyofWithOneEmptySchema1BoxedList extends AnyofWithOneEmptySchema1Boxed { - public final FrozenList<@Nullable Object> data; - private AnyofWithOneEmptySchema1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record AnyofWithOneEmptySchema1BoxedList(FrozenList<@Nullable Object> data) implements AnyofWithOneEmptySchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AnyofWithOneEmptySchema1BoxedMap extends AnyofWithOneEmptySchema1Boxed { - public final FrozenMap<@Nullable Object> data; - private AnyofWithOneEmptySchema1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record AnyofWithOneEmptySchema1BoxedMap(FrozenMap<@Nullable Object> data) implements AnyofWithOneEmptySchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class AnyofWithOneEmptySchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, AnyofWithOneEmptySchema1BoxedList>, MapSchemaValidator, AnyofWithOneEmptySchema1BoxedMap> { + public static class AnyofWithOneEmptySchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, AnyofWithOneEmptySchema1BoxedList>, MapSchemaValidator, AnyofWithOneEmptySchema1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -238,11 +214,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -273,11 +249,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -356,5 +332,24 @@ public AnyofWithOneEmptySchema1BoxedList validateAndBox(List arg, SchemaConfi public AnyofWithOneEmptySchema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new AnyofWithOneEmptySchema1BoxedMap(validate(arg, configuration)); } + @Override + public AnyofWithOneEmptySchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ArrayTypeMatchesArrays.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ArrayTypeMatchesArrays.java index a77c6b97c7f..4a31884a01b 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ArrayTypeMatchesArrays.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ArrayTypeMatchesArrays.java @@ -107,24 +107,20 @@ public ArrayTypeMatchesArraysListBuilder add(Map item) { } - public static abstract sealed class ArrayTypeMatchesArrays1Boxed permits ArrayTypeMatchesArrays1BoxedList { - public abstract @Nullable Object data(); + public sealed interface ArrayTypeMatchesArrays1Boxed permits ArrayTypeMatchesArrays1BoxedList { + @Nullable Object getData(); } - public static final class ArrayTypeMatchesArrays1BoxedList extends ArrayTypeMatchesArrays1Boxed { - public final ArrayTypeMatchesArraysList data; - private ArrayTypeMatchesArrays1BoxedList(ArrayTypeMatchesArraysList data) { - this.data = data; - } + public record ArrayTypeMatchesArrays1BoxedList(ArrayTypeMatchesArraysList data) implements ArrayTypeMatchesArrays1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ArrayTypeMatchesArrays1 extends JsonSchema implements ListSchemaValidator { + public static class ArrayTypeMatchesArrays1 extends JsonSchema implements ListSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -154,11 +150,11 @@ public ArrayTypeMatchesArraysList getNewInstance(List arg, List pathT for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -195,5 +191,12 @@ public ArrayTypeMatchesArraysList validate(List arg, SchemaConfiguration conf public ArrayTypeMatchesArrays1BoxedList validateAndBox(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ArrayTypeMatchesArrays1BoxedList(validate(arg, configuration)); } + @Override + public ArrayTypeMatchesArrays1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByInt.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByInt.java index 7c73de0f7d5..ebcbb032fc3 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByInt.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByInt.java @@ -36,78 +36,54 @@ public class ByInt { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class ByInt1Boxed permits ByInt1BoxedVoid, ByInt1BoxedBoolean, ByInt1BoxedNumber, ByInt1BoxedString, ByInt1BoxedList, ByInt1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface ByInt1Boxed permits ByInt1BoxedVoid, ByInt1BoxedBoolean, ByInt1BoxedNumber, ByInt1BoxedString, ByInt1BoxedList, ByInt1BoxedMap { + @Nullable Object getData(); } - public static final class ByInt1BoxedVoid extends ByInt1Boxed { - public final Void data; - private ByInt1BoxedVoid(Void data) { - this.data = data; - } + public record ByInt1BoxedVoid(Void data) implements ByInt1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ByInt1BoxedBoolean extends ByInt1Boxed { - public final boolean data; - private ByInt1BoxedBoolean(boolean data) { - this.data = data; - } + public record ByInt1BoxedBoolean(boolean data) implements ByInt1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ByInt1BoxedNumber extends ByInt1Boxed { - public final Number data; - private ByInt1BoxedNumber(Number data) { - this.data = data; - } + public record ByInt1BoxedNumber(Number data) implements ByInt1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ByInt1BoxedString extends ByInt1Boxed { - public final String data; - private ByInt1BoxedString(String data) { - this.data = data; - } + public record ByInt1BoxedString(String data) implements ByInt1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ByInt1BoxedList extends ByInt1Boxed { - public final FrozenList<@Nullable Object> data; - private ByInt1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record ByInt1BoxedList(FrozenList<@Nullable Object> data) implements ByInt1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ByInt1BoxedMap extends ByInt1Boxed { - public final FrozenMap<@Nullable Object> data; - private ByInt1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record ByInt1BoxedMap(FrozenMap<@Nullable Object> data) implements ByInt1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ByInt1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ByInt1BoxedList>, MapSchemaValidator, ByInt1BoxedMap> { + public static class ByInt1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ByInt1BoxedList>, MapSchemaValidator, ByInt1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -212,11 +188,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -247,11 +223,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -330,5 +306,24 @@ public ByInt1BoxedList validateAndBox(List arg, SchemaConfiguration configura public ByInt1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ByInt1BoxedMap(validate(arg, configuration)); } + @Override + public ByInt1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByNumber.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByNumber.java index 2827c47bd81..828c756720c 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByNumber.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByNumber.java @@ -36,78 +36,54 @@ public class ByNumber { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class ByNumber1Boxed permits ByNumber1BoxedVoid, ByNumber1BoxedBoolean, ByNumber1BoxedNumber, ByNumber1BoxedString, ByNumber1BoxedList, ByNumber1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface ByNumber1Boxed permits ByNumber1BoxedVoid, ByNumber1BoxedBoolean, ByNumber1BoxedNumber, ByNumber1BoxedString, ByNumber1BoxedList, ByNumber1BoxedMap { + @Nullable Object getData(); } - public static final class ByNumber1BoxedVoid extends ByNumber1Boxed { - public final Void data; - private ByNumber1BoxedVoid(Void data) { - this.data = data; - } + public record ByNumber1BoxedVoid(Void data) implements ByNumber1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ByNumber1BoxedBoolean extends ByNumber1Boxed { - public final boolean data; - private ByNumber1BoxedBoolean(boolean data) { - this.data = data; - } + public record ByNumber1BoxedBoolean(boolean data) implements ByNumber1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ByNumber1BoxedNumber extends ByNumber1Boxed { - public final Number data; - private ByNumber1BoxedNumber(Number data) { - this.data = data; - } + public record ByNumber1BoxedNumber(Number data) implements ByNumber1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ByNumber1BoxedString extends ByNumber1Boxed { - public final String data; - private ByNumber1BoxedString(String data) { - this.data = data; - } + public record ByNumber1BoxedString(String data) implements ByNumber1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ByNumber1BoxedList extends ByNumber1Boxed { - public final FrozenList<@Nullable Object> data; - private ByNumber1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record ByNumber1BoxedList(FrozenList<@Nullable Object> data) implements ByNumber1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ByNumber1BoxedMap extends ByNumber1Boxed { - public final FrozenMap<@Nullable Object> data; - private ByNumber1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record ByNumber1BoxedMap(FrozenMap<@Nullable Object> data) implements ByNumber1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ByNumber1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ByNumber1BoxedList>, MapSchemaValidator, ByNumber1BoxedMap> { + public static class ByNumber1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ByNumber1BoxedList>, MapSchemaValidator, ByNumber1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -212,11 +188,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -247,11 +223,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -330,5 +306,24 @@ public ByNumber1BoxedList validateAndBox(List arg, SchemaConfiguration config public ByNumber1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ByNumber1BoxedMap(validate(arg, configuration)); } + @Override + public ByNumber1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/BySmallNumber.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/BySmallNumber.java index 2a0c8430099..c91371daa4a 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/BySmallNumber.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/BySmallNumber.java @@ -36,78 +36,54 @@ public class BySmallNumber { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class BySmallNumber1Boxed permits BySmallNumber1BoxedVoid, BySmallNumber1BoxedBoolean, BySmallNumber1BoxedNumber, BySmallNumber1BoxedString, BySmallNumber1BoxedList, BySmallNumber1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface BySmallNumber1Boxed permits BySmallNumber1BoxedVoid, BySmallNumber1BoxedBoolean, BySmallNumber1BoxedNumber, BySmallNumber1BoxedString, BySmallNumber1BoxedList, BySmallNumber1BoxedMap { + @Nullable Object getData(); } - public static final class BySmallNumber1BoxedVoid extends BySmallNumber1Boxed { - public final Void data; - private BySmallNumber1BoxedVoid(Void data) { - this.data = data; - } + public record BySmallNumber1BoxedVoid(Void data) implements BySmallNumber1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class BySmallNumber1BoxedBoolean extends BySmallNumber1Boxed { - public final boolean data; - private BySmallNumber1BoxedBoolean(boolean data) { - this.data = data; - } + public record BySmallNumber1BoxedBoolean(boolean data) implements BySmallNumber1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class BySmallNumber1BoxedNumber extends BySmallNumber1Boxed { - public final Number data; - private BySmallNumber1BoxedNumber(Number data) { - this.data = data; - } + public record BySmallNumber1BoxedNumber(Number data) implements BySmallNumber1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class BySmallNumber1BoxedString extends BySmallNumber1Boxed { - public final String data; - private BySmallNumber1BoxedString(String data) { - this.data = data; - } + public record BySmallNumber1BoxedString(String data) implements BySmallNumber1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class BySmallNumber1BoxedList extends BySmallNumber1Boxed { - public final FrozenList<@Nullable Object> data; - private BySmallNumber1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record BySmallNumber1BoxedList(FrozenList<@Nullable Object> data) implements BySmallNumber1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class BySmallNumber1BoxedMap extends BySmallNumber1Boxed { - public final FrozenMap<@Nullable Object> data; - private BySmallNumber1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record BySmallNumber1BoxedMap(FrozenMap<@Nullable Object> data) implements BySmallNumber1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class BySmallNumber1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, BySmallNumber1BoxedList>, MapSchemaValidator, BySmallNumber1BoxedMap> { + public static class BySmallNumber1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, BySmallNumber1BoxedList>, MapSchemaValidator, BySmallNumber1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -212,11 +188,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -247,11 +223,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -330,5 +306,24 @@ public BySmallNumber1BoxedList validateAndBox(List arg, SchemaConfiguration c public BySmallNumber1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new BySmallNumber1BoxedMap(validate(arg, configuration)); } + @Override + public BySmallNumber1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateTimeFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateTimeFormat.java index 5eeb37ac76c..fd3953683af 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateTimeFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateTimeFormat.java @@ -35,78 +35,54 @@ public class DateTimeFormat { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class DateTimeFormat1Boxed permits DateTimeFormat1BoxedVoid, DateTimeFormat1BoxedBoolean, DateTimeFormat1BoxedNumber, DateTimeFormat1BoxedString, DateTimeFormat1BoxedList, DateTimeFormat1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface DateTimeFormat1Boxed permits DateTimeFormat1BoxedVoid, DateTimeFormat1BoxedBoolean, DateTimeFormat1BoxedNumber, DateTimeFormat1BoxedString, DateTimeFormat1BoxedList, DateTimeFormat1BoxedMap { + @Nullable Object getData(); } - public static final class DateTimeFormat1BoxedVoid extends DateTimeFormat1Boxed { - public final Void data; - private DateTimeFormat1BoxedVoid(Void data) { - this.data = data; - } + public record DateTimeFormat1BoxedVoid(Void data) implements DateTimeFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class DateTimeFormat1BoxedBoolean extends DateTimeFormat1Boxed { - public final boolean data; - private DateTimeFormat1BoxedBoolean(boolean data) { - this.data = data; - } + public record DateTimeFormat1BoxedBoolean(boolean data) implements DateTimeFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class DateTimeFormat1BoxedNumber extends DateTimeFormat1Boxed { - public final Number data; - private DateTimeFormat1BoxedNumber(Number data) { - this.data = data; - } + public record DateTimeFormat1BoxedNumber(Number data) implements DateTimeFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class DateTimeFormat1BoxedString extends DateTimeFormat1Boxed { - public final String data; - private DateTimeFormat1BoxedString(String data) { - this.data = data; - } + public record DateTimeFormat1BoxedString(String data) implements DateTimeFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class DateTimeFormat1BoxedList extends DateTimeFormat1Boxed { - public final FrozenList<@Nullable Object> data; - private DateTimeFormat1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record DateTimeFormat1BoxedList(FrozenList<@Nullable Object> data) implements DateTimeFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class DateTimeFormat1BoxedMap extends DateTimeFormat1Boxed { - public final FrozenMap<@Nullable Object> data; - private DateTimeFormat1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record DateTimeFormat1BoxedMap(FrozenMap<@Nullable Object> data) implements DateTimeFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class DateTimeFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, DateTimeFormat1BoxedList>, MapSchemaValidator, DateTimeFormat1BoxedMap> { + public static class DateTimeFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, DateTimeFormat1BoxedList>, MapSchemaValidator, DateTimeFormat1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -211,11 +187,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -246,11 +222,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -329,5 +305,24 @@ public DateTimeFormat1BoxedList validateAndBox(List arg, SchemaConfiguration public DateTimeFormat1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new DateTimeFormat1BoxedMap(validate(arg, configuration)); } + @Override + public DateTimeFormat1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EmailFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EmailFormat.java index c2b5bddb5d4..97090800803 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EmailFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EmailFormat.java @@ -35,78 +35,54 @@ public class EmailFormat { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class EmailFormat1Boxed permits EmailFormat1BoxedVoid, EmailFormat1BoxedBoolean, EmailFormat1BoxedNumber, EmailFormat1BoxedString, EmailFormat1BoxedList, EmailFormat1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface EmailFormat1Boxed permits EmailFormat1BoxedVoid, EmailFormat1BoxedBoolean, EmailFormat1BoxedNumber, EmailFormat1BoxedString, EmailFormat1BoxedList, EmailFormat1BoxedMap { + @Nullable Object getData(); } - public static final class EmailFormat1BoxedVoid extends EmailFormat1Boxed { - public final Void data; - private EmailFormat1BoxedVoid(Void data) { - this.data = data; - } + public record EmailFormat1BoxedVoid(Void data) implements EmailFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class EmailFormat1BoxedBoolean extends EmailFormat1Boxed { - public final boolean data; - private EmailFormat1BoxedBoolean(boolean data) { - this.data = data; - } + public record EmailFormat1BoxedBoolean(boolean data) implements EmailFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class EmailFormat1BoxedNumber extends EmailFormat1Boxed { - public final Number data; - private EmailFormat1BoxedNumber(Number data) { - this.data = data; - } + public record EmailFormat1BoxedNumber(Number data) implements EmailFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class EmailFormat1BoxedString extends EmailFormat1Boxed { - public final String data; - private EmailFormat1BoxedString(String data) { - this.data = data; - } + public record EmailFormat1BoxedString(String data) implements EmailFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class EmailFormat1BoxedList extends EmailFormat1Boxed { - public final FrozenList<@Nullable Object> data; - private EmailFormat1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record EmailFormat1BoxedList(FrozenList<@Nullable Object> data) implements EmailFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class EmailFormat1BoxedMap extends EmailFormat1Boxed { - public final FrozenMap<@Nullable Object> data; - private EmailFormat1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record EmailFormat1BoxedMap(FrozenMap<@Nullable Object> data) implements EmailFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class EmailFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, EmailFormat1BoxedList>, MapSchemaValidator, EmailFormat1BoxedMap> { + public static class EmailFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, EmailFormat1BoxedList>, MapSchemaValidator, EmailFormat1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -211,11 +187,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -246,11 +222,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -329,5 +305,24 @@ public EmailFormat1BoxedList validateAndBox(List arg, SchemaConfiguration con public EmailFormat1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new EmailFormat1BoxedMap(validate(arg, configuration)); } + @Override + public EmailFormat1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWith0DoesNotMatchFalse.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWith0DoesNotMatchFalse.java index 4038bd2e7ed..925c8e678d9 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWith0DoesNotMatchFalse.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWith0DoesNotMatchFalse.java @@ -77,24 +77,20 @@ public double value() { } - public static abstract sealed class EnumWith0DoesNotMatchFalse1Boxed permits EnumWith0DoesNotMatchFalse1BoxedNumber { - public abstract @Nullable Object data(); + public sealed interface EnumWith0DoesNotMatchFalse1Boxed permits EnumWith0DoesNotMatchFalse1BoxedNumber { + @Nullable Object getData(); } - public static final class EnumWith0DoesNotMatchFalse1BoxedNumber extends EnumWith0DoesNotMatchFalse1Boxed { - public final Number data; - private EnumWith0DoesNotMatchFalse1BoxedNumber(Number data) { - this.data = data; - } + public record EnumWith0DoesNotMatchFalse1BoxedNumber(Number data) implements EnumWith0DoesNotMatchFalse1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class EnumWith0DoesNotMatchFalse1 extends JsonSchema implements IntegerEnumValidator, LongEnumValidator, FloatEnumValidator, DoubleEnumValidator, NumberSchemaValidator { + public static class EnumWith0DoesNotMatchFalse1 extends JsonSchema implements IntegerEnumValidator, LongEnumValidator, FloatEnumValidator, DoubleEnumValidator, NumberSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -189,5 +185,12 @@ public double validate(DoubleEnumWith0DoesNotMatchFalseEnums arg,SchemaConfigura public EnumWith0DoesNotMatchFalse1BoxedNumber validateAndBox(Number arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new EnumWith0DoesNotMatchFalse1BoxedNumber(validate(arg, configuration)); } + @Override + public EnumWith0DoesNotMatchFalse1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWith1DoesNotMatchTrue.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWith1DoesNotMatchTrue.java index caa23849d46..3fc1f77d7d0 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWith1DoesNotMatchTrue.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWith1DoesNotMatchTrue.java @@ -77,24 +77,20 @@ public double value() { } - public static abstract sealed class EnumWith1DoesNotMatchTrue1Boxed permits EnumWith1DoesNotMatchTrue1BoxedNumber { - public abstract @Nullable Object data(); + public sealed interface EnumWith1DoesNotMatchTrue1Boxed permits EnumWith1DoesNotMatchTrue1BoxedNumber { + @Nullable Object getData(); } - public static final class EnumWith1DoesNotMatchTrue1BoxedNumber extends EnumWith1DoesNotMatchTrue1Boxed { - public final Number data; - private EnumWith1DoesNotMatchTrue1BoxedNumber(Number data) { - this.data = data; - } + public record EnumWith1DoesNotMatchTrue1BoxedNumber(Number data) implements EnumWith1DoesNotMatchTrue1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class EnumWith1DoesNotMatchTrue1 extends JsonSchema implements IntegerEnumValidator, LongEnumValidator, FloatEnumValidator, DoubleEnumValidator, NumberSchemaValidator { + public static class EnumWith1DoesNotMatchTrue1 extends JsonSchema implements IntegerEnumValidator, LongEnumValidator, FloatEnumValidator, DoubleEnumValidator, NumberSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -189,5 +185,12 @@ public double validate(DoubleEnumWith1DoesNotMatchTrueEnums arg,SchemaConfigurat public EnumWith1DoesNotMatchTrue1BoxedNumber validateAndBox(Number arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new EnumWith1DoesNotMatchTrue1BoxedNumber(validate(arg, configuration)); } + @Override + public EnumWith1DoesNotMatchTrue1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWithEscapedCharacters.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWithEscapedCharacters.java index f10f7b3118b..d5dab170d98 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWithEscapedCharacters.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWithEscapedCharacters.java @@ -35,24 +35,20 @@ public String value() { } - public static abstract sealed class EnumWithEscapedCharacters1Boxed permits EnumWithEscapedCharacters1BoxedString { - public abstract @Nullable Object data(); + public sealed interface EnumWithEscapedCharacters1Boxed permits EnumWithEscapedCharacters1BoxedString { + @Nullable Object getData(); } - public static final class EnumWithEscapedCharacters1BoxedString extends EnumWithEscapedCharacters1Boxed { - public final String data; - private EnumWithEscapedCharacters1BoxedString(String data) { - this.data = data; - } + public record EnumWithEscapedCharacters1BoxedString(String data) implements EnumWithEscapedCharacters1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class EnumWithEscapedCharacters1 extends JsonSchema implements StringSchemaValidator, StringEnumValidator { + public static class EnumWithEscapedCharacters1 extends JsonSchema implements StringSchemaValidator, StringEnumValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -114,5 +110,12 @@ public String validate(StringEnumWithEscapedCharactersEnums arg,SchemaConfigurat public EnumWithEscapedCharacters1BoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new EnumWithEscapedCharacters1BoxedString(validate(arg, configuration)); } + @Override + public EnumWithEscapedCharacters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWithFalseDoesNotMatch0.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWithFalseDoesNotMatch0.java index 2562191b685..bfc0223b2f7 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWithFalseDoesNotMatch0.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWithFalseDoesNotMatch0.java @@ -34,24 +34,20 @@ public boolean value() { } - public static abstract sealed class EnumWithFalseDoesNotMatch01Boxed permits EnumWithFalseDoesNotMatch01BoxedBoolean { - public abstract @Nullable Object data(); + public sealed interface EnumWithFalseDoesNotMatch01Boxed permits EnumWithFalseDoesNotMatch01BoxedBoolean { + @Nullable Object getData(); } - public static final class EnumWithFalseDoesNotMatch01BoxedBoolean extends EnumWithFalseDoesNotMatch01Boxed { - public final boolean data; - private EnumWithFalseDoesNotMatch01BoxedBoolean(boolean data) { - this.data = data; - } + public record EnumWithFalseDoesNotMatch01BoxedBoolean(boolean data) implements EnumWithFalseDoesNotMatch01Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class EnumWithFalseDoesNotMatch01 extends JsonSchema implements BooleanSchemaValidator, BooleanEnumValidator { + public static class EnumWithFalseDoesNotMatch01 extends JsonSchema implements BooleanSchemaValidator, BooleanEnumValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -112,5 +108,13 @@ public boolean validate(BooleanEnumWithFalseDoesNotMatch0Enums arg,SchemaConfigu public EnumWithFalseDoesNotMatch01BoxedBoolean validateAndBox(boolean arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new EnumWithFalseDoesNotMatch01BoxedBoolean(validate(arg, configuration)); } + @Override + public EnumWithFalseDoesNotMatch01Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWithTrueDoesNotMatch1.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWithTrueDoesNotMatch1.java index 1f5b945b758..4581de4b395 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWithTrueDoesNotMatch1.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWithTrueDoesNotMatch1.java @@ -34,24 +34,20 @@ public boolean value() { } - public static abstract sealed class EnumWithTrueDoesNotMatch11Boxed permits EnumWithTrueDoesNotMatch11BoxedBoolean { - public abstract @Nullable Object data(); + public sealed interface EnumWithTrueDoesNotMatch11Boxed permits EnumWithTrueDoesNotMatch11BoxedBoolean { + @Nullable Object getData(); } - public static final class EnumWithTrueDoesNotMatch11BoxedBoolean extends EnumWithTrueDoesNotMatch11Boxed { - public final boolean data; - private EnumWithTrueDoesNotMatch11BoxedBoolean(boolean data) { - this.data = data; - } + public record EnumWithTrueDoesNotMatch11BoxedBoolean(boolean data) implements EnumWithTrueDoesNotMatch11Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class EnumWithTrueDoesNotMatch11 extends JsonSchema implements BooleanSchemaValidator, BooleanEnumValidator { + public static class EnumWithTrueDoesNotMatch11 extends JsonSchema implements BooleanSchemaValidator, BooleanEnumValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -112,5 +108,13 @@ public boolean validate(BooleanEnumWithTrueDoesNotMatch1Enums arg,SchemaConfigur public EnumWithTrueDoesNotMatch11BoxedBoolean validateAndBox(boolean arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new EnumWithTrueDoesNotMatch11BoxedBoolean(validate(arg, configuration)); } + @Override + public EnumWithTrueDoesNotMatch11Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumsInProperties.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumsInProperties.java index a34b3eb5bd4..3822c82493e 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumsInProperties.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumsInProperties.java @@ -44,24 +44,20 @@ public String value() { } - public static abstract sealed class FooBoxed permits FooBoxedString { - public abstract @Nullable Object data(); + public sealed interface FooBoxed permits FooBoxedString { + @Nullable Object getData(); } - public static final class FooBoxedString extends FooBoxed { - public final String data; - private FooBoxedString(String data) { - this.data = data; - } + public record FooBoxedString(String data) implements FooBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Foo extends JsonSchema implements StringSchemaValidator, StringEnumValidator { + public static class Foo extends JsonSchema implements StringSchemaValidator, StringEnumValidator { private static @Nullable Foo instance = null; protected Foo() { @@ -116,6 +112,13 @@ public String validate(StringFooEnums arg,SchemaConfiguration configuration) thr public FooBoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new FooBoxedString(validate(arg, configuration)); } + @Override + public FooBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public enum StringBarEnums implements StringValueMethod { BAR("bar"); @@ -130,24 +133,20 @@ public String value() { } - public static abstract sealed class BarBoxed permits BarBoxedString { - public abstract @Nullable Object data(); + public sealed interface BarBoxed permits BarBoxedString { + @Nullable Object getData(); } - public static final class BarBoxedString extends BarBoxed { - public final String data; - private BarBoxedString(String data) { - this.data = data; - } + public record BarBoxedString(String data) implements BarBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Bar extends JsonSchema implements StringSchemaValidator, StringEnumValidator { + public static class Bar extends JsonSchema implements StringSchemaValidator, StringEnumValidator { private static @Nullable Bar instance = null; protected Bar() { @@ -202,6 +201,13 @@ public String validate(StringBarEnums arg,SchemaConfiguration configuration) thr public BarBoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new BarBoxedString(validate(arg, configuration)); } + @Override + public BarBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class EnumsInPropertiesMap extends FrozenMap<@Nullable Object> { @@ -317,23 +323,19 @@ public EnumsInPropertiesMap0Builder getBuilderAfterBar(Map { + public static class EnumsInProperties1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -373,11 +375,11 @@ public EnumsInPropertiesMap getNewInstance(Map arg, List pathToIte List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -414,6 +416,13 @@ public EnumsInPropertiesMap validate(Map arg, SchemaConfiguration configur public EnumsInProperties1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new EnumsInProperties1BoxedMap(validate(arg, configuration)); } + @Override + public EnumsInProperties1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ForbiddenProperty.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ForbiddenProperty.java index 5193de6d6da..75ee6ca186a 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ForbiddenProperty.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ForbiddenProperty.java @@ -159,78 +159,54 @@ public ForbiddenPropertyMapBuilder getBuilderAfterAdditionalProperty(Map data; - private ForbiddenProperty1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record ForbiddenProperty1BoxedList(FrozenList<@Nullable Object> data) implements ForbiddenProperty1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ForbiddenProperty1BoxedMap extends ForbiddenProperty1Boxed { - public final ForbiddenPropertyMap data; - private ForbiddenProperty1BoxedMap(ForbiddenPropertyMap data) { - this.data = data; - } + public record ForbiddenProperty1BoxedMap(ForbiddenPropertyMap data) implements ForbiddenProperty1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ForbiddenProperty1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ForbiddenProperty1BoxedList>, MapSchemaValidator { + public static class ForbiddenProperty1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ForbiddenProperty1BoxedList>, MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -337,11 +313,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -372,11 +348,11 @@ public ForbiddenPropertyMap getNewInstance(Map arg, List pathToIte List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -455,5 +431,24 @@ public ForbiddenProperty1BoxedList validateAndBox(List arg, SchemaConfigurati public ForbiddenProperty1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ForbiddenProperty1BoxedMap(validate(arg, configuration)); } + @Override + public ForbiddenProperty1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/HostnameFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/HostnameFormat.java index 6ec1cc93896..da84ef4c6ed 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/HostnameFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/HostnameFormat.java @@ -35,78 +35,54 @@ public class HostnameFormat { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class HostnameFormat1Boxed permits HostnameFormat1BoxedVoid, HostnameFormat1BoxedBoolean, HostnameFormat1BoxedNumber, HostnameFormat1BoxedString, HostnameFormat1BoxedList, HostnameFormat1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface HostnameFormat1Boxed permits HostnameFormat1BoxedVoid, HostnameFormat1BoxedBoolean, HostnameFormat1BoxedNumber, HostnameFormat1BoxedString, HostnameFormat1BoxedList, HostnameFormat1BoxedMap { + @Nullable Object getData(); } - public static final class HostnameFormat1BoxedVoid extends HostnameFormat1Boxed { - public final Void data; - private HostnameFormat1BoxedVoid(Void data) { - this.data = data; - } + public record HostnameFormat1BoxedVoid(Void data) implements HostnameFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class HostnameFormat1BoxedBoolean extends HostnameFormat1Boxed { - public final boolean data; - private HostnameFormat1BoxedBoolean(boolean data) { - this.data = data; - } + public record HostnameFormat1BoxedBoolean(boolean data) implements HostnameFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class HostnameFormat1BoxedNumber extends HostnameFormat1Boxed { - public final Number data; - private HostnameFormat1BoxedNumber(Number data) { - this.data = data; - } + public record HostnameFormat1BoxedNumber(Number data) implements HostnameFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class HostnameFormat1BoxedString extends HostnameFormat1Boxed { - public final String data; - private HostnameFormat1BoxedString(String data) { - this.data = data; - } + public record HostnameFormat1BoxedString(String data) implements HostnameFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class HostnameFormat1BoxedList extends HostnameFormat1Boxed { - public final FrozenList<@Nullable Object> data; - private HostnameFormat1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record HostnameFormat1BoxedList(FrozenList<@Nullable Object> data) implements HostnameFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class HostnameFormat1BoxedMap extends HostnameFormat1Boxed { - public final FrozenMap<@Nullable Object> data; - private HostnameFormat1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record HostnameFormat1BoxedMap(FrozenMap<@Nullable Object> data) implements HostnameFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class HostnameFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, HostnameFormat1BoxedList>, MapSchemaValidator, HostnameFormat1BoxedMap> { + public static class HostnameFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, HostnameFormat1BoxedList>, MapSchemaValidator, HostnameFormat1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -211,11 +187,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -246,11 +222,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -329,5 +305,24 @@ public HostnameFormat1BoxedList validateAndBox(List arg, SchemaConfiguration public HostnameFormat1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new HostnameFormat1BoxedMap(validate(arg, configuration)); } + @Override + public HostnameFormat1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf.java index c8072c827a2..e473cb0c78d 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf.java @@ -20,24 +20,20 @@ public class InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf1Boxed permits InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf1BoxedNumber { - public abstract @Nullable Object data(); + public sealed interface InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf1Boxed permits InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf1BoxedNumber { + @Nullable Object getData(); } - public static final class InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf1BoxedNumber extends InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf1Boxed { - public final Number data; - private InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf1BoxedNumber(Number data) { - this.data = data; - } + public record InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf1BoxedNumber(Number data) implements InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf1 extends JsonSchema implements NumberSchemaValidator { + public static class InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf1 extends JsonSchema implements NumberSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -111,5 +107,12 @@ public double validate(double arg, SchemaConfiguration configuration) throws Val public InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf1BoxedNumber validateAndBox(Number arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf1BoxedNumber(validate(arg, configuration)); } + @Override + public InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidStringValueForDefault.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidStringValueForDefault.java index 64f3c72e996..bcb1f0ca8e1 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidStringValueForDefault.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/InvalidStringValueForDefault.java @@ -38,24 +38,20 @@ public class InvalidStringValueForDefault { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class BarBoxed permits BarBoxedString { - public abstract @Nullable Object data(); + public sealed interface BarBoxed permits BarBoxedString { + @Nullable Object getData(); } - public static final class BarBoxedString extends BarBoxed { - public final String data; - private BarBoxedString(String data) { - this.data = data; - } + public record BarBoxedString(String data) implements BarBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Bar extends JsonSchema implements StringSchemaValidator, DefaultValueMethod { + public static class Bar extends JsonSchema implements StringSchemaValidator, DefaultValueMethod { private static @Nullable Bar instance = null; protected Bar() { @@ -110,6 +106,13 @@ public String defaultValue() { public BarBoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new BarBoxedString(validate(arg, configuration)); } + @Override + public BarBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class InvalidStringValueForDefaultMap extends FrozenMap<@Nullable Object> { @@ -178,78 +181,54 @@ public InvalidStringValueForDefaultMapBuilder getBuilderAfterAdditionalProperty( } - public static abstract sealed class InvalidStringValueForDefault1Boxed permits InvalidStringValueForDefault1BoxedVoid, InvalidStringValueForDefault1BoxedBoolean, InvalidStringValueForDefault1BoxedNumber, InvalidStringValueForDefault1BoxedString, InvalidStringValueForDefault1BoxedList, InvalidStringValueForDefault1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface InvalidStringValueForDefault1Boxed permits InvalidStringValueForDefault1BoxedVoid, InvalidStringValueForDefault1BoxedBoolean, InvalidStringValueForDefault1BoxedNumber, InvalidStringValueForDefault1BoxedString, InvalidStringValueForDefault1BoxedList, InvalidStringValueForDefault1BoxedMap { + @Nullable Object getData(); } - public static final class InvalidStringValueForDefault1BoxedVoid extends InvalidStringValueForDefault1Boxed { - public final Void data; - private InvalidStringValueForDefault1BoxedVoid(Void data) { - this.data = data; - } + public record InvalidStringValueForDefault1BoxedVoid(Void data) implements InvalidStringValueForDefault1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class InvalidStringValueForDefault1BoxedBoolean extends InvalidStringValueForDefault1Boxed { - public final boolean data; - private InvalidStringValueForDefault1BoxedBoolean(boolean data) { - this.data = data; - } + public record InvalidStringValueForDefault1BoxedBoolean(boolean data) implements InvalidStringValueForDefault1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class InvalidStringValueForDefault1BoxedNumber extends InvalidStringValueForDefault1Boxed { - public final Number data; - private InvalidStringValueForDefault1BoxedNumber(Number data) { - this.data = data; - } + public record InvalidStringValueForDefault1BoxedNumber(Number data) implements InvalidStringValueForDefault1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class InvalidStringValueForDefault1BoxedString extends InvalidStringValueForDefault1Boxed { - public final String data; - private InvalidStringValueForDefault1BoxedString(String data) { - this.data = data; - } + public record InvalidStringValueForDefault1BoxedString(String data) implements InvalidStringValueForDefault1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class InvalidStringValueForDefault1BoxedList extends InvalidStringValueForDefault1Boxed { - public final FrozenList<@Nullable Object> data; - private InvalidStringValueForDefault1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record InvalidStringValueForDefault1BoxedList(FrozenList<@Nullable Object> data) implements InvalidStringValueForDefault1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class InvalidStringValueForDefault1BoxedMap extends InvalidStringValueForDefault1Boxed { - public final InvalidStringValueForDefaultMap data; - private InvalidStringValueForDefault1BoxedMap(InvalidStringValueForDefaultMap data) { - this.data = data; - } + public record InvalidStringValueForDefault1BoxedMap(InvalidStringValueForDefaultMap data) implements InvalidStringValueForDefault1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class InvalidStringValueForDefault1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, InvalidStringValueForDefault1BoxedList>, MapSchemaValidator { + public static class InvalidStringValueForDefault1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, InvalidStringValueForDefault1BoxedList>, MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -356,11 +335,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -391,11 +370,11 @@ public InvalidStringValueForDefaultMap getNewInstance(Map arg, List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -474,5 +453,24 @@ public InvalidStringValueForDefault1BoxedList validateAndBox(List arg, Schema public InvalidStringValueForDefault1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new InvalidStringValueForDefault1BoxedMap(validate(arg, configuration)); } + @Override + public InvalidStringValueForDefault1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv4Format.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv4Format.java index d891e096c49..9db27444b5d 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv4Format.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv4Format.java @@ -35,78 +35,54 @@ public class Ipv4Format { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class Ipv4Format1Boxed permits Ipv4Format1BoxedVoid, Ipv4Format1BoxedBoolean, Ipv4Format1BoxedNumber, Ipv4Format1BoxedString, Ipv4Format1BoxedList, Ipv4Format1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Ipv4Format1Boxed permits Ipv4Format1BoxedVoid, Ipv4Format1BoxedBoolean, Ipv4Format1BoxedNumber, Ipv4Format1BoxedString, Ipv4Format1BoxedList, Ipv4Format1BoxedMap { + @Nullable Object getData(); } - public static final class Ipv4Format1BoxedVoid extends Ipv4Format1Boxed { - public final Void data; - private Ipv4Format1BoxedVoid(Void data) { - this.data = data; - } + public record Ipv4Format1BoxedVoid(Void data) implements Ipv4Format1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Ipv4Format1BoxedBoolean extends Ipv4Format1Boxed { - public final boolean data; - private Ipv4Format1BoxedBoolean(boolean data) { - this.data = data; - } + public record Ipv4Format1BoxedBoolean(boolean data) implements Ipv4Format1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Ipv4Format1BoxedNumber extends Ipv4Format1Boxed { - public final Number data; - private Ipv4Format1BoxedNumber(Number data) { - this.data = data; - } + public record Ipv4Format1BoxedNumber(Number data) implements Ipv4Format1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Ipv4Format1BoxedString extends Ipv4Format1Boxed { - public final String data; - private Ipv4Format1BoxedString(String data) { - this.data = data; - } + public record Ipv4Format1BoxedString(String data) implements Ipv4Format1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Ipv4Format1BoxedList extends Ipv4Format1Boxed { - public final FrozenList<@Nullable Object> data; - private Ipv4Format1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Ipv4Format1BoxedList(FrozenList<@Nullable Object> data) implements Ipv4Format1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Ipv4Format1BoxedMap extends Ipv4Format1Boxed { - public final FrozenMap<@Nullable Object> data; - private Ipv4Format1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record Ipv4Format1BoxedMap(FrozenMap<@Nullable Object> data) implements Ipv4Format1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Ipv4Format1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Ipv4Format1BoxedList>, MapSchemaValidator, Ipv4Format1BoxedMap> { + public static class Ipv4Format1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Ipv4Format1BoxedList>, MapSchemaValidator, Ipv4Format1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -211,11 +187,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -246,11 +222,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -329,5 +305,24 @@ public Ipv4Format1BoxedList validateAndBox(List arg, SchemaConfiguration conf public Ipv4Format1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Ipv4Format1BoxedMap(validate(arg, configuration)); } + @Override + public Ipv4Format1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv6Format.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv6Format.java index a951cba8480..f52011acf83 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv6Format.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv6Format.java @@ -35,78 +35,54 @@ public class Ipv6Format { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class Ipv6Format1Boxed permits Ipv6Format1BoxedVoid, Ipv6Format1BoxedBoolean, Ipv6Format1BoxedNumber, Ipv6Format1BoxedString, Ipv6Format1BoxedList, Ipv6Format1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Ipv6Format1Boxed permits Ipv6Format1BoxedVoid, Ipv6Format1BoxedBoolean, Ipv6Format1BoxedNumber, Ipv6Format1BoxedString, Ipv6Format1BoxedList, Ipv6Format1BoxedMap { + @Nullable Object getData(); } - public static final class Ipv6Format1BoxedVoid extends Ipv6Format1Boxed { - public final Void data; - private Ipv6Format1BoxedVoid(Void data) { - this.data = data; - } + public record Ipv6Format1BoxedVoid(Void data) implements Ipv6Format1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Ipv6Format1BoxedBoolean extends Ipv6Format1Boxed { - public final boolean data; - private Ipv6Format1BoxedBoolean(boolean data) { - this.data = data; - } + public record Ipv6Format1BoxedBoolean(boolean data) implements Ipv6Format1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Ipv6Format1BoxedNumber extends Ipv6Format1Boxed { - public final Number data; - private Ipv6Format1BoxedNumber(Number data) { - this.data = data; - } + public record Ipv6Format1BoxedNumber(Number data) implements Ipv6Format1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Ipv6Format1BoxedString extends Ipv6Format1Boxed { - public final String data; - private Ipv6Format1BoxedString(String data) { - this.data = data; - } + public record Ipv6Format1BoxedString(String data) implements Ipv6Format1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Ipv6Format1BoxedList extends Ipv6Format1Boxed { - public final FrozenList<@Nullable Object> data; - private Ipv6Format1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Ipv6Format1BoxedList(FrozenList<@Nullable Object> data) implements Ipv6Format1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Ipv6Format1BoxedMap extends Ipv6Format1Boxed { - public final FrozenMap<@Nullable Object> data; - private Ipv6Format1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record Ipv6Format1BoxedMap(FrozenMap<@Nullable Object> data) implements Ipv6Format1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Ipv6Format1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Ipv6Format1BoxedList>, MapSchemaValidator, Ipv6Format1BoxedMap> { + public static class Ipv6Format1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Ipv6Format1BoxedList>, MapSchemaValidator, Ipv6Format1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -211,11 +187,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -246,11 +222,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -329,5 +305,24 @@ public Ipv6Format1BoxedList validateAndBox(List arg, SchemaConfiguration conf public Ipv6Format1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Ipv6Format1BoxedMap(validate(arg, configuration)); } + @Override + public Ipv6Format1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/JsonPointerFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/JsonPointerFormat.java index 2699ff60012..fce4b261f1d 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/JsonPointerFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/JsonPointerFormat.java @@ -35,78 +35,54 @@ public class JsonPointerFormat { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class JsonPointerFormat1Boxed permits JsonPointerFormat1BoxedVoid, JsonPointerFormat1BoxedBoolean, JsonPointerFormat1BoxedNumber, JsonPointerFormat1BoxedString, JsonPointerFormat1BoxedList, JsonPointerFormat1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface JsonPointerFormat1Boxed permits JsonPointerFormat1BoxedVoid, JsonPointerFormat1BoxedBoolean, JsonPointerFormat1BoxedNumber, JsonPointerFormat1BoxedString, JsonPointerFormat1BoxedList, JsonPointerFormat1BoxedMap { + @Nullable Object getData(); } - public static final class JsonPointerFormat1BoxedVoid extends JsonPointerFormat1Boxed { - public final Void data; - private JsonPointerFormat1BoxedVoid(Void data) { - this.data = data; - } + public record JsonPointerFormat1BoxedVoid(Void data) implements JsonPointerFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class JsonPointerFormat1BoxedBoolean extends JsonPointerFormat1Boxed { - public final boolean data; - private JsonPointerFormat1BoxedBoolean(boolean data) { - this.data = data; - } + public record JsonPointerFormat1BoxedBoolean(boolean data) implements JsonPointerFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class JsonPointerFormat1BoxedNumber extends JsonPointerFormat1Boxed { - public final Number data; - private JsonPointerFormat1BoxedNumber(Number data) { - this.data = data; - } + public record JsonPointerFormat1BoxedNumber(Number data) implements JsonPointerFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class JsonPointerFormat1BoxedString extends JsonPointerFormat1Boxed { - public final String data; - private JsonPointerFormat1BoxedString(String data) { - this.data = data; - } + public record JsonPointerFormat1BoxedString(String data) implements JsonPointerFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class JsonPointerFormat1BoxedList extends JsonPointerFormat1Boxed { - public final FrozenList<@Nullable Object> data; - private JsonPointerFormat1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record JsonPointerFormat1BoxedList(FrozenList<@Nullable Object> data) implements JsonPointerFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class JsonPointerFormat1BoxedMap extends JsonPointerFormat1Boxed { - public final FrozenMap<@Nullable Object> data; - private JsonPointerFormat1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record JsonPointerFormat1BoxedMap(FrozenMap<@Nullable Object> data) implements JsonPointerFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class JsonPointerFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, JsonPointerFormat1BoxedList>, MapSchemaValidator, JsonPointerFormat1BoxedMap> { + public static class JsonPointerFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, JsonPointerFormat1BoxedList>, MapSchemaValidator, JsonPointerFormat1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -211,11 +187,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -246,11 +222,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -329,5 +305,24 @@ public JsonPointerFormat1BoxedList validateAndBox(List arg, SchemaConfigurati public JsonPointerFormat1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new JsonPointerFormat1BoxedMap(validate(arg, configuration)); } + @Override + public JsonPointerFormat1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidation.java index 7c10873848d..ff2f9aec232 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidation.java @@ -35,78 +35,54 @@ public class MaximumValidation { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class MaximumValidation1Boxed permits MaximumValidation1BoxedVoid, MaximumValidation1BoxedBoolean, MaximumValidation1BoxedNumber, MaximumValidation1BoxedString, MaximumValidation1BoxedList, MaximumValidation1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface MaximumValidation1Boxed permits MaximumValidation1BoxedVoid, MaximumValidation1BoxedBoolean, MaximumValidation1BoxedNumber, MaximumValidation1BoxedString, MaximumValidation1BoxedList, MaximumValidation1BoxedMap { + @Nullable Object getData(); } - public static final class MaximumValidation1BoxedVoid extends MaximumValidation1Boxed { - public final Void data; - private MaximumValidation1BoxedVoid(Void data) { - this.data = data; - } + public record MaximumValidation1BoxedVoid(Void data) implements MaximumValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MaximumValidation1BoxedBoolean extends MaximumValidation1Boxed { - public final boolean data; - private MaximumValidation1BoxedBoolean(boolean data) { - this.data = data; - } + public record MaximumValidation1BoxedBoolean(boolean data) implements MaximumValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MaximumValidation1BoxedNumber extends MaximumValidation1Boxed { - public final Number data; - private MaximumValidation1BoxedNumber(Number data) { - this.data = data; - } + public record MaximumValidation1BoxedNumber(Number data) implements MaximumValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MaximumValidation1BoxedString extends MaximumValidation1Boxed { - public final String data; - private MaximumValidation1BoxedString(String data) { - this.data = data; - } + public record MaximumValidation1BoxedString(String data) implements MaximumValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MaximumValidation1BoxedList extends MaximumValidation1Boxed { - public final FrozenList<@Nullable Object> data; - private MaximumValidation1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record MaximumValidation1BoxedList(FrozenList<@Nullable Object> data) implements MaximumValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MaximumValidation1BoxedMap extends MaximumValidation1Boxed { - public final FrozenMap<@Nullable Object> data; - private MaximumValidation1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record MaximumValidation1BoxedMap(FrozenMap<@Nullable Object> data) implements MaximumValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class MaximumValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, MaximumValidation1BoxedList>, MapSchemaValidator, MaximumValidation1BoxedMap> { + public static class MaximumValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, MaximumValidation1BoxedList>, MapSchemaValidator, MaximumValidation1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -211,11 +187,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -246,11 +222,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -329,5 +305,24 @@ public MaximumValidation1BoxedList validateAndBox(List arg, SchemaConfigurati public MaximumValidation1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new MaximumValidation1BoxedMap(validate(arg, configuration)); } + @Override + public MaximumValidation1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidationWithUnsignedInteger.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidationWithUnsignedInteger.java index 0eebe36727c..9f2eefdd7cd 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidationWithUnsignedInteger.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidationWithUnsignedInteger.java @@ -35,78 +35,54 @@ public class MaximumValidationWithUnsignedInteger { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class MaximumValidationWithUnsignedInteger1Boxed permits MaximumValidationWithUnsignedInteger1BoxedVoid, MaximumValidationWithUnsignedInteger1BoxedBoolean, MaximumValidationWithUnsignedInteger1BoxedNumber, MaximumValidationWithUnsignedInteger1BoxedString, MaximumValidationWithUnsignedInteger1BoxedList, MaximumValidationWithUnsignedInteger1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface MaximumValidationWithUnsignedInteger1Boxed permits MaximumValidationWithUnsignedInteger1BoxedVoid, MaximumValidationWithUnsignedInteger1BoxedBoolean, MaximumValidationWithUnsignedInteger1BoxedNumber, MaximumValidationWithUnsignedInteger1BoxedString, MaximumValidationWithUnsignedInteger1BoxedList, MaximumValidationWithUnsignedInteger1BoxedMap { + @Nullable Object getData(); } - public static final class MaximumValidationWithUnsignedInteger1BoxedVoid extends MaximumValidationWithUnsignedInteger1Boxed { - public final Void data; - private MaximumValidationWithUnsignedInteger1BoxedVoid(Void data) { - this.data = data; - } + public record MaximumValidationWithUnsignedInteger1BoxedVoid(Void data) implements MaximumValidationWithUnsignedInteger1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MaximumValidationWithUnsignedInteger1BoxedBoolean extends MaximumValidationWithUnsignedInteger1Boxed { - public final boolean data; - private MaximumValidationWithUnsignedInteger1BoxedBoolean(boolean data) { - this.data = data; - } + public record MaximumValidationWithUnsignedInteger1BoxedBoolean(boolean data) implements MaximumValidationWithUnsignedInteger1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MaximumValidationWithUnsignedInteger1BoxedNumber extends MaximumValidationWithUnsignedInteger1Boxed { - public final Number data; - private MaximumValidationWithUnsignedInteger1BoxedNumber(Number data) { - this.data = data; - } + public record MaximumValidationWithUnsignedInteger1BoxedNumber(Number data) implements MaximumValidationWithUnsignedInteger1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MaximumValidationWithUnsignedInteger1BoxedString extends MaximumValidationWithUnsignedInteger1Boxed { - public final String data; - private MaximumValidationWithUnsignedInteger1BoxedString(String data) { - this.data = data; - } + public record MaximumValidationWithUnsignedInteger1BoxedString(String data) implements MaximumValidationWithUnsignedInteger1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MaximumValidationWithUnsignedInteger1BoxedList extends MaximumValidationWithUnsignedInteger1Boxed { - public final FrozenList<@Nullable Object> data; - private MaximumValidationWithUnsignedInteger1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record MaximumValidationWithUnsignedInteger1BoxedList(FrozenList<@Nullable Object> data) implements MaximumValidationWithUnsignedInteger1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MaximumValidationWithUnsignedInteger1BoxedMap extends MaximumValidationWithUnsignedInteger1Boxed { - public final FrozenMap<@Nullable Object> data; - private MaximumValidationWithUnsignedInteger1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record MaximumValidationWithUnsignedInteger1BoxedMap(FrozenMap<@Nullable Object> data) implements MaximumValidationWithUnsignedInteger1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class MaximumValidationWithUnsignedInteger1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, MaximumValidationWithUnsignedInteger1BoxedList>, MapSchemaValidator, MaximumValidationWithUnsignedInteger1BoxedMap> { + public static class MaximumValidationWithUnsignedInteger1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, MaximumValidationWithUnsignedInteger1BoxedList>, MapSchemaValidator, MaximumValidationWithUnsignedInteger1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -211,11 +187,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -246,11 +222,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -329,5 +305,24 @@ public MaximumValidationWithUnsignedInteger1BoxedList validateAndBox(List arg public MaximumValidationWithUnsignedInteger1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new MaximumValidationWithUnsignedInteger1BoxedMap(validate(arg, configuration)); } + @Override + public MaximumValidationWithUnsignedInteger1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxitemsValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxitemsValidation.java index 3cfd11b3d5e..dfbadbb5e68 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxitemsValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxitemsValidation.java @@ -35,78 +35,54 @@ public class MaxitemsValidation { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class MaxitemsValidation1Boxed permits MaxitemsValidation1BoxedVoid, MaxitemsValidation1BoxedBoolean, MaxitemsValidation1BoxedNumber, MaxitemsValidation1BoxedString, MaxitemsValidation1BoxedList, MaxitemsValidation1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface MaxitemsValidation1Boxed permits MaxitemsValidation1BoxedVoid, MaxitemsValidation1BoxedBoolean, MaxitemsValidation1BoxedNumber, MaxitemsValidation1BoxedString, MaxitemsValidation1BoxedList, MaxitemsValidation1BoxedMap { + @Nullable Object getData(); } - public static final class MaxitemsValidation1BoxedVoid extends MaxitemsValidation1Boxed { - public final Void data; - private MaxitemsValidation1BoxedVoid(Void data) { - this.data = data; - } + public record MaxitemsValidation1BoxedVoid(Void data) implements MaxitemsValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MaxitemsValidation1BoxedBoolean extends MaxitemsValidation1Boxed { - public final boolean data; - private MaxitemsValidation1BoxedBoolean(boolean data) { - this.data = data; - } + public record MaxitemsValidation1BoxedBoolean(boolean data) implements MaxitemsValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MaxitemsValidation1BoxedNumber extends MaxitemsValidation1Boxed { - public final Number data; - private MaxitemsValidation1BoxedNumber(Number data) { - this.data = data; - } + public record MaxitemsValidation1BoxedNumber(Number data) implements MaxitemsValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MaxitemsValidation1BoxedString extends MaxitemsValidation1Boxed { - public final String data; - private MaxitemsValidation1BoxedString(String data) { - this.data = data; - } + public record MaxitemsValidation1BoxedString(String data) implements MaxitemsValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MaxitemsValidation1BoxedList extends MaxitemsValidation1Boxed { - public final FrozenList<@Nullable Object> data; - private MaxitemsValidation1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record MaxitemsValidation1BoxedList(FrozenList<@Nullable Object> data) implements MaxitemsValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MaxitemsValidation1BoxedMap extends MaxitemsValidation1Boxed { - public final FrozenMap<@Nullable Object> data; - private MaxitemsValidation1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record MaxitemsValidation1BoxedMap(FrozenMap<@Nullable Object> data) implements MaxitemsValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class MaxitemsValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, MaxitemsValidation1BoxedList>, MapSchemaValidator, MaxitemsValidation1BoxedMap> { + public static class MaxitemsValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, MaxitemsValidation1BoxedList>, MapSchemaValidator, MaxitemsValidation1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -211,11 +187,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -246,11 +222,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -329,5 +305,24 @@ public MaxitemsValidation1BoxedList validateAndBox(List arg, SchemaConfigurat public MaxitemsValidation1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new MaxitemsValidation1BoxedMap(validate(arg, configuration)); } + @Override + public MaxitemsValidation1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxlengthValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxlengthValidation.java index 31119d1840d..02d41b936b7 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxlengthValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxlengthValidation.java @@ -35,78 +35,54 @@ public class MaxlengthValidation { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class MaxlengthValidation1Boxed permits MaxlengthValidation1BoxedVoid, MaxlengthValidation1BoxedBoolean, MaxlengthValidation1BoxedNumber, MaxlengthValidation1BoxedString, MaxlengthValidation1BoxedList, MaxlengthValidation1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface MaxlengthValidation1Boxed permits MaxlengthValidation1BoxedVoid, MaxlengthValidation1BoxedBoolean, MaxlengthValidation1BoxedNumber, MaxlengthValidation1BoxedString, MaxlengthValidation1BoxedList, MaxlengthValidation1BoxedMap { + @Nullable Object getData(); } - public static final class MaxlengthValidation1BoxedVoid extends MaxlengthValidation1Boxed { - public final Void data; - private MaxlengthValidation1BoxedVoid(Void data) { - this.data = data; - } + public record MaxlengthValidation1BoxedVoid(Void data) implements MaxlengthValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MaxlengthValidation1BoxedBoolean extends MaxlengthValidation1Boxed { - public final boolean data; - private MaxlengthValidation1BoxedBoolean(boolean data) { - this.data = data; - } + public record MaxlengthValidation1BoxedBoolean(boolean data) implements MaxlengthValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MaxlengthValidation1BoxedNumber extends MaxlengthValidation1Boxed { - public final Number data; - private MaxlengthValidation1BoxedNumber(Number data) { - this.data = data; - } + public record MaxlengthValidation1BoxedNumber(Number data) implements MaxlengthValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MaxlengthValidation1BoxedString extends MaxlengthValidation1Boxed { - public final String data; - private MaxlengthValidation1BoxedString(String data) { - this.data = data; - } + public record MaxlengthValidation1BoxedString(String data) implements MaxlengthValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MaxlengthValidation1BoxedList extends MaxlengthValidation1Boxed { - public final FrozenList<@Nullable Object> data; - private MaxlengthValidation1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record MaxlengthValidation1BoxedList(FrozenList<@Nullable Object> data) implements MaxlengthValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MaxlengthValidation1BoxedMap extends MaxlengthValidation1Boxed { - public final FrozenMap<@Nullable Object> data; - private MaxlengthValidation1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record MaxlengthValidation1BoxedMap(FrozenMap<@Nullable Object> data) implements MaxlengthValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class MaxlengthValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, MaxlengthValidation1BoxedList>, MapSchemaValidator, MaxlengthValidation1BoxedMap> { + public static class MaxlengthValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, MaxlengthValidation1BoxedList>, MapSchemaValidator, MaxlengthValidation1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -211,11 +187,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -246,11 +222,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -329,5 +305,24 @@ public MaxlengthValidation1BoxedList validateAndBox(List arg, SchemaConfigura public MaxlengthValidation1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new MaxlengthValidation1BoxedMap(validate(arg, configuration)); } + @Override + public MaxlengthValidation1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Maxproperties0MeansTheObjectIsEmpty.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Maxproperties0MeansTheObjectIsEmpty.java index 7f83ee503d6..c71474bd82f 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Maxproperties0MeansTheObjectIsEmpty.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Maxproperties0MeansTheObjectIsEmpty.java @@ -35,78 +35,54 @@ public class Maxproperties0MeansTheObjectIsEmpty { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class Maxproperties0MeansTheObjectIsEmpty1Boxed permits Maxproperties0MeansTheObjectIsEmpty1BoxedVoid, Maxproperties0MeansTheObjectIsEmpty1BoxedBoolean, Maxproperties0MeansTheObjectIsEmpty1BoxedNumber, Maxproperties0MeansTheObjectIsEmpty1BoxedString, Maxproperties0MeansTheObjectIsEmpty1BoxedList, Maxproperties0MeansTheObjectIsEmpty1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Maxproperties0MeansTheObjectIsEmpty1Boxed permits Maxproperties0MeansTheObjectIsEmpty1BoxedVoid, Maxproperties0MeansTheObjectIsEmpty1BoxedBoolean, Maxproperties0MeansTheObjectIsEmpty1BoxedNumber, Maxproperties0MeansTheObjectIsEmpty1BoxedString, Maxproperties0MeansTheObjectIsEmpty1BoxedList, Maxproperties0MeansTheObjectIsEmpty1BoxedMap { + @Nullable Object getData(); } - public static final class Maxproperties0MeansTheObjectIsEmpty1BoxedVoid extends Maxproperties0MeansTheObjectIsEmpty1Boxed { - public final Void data; - private Maxproperties0MeansTheObjectIsEmpty1BoxedVoid(Void data) { - this.data = data; - } + public record Maxproperties0MeansTheObjectIsEmpty1BoxedVoid(Void data) implements Maxproperties0MeansTheObjectIsEmpty1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Maxproperties0MeansTheObjectIsEmpty1BoxedBoolean extends Maxproperties0MeansTheObjectIsEmpty1Boxed { - public final boolean data; - private Maxproperties0MeansTheObjectIsEmpty1BoxedBoolean(boolean data) { - this.data = data; - } + public record Maxproperties0MeansTheObjectIsEmpty1BoxedBoolean(boolean data) implements Maxproperties0MeansTheObjectIsEmpty1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Maxproperties0MeansTheObjectIsEmpty1BoxedNumber extends Maxproperties0MeansTheObjectIsEmpty1Boxed { - public final Number data; - private Maxproperties0MeansTheObjectIsEmpty1BoxedNumber(Number data) { - this.data = data; - } + public record Maxproperties0MeansTheObjectIsEmpty1BoxedNumber(Number data) implements Maxproperties0MeansTheObjectIsEmpty1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Maxproperties0MeansTheObjectIsEmpty1BoxedString extends Maxproperties0MeansTheObjectIsEmpty1Boxed { - public final String data; - private Maxproperties0MeansTheObjectIsEmpty1BoxedString(String data) { - this.data = data; - } + public record Maxproperties0MeansTheObjectIsEmpty1BoxedString(String data) implements Maxproperties0MeansTheObjectIsEmpty1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Maxproperties0MeansTheObjectIsEmpty1BoxedList extends Maxproperties0MeansTheObjectIsEmpty1Boxed { - public final FrozenList<@Nullable Object> data; - private Maxproperties0MeansTheObjectIsEmpty1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Maxproperties0MeansTheObjectIsEmpty1BoxedList(FrozenList<@Nullable Object> data) implements Maxproperties0MeansTheObjectIsEmpty1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Maxproperties0MeansTheObjectIsEmpty1BoxedMap extends Maxproperties0MeansTheObjectIsEmpty1Boxed { - public final FrozenMap<@Nullable Object> data; - private Maxproperties0MeansTheObjectIsEmpty1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record Maxproperties0MeansTheObjectIsEmpty1BoxedMap(FrozenMap<@Nullable Object> data) implements Maxproperties0MeansTheObjectIsEmpty1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Maxproperties0MeansTheObjectIsEmpty1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Maxproperties0MeansTheObjectIsEmpty1BoxedList>, MapSchemaValidator, Maxproperties0MeansTheObjectIsEmpty1BoxedMap> { + public static class Maxproperties0MeansTheObjectIsEmpty1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Maxproperties0MeansTheObjectIsEmpty1BoxedList>, MapSchemaValidator, Maxproperties0MeansTheObjectIsEmpty1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -211,11 +187,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -246,11 +222,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -329,5 +305,24 @@ public Maxproperties0MeansTheObjectIsEmpty1BoxedList validateAndBox(List arg, public Maxproperties0MeansTheObjectIsEmpty1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Maxproperties0MeansTheObjectIsEmpty1BoxedMap(validate(arg, configuration)); } + @Override + public Maxproperties0MeansTheObjectIsEmpty1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxpropertiesValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxpropertiesValidation.java index c70a020af26..5386164471a 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxpropertiesValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxpropertiesValidation.java @@ -35,78 +35,54 @@ public class MaxpropertiesValidation { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class MaxpropertiesValidation1Boxed permits MaxpropertiesValidation1BoxedVoid, MaxpropertiesValidation1BoxedBoolean, MaxpropertiesValidation1BoxedNumber, MaxpropertiesValidation1BoxedString, MaxpropertiesValidation1BoxedList, MaxpropertiesValidation1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface MaxpropertiesValidation1Boxed permits MaxpropertiesValidation1BoxedVoid, MaxpropertiesValidation1BoxedBoolean, MaxpropertiesValidation1BoxedNumber, MaxpropertiesValidation1BoxedString, MaxpropertiesValidation1BoxedList, MaxpropertiesValidation1BoxedMap { + @Nullable Object getData(); } - public static final class MaxpropertiesValidation1BoxedVoid extends MaxpropertiesValidation1Boxed { - public final Void data; - private MaxpropertiesValidation1BoxedVoid(Void data) { - this.data = data; - } + public record MaxpropertiesValidation1BoxedVoid(Void data) implements MaxpropertiesValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MaxpropertiesValidation1BoxedBoolean extends MaxpropertiesValidation1Boxed { - public final boolean data; - private MaxpropertiesValidation1BoxedBoolean(boolean data) { - this.data = data; - } + public record MaxpropertiesValidation1BoxedBoolean(boolean data) implements MaxpropertiesValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MaxpropertiesValidation1BoxedNumber extends MaxpropertiesValidation1Boxed { - public final Number data; - private MaxpropertiesValidation1BoxedNumber(Number data) { - this.data = data; - } + public record MaxpropertiesValidation1BoxedNumber(Number data) implements MaxpropertiesValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MaxpropertiesValidation1BoxedString extends MaxpropertiesValidation1Boxed { - public final String data; - private MaxpropertiesValidation1BoxedString(String data) { - this.data = data; - } + public record MaxpropertiesValidation1BoxedString(String data) implements MaxpropertiesValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MaxpropertiesValidation1BoxedList extends MaxpropertiesValidation1Boxed { - public final FrozenList<@Nullable Object> data; - private MaxpropertiesValidation1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record MaxpropertiesValidation1BoxedList(FrozenList<@Nullable Object> data) implements MaxpropertiesValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MaxpropertiesValidation1BoxedMap extends MaxpropertiesValidation1Boxed { - public final FrozenMap<@Nullable Object> data; - private MaxpropertiesValidation1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record MaxpropertiesValidation1BoxedMap(FrozenMap<@Nullable Object> data) implements MaxpropertiesValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class MaxpropertiesValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, MaxpropertiesValidation1BoxedList>, MapSchemaValidator, MaxpropertiesValidation1BoxedMap> { + public static class MaxpropertiesValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, MaxpropertiesValidation1BoxedList>, MapSchemaValidator, MaxpropertiesValidation1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -211,11 +187,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -246,11 +222,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -329,5 +305,24 @@ public MaxpropertiesValidation1BoxedList validateAndBox(List arg, SchemaConfi public MaxpropertiesValidation1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new MaxpropertiesValidation1BoxedMap(validate(arg, configuration)); } + @Override + public MaxpropertiesValidation1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidation.java index b27eb1b8c5c..29325be0f63 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidation.java @@ -35,78 +35,54 @@ public class MinimumValidation { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class MinimumValidation1Boxed permits MinimumValidation1BoxedVoid, MinimumValidation1BoxedBoolean, MinimumValidation1BoxedNumber, MinimumValidation1BoxedString, MinimumValidation1BoxedList, MinimumValidation1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface MinimumValidation1Boxed permits MinimumValidation1BoxedVoid, MinimumValidation1BoxedBoolean, MinimumValidation1BoxedNumber, MinimumValidation1BoxedString, MinimumValidation1BoxedList, MinimumValidation1BoxedMap { + @Nullable Object getData(); } - public static final class MinimumValidation1BoxedVoid extends MinimumValidation1Boxed { - public final Void data; - private MinimumValidation1BoxedVoid(Void data) { - this.data = data; - } + public record MinimumValidation1BoxedVoid(Void data) implements MinimumValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MinimumValidation1BoxedBoolean extends MinimumValidation1Boxed { - public final boolean data; - private MinimumValidation1BoxedBoolean(boolean data) { - this.data = data; - } + public record MinimumValidation1BoxedBoolean(boolean data) implements MinimumValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MinimumValidation1BoxedNumber extends MinimumValidation1Boxed { - public final Number data; - private MinimumValidation1BoxedNumber(Number data) { - this.data = data; - } + public record MinimumValidation1BoxedNumber(Number data) implements MinimumValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MinimumValidation1BoxedString extends MinimumValidation1Boxed { - public final String data; - private MinimumValidation1BoxedString(String data) { - this.data = data; - } + public record MinimumValidation1BoxedString(String data) implements MinimumValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MinimumValidation1BoxedList extends MinimumValidation1Boxed { - public final FrozenList<@Nullable Object> data; - private MinimumValidation1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record MinimumValidation1BoxedList(FrozenList<@Nullable Object> data) implements MinimumValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MinimumValidation1BoxedMap extends MinimumValidation1Boxed { - public final FrozenMap<@Nullable Object> data; - private MinimumValidation1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record MinimumValidation1BoxedMap(FrozenMap<@Nullable Object> data) implements MinimumValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class MinimumValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, MinimumValidation1BoxedList>, MapSchemaValidator, MinimumValidation1BoxedMap> { + public static class MinimumValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, MinimumValidation1BoxedList>, MapSchemaValidator, MinimumValidation1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -211,11 +187,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -246,11 +222,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -329,5 +305,24 @@ public MinimumValidation1BoxedList validateAndBox(List arg, SchemaConfigurati public MinimumValidation1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new MinimumValidation1BoxedMap(validate(arg, configuration)); } + @Override + public MinimumValidation1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidationWithSignedInteger.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidationWithSignedInteger.java index e22e2b223a8..531298768ff 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidationWithSignedInteger.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidationWithSignedInteger.java @@ -35,78 +35,54 @@ public class MinimumValidationWithSignedInteger { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class MinimumValidationWithSignedInteger1Boxed permits MinimumValidationWithSignedInteger1BoxedVoid, MinimumValidationWithSignedInteger1BoxedBoolean, MinimumValidationWithSignedInteger1BoxedNumber, MinimumValidationWithSignedInteger1BoxedString, MinimumValidationWithSignedInteger1BoxedList, MinimumValidationWithSignedInteger1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface MinimumValidationWithSignedInteger1Boxed permits MinimumValidationWithSignedInteger1BoxedVoid, MinimumValidationWithSignedInteger1BoxedBoolean, MinimumValidationWithSignedInteger1BoxedNumber, MinimumValidationWithSignedInteger1BoxedString, MinimumValidationWithSignedInteger1BoxedList, MinimumValidationWithSignedInteger1BoxedMap { + @Nullable Object getData(); } - public static final class MinimumValidationWithSignedInteger1BoxedVoid extends MinimumValidationWithSignedInteger1Boxed { - public final Void data; - private MinimumValidationWithSignedInteger1BoxedVoid(Void data) { - this.data = data; - } + public record MinimumValidationWithSignedInteger1BoxedVoid(Void data) implements MinimumValidationWithSignedInteger1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MinimumValidationWithSignedInteger1BoxedBoolean extends MinimumValidationWithSignedInteger1Boxed { - public final boolean data; - private MinimumValidationWithSignedInteger1BoxedBoolean(boolean data) { - this.data = data; - } + public record MinimumValidationWithSignedInteger1BoxedBoolean(boolean data) implements MinimumValidationWithSignedInteger1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MinimumValidationWithSignedInteger1BoxedNumber extends MinimumValidationWithSignedInteger1Boxed { - public final Number data; - private MinimumValidationWithSignedInteger1BoxedNumber(Number data) { - this.data = data; - } + public record MinimumValidationWithSignedInteger1BoxedNumber(Number data) implements MinimumValidationWithSignedInteger1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MinimumValidationWithSignedInteger1BoxedString extends MinimumValidationWithSignedInteger1Boxed { - public final String data; - private MinimumValidationWithSignedInteger1BoxedString(String data) { - this.data = data; - } + public record MinimumValidationWithSignedInteger1BoxedString(String data) implements MinimumValidationWithSignedInteger1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MinimumValidationWithSignedInteger1BoxedList extends MinimumValidationWithSignedInteger1Boxed { - public final FrozenList<@Nullable Object> data; - private MinimumValidationWithSignedInteger1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record MinimumValidationWithSignedInteger1BoxedList(FrozenList<@Nullable Object> data) implements MinimumValidationWithSignedInteger1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MinimumValidationWithSignedInteger1BoxedMap extends MinimumValidationWithSignedInteger1Boxed { - public final FrozenMap<@Nullable Object> data; - private MinimumValidationWithSignedInteger1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record MinimumValidationWithSignedInteger1BoxedMap(FrozenMap<@Nullable Object> data) implements MinimumValidationWithSignedInteger1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class MinimumValidationWithSignedInteger1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, MinimumValidationWithSignedInteger1BoxedList>, MapSchemaValidator, MinimumValidationWithSignedInteger1BoxedMap> { + public static class MinimumValidationWithSignedInteger1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, MinimumValidationWithSignedInteger1BoxedList>, MapSchemaValidator, MinimumValidationWithSignedInteger1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -211,11 +187,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -246,11 +222,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -329,5 +305,24 @@ public MinimumValidationWithSignedInteger1BoxedList validateAndBox(List arg, public MinimumValidationWithSignedInteger1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new MinimumValidationWithSignedInteger1BoxedMap(validate(arg, configuration)); } + @Override + public MinimumValidationWithSignedInteger1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinitemsValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinitemsValidation.java index c936275b7b5..13a669101d6 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinitemsValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinitemsValidation.java @@ -35,78 +35,54 @@ public class MinitemsValidation { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class MinitemsValidation1Boxed permits MinitemsValidation1BoxedVoid, MinitemsValidation1BoxedBoolean, MinitemsValidation1BoxedNumber, MinitemsValidation1BoxedString, MinitemsValidation1BoxedList, MinitemsValidation1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface MinitemsValidation1Boxed permits MinitemsValidation1BoxedVoid, MinitemsValidation1BoxedBoolean, MinitemsValidation1BoxedNumber, MinitemsValidation1BoxedString, MinitemsValidation1BoxedList, MinitemsValidation1BoxedMap { + @Nullable Object getData(); } - public static final class MinitemsValidation1BoxedVoid extends MinitemsValidation1Boxed { - public final Void data; - private MinitemsValidation1BoxedVoid(Void data) { - this.data = data; - } + public record MinitemsValidation1BoxedVoid(Void data) implements MinitemsValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MinitemsValidation1BoxedBoolean extends MinitemsValidation1Boxed { - public final boolean data; - private MinitemsValidation1BoxedBoolean(boolean data) { - this.data = data; - } + public record MinitemsValidation1BoxedBoolean(boolean data) implements MinitemsValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MinitemsValidation1BoxedNumber extends MinitemsValidation1Boxed { - public final Number data; - private MinitemsValidation1BoxedNumber(Number data) { - this.data = data; - } + public record MinitemsValidation1BoxedNumber(Number data) implements MinitemsValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MinitemsValidation1BoxedString extends MinitemsValidation1Boxed { - public final String data; - private MinitemsValidation1BoxedString(String data) { - this.data = data; - } + public record MinitemsValidation1BoxedString(String data) implements MinitemsValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MinitemsValidation1BoxedList extends MinitemsValidation1Boxed { - public final FrozenList<@Nullable Object> data; - private MinitemsValidation1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record MinitemsValidation1BoxedList(FrozenList<@Nullable Object> data) implements MinitemsValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MinitemsValidation1BoxedMap extends MinitemsValidation1Boxed { - public final FrozenMap<@Nullable Object> data; - private MinitemsValidation1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record MinitemsValidation1BoxedMap(FrozenMap<@Nullable Object> data) implements MinitemsValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class MinitemsValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, MinitemsValidation1BoxedList>, MapSchemaValidator, MinitemsValidation1BoxedMap> { + public static class MinitemsValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, MinitemsValidation1BoxedList>, MapSchemaValidator, MinitemsValidation1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -211,11 +187,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -246,11 +222,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -329,5 +305,24 @@ public MinitemsValidation1BoxedList validateAndBox(List arg, SchemaConfigurat public MinitemsValidation1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new MinitemsValidation1BoxedMap(validate(arg, configuration)); } + @Override + public MinitemsValidation1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinlengthValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinlengthValidation.java index 2ab8aacdd70..835bdc24f37 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinlengthValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinlengthValidation.java @@ -35,78 +35,54 @@ public class MinlengthValidation { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class MinlengthValidation1Boxed permits MinlengthValidation1BoxedVoid, MinlengthValidation1BoxedBoolean, MinlengthValidation1BoxedNumber, MinlengthValidation1BoxedString, MinlengthValidation1BoxedList, MinlengthValidation1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface MinlengthValidation1Boxed permits MinlengthValidation1BoxedVoid, MinlengthValidation1BoxedBoolean, MinlengthValidation1BoxedNumber, MinlengthValidation1BoxedString, MinlengthValidation1BoxedList, MinlengthValidation1BoxedMap { + @Nullable Object getData(); } - public static final class MinlengthValidation1BoxedVoid extends MinlengthValidation1Boxed { - public final Void data; - private MinlengthValidation1BoxedVoid(Void data) { - this.data = data; - } + public record MinlengthValidation1BoxedVoid(Void data) implements MinlengthValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MinlengthValidation1BoxedBoolean extends MinlengthValidation1Boxed { - public final boolean data; - private MinlengthValidation1BoxedBoolean(boolean data) { - this.data = data; - } + public record MinlengthValidation1BoxedBoolean(boolean data) implements MinlengthValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MinlengthValidation1BoxedNumber extends MinlengthValidation1Boxed { - public final Number data; - private MinlengthValidation1BoxedNumber(Number data) { - this.data = data; - } + public record MinlengthValidation1BoxedNumber(Number data) implements MinlengthValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MinlengthValidation1BoxedString extends MinlengthValidation1Boxed { - public final String data; - private MinlengthValidation1BoxedString(String data) { - this.data = data; - } + public record MinlengthValidation1BoxedString(String data) implements MinlengthValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MinlengthValidation1BoxedList extends MinlengthValidation1Boxed { - public final FrozenList<@Nullable Object> data; - private MinlengthValidation1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record MinlengthValidation1BoxedList(FrozenList<@Nullable Object> data) implements MinlengthValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MinlengthValidation1BoxedMap extends MinlengthValidation1Boxed { - public final FrozenMap<@Nullable Object> data; - private MinlengthValidation1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record MinlengthValidation1BoxedMap(FrozenMap<@Nullable Object> data) implements MinlengthValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class MinlengthValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, MinlengthValidation1BoxedList>, MapSchemaValidator, MinlengthValidation1BoxedMap> { + public static class MinlengthValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, MinlengthValidation1BoxedList>, MapSchemaValidator, MinlengthValidation1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -211,11 +187,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -246,11 +222,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -329,5 +305,24 @@ public MinlengthValidation1BoxedList validateAndBox(List arg, SchemaConfigura public MinlengthValidation1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new MinlengthValidation1BoxedMap(validate(arg, configuration)); } + @Override + public MinlengthValidation1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinpropertiesValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinpropertiesValidation.java index 23d772b6a6a..1802917d267 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinpropertiesValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinpropertiesValidation.java @@ -35,78 +35,54 @@ public class MinpropertiesValidation { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class MinpropertiesValidation1Boxed permits MinpropertiesValidation1BoxedVoid, MinpropertiesValidation1BoxedBoolean, MinpropertiesValidation1BoxedNumber, MinpropertiesValidation1BoxedString, MinpropertiesValidation1BoxedList, MinpropertiesValidation1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface MinpropertiesValidation1Boxed permits MinpropertiesValidation1BoxedVoid, MinpropertiesValidation1BoxedBoolean, MinpropertiesValidation1BoxedNumber, MinpropertiesValidation1BoxedString, MinpropertiesValidation1BoxedList, MinpropertiesValidation1BoxedMap { + @Nullable Object getData(); } - public static final class MinpropertiesValidation1BoxedVoid extends MinpropertiesValidation1Boxed { - public final Void data; - private MinpropertiesValidation1BoxedVoid(Void data) { - this.data = data; - } + public record MinpropertiesValidation1BoxedVoid(Void data) implements MinpropertiesValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MinpropertiesValidation1BoxedBoolean extends MinpropertiesValidation1Boxed { - public final boolean data; - private MinpropertiesValidation1BoxedBoolean(boolean data) { - this.data = data; - } + public record MinpropertiesValidation1BoxedBoolean(boolean data) implements MinpropertiesValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MinpropertiesValidation1BoxedNumber extends MinpropertiesValidation1Boxed { - public final Number data; - private MinpropertiesValidation1BoxedNumber(Number data) { - this.data = data; - } + public record MinpropertiesValidation1BoxedNumber(Number data) implements MinpropertiesValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MinpropertiesValidation1BoxedString extends MinpropertiesValidation1Boxed { - public final String data; - private MinpropertiesValidation1BoxedString(String data) { - this.data = data; - } + public record MinpropertiesValidation1BoxedString(String data) implements MinpropertiesValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MinpropertiesValidation1BoxedList extends MinpropertiesValidation1Boxed { - public final FrozenList<@Nullable Object> data; - private MinpropertiesValidation1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record MinpropertiesValidation1BoxedList(FrozenList<@Nullable Object> data) implements MinpropertiesValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MinpropertiesValidation1BoxedMap extends MinpropertiesValidation1Boxed { - public final FrozenMap<@Nullable Object> data; - private MinpropertiesValidation1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record MinpropertiesValidation1BoxedMap(FrozenMap<@Nullable Object> data) implements MinpropertiesValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class MinpropertiesValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, MinpropertiesValidation1BoxedList>, MapSchemaValidator, MinpropertiesValidation1BoxedMap> { + public static class MinpropertiesValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, MinpropertiesValidation1BoxedList>, MapSchemaValidator, MinpropertiesValidation1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -211,11 +187,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -246,11 +222,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -329,5 +305,24 @@ public MinpropertiesValidation1BoxedList validateAndBox(List arg, SchemaConfi public MinpropertiesValidation1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new MinpropertiesValidation1BoxedMap(validate(arg, configuration)); } + @Override + public MinpropertiesValidation1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAllofToCheckValidationSemantics.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAllofToCheckValidationSemantics.java index 87939b8db33..b7648383ba2 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAllofToCheckValidationSemantics.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAllofToCheckValidationSemantics.java @@ -47,78 +47,54 @@ public static Schema01 getInstance() { } - public static abstract sealed class Schema0Boxed permits Schema0BoxedVoid, Schema0BoxedBoolean, Schema0BoxedNumber, Schema0BoxedString, Schema0BoxedList, Schema0BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Schema0Boxed permits Schema0BoxedVoid, Schema0BoxedBoolean, Schema0BoxedNumber, Schema0BoxedString, Schema0BoxedList, Schema0BoxedMap { + @Nullable Object getData(); } - public static final class Schema0BoxedVoid extends Schema0Boxed { - public final Void data; - private Schema0BoxedVoid(Void data) { - this.data = data; - } + public record Schema0BoxedVoid(Void data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedBoolean extends Schema0Boxed { - public final boolean data; - private Schema0BoxedBoolean(boolean data) { - this.data = data; - } + public record Schema0BoxedBoolean(boolean data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedNumber extends Schema0Boxed { - public final Number data; - private Schema0BoxedNumber(Number data) { - this.data = data; - } + public record Schema0BoxedNumber(Number data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedString extends Schema0Boxed { - public final String data; - private Schema0BoxedString(String data) { - this.data = data; - } + public record Schema0BoxedString(String data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedList extends Schema0Boxed { - public final FrozenList<@Nullable Object> data; - private Schema0BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Schema0BoxedList(FrozenList<@Nullable Object> data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedMap extends Schema0Boxed { - public final FrozenMap<@Nullable Object> data; - private Schema0BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record Schema0BoxedMap(FrozenMap<@Nullable Object> data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema0BoxedList>, MapSchemaValidator, Schema0BoxedMap> { + public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema0BoxedList>, MapSchemaValidator, Schema0BoxedMap> { private static @Nullable Schema0 instance = null; protected Schema0() { @@ -219,11 +195,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -254,11 +230,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -337,80 +313,75 @@ public Schema0BoxedList validateAndBox(List arg, SchemaConfiguration configur public Schema0BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema0BoxedMap(validate(arg, configuration)); } + @Override + public Schema0Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class NestedAllofToCheckValidationSemantics1Boxed permits NestedAllofToCheckValidationSemantics1BoxedVoid, NestedAllofToCheckValidationSemantics1BoxedBoolean, NestedAllofToCheckValidationSemantics1BoxedNumber, NestedAllofToCheckValidationSemantics1BoxedString, NestedAllofToCheckValidationSemantics1BoxedList, NestedAllofToCheckValidationSemantics1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface NestedAllofToCheckValidationSemantics1Boxed permits NestedAllofToCheckValidationSemantics1BoxedVoid, NestedAllofToCheckValidationSemantics1BoxedBoolean, NestedAllofToCheckValidationSemantics1BoxedNumber, NestedAllofToCheckValidationSemantics1BoxedString, NestedAllofToCheckValidationSemantics1BoxedList, NestedAllofToCheckValidationSemantics1BoxedMap { + @Nullable Object getData(); } - public static final class NestedAllofToCheckValidationSemantics1BoxedVoid extends NestedAllofToCheckValidationSemantics1Boxed { - public final Void data; - private NestedAllofToCheckValidationSemantics1BoxedVoid(Void data) { - this.data = data; - } + public record NestedAllofToCheckValidationSemantics1BoxedVoid(Void data) implements NestedAllofToCheckValidationSemantics1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NestedAllofToCheckValidationSemantics1BoxedBoolean extends NestedAllofToCheckValidationSemantics1Boxed { - public final boolean data; - private NestedAllofToCheckValidationSemantics1BoxedBoolean(boolean data) { - this.data = data; - } + public record NestedAllofToCheckValidationSemantics1BoxedBoolean(boolean data) implements NestedAllofToCheckValidationSemantics1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NestedAllofToCheckValidationSemantics1BoxedNumber extends NestedAllofToCheckValidationSemantics1Boxed { - public final Number data; - private NestedAllofToCheckValidationSemantics1BoxedNumber(Number data) { - this.data = data; - } + public record NestedAllofToCheckValidationSemantics1BoxedNumber(Number data) implements NestedAllofToCheckValidationSemantics1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NestedAllofToCheckValidationSemantics1BoxedString extends NestedAllofToCheckValidationSemantics1Boxed { - public final String data; - private NestedAllofToCheckValidationSemantics1BoxedString(String data) { - this.data = data; - } + public record NestedAllofToCheckValidationSemantics1BoxedString(String data) implements NestedAllofToCheckValidationSemantics1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NestedAllofToCheckValidationSemantics1BoxedList extends NestedAllofToCheckValidationSemantics1Boxed { - public final FrozenList<@Nullable Object> data; - private NestedAllofToCheckValidationSemantics1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record NestedAllofToCheckValidationSemantics1BoxedList(FrozenList<@Nullable Object> data) implements NestedAllofToCheckValidationSemantics1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NestedAllofToCheckValidationSemantics1BoxedMap extends NestedAllofToCheckValidationSemantics1Boxed { - public final FrozenMap<@Nullable Object> data; - private NestedAllofToCheckValidationSemantics1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record NestedAllofToCheckValidationSemantics1BoxedMap(FrozenMap<@Nullable Object> data) implements NestedAllofToCheckValidationSemantics1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class NestedAllofToCheckValidationSemantics1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, NestedAllofToCheckValidationSemantics1BoxedList>, MapSchemaValidator, NestedAllofToCheckValidationSemantics1BoxedMap> { + public static class NestedAllofToCheckValidationSemantics1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, NestedAllofToCheckValidationSemantics1BoxedList>, MapSchemaValidator, NestedAllofToCheckValidationSemantics1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -517,11 +488,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -552,11 +523,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -635,5 +606,24 @@ public NestedAllofToCheckValidationSemantics1BoxedList validateAndBox(List ar public NestedAllofToCheckValidationSemantics1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new NestedAllofToCheckValidationSemantics1BoxedMap(validate(arg, configuration)); } + @Override + public NestedAllofToCheckValidationSemantics1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAnyofToCheckValidationSemantics.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAnyofToCheckValidationSemantics.java index aae4e9d3cf6..7709bbbf75c 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAnyofToCheckValidationSemantics.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAnyofToCheckValidationSemantics.java @@ -47,78 +47,54 @@ public static Schema01 getInstance() { } - public static abstract sealed class Schema0Boxed permits Schema0BoxedVoid, Schema0BoxedBoolean, Schema0BoxedNumber, Schema0BoxedString, Schema0BoxedList, Schema0BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Schema0Boxed permits Schema0BoxedVoid, Schema0BoxedBoolean, Schema0BoxedNumber, Schema0BoxedString, Schema0BoxedList, Schema0BoxedMap { + @Nullable Object getData(); } - public static final class Schema0BoxedVoid extends Schema0Boxed { - public final Void data; - private Schema0BoxedVoid(Void data) { - this.data = data; - } + public record Schema0BoxedVoid(Void data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedBoolean extends Schema0Boxed { - public final boolean data; - private Schema0BoxedBoolean(boolean data) { - this.data = data; - } + public record Schema0BoxedBoolean(boolean data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedNumber extends Schema0Boxed { - public final Number data; - private Schema0BoxedNumber(Number data) { - this.data = data; - } + public record Schema0BoxedNumber(Number data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedString extends Schema0Boxed { - public final String data; - private Schema0BoxedString(String data) { - this.data = data; - } + public record Schema0BoxedString(String data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedList extends Schema0Boxed { - public final FrozenList<@Nullable Object> data; - private Schema0BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Schema0BoxedList(FrozenList<@Nullable Object> data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedMap extends Schema0Boxed { - public final FrozenMap<@Nullable Object> data; - private Schema0BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record Schema0BoxedMap(FrozenMap<@Nullable Object> data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema0BoxedList>, MapSchemaValidator, Schema0BoxedMap> { + public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema0BoxedList>, MapSchemaValidator, Schema0BoxedMap> { private static @Nullable Schema0 instance = null; protected Schema0() { @@ -219,11 +195,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -254,11 +230,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -337,80 +313,75 @@ public Schema0BoxedList validateAndBox(List arg, SchemaConfiguration configur public Schema0BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema0BoxedMap(validate(arg, configuration)); } + @Override + public Schema0Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class NestedAnyofToCheckValidationSemantics1Boxed permits NestedAnyofToCheckValidationSemantics1BoxedVoid, NestedAnyofToCheckValidationSemantics1BoxedBoolean, NestedAnyofToCheckValidationSemantics1BoxedNumber, NestedAnyofToCheckValidationSemantics1BoxedString, NestedAnyofToCheckValidationSemantics1BoxedList, NestedAnyofToCheckValidationSemantics1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface NestedAnyofToCheckValidationSemantics1Boxed permits NestedAnyofToCheckValidationSemantics1BoxedVoid, NestedAnyofToCheckValidationSemantics1BoxedBoolean, NestedAnyofToCheckValidationSemantics1BoxedNumber, NestedAnyofToCheckValidationSemantics1BoxedString, NestedAnyofToCheckValidationSemantics1BoxedList, NestedAnyofToCheckValidationSemantics1BoxedMap { + @Nullable Object getData(); } - public static final class NestedAnyofToCheckValidationSemantics1BoxedVoid extends NestedAnyofToCheckValidationSemantics1Boxed { - public final Void data; - private NestedAnyofToCheckValidationSemantics1BoxedVoid(Void data) { - this.data = data; - } + public record NestedAnyofToCheckValidationSemantics1BoxedVoid(Void data) implements NestedAnyofToCheckValidationSemantics1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NestedAnyofToCheckValidationSemantics1BoxedBoolean extends NestedAnyofToCheckValidationSemantics1Boxed { - public final boolean data; - private NestedAnyofToCheckValidationSemantics1BoxedBoolean(boolean data) { - this.data = data; - } + public record NestedAnyofToCheckValidationSemantics1BoxedBoolean(boolean data) implements NestedAnyofToCheckValidationSemantics1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NestedAnyofToCheckValidationSemantics1BoxedNumber extends NestedAnyofToCheckValidationSemantics1Boxed { - public final Number data; - private NestedAnyofToCheckValidationSemantics1BoxedNumber(Number data) { - this.data = data; - } + public record NestedAnyofToCheckValidationSemantics1BoxedNumber(Number data) implements NestedAnyofToCheckValidationSemantics1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NestedAnyofToCheckValidationSemantics1BoxedString extends NestedAnyofToCheckValidationSemantics1Boxed { - public final String data; - private NestedAnyofToCheckValidationSemantics1BoxedString(String data) { - this.data = data; - } + public record NestedAnyofToCheckValidationSemantics1BoxedString(String data) implements NestedAnyofToCheckValidationSemantics1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NestedAnyofToCheckValidationSemantics1BoxedList extends NestedAnyofToCheckValidationSemantics1Boxed { - public final FrozenList<@Nullable Object> data; - private NestedAnyofToCheckValidationSemantics1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record NestedAnyofToCheckValidationSemantics1BoxedList(FrozenList<@Nullable Object> data) implements NestedAnyofToCheckValidationSemantics1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NestedAnyofToCheckValidationSemantics1BoxedMap extends NestedAnyofToCheckValidationSemantics1Boxed { - public final FrozenMap<@Nullable Object> data; - private NestedAnyofToCheckValidationSemantics1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record NestedAnyofToCheckValidationSemantics1BoxedMap(FrozenMap<@Nullable Object> data) implements NestedAnyofToCheckValidationSemantics1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class NestedAnyofToCheckValidationSemantics1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, NestedAnyofToCheckValidationSemantics1BoxedList>, MapSchemaValidator, NestedAnyofToCheckValidationSemantics1BoxedMap> { + public static class NestedAnyofToCheckValidationSemantics1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, NestedAnyofToCheckValidationSemantics1BoxedList>, MapSchemaValidator, NestedAnyofToCheckValidationSemantics1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -517,11 +488,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -552,11 +523,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -635,5 +606,24 @@ public NestedAnyofToCheckValidationSemantics1BoxedList validateAndBox(List ar public NestedAnyofToCheckValidationSemantics1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new NestedAnyofToCheckValidationSemantics1BoxedMap(validate(arg, configuration)); } + @Override + public NestedAnyofToCheckValidationSemantics1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedItems.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedItems.java index 0219796a2e7..9e6928c1b4c 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedItems.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedItems.java @@ -81,24 +81,20 @@ public List build() { } - public static abstract sealed class Items2Boxed permits Items2BoxedList { - public abstract @Nullable Object data(); + public sealed interface Items2Boxed permits Items2BoxedList { + @Nullable Object getData(); } - public static final class Items2BoxedList extends Items2Boxed { - public final ItemsList data; - private Items2BoxedList(ItemsList data) { - this.data = data; - } + public record Items2BoxedList(ItemsList data) implements Items2Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Items2 extends JsonSchema implements ListSchemaValidator { + public static class Items2 extends JsonSchema implements ListSchemaValidator { private static @Nullable Items2 instance = null; protected Items2() { @@ -122,11 +118,11 @@ public ItemsList getNewInstance(List arg, List pathToItem, PathToSche for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Number)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -166,6 +162,13 @@ public ItemsList validate(List arg, SchemaConfiguration configuration) throws public Items2BoxedList validateAndBox(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Items2BoxedList(validate(arg, configuration)); } + @Override + public Items2Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class ItemsList1 extends FrozenList { @@ -200,24 +203,20 @@ public List> build() { } - public static abstract sealed class Items1Boxed permits Items1BoxedList { - public abstract @Nullable Object data(); + public sealed interface Items1Boxed permits Items1BoxedList { + @Nullable Object getData(); } - public static final class Items1BoxedList extends Items1Boxed { - public final ItemsList1 data; - private Items1BoxedList(ItemsList1 data) { - this.data = data; - } + public record Items1BoxedList(ItemsList1 data) implements Items1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Items1 extends JsonSchema implements ListSchemaValidator { + public static class Items1 extends JsonSchema implements ListSchemaValidator { private static @Nullable Items1 instance = null; protected Items1() { @@ -241,11 +240,11 @@ public ItemsList1 getNewInstance(List arg, List pathToItem, PathToSch for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof ItemsList)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -285,6 +284,13 @@ public ItemsList1 validate(List arg, SchemaConfiguration configuration) throw public Items1BoxedList validateAndBox(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Items1BoxedList(validate(arg, configuration)); } + @Override + public Items1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class ItemsList2 extends FrozenList { @@ -319,24 +325,20 @@ public List>> build() { } - public static abstract sealed class ItemsBoxed permits ItemsBoxedList { - public abstract @Nullable Object data(); + public sealed interface ItemsBoxed permits ItemsBoxedList { + @Nullable Object getData(); } - public static final class ItemsBoxedList extends ItemsBoxed { - public final ItemsList2 data; - private ItemsBoxedList(ItemsList2 data) { - this.data = data; - } + public record ItemsBoxedList(ItemsList2 data) implements ItemsBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Items extends JsonSchema implements ListSchemaValidator { + public static class Items extends JsonSchema implements ListSchemaValidator { private static @Nullable Items instance = null; protected Items() { @@ -360,11 +362,11 @@ public ItemsList2 getNewInstance(List arg, List pathToItem, PathToSch for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof ItemsList1)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -404,6 +406,13 @@ public ItemsList2 validate(List arg, SchemaConfiguration configuration) throw public ItemsBoxedList validateAndBox(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ItemsBoxedList(validate(arg, configuration)); } + @Override + public ItemsBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class NestedItemsList extends FrozenList { @@ -438,24 +447,20 @@ public List>>> build() { } - public static abstract sealed class NestedItems1Boxed permits NestedItems1BoxedList { - public abstract @Nullable Object data(); + public sealed interface NestedItems1Boxed permits NestedItems1BoxedList { + @Nullable Object getData(); } - public static final class NestedItems1BoxedList extends NestedItems1Boxed { - public final NestedItemsList data; - private NestedItems1BoxedList(NestedItemsList data) { - this.data = data; - } + public record NestedItems1BoxedList(NestedItemsList data) implements NestedItems1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class NestedItems1 extends JsonSchema implements ListSchemaValidator { + public static class NestedItems1 extends JsonSchema implements ListSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -485,11 +490,11 @@ public NestedItemsList getNewInstance(List arg, List pathToItem, Path for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof ItemsList2)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -529,5 +534,12 @@ public NestedItemsList validate(List arg, SchemaConfiguration configuration) public NestedItems1BoxedList validateAndBox(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new NestedItems1BoxedList(validate(arg, configuration)); } + @Override + public NestedItems1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedOneofToCheckValidationSemantics.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedOneofToCheckValidationSemantics.java index b4e576c997f..e75084fe04d 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedOneofToCheckValidationSemantics.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedOneofToCheckValidationSemantics.java @@ -47,78 +47,54 @@ public static Schema01 getInstance() { } - public static abstract sealed class Schema0Boxed permits Schema0BoxedVoid, Schema0BoxedBoolean, Schema0BoxedNumber, Schema0BoxedString, Schema0BoxedList, Schema0BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Schema0Boxed permits Schema0BoxedVoid, Schema0BoxedBoolean, Schema0BoxedNumber, Schema0BoxedString, Schema0BoxedList, Schema0BoxedMap { + @Nullable Object getData(); } - public static final class Schema0BoxedVoid extends Schema0Boxed { - public final Void data; - private Schema0BoxedVoid(Void data) { - this.data = data; - } + public record Schema0BoxedVoid(Void data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedBoolean extends Schema0Boxed { - public final boolean data; - private Schema0BoxedBoolean(boolean data) { - this.data = data; - } + public record Schema0BoxedBoolean(boolean data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedNumber extends Schema0Boxed { - public final Number data; - private Schema0BoxedNumber(Number data) { - this.data = data; - } + public record Schema0BoxedNumber(Number data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedString extends Schema0Boxed { - public final String data; - private Schema0BoxedString(String data) { - this.data = data; - } + public record Schema0BoxedString(String data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedList extends Schema0Boxed { - public final FrozenList<@Nullable Object> data; - private Schema0BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Schema0BoxedList(FrozenList<@Nullable Object> data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedMap extends Schema0Boxed { - public final FrozenMap<@Nullable Object> data; - private Schema0BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record Schema0BoxedMap(FrozenMap<@Nullable Object> data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema0BoxedList>, MapSchemaValidator, Schema0BoxedMap> { + public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema0BoxedList>, MapSchemaValidator, Schema0BoxedMap> { private static @Nullable Schema0 instance = null; protected Schema0() { @@ -219,11 +195,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -254,11 +230,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -337,80 +313,75 @@ public Schema0BoxedList validateAndBox(List arg, SchemaConfiguration configur public Schema0BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema0BoxedMap(validate(arg, configuration)); } + @Override + public Schema0Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class NestedOneofToCheckValidationSemantics1Boxed permits NestedOneofToCheckValidationSemantics1BoxedVoid, NestedOneofToCheckValidationSemantics1BoxedBoolean, NestedOneofToCheckValidationSemantics1BoxedNumber, NestedOneofToCheckValidationSemantics1BoxedString, NestedOneofToCheckValidationSemantics1BoxedList, NestedOneofToCheckValidationSemantics1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface NestedOneofToCheckValidationSemantics1Boxed permits NestedOneofToCheckValidationSemantics1BoxedVoid, NestedOneofToCheckValidationSemantics1BoxedBoolean, NestedOneofToCheckValidationSemantics1BoxedNumber, NestedOneofToCheckValidationSemantics1BoxedString, NestedOneofToCheckValidationSemantics1BoxedList, NestedOneofToCheckValidationSemantics1BoxedMap { + @Nullable Object getData(); } - public static final class NestedOneofToCheckValidationSemantics1BoxedVoid extends NestedOneofToCheckValidationSemantics1Boxed { - public final Void data; - private NestedOneofToCheckValidationSemantics1BoxedVoid(Void data) { - this.data = data; - } + public record NestedOneofToCheckValidationSemantics1BoxedVoid(Void data) implements NestedOneofToCheckValidationSemantics1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NestedOneofToCheckValidationSemantics1BoxedBoolean extends NestedOneofToCheckValidationSemantics1Boxed { - public final boolean data; - private NestedOneofToCheckValidationSemantics1BoxedBoolean(boolean data) { - this.data = data; - } + public record NestedOneofToCheckValidationSemantics1BoxedBoolean(boolean data) implements NestedOneofToCheckValidationSemantics1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NestedOneofToCheckValidationSemantics1BoxedNumber extends NestedOneofToCheckValidationSemantics1Boxed { - public final Number data; - private NestedOneofToCheckValidationSemantics1BoxedNumber(Number data) { - this.data = data; - } + public record NestedOneofToCheckValidationSemantics1BoxedNumber(Number data) implements NestedOneofToCheckValidationSemantics1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NestedOneofToCheckValidationSemantics1BoxedString extends NestedOneofToCheckValidationSemantics1Boxed { - public final String data; - private NestedOneofToCheckValidationSemantics1BoxedString(String data) { - this.data = data; - } + public record NestedOneofToCheckValidationSemantics1BoxedString(String data) implements NestedOneofToCheckValidationSemantics1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NestedOneofToCheckValidationSemantics1BoxedList extends NestedOneofToCheckValidationSemantics1Boxed { - public final FrozenList<@Nullable Object> data; - private NestedOneofToCheckValidationSemantics1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record NestedOneofToCheckValidationSemantics1BoxedList(FrozenList<@Nullable Object> data) implements NestedOneofToCheckValidationSemantics1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NestedOneofToCheckValidationSemantics1BoxedMap extends NestedOneofToCheckValidationSemantics1Boxed { - public final FrozenMap<@Nullable Object> data; - private NestedOneofToCheckValidationSemantics1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record NestedOneofToCheckValidationSemantics1BoxedMap(FrozenMap<@Nullable Object> data) implements NestedOneofToCheckValidationSemantics1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class NestedOneofToCheckValidationSemantics1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, NestedOneofToCheckValidationSemantics1BoxedList>, MapSchemaValidator, NestedOneofToCheckValidationSemantics1BoxedMap> { + public static class NestedOneofToCheckValidationSemantics1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, NestedOneofToCheckValidationSemantics1BoxedList>, MapSchemaValidator, NestedOneofToCheckValidationSemantics1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -517,11 +488,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -552,11 +523,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -635,5 +606,24 @@ public NestedOneofToCheckValidationSemantics1BoxedList validateAndBox(List ar public NestedOneofToCheckValidationSemantics1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new NestedOneofToCheckValidationSemantics1BoxedMap(validate(arg, configuration)); } + @Override + public NestedOneofToCheckValidationSemantics1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Not.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Not.java index ea255f3c1e1..98514e1cbff 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Not.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Not.java @@ -47,78 +47,54 @@ public static Not2 getInstance() { } - public static abstract sealed class Not1Boxed permits Not1BoxedVoid, Not1BoxedBoolean, Not1BoxedNumber, Not1BoxedString, Not1BoxedList, Not1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Not1Boxed permits Not1BoxedVoid, Not1BoxedBoolean, Not1BoxedNumber, Not1BoxedString, Not1BoxedList, Not1BoxedMap { + @Nullable Object getData(); } - public static final class Not1BoxedVoid extends Not1Boxed { - public final Void data; - private Not1BoxedVoid(Void data) { - this.data = data; - } + public record Not1BoxedVoid(Void data) implements Not1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Not1BoxedBoolean extends Not1Boxed { - public final boolean data; - private Not1BoxedBoolean(boolean data) { - this.data = data; - } + public record Not1BoxedBoolean(boolean data) implements Not1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Not1BoxedNumber extends Not1Boxed { - public final Number data; - private Not1BoxedNumber(Number data) { - this.data = data; - } + public record Not1BoxedNumber(Number data) implements Not1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Not1BoxedString extends Not1Boxed { - public final String data; - private Not1BoxedString(String data) { - this.data = data; - } + public record Not1BoxedString(String data) implements Not1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Not1BoxedList extends Not1Boxed { - public final FrozenList<@Nullable Object> data; - private Not1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Not1BoxedList(FrozenList<@Nullable Object> data) implements Not1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Not1BoxedMap extends Not1Boxed { - public final FrozenMap<@Nullable Object> data; - private Not1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record Not1BoxedMap(FrozenMap<@Nullable Object> data) implements Not1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Not1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Not1BoxedList>, MapSchemaValidator, Not1BoxedMap> { + public static class Not1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Not1BoxedList>, MapSchemaValidator, Not1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -223,11 +199,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -258,11 +234,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -341,5 +317,24 @@ public Not1BoxedList validateAndBox(List arg, SchemaConfiguration configurati public Not1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Not1BoxedMap(validate(arg, configuration)); } + @Override + public Not1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMoreComplexSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMoreComplexSchema.java index 245812f4415..0e92dc9eac8 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMoreComplexSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMoreComplexSchema.java @@ -115,23 +115,19 @@ public NotMapBuilder getBuilderAfterAdditionalProperty(Map { + public static class Not extends JsonSchema implements MapSchemaValidator { private static @Nullable Not instance = null; protected Not() { @@ -161,11 +157,11 @@ public NotMap getNewInstance(Map arg, List pathToItem, PathToSchem List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -202,81 +198,64 @@ public NotMap validate(Map arg, SchemaConfiguration configuration) throws public NotBoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new NotBoxedMap(validate(arg, configuration)); } + @Override + public NotBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class NotMoreComplexSchema1Boxed permits NotMoreComplexSchema1BoxedVoid, NotMoreComplexSchema1BoxedBoolean, NotMoreComplexSchema1BoxedNumber, NotMoreComplexSchema1BoxedString, NotMoreComplexSchema1BoxedList, NotMoreComplexSchema1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface NotMoreComplexSchema1Boxed permits NotMoreComplexSchema1BoxedVoid, NotMoreComplexSchema1BoxedBoolean, NotMoreComplexSchema1BoxedNumber, NotMoreComplexSchema1BoxedString, NotMoreComplexSchema1BoxedList, NotMoreComplexSchema1BoxedMap { + @Nullable Object getData(); } - public static final class NotMoreComplexSchema1BoxedVoid extends NotMoreComplexSchema1Boxed { - public final Void data; - private NotMoreComplexSchema1BoxedVoid(Void data) { - this.data = data; - } + public record NotMoreComplexSchema1BoxedVoid(Void data) implements NotMoreComplexSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NotMoreComplexSchema1BoxedBoolean extends NotMoreComplexSchema1Boxed { - public final boolean data; - private NotMoreComplexSchema1BoxedBoolean(boolean data) { - this.data = data; - } + public record NotMoreComplexSchema1BoxedBoolean(boolean data) implements NotMoreComplexSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NotMoreComplexSchema1BoxedNumber extends NotMoreComplexSchema1Boxed { - public final Number data; - private NotMoreComplexSchema1BoxedNumber(Number data) { - this.data = data; - } + public record NotMoreComplexSchema1BoxedNumber(Number data) implements NotMoreComplexSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NotMoreComplexSchema1BoxedString extends NotMoreComplexSchema1Boxed { - public final String data; - private NotMoreComplexSchema1BoxedString(String data) { - this.data = data; - } + public record NotMoreComplexSchema1BoxedString(String data) implements NotMoreComplexSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NotMoreComplexSchema1BoxedList extends NotMoreComplexSchema1Boxed { - public final FrozenList<@Nullable Object> data; - private NotMoreComplexSchema1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record NotMoreComplexSchema1BoxedList(FrozenList<@Nullable Object> data) implements NotMoreComplexSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NotMoreComplexSchema1BoxedMap extends NotMoreComplexSchema1Boxed { - public final FrozenMap<@Nullable Object> data; - private NotMoreComplexSchema1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record NotMoreComplexSchema1BoxedMap(FrozenMap<@Nullable Object> data) implements NotMoreComplexSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class NotMoreComplexSchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, NotMoreComplexSchema1BoxedList>, MapSchemaValidator, NotMoreComplexSchema1BoxedMap> { + public static class NotMoreComplexSchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, NotMoreComplexSchema1BoxedList>, MapSchemaValidator, NotMoreComplexSchema1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -381,11 +360,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -416,11 +395,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -499,5 +478,24 @@ public NotMoreComplexSchema1BoxedList validateAndBox(List arg, SchemaConfigur public NotMoreComplexSchema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new NotMoreComplexSchema1BoxedMap(validate(arg, configuration)); } + @Override + public NotMoreComplexSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NulCharactersInStrings.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NulCharactersInStrings.java index 488e5aa4a93..cccbac4a8ff 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NulCharactersInStrings.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NulCharactersInStrings.java @@ -34,24 +34,20 @@ public String value() { } - public static abstract sealed class NulCharactersInStrings1Boxed permits NulCharactersInStrings1BoxedString { - public abstract @Nullable Object data(); + public sealed interface NulCharactersInStrings1Boxed permits NulCharactersInStrings1BoxedString { + @Nullable Object getData(); } - public static final class NulCharactersInStrings1BoxedString extends NulCharactersInStrings1Boxed { - public final String data; - private NulCharactersInStrings1BoxedString(String data) { - this.data = data; - } + public record NulCharactersInStrings1BoxedString(String data) implements NulCharactersInStrings1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class NulCharactersInStrings1 extends JsonSchema implements StringSchemaValidator, StringEnumValidator { + public static class NulCharactersInStrings1 extends JsonSchema implements StringSchemaValidator, StringEnumValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -112,5 +108,12 @@ public String validate(StringNulCharactersInStringsEnums arg,SchemaConfiguration public NulCharactersInStrings1BoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new NulCharactersInStrings1BoxedString(validate(arg, configuration)); } + @Override + public NulCharactersInStrings1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java index 9637bde1419..01f7f868c52 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java @@ -171,78 +171,54 @@ public ObjectPropertiesValidationMapBuilder getBuilderAfterAdditionalProperty(Ma } - public static abstract sealed class ObjectPropertiesValidation1Boxed permits ObjectPropertiesValidation1BoxedVoid, ObjectPropertiesValidation1BoxedBoolean, ObjectPropertiesValidation1BoxedNumber, ObjectPropertiesValidation1BoxedString, ObjectPropertiesValidation1BoxedList, ObjectPropertiesValidation1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface ObjectPropertiesValidation1Boxed permits ObjectPropertiesValidation1BoxedVoid, ObjectPropertiesValidation1BoxedBoolean, ObjectPropertiesValidation1BoxedNumber, ObjectPropertiesValidation1BoxedString, ObjectPropertiesValidation1BoxedList, ObjectPropertiesValidation1BoxedMap { + @Nullable Object getData(); } - public static final class ObjectPropertiesValidation1BoxedVoid extends ObjectPropertiesValidation1Boxed { - public final Void data; - private ObjectPropertiesValidation1BoxedVoid(Void data) { - this.data = data; - } + public record ObjectPropertiesValidation1BoxedVoid(Void data) implements ObjectPropertiesValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ObjectPropertiesValidation1BoxedBoolean extends ObjectPropertiesValidation1Boxed { - public final boolean data; - private ObjectPropertiesValidation1BoxedBoolean(boolean data) { - this.data = data; - } + public record ObjectPropertiesValidation1BoxedBoolean(boolean data) implements ObjectPropertiesValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ObjectPropertiesValidation1BoxedNumber extends ObjectPropertiesValidation1Boxed { - public final Number data; - private ObjectPropertiesValidation1BoxedNumber(Number data) { - this.data = data; - } + public record ObjectPropertiesValidation1BoxedNumber(Number data) implements ObjectPropertiesValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ObjectPropertiesValidation1BoxedString extends ObjectPropertiesValidation1Boxed { - public final String data; - private ObjectPropertiesValidation1BoxedString(String data) { - this.data = data; - } + public record ObjectPropertiesValidation1BoxedString(String data) implements ObjectPropertiesValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ObjectPropertiesValidation1BoxedList extends ObjectPropertiesValidation1Boxed { - public final FrozenList<@Nullable Object> data; - private ObjectPropertiesValidation1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record ObjectPropertiesValidation1BoxedList(FrozenList<@Nullable Object> data) implements ObjectPropertiesValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ObjectPropertiesValidation1BoxedMap extends ObjectPropertiesValidation1Boxed { - public final ObjectPropertiesValidationMap data; - private ObjectPropertiesValidation1BoxedMap(ObjectPropertiesValidationMap data) { - this.data = data; - } + public record ObjectPropertiesValidation1BoxedMap(ObjectPropertiesValidationMap data) implements ObjectPropertiesValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ObjectPropertiesValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ObjectPropertiesValidation1BoxedList>, MapSchemaValidator { + public static class ObjectPropertiesValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ObjectPropertiesValidation1BoxedList>, MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -350,11 +326,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -385,11 +361,11 @@ public ObjectPropertiesValidationMap getNewInstance(Map arg, List List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -468,5 +444,24 @@ public ObjectPropertiesValidation1BoxedList validateAndBox(List arg, SchemaCo public ObjectPropertiesValidation1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ObjectPropertiesValidation1BoxedMap(validate(arg, configuration)); } + @Override + public ObjectPropertiesValidation1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Oneof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Oneof.java index 3fb43ed1107..86951cf5e63 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Oneof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Oneof.java @@ -47,78 +47,54 @@ public static Schema0 getInstance() { } - public static abstract sealed class Schema1Boxed permits Schema1BoxedVoid, Schema1BoxedBoolean, Schema1BoxedNumber, Schema1BoxedString, Schema1BoxedList, Schema1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Schema1Boxed permits Schema1BoxedVoid, Schema1BoxedBoolean, Schema1BoxedNumber, Schema1BoxedString, Schema1BoxedList, Schema1BoxedMap { + @Nullable Object getData(); } - public static final class Schema1BoxedVoid extends Schema1Boxed { - public final Void data; - private Schema1BoxedVoid(Void data) { - this.data = data; - } + public record Schema1BoxedVoid(Void data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedBoolean extends Schema1Boxed { - public final boolean data; - private Schema1BoxedBoolean(boolean data) { - this.data = data; - } + public record Schema1BoxedBoolean(boolean data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedNumber extends Schema1Boxed { - public final Number data; - private Schema1BoxedNumber(Number data) { - this.data = data; - } + public record Schema1BoxedNumber(Number data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedString extends Schema1Boxed { - public final String data; - private Schema1BoxedString(String data) { - this.data = data; - } + public record Schema1BoxedString(String data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedList extends Schema1Boxed { - public final FrozenList<@Nullable Object> data; - private Schema1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Schema1BoxedList(FrozenList<@Nullable Object> data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedMap extends Schema1Boxed { - public final FrozenMap<@Nullable Object> data; - private Schema1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record Schema1BoxedMap(FrozenMap<@Nullable Object> data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema1BoxedList>, MapSchemaValidator, Schema1BoxedMap> { + public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema1BoxedList>, MapSchemaValidator, Schema1BoxedMap> { private static @Nullable Schema1 instance = null; protected Schema1() { @@ -217,11 +193,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -252,11 +228,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -335,80 +311,75 @@ public Schema1BoxedList validateAndBox(List arg, SchemaConfiguration configur public Schema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema1BoxedMap(validate(arg, configuration)); } + @Override + public Schema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class Oneof1Boxed permits Oneof1BoxedVoid, Oneof1BoxedBoolean, Oneof1BoxedNumber, Oneof1BoxedString, Oneof1BoxedList, Oneof1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Oneof1Boxed permits Oneof1BoxedVoid, Oneof1BoxedBoolean, Oneof1BoxedNumber, Oneof1BoxedString, Oneof1BoxedList, Oneof1BoxedMap { + @Nullable Object getData(); } - public static final class Oneof1BoxedVoid extends Oneof1Boxed { - public final Void data; - private Oneof1BoxedVoid(Void data) { - this.data = data; - } + public record Oneof1BoxedVoid(Void data) implements Oneof1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Oneof1BoxedBoolean extends Oneof1Boxed { - public final boolean data; - private Oneof1BoxedBoolean(boolean data) { - this.data = data; - } + public record Oneof1BoxedBoolean(boolean data) implements Oneof1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Oneof1BoxedNumber extends Oneof1Boxed { - public final Number data; - private Oneof1BoxedNumber(Number data) { - this.data = data; - } + public record Oneof1BoxedNumber(Number data) implements Oneof1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Oneof1BoxedString extends Oneof1Boxed { - public final String data; - private Oneof1BoxedString(String data) { - this.data = data; - } + public record Oneof1BoxedString(String data) implements Oneof1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Oneof1BoxedList extends Oneof1Boxed { - public final FrozenList<@Nullable Object> data; - private Oneof1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Oneof1BoxedList(FrozenList<@Nullable Object> data) implements Oneof1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Oneof1BoxedMap extends Oneof1Boxed { - public final FrozenMap<@Nullable Object> data; - private Oneof1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record Oneof1BoxedMap(FrozenMap<@Nullable Object> data) implements Oneof1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Oneof1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Oneof1BoxedList>, MapSchemaValidator, Oneof1BoxedMap> { + public static class Oneof1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Oneof1BoxedList>, MapSchemaValidator, Oneof1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -516,11 +487,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -551,11 +522,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -634,5 +605,24 @@ public Oneof1BoxedList validateAndBox(List arg, SchemaConfiguration configura public Oneof1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Oneof1BoxedMap(validate(arg, configuration)); } + @Override + public Oneof1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java index 84d62dcd36a..ee1966faee0 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java @@ -142,78 +142,54 @@ public Schema0Map0Builder getBuilderAfterBar(Map insta } - public static abstract sealed class Schema0Boxed permits Schema0BoxedVoid, Schema0BoxedBoolean, Schema0BoxedNumber, Schema0BoxedString, Schema0BoxedList, Schema0BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Schema0Boxed permits Schema0BoxedVoid, Schema0BoxedBoolean, Schema0BoxedNumber, Schema0BoxedString, Schema0BoxedList, Schema0BoxedMap { + @Nullable Object getData(); } - public static final class Schema0BoxedVoid extends Schema0Boxed { - public final Void data; - private Schema0BoxedVoid(Void data) { - this.data = data; - } + public record Schema0BoxedVoid(Void data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedBoolean extends Schema0Boxed { - public final boolean data; - private Schema0BoxedBoolean(boolean data) { - this.data = data; - } + public record Schema0BoxedBoolean(boolean data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedNumber extends Schema0Boxed { - public final Number data; - private Schema0BoxedNumber(Number data) { - this.data = data; - } + public record Schema0BoxedNumber(Number data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedString extends Schema0Boxed { - public final String data; - private Schema0BoxedString(String data) { - this.data = data; - } + public record Schema0BoxedString(String data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedList extends Schema0Boxed { - public final FrozenList<@Nullable Object> data; - private Schema0BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Schema0BoxedList(FrozenList<@Nullable Object> data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedMap extends Schema0Boxed { - public final Schema0Map data; - private Schema0BoxedMap(Schema0Map data) { - this.data = data; - } + public record Schema0BoxedMap(Schema0Map data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema0BoxedList>, MapSchemaValidator { + public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema0BoxedList>, MapSchemaValidator { private static @Nullable Schema0 instance = null; protected Schema0() { @@ -317,11 +293,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -352,11 +328,11 @@ public Schema0Map getNewInstance(Map arg, List pathToItem, PathToS List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -435,6 +411,25 @@ public Schema0BoxedList validateAndBox(List arg, SchemaConfiguration configur public Schema0BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema0BoxedMap(validate(arg, configuration)); } + @Override + public Schema0Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class Foo extends StringJsonSchema.StringJsonSchema1 { @@ -522,78 +517,54 @@ public Schema1Map0Builder getBuilderAfterFoo(Map insta } - public static abstract sealed class Schema1Boxed permits Schema1BoxedVoid, Schema1BoxedBoolean, Schema1BoxedNumber, Schema1BoxedString, Schema1BoxedList, Schema1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Schema1Boxed permits Schema1BoxedVoid, Schema1BoxedBoolean, Schema1BoxedNumber, Schema1BoxedString, Schema1BoxedList, Schema1BoxedMap { + @Nullable Object getData(); } - public static final class Schema1BoxedVoid extends Schema1Boxed { - public final Void data; - private Schema1BoxedVoid(Void data) { - this.data = data; - } + public record Schema1BoxedVoid(Void data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedBoolean extends Schema1Boxed { - public final boolean data; - private Schema1BoxedBoolean(boolean data) { - this.data = data; - } + public record Schema1BoxedBoolean(boolean data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedNumber extends Schema1Boxed { - public final Number data; - private Schema1BoxedNumber(Number data) { - this.data = data; - } + public record Schema1BoxedNumber(Number data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedString extends Schema1Boxed { - public final String data; - private Schema1BoxedString(String data) { - this.data = data; - } + public record Schema1BoxedString(String data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedList extends Schema1Boxed { - public final FrozenList<@Nullable Object> data; - private Schema1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Schema1BoxedList(FrozenList<@Nullable Object> data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedMap extends Schema1Boxed { - public final Schema1Map data; - private Schema1BoxedMap(Schema1Map data) { - this.data = data; - } + public record Schema1BoxedMap(Schema1Map data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema1BoxedList>, MapSchemaValidator { + public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema1BoxedList>, MapSchemaValidator { private static @Nullable Schema1 instance = null; protected Schema1() { @@ -697,11 +668,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -732,11 +703,11 @@ public Schema1Map getNewInstance(Map arg, List pathToItem, PathToS List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -815,80 +786,75 @@ public Schema1BoxedList validateAndBox(List arg, SchemaConfiguration configur public Schema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema1BoxedMap(validate(arg, configuration)); } + @Override + public Schema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class OneofComplexTypes1Boxed permits OneofComplexTypes1BoxedVoid, OneofComplexTypes1BoxedBoolean, OneofComplexTypes1BoxedNumber, OneofComplexTypes1BoxedString, OneofComplexTypes1BoxedList, OneofComplexTypes1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface OneofComplexTypes1Boxed permits OneofComplexTypes1BoxedVoid, OneofComplexTypes1BoxedBoolean, OneofComplexTypes1BoxedNumber, OneofComplexTypes1BoxedString, OneofComplexTypes1BoxedList, OneofComplexTypes1BoxedMap { + @Nullable Object getData(); } - public static final class OneofComplexTypes1BoxedVoid extends OneofComplexTypes1Boxed { - public final Void data; - private OneofComplexTypes1BoxedVoid(Void data) { - this.data = data; - } + public record OneofComplexTypes1BoxedVoid(Void data) implements OneofComplexTypes1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class OneofComplexTypes1BoxedBoolean extends OneofComplexTypes1Boxed { - public final boolean data; - private OneofComplexTypes1BoxedBoolean(boolean data) { - this.data = data; - } + public record OneofComplexTypes1BoxedBoolean(boolean data) implements OneofComplexTypes1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class OneofComplexTypes1BoxedNumber extends OneofComplexTypes1Boxed { - public final Number data; - private OneofComplexTypes1BoxedNumber(Number data) { - this.data = data; - } + public record OneofComplexTypes1BoxedNumber(Number data) implements OneofComplexTypes1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class OneofComplexTypes1BoxedString extends OneofComplexTypes1Boxed { - public final String data; - private OneofComplexTypes1BoxedString(String data) { - this.data = data; - } + public record OneofComplexTypes1BoxedString(String data) implements OneofComplexTypes1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class OneofComplexTypes1BoxedList extends OneofComplexTypes1Boxed { - public final FrozenList<@Nullable Object> data; - private OneofComplexTypes1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record OneofComplexTypes1BoxedList(FrozenList<@Nullable Object> data) implements OneofComplexTypes1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class OneofComplexTypes1BoxedMap extends OneofComplexTypes1Boxed { - public final FrozenMap<@Nullable Object> data; - private OneofComplexTypes1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record OneofComplexTypes1BoxedMap(FrozenMap<@Nullable Object> data) implements OneofComplexTypes1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class OneofComplexTypes1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, OneofComplexTypes1BoxedList>, MapSchemaValidator, OneofComplexTypes1BoxedMap> { + public static class OneofComplexTypes1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, OneofComplexTypes1BoxedList>, MapSchemaValidator, OneofComplexTypes1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -996,11 +962,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -1031,11 +997,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -1114,5 +1080,24 @@ public OneofComplexTypes1BoxedList validateAndBox(List arg, SchemaConfigurati public OneofComplexTypes1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new OneofComplexTypes1BoxedMap(validate(arg, configuration)); } + @Override + public OneofComplexTypes1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithBaseSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithBaseSchema.java index 6fdab1d7d35..e9d3f27028e 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithBaseSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithBaseSchema.java @@ -35,78 +35,54 @@ public class OneofWithBaseSchema { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class Schema0Boxed permits Schema0BoxedVoid, Schema0BoxedBoolean, Schema0BoxedNumber, Schema0BoxedString, Schema0BoxedList, Schema0BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Schema0Boxed permits Schema0BoxedVoid, Schema0BoxedBoolean, Schema0BoxedNumber, Schema0BoxedString, Schema0BoxedList, Schema0BoxedMap { + @Nullable Object getData(); } - public static final class Schema0BoxedVoid extends Schema0Boxed { - public final Void data; - private Schema0BoxedVoid(Void data) { - this.data = data; - } + public record Schema0BoxedVoid(Void data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedBoolean extends Schema0Boxed { - public final boolean data; - private Schema0BoxedBoolean(boolean data) { - this.data = data; - } + public record Schema0BoxedBoolean(boolean data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedNumber extends Schema0Boxed { - public final Number data; - private Schema0BoxedNumber(Number data) { - this.data = data; - } + public record Schema0BoxedNumber(Number data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedString extends Schema0Boxed { - public final String data; - private Schema0BoxedString(String data) { - this.data = data; - } + public record Schema0BoxedString(String data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedList extends Schema0Boxed { - public final FrozenList<@Nullable Object> data; - private Schema0BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Schema0BoxedList(FrozenList<@Nullable Object> data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedMap extends Schema0Boxed { - public final FrozenMap<@Nullable Object> data; - private Schema0BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record Schema0BoxedMap(FrozenMap<@Nullable Object> data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema0BoxedList>, MapSchemaValidator, Schema0BoxedMap> { + public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema0BoxedList>, MapSchemaValidator, Schema0BoxedMap> { private static @Nullable Schema0 instance = null; protected Schema0() { @@ -205,11 +181,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -240,11 +216,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -323,80 +299,75 @@ public Schema0BoxedList validateAndBox(List arg, SchemaConfiguration configur public Schema0BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema0BoxedMap(validate(arg, configuration)); } + @Override + public Schema0Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class Schema1Boxed permits Schema1BoxedVoid, Schema1BoxedBoolean, Schema1BoxedNumber, Schema1BoxedString, Schema1BoxedList, Schema1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Schema1Boxed permits Schema1BoxedVoid, Schema1BoxedBoolean, Schema1BoxedNumber, Schema1BoxedString, Schema1BoxedList, Schema1BoxedMap { + @Nullable Object getData(); } - public static final class Schema1BoxedVoid extends Schema1Boxed { - public final Void data; - private Schema1BoxedVoid(Void data) { - this.data = data; - } + public record Schema1BoxedVoid(Void data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedBoolean extends Schema1Boxed { - public final boolean data; - private Schema1BoxedBoolean(boolean data) { - this.data = data; - } + public record Schema1BoxedBoolean(boolean data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedNumber extends Schema1Boxed { - public final Number data; - private Schema1BoxedNumber(Number data) { - this.data = data; - } + public record Schema1BoxedNumber(Number data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedString extends Schema1Boxed { - public final String data; - private Schema1BoxedString(String data) { - this.data = data; - } + public record Schema1BoxedString(String data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedList extends Schema1Boxed { - public final FrozenList<@Nullable Object> data; - private Schema1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Schema1BoxedList(FrozenList<@Nullable Object> data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedMap extends Schema1Boxed { - public final FrozenMap<@Nullable Object> data; - private Schema1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record Schema1BoxedMap(FrozenMap<@Nullable Object> data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema1BoxedList>, MapSchemaValidator, Schema1BoxedMap> { + public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema1BoxedList>, MapSchemaValidator, Schema1BoxedMap> { private static @Nullable Schema1 instance = null; protected Schema1() { @@ -495,11 +466,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -530,11 +501,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -613,26 +584,41 @@ public Schema1BoxedList validateAndBox(List arg, SchemaConfiguration configur public Schema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema1BoxedMap(validate(arg, configuration)); } + @Override + public Schema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class OneofWithBaseSchema1Boxed permits OneofWithBaseSchema1BoxedString { - public abstract @Nullable Object data(); + public sealed interface OneofWithBaseSchema1Boxed permits OneofWithBaseSchema1BoxedString { + @Nullable Object getData(); } - public static final class OneofWithBaseSchema1BoxedString extends OneofWithBaseSchema1Boxed { - public final String data; - private OneofWithBaseSchema1BoxedString(String data) { - this.data = data; - } + public record OneofWithBaseSchema1BoxedString(String data) implements OneofWithBaseSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class OneofWithBaseSchema1 extends JsonSchema implements StringSchemaValidator { + public static class OneofWithBaseSchema1 extends JsonSchema implements StringSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -689,5 +675,12 @@ public String validate(String arg, SchemaConfiguration configuration) throws Val public OneofWithBaseSchema1BoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new OneofWithBaseSchema1BoxedString(validate(arg, configuration)); } + @Override + public OneofWithBaseSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithEmptySchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithEmptySchema.java index 14094b8e686..96c4c68034b 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithEmptySchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithEmptySchema.java @@ -59,78 +59,54 @@ public static Schema1 getInstance() { } - public static abstract sealed class OneofWithEmptySchema1Boxed permits OneofWithEmptySchema1BoxedVoid, OneofWithEmptySchema1BoxedBoolean, OneofWithEmptySchema1BoxedNumber, OneofWithEmptySchema1BoxedString, OneofWithEmptySchema1BoxedList, OneofWithEmptySchema1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface OneofWithEmptySchema1Boxed permits OneofWithEmptySchema1BoxedVoid, OneofWithEmptySchema1BoxedBoolean, OneofWithEmptySchema1BoxedNumber, OneofWithEmptySchema1BoxedString, OneofWithEmptySchema1BoxedList, OneofWithEmptySchema1BoxedMap { + @Nullable Object getData(); } - public static final class OneofWithEmptySchema1BoxedVoid extends OneofWithEmptySchema1Boxed { - public final Void data; - private OneofWithEmptySchema1BoxedVoid(Void data) { - this.data = data; - } + public record OneofWithEmptySchema1BoxedVoid(Void data) implements OneofWithEmptySchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class OneofWithEmptySchema1BoxedBoolean extends OneofWithEmptySchema1Boxed { - public final boolean data; - private OneofWithEmptySchema1BoxedBoolean(boolean data) { - this.data = data; - } + public record OneofWithEmptySchema1BoxedBoolean(boolean data) implements OneofWithEmptySchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class OneofWithEmptySchema1BoxedNumber extends OneofWithEmptySchema1Boxed { - public final Number data; - private OneofWithEmptySchema1BoxedNumber(Number data) { - this.data = data; - } + public record OneofWithEmptySchema1BoxedNumber(Number data) implements OneofWithEmptySchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class OneofWithEmptySchema1BoxedString extends OneofWithEmptySchema1Boxed { - public final String data; - private OneofWithEmptySchema1BoxedString(String data) { - this.data = data; - } + public record OneofWithEmptySchema1BoxedString(String data) implements OneofWithEmptySchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class OneofWithEmptySchema1BoxedList extends OneofWithEmptySchema1Boxed { - public final FrozenList<@Nullable Object> data; - private OneofWithEmptySchema1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record OneofWithEmptySchema1BoxedList(FrozenList<@Nullable Object> data) implements OneofWithEmptySchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class OneofWithEmptySchema1BoxedMap extends OneofWithEmptySchema1Boxed { - public final FrozenMap<@Nullable Object> data; - private OneofWithEmptySchema1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record OneofWithEmptySchema1BoxedMap(FrozenMap<@Nullable Object> data) implements OneofWithEmptySchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class OneofWithEmptySchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, OneofWithEmptySchema1BoxedList>, MapSchemaValidator, OneofWithEmptySchema1BoxedMap> { + public static class OneofWithEmptySchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, OneofWithEmptySchema1BoxedList>, MapSchemaValidator, OneofWithEmptySchema1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -238,11 +214,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -273,11 +249,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -356,5 +332,24 @@ public OneofWithEmptySchema1BoxedList validateAndBox(List arg, SchemaConfigur public OneofWithEmptySchema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new OneofWithEmptySchema1BoxedMap(validate(arg, configuration)); } + @Override + public OneofWithEmptySchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithRequired.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithRequired.java index 98c0decd936..b62dc7bf97e 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithRequired.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithRequired.java @@ -248,78 +248,54 @@ public Schema0Map10Builder getBuilderAfterFoo(Map inst } - public static abstract sealed class Schema0Boxed permits Schema0BoxedVoid, Schema0BoxedBoolean, Schema0BoxedNumber, Schema0BoxedString, Schema0BoxedList, Schema0BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Schema0Boxed permits Schema0BoxedVoid, Schema0BoxedBoolean, Schema0BoxedNumber, Schema0BoxedString, Schema0BoxedList, Schema0BoxedMap { + @Nullable Object getData(); } - public static final class Schema0BoxedVoid extends Schema0Boxed { - public final Void data; - private Schema0BoxedVoid(Void data) { - this.data = data; - } + public record Schema0BoxedVoid(Void data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedBoolean extends Schema0Boxed { - public final boolean data; - private Schema0BoxedBoolean(boolean data) { - this.data = data; - } + public record Schema0BoxedBoolean(boolean data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedNumber extends Schema0Boxed { - public final Number data; - private Schema0BoxedNumber(Number data) { - this.data = data; - } + public record Schema0BoxedNumber(Number data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedString extends Schema0Boxed { - public final String data; - private Schema0BoxedString(String data) { - this.data = data; - } + public record Schema0BoxedString(String data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedList extends Schema0Boxed { - public final FrozenList<@Nullable Object> data; - private Schema0BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Schema0BoxedList(FrozenList<@Nullable Object> data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedMap extends Schema0Boxed { - public final Schema0Map data; - private Schema0BoxedMap(Schema0Map data) { - this.data = data; - } + public record Schema0BoxedMap(Schema0Map data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema0BoxedList>, MapSchemaValidator { + public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema0BoxedList>, MapSchemaValidator { private static @Nullable Schema0 instance = null; protected Schema0() { @@ -421,11 +397,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -456,11 +432,11 @@ public Schema0Map getNewInstance(Map arg, List pathToItem, PathToS List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -539,6 +515,25 @@ public Schema0BoxedList validateAndBox(List arg, SchemaConfiguration configur public Schema0BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema0BoxedMap(validate(arg, configuration)); } + @Override + public Schema0Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class Schema1Map extends FrozenMap<@Nullable Object> { @@ -753,78 +748,54 @@ public Schema1Map10Builder getBuilderAfterFoo1(Map ins } - public static abstract sealed class Schema1Boxed permits Schema1BoxedVoid, Schema1BoxedBoolean, Schema1BoxedNumber, Schema1BoxedString, Schema1BoxedList, Schema1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Schema1Boxed permits Schema1BoxedVoid, Schema1BoxedBoolean, Schema1BoxedNumber, Schema1BoxedString, Schema1BoxedList, Schema1BoxedMap { + @Nullable Object getData(); } - public static final class Schema1BoxedVoid extends Schema1Boxed { - public final Void data; - private Schema1BoxedVoid(Void data) { - this.data = data; - } + public record Schema1BoxedVoid(Void data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedBoolean extends Schema1Boxed { - public final boolean data; - private Schema1BoxedBoolean(boolean data) { - this.data = data; - } + public record Schema1BoxedBoolean(boolean data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedNumber extends Schema1Boxed { - public final Number data; - private Schema1BoxedNumber(Number data) { - this.data = data; - } + public record Schema1BoxedNumber(Number data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedString extends Schema1Boxed { - public final String data; - private Schema1BoxedString(String data) { - this.data = data; - } + public record Schema1BoxedString(String data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedList extends Schema1Boxed { - public final FrozenList<@Nullable Object> data; - private Schema1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Schema1BoxedList(FrozenList<@Nullable Object> data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedMap extends Schema1Boxed { - public final Schema1Map data; - private Schema1BoxedMap(Schema1Map data) { - this.data = data; - } + public record Schema1BoxedMap(Schema1Map data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema1BoxedList>, MapSchemaValidator { + public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema1BoxedList>, MapSchemaValidator { private static @Nullable Schema1 instance = null; protected Schema1() { @@ -926,11 +897,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -961,11 +932,11 @@ public Schema1Map getNewInstance(Map arg, List pathToItem, PathToS List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -1044,25 +1015,40 @@ public Schema1BoxedList validateAndBox(List arg, SchemaConfiguration configur public Schema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema1BoxedMap(validate(arg, configuration)); } + @Override + public Schema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class OneofWithRequired1Boxed permits OneofWithRequired1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface OneofWithRequired1Boxed permits OneofWithRequired1BoxedMap { + @Nullable Object getData(); } - public static final class OneofWithRequired1BoxedMap extends OneofWithRequired1Boxed { - public final FrozenMap<@Nullable Object> data; - private OneofWithRequired1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record OneofWithRequired1BoxedMap(FrozenMap<@Nullable Object> data) implements OneofWithRequired1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class OneofWithRequired1 extends JsonSchema implements MapSchemaValidator, OneofWithRequired1BoxedMap> { + public static class OneofWithRequired1 extends JsonSchema implements MapSchemaValidator, OneofWithRequired1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -1099,11 +1085,11 @@ public static OneofWithRequired1 getInstance() { List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -1140,6 +1126,13 @@ public static OneofWithRequired1 getInstance() { public OneofWithRequired1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new OneofWithRequired1BoxedMap(validate(arg, configuration)); } + @Override + public OneofWithRequired1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternIsNotAnchored.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternIsNotAnchored.java index 01e0392657e..49d4017ae06 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternIsNotAnchored.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternIsNotAnchored.java @@ -36,78 +36,54 @@ public class PatternIsNotAnchored { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class PatternIsNotAnchored1Boxed permits PatternIsNotAnchored1BoxedVoid, PatternIsNotAnchored1BoxedBoolean, PatternIsNotAnchored1BoxedNumber, PatternIsNotAnchored1BoxedString, PatternIsNotAnchored1BoxedList, PatternIsNotAnchored1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface PatternIsNotAnchored1Boxed permits PatternIsNotAnchored1BoxedVoid, PatternIsNotAnchored1BoxedBoolean, PatternIsNotAnchored1BoxedNumber, PatternIsNotAnchored1BoxedString, PatternIsNotAnchored1BoxedList, PatternIsNotAnchored1BoxedMap { + @Nullable Object getData(); } - public static final class PatternIsNotAnchored1BoxedVoid extends PatternIsNotAnchored1Boxed { - public final Void data; - private PatternIsNotAnchored1BoxedVoid(Void data) { - this.data = data; - } + public record PatternIsNotAnchored1BoxedVoid(Void data) implements PatternIsNotAnchored1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class PatternIsNotAnchored1BoxedBoolean extends PatternIsNotAnchored1Boxed { - public final boolean data; - private PatternIsNotAnchored1BoxedBoolean(boolean data) { - this.data = data; - } + public record PatternIsNotAnchored1BoxedBoolean(boolean data) implements PatternIsNotAnchored1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class PatternIsNotAnchored1BoxedNumber extends PatternIsNotAnchored1Boxed { - public final Number data; - private PatternIsNotAnchored1BoxedNumber(Number data) { - this.data = data; - } + public record PatternIsNotAnchored1BoxedNumber(Number data) implements PatternIsNotAnchored1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class PatternIsNotAnchored1BoxedString extends PatternIsNotAnchored1Boxed { - public final String data; - private PatternIsNotAnchored1BoxedString(String data) { - this.data = data; - } + public record PatternIsNotAnchored1BoxedString(String data) implements PatternIsNotAnchored1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class PatternIsNotAnchored1BoxedList extends PatternIsNotAnchored1Boxed { - public final FrozenList<@Nullable Object> data; - private PatternIsNotAnchored1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record PatternIsNotAnchored1BoxedList(FrozenList<@Nullable Object> data) implements PatternIsNotAnchored1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class PatternIsNotAnchored1BoxedMap extends PatternIsNotAnchored1Boxed { - public final FrozenMap<@Nullable Object> data; - private PatternIsNotAnchored1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record PatternIsNotAnchored1BoxedMap(FrozenMap<@Nullable Object> data) implements PatternIsNotAnchored1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class PatternIsNotAnchored1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, PatternIsNotAnchored1BoxedList>, MapSchemaValidator, PatternIsNotAnchored1BoxedMap> { + public static class PatternIsNotAnchored1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, PatternIsNotAnchored1BoxedList>, MapSchemaValidator, PatternIsNotAnchored1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -214,11 +190,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -249,11 +225,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -332,5 +308,24 @@ public PatternIsNotAnchored1BoxedList validateAndBox(List arg, SchemaConfigur public PatternIsNotAnchored1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new PatternIsNotAnchored1BoxedMap(validate(arg, configuration)); } + @Override + public PatternIsNotAnchored1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternValidation.java index 1493b20852c..7e0ffabd596 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternValidation.java @@ -36,78 +36,54 @@ public class PatternValidation { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class PatternValidation1Boxed permits PatternValidation1BoxedVoid, PatternValidation1BoxedBoolean, PatternValidation1BoxedNumber, PatternValidation1BoxedString, PatternValidation1BoxedList, PatternValidation1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface PatternValidation1Boxed permits PatternValidation1BoxedVoid, PatternValidation1BoxedBoolean, PatternValidation1BoxedNumber, PatternValidation1BoxedString, PatternValidation1BoxedList, PatternValidation1BoxedMap { + @Nullable Object getData(); } - public static final class PatternValidation1BoxedVoid extends PatternValidation1Boxed { - public final Void data; - private PatternValidation1BoxedVoid(Void data) { - this.data = data; - } + public record PatternValidation1BoxedVoid(Void data) implements PatternValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class PatternValidation1BoxedBoolean extends PatternValidation1Boxed { - public final boolean data; - private PatternValidation1BoxedBoolean(boolean data) { - this.data = data; - } + public record PatternValidation1BoxedBoolean(boolean data) implements PatternValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class PatternValidation1BoxedNumber extends PatternValidation1Boxed { - public final Number data; - private PatternValidation1BoxedNumber(Number data) { - this.data = data; - } + public record PatternValidation1BoxedNumber(Number data) implements PatternValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class PatternValidation1BoxedString extends PatternValidation1Boxed { - public final String data; - private PatternValidation1BoxedString(String data) { - this.data = data; - } + public record PatternValidation1BoxedString(String data) implements PatternValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class PatternValidation1BoxedList extends PatternValidation1Boxed { - public final FrozenList<@Nullable Object> data; - private PatternValidation1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record PatternValidation1BoxedList(FrozenList<@Nullable Object> data) implements PatternValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class PatternValidation1BoxedMap extends PatternValidation1Boxed { - public final FrozenMap<@Nullable Object> data; - private PatternValidation1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record PatternValidation1BoxedMap(FrozenMap<@Nullable Object> data) implements PatternValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class PatternValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, PatternValidation1BoxedList>, MapSchemaValidator, PatternValidation1BoxedMap> { + public static class PatternValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, PatternValidation1BoxedList>, MapSchemaValidator, PatternValidation1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -214,11 +190,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -249,11 +225,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -332,5 +308,24 @@ public PatternValidation1BoxedList validateAndBox(List arg, SchemaConfigurati public PatternValidation1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new PatternValidation1BoxedMap(validate(arg, configuration)); } + @Override + public PatternValidation1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesWithEscapedCharacters.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesWithEscapedCharacters.java index 5c68c3db422..9fec0c66360 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesWithEscapedCharacters.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesWithEscapedCharacters.java @@ -348,78 +348,54 @@ public PropertiesWithEscapedCharactersMapBuilder getBuilderAfterAdditionalProper } - public static abstract sealed class PropertiesWithEscapedCharacters1Boxed permits PropertiesWithEscapedCharacters1BoxedVoid, PropertiesWithEscapedCharacters1BoxedBoolean, PropertiesWithEscapedCharacters1BoxedNumber, PropertiesWithEscapedCharacters1BoxedString, PropertiesWithEscapedCharacters1BoxedList, PropertiesWithEscapedCharacters1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface PropertiesWithEscapedCharacters1Boxed permits PropertiesWithEscapedCharacters1BoxedVoid, PropertiesWithEscapedCharacters1BoxedBoolean, PropertiesWithEscapedCharacters1BoxedNumber, PropertiesWithEscapedCharacters1BoxedString, PropertiesWithEscapedCharacters1BoxedList, PropertiesWithEscapedCharacters1BoxedMap { + @Nullable Object getData(); } - public static final class PropertiesWithEscapedCharacters1BoxedVoid extends PropertiesWithEscapedCharacters1Boxed { - public final Void data; - private PropertiesWithEscapedCharacters1BoxedVoid(Void data) { - this.data = data; - } + public record PropertiesWithEscapedCharacters1BoxedVoid(Void data) implements PropertiesWithEscapedCharacters1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class PropertiesWithEscapedCharacters1BoxedBoolean extends PropertiesWithEscapedCharacters1Boxed { - public final boolean data; - private PropertiesWithEscapedCharacters1BoxedBoolean(boolean data) { - this.data = data; - } + public record PropertiesWithEscapedCharacters1BoxedBoolean(boolean data) implements PropertiesWithEscapedCharacters1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class PropertiesWithEscapedCharacters1BoxedNumber extends PropertiesWithEscapedCharacters1Boxed { - public final Number data; - private PropertiesWithEscapedCharacters1BoxedNumber(Number data) { - this.data = data; - } + public record PropertiesWithEscapedCharacters1BoxedNumber(Number data) implements PropertiesWithEscapedCharacters1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class PropertiesWithEscapedCharacters1BoxedString extends PropertiesWithEscapedCharacters1Boxed { - public final String data; - private PropertiesWithEscapedCharacters1BoxedString(String data) { - this.data = data; - } + public record PropertiesWithEscapedCharacters1BoxedString(String data) implements PropertiesWithEscapedCharacters1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class PropertiesWithEscapedCharacters1BoxedList extends PropertiesWithEscapedCharacters1Boxed { - public final FrozenList<@Nullable Object> data; - private PropertiesWithEscapedCharacters1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record PropertiesWithEscapedCharacters1BoxedList(FrozenList<@Nullable Object> data) implements PropertiesWithEscapedCharacters1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class PropertiesWithEscapedCharacters1BoxedMap extends PropertiesWithEscapedCharacters1Boxed { - public final PropertiesWithEscapedCharactersMap data; - private PropertiesWithEscapedCharacters1BoxedMap(PropertiesWithEscapedCharactersMap data) { - this.data = data; - } + public record PropertiesWithEscapedCharacters1BoxedMap(PropertiesWithEscapedCharactersMap data) implements PropertiesWithEscapedCharacters1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class PropertiesWithEscapedCharacters1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, PropertiesWithEscapedCharacters1BoxedList>, MapSchemaValidator { + public static class PropertiesWithEscapedCharacters1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, PropertiesWithEscapedCharacters1BoxedList>, MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -531,11 +507,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -566,11 +542,11 @@ public PropertiesWithEscapedCharactersMap getNewInstance(Map arg, List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -649,5 +625,24 @@ public PropertiesWithEscapedCharacters1BoxedList validateAndBox(List arg, Sch public PropertiesWithEscapedCharacters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new PropertiesWithEscapedCharacters1BoxedMap(validate(arg, configuration)); } + @Override + public PropertiesWithEscapedCharacters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertyNamedRefThatIsNotAReference.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertyNamedRefThatIsNotAReference.java index 4f5b39e6deb..559e0f4fe6f 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertyNamedRefThatIsNotAReference.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertyNamedRefThatIsNotAReference.java @@ -105,78 +105,54 @@ public PropertyNamedRefThatIsNotAReferenceMapBuilder getBuilderAfterAdditionalPr } - public static abstract sealed class PropertyNamedRefThatIsNotAReference1Boxed permits PropertyNamedRefThatIsNotAReference1BoxedVoid, PropertyNamedRefThatIsNotAReference1BoxedBoolean, PropertyNamedRefThatIsNotAReference1BoxedNumber, PropertyNamedRefThatIsNotAReference1BoxedString, PropertyNamedRefThatIsNotAReference1BoxedList, PropertyNamedRefThatIsNotAReference1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface PropertyNamedRefThatIsNotAReference1Boxed permits PropertyNamedRefThatIsNotAReference1BoxedVoid, PropertyNamedRefThatIsNotAReference1BoxedBoolean, PropertyNamedRefThatIsNotAReference1BoxedNumber, PropertyNamedRefThatIsNotAReference1BoxedString, PropertyNamedRefThatIsNotAReference1BoxedList, PropertyNamedRefThatIsNotAReference1BoxedMap { + @Nullable Object getData(); } - public static final class PropertyNamedRefThatIsNotAReference1BoxedVoid extends PropertyNamedRefThatIsNotAReference1Boxed { - public final Void data; - private PropertyNamedRefThatIsNotAReference1BoxedVoid(Void data) { - this.data = data; - } + public record PropertyNamedRefThatIsNotAReference1BoxedVoid(Void data) implements PropertyNamedRefThatIsNotAReference1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class PropertyNamedRefThatIsNotAReference1BoxedBoolean extends PropertyNamedRefThatIsNotAReference1Boxed { - public final boolean data; - private PropertyNamedRefThatIsNotAReference1BoxedBoolean(boolean data) { - this.data = data; - } + public record PropertyNamedRefThatIsNotAReference1BoxedBoolean(boolean data) implements PropertyNamedRefThatIsNotAReference1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class PropertyNamedRefThatIsNotAReference1BoxedNumber extends PropertyNamedRefThatIsNotAReference1Boxed { - public final Number data; - private PropertyNamedRefThatIsNotAReference1BoxedNumber(Number data) { - this.data = data; - } + public record PropertyNamedRefThatIsNotAReference1BoxedNumber(Number data) implements PropertyNamedRefThatIsNotAReference1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class PropertyNamedRefThatIsNotAReference1BoxedString extends PropertyNamedRefThatIsNotAReference1Boxed { - public final String data; - private PropertyNamedRefThatIsNotAReference1BoxedString(String data) { - this.data = data; - } + public record PropertyNamedRefThatIsNotAReference1BoxedString(String data) implements PropertyNamedRefThatIsNotAReference1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class PropertyNamedRefThatIsNotAReference1BoxedList extends PropertyNamedRefThatIsNotAReference1Boxed { - public final FrozenList<@Nullable Object> data; - private PropertyNamedRefThatIsNotAReference1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record PropertyNamedRefThatIsNotAReference1BoxedList(FrozenList<@Nullable Object> data) implements PropertyNamedRefThatIsNotAReference1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class PropertyNamedRefThatIsNotAReference1BoxedMap extends PropertyNamedRefThatIsNotAReference1Boxed { - public final PropertyNamedRefThatIsNotAReferenceMap data; - private PropertyNamedRefThatIsNotAReference1BoxedMap(PropertyNamedRefThatIsNotAReferenceMap data) { - this.data = data; - } + public record PropertyNamedRefThatIsNotAReference1BoxedMap(PropertyNamedRefThatIsNotAReferenceMap data) implements PropertyNamedRefThatIsNotAReference1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class PropertyNamedRefThatIsNotAReference1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, PropertyNamedRefThatIsNotAReference1BoxedList>, MapSchemaValidator { + public static class PropertyNamedRefThatIsNotAReference1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, PropertyNamedRefThatIsNotAReference1BoxedList>, MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -283,11 +259,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -318,11 +294,11 @@ public PropertyNamedRefThatIsNotAReferenceMap getNewInstance(Map arg, List List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -401,5 +377,24 @@ public PropertyNamedRefThatIsNotAReference1BoxedList validateAndBox(List arg, public PropertyNamedRefThatIsNotAReference1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new PropertyNamedRefThatIsNotAReference1BoxedMap(validate(arg, configuration)); } + @Override + public PropertyNamedRefThatIsNotAReference1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAdditionalproperties.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAdditionalproperties.java index 595f2e74aaf..efa1e208ac7 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAdditionalproperties.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAdditionalproperties.java @@ -132,23 +132,19 @@ public RefInAdditionalpropertiesMapBuilder getBuilderAfterAdditionalProperty(Map } - public static abstract sealed class RefInAdditionalproperties1Boxed permits RefInAdditionalproperties1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface RefInAdditionalproperties1Boxed permits RefInAdditionalproperties1BoxedMap { + @Nullable Object getData(); } - public static final class RefInAdditionalproperties1BoxedMap extends RefInAdditionalproperties1Boxed { - public final RefInAdditionalpropertiesMap data; - private RefInAdditionalproperties1BoxedMap(RefInAdditionalpropertiesMap data) { - this.data = data; - } + public record RefInAdditionalproperties1BoxedMap(RefInAdditionalpropertiesMap data) implements RefInAdditionalproperties1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class RefInAdditionalproperties1 extends JsonSchema implements MapSchemaValidator { + public static class RefInAdditionalproperties1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -182,11 +178,11 @@ public RefInAdditionalpropertiesMap getNewInstance(Map arg, List p List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -226,6 +222,13 @@ public RefInAdditionalpropertiesMap validate(Map arg, SchemaConfiguration public RefInAdditionalproperties1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new RefInAdditionalproperties1BoxedMap(validate(arg, configuration)); } + @Override + public RefInAdditionalproperties1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAllof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAllof.java index 817333e4575..a826571f87c 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAllof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAllof.java @@ -35,78 +35,54 @@ public class RefInAllof { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class RefInAllof1Boxed permits RefInAllof1BoxedVoid, RefInAllof1BoxedBoolean, RefInAllof1BoxedNumber, RefInAllof1BoxedString, RefInAllof1BoxedList, RefInAllof1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface RefInAllof1Boxed permits RefInAllof1BoxedVoid, RefInAllof1BoxedBoolean, RefInAllof1BoxedNumber, RefInAllof1BoxedString, RefInAllof1BoxedList, RefInAllof1BoxedMap { + @Nullable Object getData(); } - public static final class RefInAllof1BoxedVoid extends RefInAllof1Boxed { - public final Void data; - private RefInAllof1BoxedVoid(Void data) { - this.data = data; - } + public record RefInAllof1BoxedVoid(Void data) implements RefInAllof1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class RefInAllof1BoxedBoolean extends RefInAllof1Boxed { - public final boolean data; - private RefInAllof1BoxedBoolean(boolean data) { - this.data = data; - } + public record RefInAllof1BoxedBoolean(boolean data) implements RefInAllof1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class RefInAllof1BoxedNumber extends RefInAllof1Boxed { - public final Number data; - private RefInAllof1BoxedNumber(Number data) { - this.data = data; - } + public record RefInAllof1BoxedNumber(Number data) implements RefInAllof1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class RefInAllof1BoxedString extends RefInAllof1Boxed { - public final String data; - private RefInAllof1BoxedString(String data) { - this.data = data; - } + public record RefInAllof1BoxedString(String data) implements RefInAllof1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class RefInAllof1BoxedList extends RefInAllof1Boxed { - public final FrozenList<@Nullable Object> data; - private RefInAllof1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record RefInAllof1BoxedList(FrozenList<@Nullable Object> data) implements RefInAllof1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class RefInAllof1BoxedMap extends RefInAllof1Boxed { - public final FrozenMap<@Nullable Object> data; - private RefInAllof1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record RefInAllof1BoxedMap(FrozenMap<@Nullable Object> data) implements RefInAllof1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class RefInAllof1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, RefInAllof1BoxedList>, MapSchemaValidator, RefInAllof1BoxedMap> { + public static class RefInAllof1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, RefInAllof1BoxedList>, MapSchemaValidator, RefInAllof1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -213,11 +189,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -248,11 +224,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -331,5 +307,24 @@ public RefInAllof1BoxedList validateAndBox(List arg, SchemaConfiguration conf public RefInAllof1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new RefInAllof1BoxedMap(validate(arg, configuration)); } + @Override + public RefInAllof1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAnyof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAnyof.java index 7c3d31d35cb..c77c290df32 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAnyof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInAnyof.java @@ -35,78 +35,54 @@ public class RefInAnyof { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class RefInAnyof1Boxed permits RefInAnyof1BoxedVoid, RefInAnyof1BoxedBoolean, RefInAnyof1BoxedNumber, RefInAnyof1BoxedString, RefInAnyof1BoxedList, RefInAnyof1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface RefInAnyof1Boxed permits RefInAnyof1BoxedVoid, RefInAnyof1BoxedBoolean, RefInAnyof1BoxedNumber, RefInAnyof1BoxedString, RefInAnyof1BoxedList, RefInAnyof1BoxedMap { + @Nullable Object getData(); } - public static final class RefInAnyof1BoxedVoid extends RefInAnyof1Boxed { - public final Void data; - private RefInAnyof1BoxedVoid(Void data) { - this.data = data; - } + public record RefInAnyof1BoxedVoid(Void data) implements RefInAnyof1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class RefInAnyof1BoxedBoolean extends RefInAnyof1Boxed { - public final boolean data; - private RefInAnyof1BoxedBoolean(boolean data) { - this.data = data; - } + public record RefInAnyof1BoxedBoolean(boolean data) implements RefInAnyof1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class RefInAnyof1BoxedNumber extends RefInAnyof1Boxed { - public final Number data; - private RefInAnyof1BoxedNumber(Number data) { - this.data = data; - } + public record RefInAnyof1BoxedNumber(Number data) implements RefInAnyof1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class RefInAnyof1BoxedString extends RefInAnyof1Boxed { - public final String data; - private RefInAnyof1BoxedString(String data) { - this.data = data; - } + public record RefInAnyof1BoxedString(String data) implements RefInAnyof1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class RefInAnyof1BoxedList extends RefInAnyof1Boxed { - public final FrozenList<@Nullable Object> data; - private RefInAnyof1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record RefInAnyof1BoxedList(FrozenList<@Nullable Object> data) implements RefInAnyof1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class RefInAnyof1BoxedMap extends RefInAnyof1Boxed { - public final FrozenMap<@Nullable Object> data; - private RefInAnyof1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record RefInAnyof1BoxedMap(FrozenMap<@Nullable Object> data) implements RefInAnyof1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class RefInAnyof1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, RefInAnyof1BoxedList>, MapSchemaValidator, RefInAnyof1BoxedMap> { + public static class RefInAnyof1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, RefInAnyof1BoxedList>, MapSchemaValidator, RefInAnyof1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -213,11 +189,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -248,11 +224,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -331,5 +307,24 @@ public RefInAnyof1BoxedList validateAndBox(List arg, SchemaConfiguration conf public RefInAnyof1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new RefInAnyof1BoxedMap(validate(arg, configuration)); } + @Override + public RefInAnyof1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInItems.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInItems.java index 6217563be32..ca25ea6cd5d 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInItems.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInItems.java @@ -95,24 +95,20 @@ public RefInItemsListBuilder add(Map item) { } - public static abstract sealed class RefInItems1Boxed permits RefInItems1BoxedList { - public abstract @Nullable Object data(); + public sealed interface RefInItems1Boxed permits RefInItems1BoxedList { + @Nullable Object getData(); } - public static final class RefInItems1BoxedList extends RefInItems1Boxed { - public final RefInItemsList data; - private RefInItems1BoxedList(RefInItemsList data) { - this.data = data; - } + public record RefInItems1BoxedList(RefInItemsList data) implements RefInItems1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class RefInItems1 extends JsonSchema implements ListSchemaValidator { + public static class RefInItems1 extends JsonSchema implements ListSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -142,11 +138,11 @@ public RefInItemsList getNewInstance(List arg, List pathToItem, PathT for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -186,5 +182,12 @@ public RefInItemsList validate(List arg, SchemaConfiguration configuration) t public RefInItems1BoxedList validateAndBox(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new RefInItems1BoxedList(validate(arg, configuration)); } + @Override + public RefInItems1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInNot.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInNot.java index 4a902917275..069ea431cda 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInNot.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInNot.java @@ -35,78 +35,54 @@ public class RefInNot { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class RefInNot1Boxed permits RefInNot1BoxedVoid, RefInNot1BoxedBoolean, RefInNot1BoxedNumber, RefInNot1BoxedString, RefInNot1BoxedList, RefInNot1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface RefInNot1Boxed permits RefInNot1BoxedVoid, RefInNot1BoxedBoolean, RefInNot1BoxedNumber, RefInNot1BoxedString, RefInNot1BoxedList, RefInNot1BoxedMap { + @Nullable Object getData(); } - public static final class RefInNot1BoxedVoid extends RefInNot1Boxed { - public final Void data; - private RefInNot1BoxedVoid(Void data) { - this.data = data; - } + public record RefInNot1BoxedVoid(Void data) implements RefInNot1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class RefInNot1BoxedBoolean extends RefInNot1Boxed { - public final boolean data; - private RefInNot1BoxedBoolean(boolean data) { - this.data = data; - } + public record RefInNot1BoxedBoolean(boolean data) implements RefInNot1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class RefInNot1BoxedNumber extends RefInNot1Boxed { - public final Number data; - private RefInNot1BoxedNumber(Number data) { - this.data = data; - } + public record RefInNot1BoxedNumber(Number data) implements RefInNot1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class RefInNot1BoxedString extends RefInNot1Boxed { - public final String data; - private RefInNot1BoxedString(String data) { - this.data = data; - } + public record RefInNot1BoxedString(String data) implements RefInNot1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class RefInNot1BoxedList extends RefInNot1Boxed { - public final FrozenList<@Nullable Object> data; - private RefInNot1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record RefInNot1BoxedList(FrozenList<@Nullable Object> data) implements RefInNot1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class RefInNot1BoxedMap extends RefInNot1Boxed { - public final FrozenMap<@Nullable Object> data; - private RefInNot1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record RefInNot1BoxedMap(FrozenMap<@Nullable Object> data) implements RefInNot1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class RefInNot1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, RefInNot1BoxedList>, MapSchemaValidator, RefInNot1BoxedMap> { + public static class RefInNot1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, RefInNot1BoxedList>, MapSchemaValidator, RefInNot1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -211,11 +187,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -246,11 +222,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -329,5 +305,24 @@ public RefInNot1BoxedList validateAndBox(List arg, SchemaConfiguration config public RefInNot1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new RefInNot1BoxedMap(validate(arg, configuration)); } + @Override + public RefInNot1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInOneof.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInOneof.java index 53fbd1405bc..16dfea00c74 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInOneof.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInOneof.java @@ -35,78 +35,54 @@ public class RefInOneof { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class RefInOneof1Boxed permits RefInOneof1BoxedVoid, RefInOneof1BoxedBoolean, RefInOneof1BoxedNumber, RefInOneof1BoxedString, RefInOneof1BoxedList, RefInOneof1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface RefInOneof1Boxed permits RefInOneof1BoxedVoid, RefInOneof1BoxedBoolean, RefInOneof1BoxedNumber, RefInOneof1BoxedString, RefInOneof1BoxedList, RefInOneof1BoxedMap { + @Nullable Object getData(); } - public static final class RefInOneof1BoxedVoid extends RefInOneof1Boxed { - public final Void data; - private RefInOneof1BoxedVoid(Void data) { - this.data = data; - } + public record RefInOneof1BoxedVoid(Void data) implements RefInOneof1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class RefInOneof1BoxedBoolean extends RefInOneof1Boxed { - public final boolean data; - private RefInOneof1BoxedBoolean(boolean data) { - this.data = data; - } + public record RefInOneof1BoxedBoolean(boolean data) implements RefInOneof1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class RefInOneof1BoxedNumber extends RefInOneof1Boxed { - public final Number data; - private RefInOneof1BoxedNumber(Number data) { - this.data = data; - } + public record RefInOneof1BoxedNumber(Number data) implements RefInOneof1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class RefInOneof1BoxedString extends RefInOneof1Boxed { - public final String data; - private RefInOneof1BoxedString(String data) { - this.data = data; - } + public record RefInOneof1BoxedString(String data) implements RefInOneof1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class RefInOneof1BoxedList extends RefInOneof1Boxed { - public final FrozenList<@Nullable Object> data; - private RefInOneof1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record RefInOneof1BoxedList(FrozenList<@Nullable Object> data) implements RefInOneof1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class RefInOneof1BoxedMap extends RefInOneof1Boxed { - public final FrozenMap<@Nullable Object> data; - private RefInOneof1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record RefInOneof1BoxedMap(FrozenMap<@Nullable Object> data) implements RefInOneof1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class RefInOneof1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, RefInOneof1BoxedList>, MapSchemaValidator, RefInOneof1BoxedMap> { + public static class RefInOneof1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, RefInOneof1BoxedList>, MapSchemaValidator, RefInOneof1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -213,11 +189,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -248,11 +224,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -331,5 +307,24 @@ public RefInOneof1BoxedList validateAndBox(List arg, SchemaConfiguration conf public RefInOneof1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new RefInOneof1BoxedMap(validate(arg, configuration)); } + @Override + public RefInOneof1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInProperty.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInProperty.java index 0cab7d30dfb..d6ed9d63722 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInProperty.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RefInProperty.java @@ -151,78 +151,54 @@ public RefInPropertyMapBuilder getBuilderAfterAdditionalProperty(Map data; - private RefInProperty1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record RefInProperty1BoxedList(FrozenList<@Nullable Object> data) implements RefInProperty1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class RefInProperty1BoxedMap extends RefInProperty1Boxed { - public final RefInPropertyMap data; - private RefInProperty1BoxedMap(RefInPropertyMap data) { - this.data = data; - } + public record RefInProperty1BoxedMap(RefInPropertyMap data) implements RefInProperty1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class RefInProperty1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, RefInProperty1BoxedList>, MapSchemaValidator { + public static class RefInProperty1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, RefInProperty1BoxedList>, MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -329,11 +305,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -364,11 +340,11 @@ public RefInPropertyMap getNewInstance(Map arg, List pathToItem, P List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -447,5 +423,24 @@ public RefInProperty1BoxedList validateAndBox(List arg, SchemaConfiguration c public RefInProperty1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new RefInProperty1BoxedMap(validate(arg, configuration)); } + @Override + public RefInProperty1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredDefaultValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredDefaultValidation.java index 3ec1cb0e025..8be0cb10a2a 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredDefaultValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredDefaultValidation.java @@ -157,78 +157,54 @@ public RequiredDefaultValidationMapBuilder getBuilderAfterAdditionalProperty(Map } - public static abstract sealed class RequiredDefaultValidation1Boxed permits RequiredDefaultValidation1BoxedVoid, RequiredDefaultValidation1BoxedBoolean, RequiredDefaultValidation1BoxedNumber, RequiredDefaultValidation1BoxedString, RequiredDefaultValidation1BoxedList, RequiredDefaultValidation1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface RequiredDefaultValidation1Boxed permits RequiredDefaultValidation1BoxedVoid, RequiredDefaultValidation1BoxedBoolean, RequiredDefaultValidation1BoxedNumber, RequiredDefaultValidation1BoxedString, RequiredDefaultValidation1BoxedList, RequiredDefaultValidation1BoxedMap { + @Nullable Object getData(); } - public static final class RequiredDefaultValidation1BoxedVoid extends RequiredDefaultValidation1Boxed { - public final Void data; - private RequiredDefaultValidation1BoxedVoid(Void data) { - this.data = data; - } + public record RequiredDefaultValidation1BoxedVoid(Void data) implements RequiredDefaultValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class RequiredDefaultValidation1BoxedBoolean extends RequiredDefaultValidation1Boxed { - public final boolean data; - private RequiredDefaultValidation1BoxedBoolean(boolean data) { - this.data = data; - } + public record RequiredDefaultValidation1BoxedBoolean(boolean data) implements RequiredDefaultValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class RequiredDefaultValidation1BoxedNumber extends RequiredDefaultValidation1Boxed { - public final Number data; - private RequiredDefaultValidation1BoxedNumber(Number data) { - this.data = data; - } + public record RequiredDefaultValidation1BoxedNumber(Number data) implements RequiredDefaultValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class RequiredDefaultValidation1BoxedString extends RequiredDefaultValidation1Boxed { - public final String data; - private RequiredDefaultValidation1BoxedString(String data) { - this.data = data; - } + public record RequiredDefaultValidation1BoxedString(String data) implements RequiredDefaultValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class RequiredDefaultValidation1BoxedList extends RequiredDefaultValidation1Boxed { - public final FrozenList<@Nullable Object> data; - private RequiredDefaultValidation1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record RequiredDefaultValidation1BoxedList(FrozenList<@Nullable Object> data) implements RequiredDefaultValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class RequiredDefaultValidation1BoxedMap extends RequiredDefaultValidation1Boxed { - public final RequiredDefaultValidationMap data; - private RequiredDefaultValidation1BoxedMap(RequiredDefaultValidationMap data) { - this.data = data; - } + public record RequiredDefaultValidation1BoxedMap(RequiredDefaultValidationMap data) implements RequiredDefaultValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class RequiredDefaultValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, RequiredDefaultValidation1BoxedList>, MapSchemaValidator { + public static class RequiredDefaultValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, RequiredDefaultValidation1BoxedList>, MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -335,11 +311,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -370,11 +346,11 @@ public RequiredDefaultValidationMap getNewInstance(Map arg, List p List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -453,5 +429,24 @@ public RequiredDefaultValidation1BoxedList validateAndBox(List arg, SchemaCon public RequiredDefaultValidation1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new RequiredDefaultValidation1BoxedMap(validate(arg, configuration)); } + @Override + public RequiredDefaultValidation1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredValidation.java index f2fcafbdf13..aeaff53e4dd 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredValidation.java @@ -247,78 +247,54 @@ public RequiredValidationMap0Builder getBuilderAfterFoo(Map data; - private RequiredValidation1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record RequiredValidation1BoxedList(FrozenList<@Nullable Object> data) implements RequiredValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class RequiredValidation1BoxedMap extends RequiredValidation1Boxed { - public final RequiredValidationMap data; - private RequiredValidation1BoxedMap(RequiredValidationMap data) { - this.data = data; - } + public record RequiredValidation1BoxedMap(RequiredValidationMap data) implements RequiredValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class RequiredValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, RequiredValidation1BoxedList>, MapSchemaValidator { + public static class RequiredValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, RequiredValidation1BoxedList>, MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -429,11 +405,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -464,11 +440,11 @@ public RequiredValidationMap getNewInstance(Map arg, List pathToIt List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -547,5 +523,24 @@ public RequiredValidation1BoxedList validateAndBox(List arg, SchemaConfigurat public RequiredValidation1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new RequiredValidation1BoxedMap(validate(arg, configuration)); } + @Override + public RequiredValidation1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEmptyArray.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEmptyArray.java index 65683b78a83..8f3fb5dbb03 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEmptyArray.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEmptyArray.java @@ -157,78 +157,54 @@ public RequiredWithEmptyArrayMapBuilder getBuilderAfterAdditionalProperty(Map data; - private RequiredWithEmptyArray1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record RequiredWithEmptyArray1BoxedList(FrozenList<@Nullable Object> data) implements RequiredWithEmptyArray1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class RequiredWithEmptyArray1BoxedMap extends RequiredWithEmptyArray1Boxed { - public final RequiredWithEmptyArrayMap data; - private RequiredWithEmptyArray1BoxedMap(RequiredWithEmptyArrayMap data) { - this.data = data; - } + public record RequiredWithEmptyArray1BoxedMap(RequiredWithEmptyArrayMap data) implements RequiredWithEmptyArray1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class RequiredWithEmptyArray1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, RequiredWithEmptyArray1BoxedList>, MapSchemaValidator { + public static class RequiredWithEmptyArray1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, RequiredWithEmptyArray1BoxedList>, MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -335,11 +311,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -370,11 +346,11 @@ public RequiredWithEmptyArrayMap getNewInstance(Map arg, List path List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -453,5 +429,24 @@ public RequiredWithEmptyArray1BoxedList validateAndBox(List arg, SchemaConfig public RequiredWithEmptyArray1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new RequiredWithEmptyArray1BoxedMap(validate(arg, configuration)); } + @Override + public RequiredWithEmptyArray1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEscapedCharacters.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEscapedCharacters.java index aa00cfb41ab..d6afadd7b34 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEscapedCharacters.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEscapedCharacters.java @@ -1648,78 +1648,54 @@ public RequiredWithEscapedCharactersMap111110Builder getBuilderAfterFoobar1(Map< } - public static abstract sealed class RequiredWithEscapedCharacters1Boxed permits RequiredWithEscapedCharacters1BoxedVoid, RequiredWithEscapedCharacters1BoxedBoolean, RequiredWithEscapedCharacters1BoxedNumber, RequiredWithEscapedCharacters1BoxedString, RequiredWithEscapedCharacters1BoxedList, RequiredWithEscapedCharacters1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface RequiredWithEscapedCharacters1Boxed permits RequiredWithEscapedCharacters1BoxedVoid, RequiredWithEscapedCharacters1BoxedBoolean, RequiredWithEscapedCharacters1BoxedNumber, RequiredWithEscapedCharacters1BoxedString, RequiredWithEscapedCharacters1BoxedList, RequiredWithEscapedCharacters1BoxedMap { + @Nullable Object getData(); } - public static final class RequiredWithEscapedCharacters1BoxedVoid extends RequiredWithEscapedCharacters1Boxed { - public final Void data; - private RequiredWithEscapedCharacters1BoxedVoid(Void data) { - this.data = data; - } + public record RequiredWithEscapedCharacters1BoxedVoid(Void data) implements RequiredWithEscapedCharacters1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class RequiredWithEscapedCharacters1BoxedBoolean extends RequiredWithEscapedCharacters1Boxed { - public final boolean data; - private RequiredWithEscapedCharacters1BoxedBoolean(boolean data) { - this.data = data; - } + public record RequiredWithEscapedCharacters1BoxedBoolean(boolean data) implements RequiredWithEscapedCharacters1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class RequiredWithEscapedCharacters1BoxedNumber extends RequiredWithEscapedCharacters1Boxed { - public final Number data; - private RequiredWithEscapedCharacters1BoxedNumber(Number data) { - this.data = data; - } + public record RequiredWithEscapedCharacters1BoxedNumber(Number data) implements RequiredWithEscapedCharacters1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class RequiredWithEscapedCharacters1BoxedString extends RequiredWithEscapedCharacters1Boxed { - public final String data; - private RequiredWithEscapedCharacters1BoxedString(String data) { - this.data = data; - } + public record RequiredWithEscapedCharacters1BoxedString(String data) implements RequiredWithEscapedCharacters1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class RequiredWithEscapedCharacters1BoxedList extends RequiredWithEscapedCharacters1Boxed { - public final FrozenList<@Nullable Object> data; - private RequiredWithEscapedCharacters1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record RequiredWithEscapedCharacters1BoxedList(FrozenList<@Nullable Object> data) implements RequiredWithEscapedCharacters1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class RequiredWithEscapedCharacters1BoxedMap extends RequiredWithEscapedCharacters1Boxed { - public final RequiredWithEscapedCharactersMap data; - private RequiredWithEscapedCharacters1BoxedMap(RequiredWithEscapedCharactersMap data) { - this.data = data; - } + public record RequiredWithEscapedCharacters1BoxedMap(RequiredWithEscapedCharactersMap data) implements RequiredWithEscapedCharacters1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class RequiredWithEscapedCharacters1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, RequiredWithEscapedCharacters1BoxedList>, MapSchemaValidator { + public static class RequiredWithEscapedCharacters1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, RequiredWithEscapedCharacters1BoxedList>, MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -1831,11 +1807,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -1866,11 +1842,11 @@ public RequiredWithEscapedCharactersMap getNewInstance(Map arg, List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -1949,5 +1925,24 @@ public RequiredWithEscapedCharacters1BoxedList validateAndBox(List arg, Schem public RequiredWithEscapedCharacters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new RequiredWithEscapedCharacters1BoxedMap(validate(arg, configuration)); } + @Override + public RequiredWithEscapedCharacters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/SimpleEnumValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/SimpleEnumValidation.java index 1007dda3a7c..9234455603c 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/SimpleEnumValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/SimpleEnumValidation.java @@ -85,24 +85,20 @@ public double value() { } - public static abstract sealed class SimpleEnumValidation1Boxed permits SimpleEnumValidation1BoxedNumber { - public abstract @Nullable Object data(); + public sealed interface SimpleEnumValidation1Boxed permits SimpleEnumValidation1BoxedNumber { + @Nullable Object getData(); } - public static final class SimpleEnumValidation1BoxedNumber extends SimpleEnumValidation1Boxed { - public final Number data; - private SimpleEnumValidation1BoxedNumber(Number data) { - this.data = data; - } + public record SimpleEnumValidation1BoxedNumber(Number data) implements SimpleEnumValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class SimpleEnumValidation1 extends JsonSchema implements IntegerEnumValidator, LongEnumValidator, FloatEnumValidator, DoubleEnumValidator, NumberSchemaValidator { + public static class SimpleEnumValidation1 extends JsonSchema implements IntegerEnumValidator, LongEnumValidator, FloatEnumValidator, DoubleEnumValidator, NumberSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -199,5 +195,12 @@ public double validate(DoubleSimpleEnumValidationEnums arg,SchemaConfiguration c public SimpleEnumValidation1BoxedNumber validateAndBox(Number arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new SimpleEnumValidation1BoxedNumber(validate(arg, configuration)); } + @Override + public SimpleEnumValidation1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.java index 033f8986e48..e730c2690f0 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.java @@ -30,24 +30,20 @@ public class TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class AlphaBoxed permits AlphaBoxedNumber { - public abstract @Nullable Object data(); + public sealed interface AlphaBoxed permits AlphaBoxedNumber { + @Nullable Object getData(); } - public static final class AlphaBoxedNumber extends AlphaBoxed { - public final Number data; - private AlphaBoxedNumber(Number data) { - this.data = data; - } + public record AlphaBoxedNumber(Number data) implements AlphaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Alpha extends JsonSchema implements NumberSchemaValidator { + public static class Alpha extends JsonSchema implements NumberSchemaValidator { private static @Nullable Alpha instance = null; protected Alpha() { @@ -115,6 +111,13 @@ public double validate(double arg, SchemaConfiguration configuration) throws Val public AlphaBoxedNumber validateAndBox(Number arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new AlphaBoxedNumber(validate(arg, configuration)); } + @Override + public AlphaBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingMap extends FrozenMap<@Nullable Object> { @@ -201,23 +204,19 @@ public TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingMapBuilder getBui } - public static abstract sealed class TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing1Boxed permits TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing1Boxed permits TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing1BoxedMap { + @Nullable Object getData(); } - public static final class TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing1BoxedMap extends TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing1Boxed { - public final TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingMap data; - private TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing1BoxedMap(TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingMap data) { - this.data = data; - } + public record TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing1BoxedMap(TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingMap data) implements TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing1 extends JsonSchema implements MapSchemaValidator { + public static class TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -253,11 +252,11 @@ public TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingMap getNewInstanc List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -294,6 +293,13 @@ public TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingMap validate(Map< public TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing1BoxedMap(validate(arg, configuration)); } + @Override + public TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsFalseValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsFalseValidation.java index bfb7f909fc0..4399cec94a9 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsFalseValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsFalseValidation.java @@ -35,78 +35,54 @@ public class UniqueitemsFalseValidation { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class UniqueitemsFalseValidation1Boxed permits UniqueitemsFalseValidation1BoxedVoid, UniqueitemsFalseValidation1BoxedBoolean, UniqueitemsFalseValidation1BoxedNumber, UniqueitemsFalseValidation1BoxedString, UniqueitemsFalseValidation1BoxedList, UniqueitemsFalseValidation1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface UniqueitemsFalseValidation1Boxed permits UniqueitemsFalseValidation1BoxedVoid, UniqueitemsFalseValidation1BoxedBoolean, UniqueitemsFalseValidation1BoxedNumber, UniqueitemsFalseValidation1BoxedString, UniqueitemsFalseValidation1BoxedList, UniqueitemsFalseValidation1BoxedMap { + @Nullable Object getData(); } - public static final class UniqueitemsFalseValidation1BoxedVoid extends UniqueitemsFalseValidation1Boxed { - public final Void data; - private UniqueitemsFalseValidation1BoxedVoid(Void data) { - this.data = data; - } + public record UniqueitemsFalseValidation1BoxedVoid(Void data) implements UniqueitemsFalseValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UniqueitemsFalseValidation1BoxedBoolean extends UniqueitemsFalseValidation1Boxed { - public final boolean data; - private UniqueitemsFalseValidation1BoxedBoolean(boolean data) { - this.data = data; - } + public record UniqueitemsFalseValidation1BoxedBoolean(boolean data) implements UniqueitemsFalseValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UniqueitemsFalseValidation1BoxedNumber extends UniqueitemsFalseValidation1Boxed { - public final Number data; - private UniqueitemsFalseValidation1BoxedNumber(Number data) { - this.data = data; - } + public record UniqueitemsFalseValidation1BoxedNumber(Number data) implements UniqueitemsFalseValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UniqueitemsFalseValidation1BoxedString extends UniqueitemsFalseValidation1Boxed { - public final String data; - private UniqueitemsFalseValidation1BoxedString(String data) { - this.data = data; - } + public record UniqueitemsFalseValidation1BoxedString(String data) implements UniqueitemsFalseValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UniqueitemsFalseValidation1BoxedList extends UniqueitemsFalseValidation1Boxed { - public final FrozenList<@Nullable Object> data; - private UniqueitemsFalseValidation1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record UniqueitemsFalseValidation1BoxedList(FrozenList<@Nullable Object> data) implements UniqueitemsFalseValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UniqueitemsFalseValidation1BoxedMap extends UniqueitemsFalseValidation1Boxed { - public final FrozenMap<@Nullable Object> data; - private UniqueitemsFalseValidation1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record UniqueitemsFalseValidation1BoxedMap(FrozenMap<@Nullable Object> data) implements UniqueitemsFalseValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class UniqueitemsFalseValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, UniqueitemsFalseValidation1BoxedList>, MapSchemaValidator, UniqueitemsFalseValidation1BoxedMap> { + public static class UniqueitemsFalseValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, UniqueitemsFalseValidation1BoxedList>, MapSchemaValidator, UniqueitemsFalseValidation1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -211,11 +187,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -246,11 +222,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -329,5 +305,24 @@ public UniqueitemsFalseValidation1BoxedList validateAndBox(List arg, SchemaCo public UniqueitemsFalseValidation1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new UniqueitemsFalseValidation1BoxedMap(validate(arg, configuration)); } + @Override + public UniqueitemsFalseValidation1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsValidation.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsValidation.java index 02694a8bd17..2433913da51 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsValidation.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsValidation.java @@ -35,78 +35,54 @@ public class UniqueitemsValidation { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class UniqueitemsValidation1Boxed permits UniqueitemsValidation1BoxedVoid, UniqueitemsValidation1BoxedBoolean, UniqueitemsValidation1BoxedNumber, UniqueitemsValidation1BoxedString, UniqueitemsValidation1BoxedList, UniqueitemsValidation1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface UniqueitemsValidation1Boxed permits UniqueitemsValidation1BoxedVoid, UniqueitemsValidation1BoxedBoolean, UniqueitemsValidation1BoxedNumber, UniqueitemsValidation1BoxedString, UniqueitemsValidation1BoxedList, UniqueitemsValidation1BoxedMap { + @Nullable Object getData(); } - public static final class UniqueitemsValidation1BoxedVoid extends UniqueitemsValidation1Boxed { - public final Void data; - private UniqueitemsValidation1BoxedVoid(Void data) { - this.data = data; - } + public record UniqueitemsValidation1BoxedVoid(Void data) implements UniqueitemsValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UniqueitemsValidation1BoxedBoolean extends UniqueitemsValidation1Boxed { - public final boolean data; - private UniqueitemsValidation1BoxedBoolean(boolean data) { - this.data = data; - } + public record UniqueitemsValidation1BoxedBoolean(boolean data) implements UniqueitemsValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UniqueitemsValidation1BoxedNumber extends UniqueitemsValidation1Boxed { - public final Number data; - private UniqueitemsValidation1BoxedNumber(Number data) { - this.data = data; - } + public record UniqueitemsValidation1BoxedNumber(Number data) implements UniqueitemsValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UniqueitemsValidation1BoxedString extends UniqueitemsValidation1Boxed { - public final String data; - private UniqueitemsValidation1BoxedString(String data) { - this.data = data; - } + public record UniqueitemsValidation1BoxedString(String data) implements UniqueitemsValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UniqueitemsValidation1BoxedList extends UniqueitemsValidation1Boxed { - public final FrozenList<@Nullable Object> data; - private UniqueitemsValidation1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record UniqueitemsValidation1BoxedList(FrozenList<@Nullable Object> data) implements UniqueitemsValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UniqueitemsValidation1BoxedMap extends UniqueitemsValidation1Boxed { - public final FrozenMap<@Nullable Object> data; - private UniqueitemsValidation1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record UniqueitemsValidation1BoxedMap(FrozenMap<@Nullable Object> data) implements UniqueitemsValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class UniqueitemsValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, UniqueitemsValidation1BoxedList>, MapSchemaValidator, UniqueitemsValidation1BoxedMap> { + public static class UniqueitemsValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, UniqueitemsValidation1BoxedList>, MapSchemaValidator, UniqueitemsValidation1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -211,11 +187,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -246,11 +222,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -329,5 +305,24 @@ public UniqueitemsValidation1BoxedList validateAndBox(List arg, SchemaConfigu public UniqueitemsValidation1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new UniqueitemsValidation1BoxedMap(validate(arg, configuration)); } + @Override + public UniqueitemsValidation1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriFormat.java index c7c3721ac5f..bc2d00b8518 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriFormat.java @@ -35,78 +35,54 @@ public class UriFormat { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class UriFormat1Boxed permits UriFormat1BoxedVoid, UriFormat1BoxedBoolean, UriFormat1BoxedNumber, UriFormat1BoxedString, UriFormat1BoxedList, UriFormat1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface UriFormat1Boxed permits UriFormat1BoxedVoid, UriFormat1BoxedBoolean, UriFormat1BoxedNumber, UriFormat1BoxedString, UriFormat1BoxedList, UriFormat1BoxedMap { + @Nullable Object getData(); } - public static final class UriFormat1BoxedVoid extends UriFormat1Boxed { - public final Void data; - private UriFormat1BoxedVoid(Void data) { - this.data = data; - } + public record UriFormat1BoxedVoid(Void data) implements UriFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UriFormat1BoxedBoolean extends UriFormat1Boxed { - public final boolean data; - private UriFormat1BoxedBoolean(boolean data) { - this.data = data; - } + public record UriFormat1BoxedBoolean(boolean data) implements UriFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UriFormat1BoxedNumber extends UriFormat1Boxed { - public final Number data; - private UriFormat1BoxedNumber(Number data) { - this.data = data; - } + public record UriFormat1BoxedNumber(Number data) implements UriFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UriFormat1BoxedString extends UriFormat1Boxed { - public final String data; - private UriFormat1BoxedString(String data) { - this.data = data; - } + public record UriFormat1BoxedString(String data) implements UriFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UriFormat1BoxedList extends UriFormat1Boxed { - public final FrozenList<@Nullable Object> data; - private UriFormat1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record UriFormat1BoxedList(FrozenList<@Nullable Object> data) implements UriFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UriFormat1BoxedMap extends UriFormat1Boxed { - public final FrozenMap<@Nullable Object> data; - private UriFormat1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record UriFormat1BoxedMap(FrozenMap<@Nullable Object> data) implements UriFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class UriFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, UriFormat1BoxedList>, MapSchemaValidator, UriFormat1BoxedMap> { + public static class UriFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, UriFormat1BoxedList>, MapSchemaValidator, UriFormat1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -211,11 +187,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -246,11 +222,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -329,5 +305,24 @@ public UriFormat1BoxedList validateAndBox(List arg, SchemaConfiguration confi public UriFormat1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new UriFormat1BoxedMap(validate(arg, configuration)); } + @Override + public UriFormat1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriReferenceFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriReferenceFormat.java index a6f0712c973..bee6021f6cf 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriReferenceFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriReferenceFormat.java @@ -35,78 +35,54 @@ public class UriReferenceFormat { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class UriReferenceFormat1Boxed permits UriReferenceFormat1BoxedVoid, UriReferenceFormat1BoxedBoolean, UriReferenceFormat1BoxedNumber, UriReferenceFormat1BoxedString, UriReferenceFormat1BoxedList, UriReferenceFormat1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface UriReferenceFormat1Boxed permits UriReferenceFormat1BoxedVoid, UriReferenceFormat1BoxedBoolean, UriReferenceFormat1BoxedNumber, UriReferenceFormat1BoxedString, UriReferenceFormat1BoxedList, UriReferenceFormat1BoxedMap { + @Nullable Object getData(); } - public static final class UriReferenceFormat1BoxedVoid extends UriReferenceFormat1Boxed { - public final Void data; - private UriReferenceFormat1BoxedVoid(Void data) { - this.data = data; - } + public record UriReferenceFormat1BoxedVoid(Void data) implements UriReferenceFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UriReferenceFormat1BoxedBoolean extends UriReferenceFormat1Boxed { - public final boolean data; - private UriReferenceFormat1BoxedBoolean(boolean data) { - this.data = data; - } + public record UriReferenceFormat1BoxedBoolean(boolean data) implements UriReferenceFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UriReferenceFormat1BoxedNumber extends UriReferenceFormat1Boxed { - public final Number data; - private UriReferenceFormat1BoxedNumber(Number data) { - this.data = data; - } + public record UriReferenceFormat1BoxedNumber(Number data) implements UriReferenceFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UriReferenceFormat1BoxedString extends UriReferenceFormat1Boxed { - public final String data; - private UriReferenceFormat1BoxedString(String data) { - this.data = data; - } + public record UriReferenceFormat1BoxedString(String data) implements UriReferenceFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UriReferenceFormat1BoxedList extends UriReferenceFormat1Boxed { - public final FrozenList<@Nullable Object> data; - private UriReferenceFormat1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record UriReferenceFormat1BoxedList(FrozenList<@Nullable Object> data) implements UriReferenceFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UriReferenceFormat1BoxedMap extends UriReferenceFormat1Boxed { - public final FrozenMap<@Nullable Object> data; - private UriReferenceFormat1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record UriReferenceFormat1BoxedMap(FrozenMap<@Nullable Object> data) implements UriReferenceFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class UriReferenceFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, UriReferenceFormat1BoxedList>, MapSchemaValidator, UriReferenceFormat1BoxedMap> { + public static class UriReferenceFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, UriReferenceFormat1BoxedList>, MapSchemaValidator, UriReferenceFormat1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -211,11 +187,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -246,11 +222,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -329,5 +305,24 @@ public UriReferenceFormat1BoxedList validateAndBox(List arg, SchemaConfigurat public UriReferenceFormat1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new UriReferenceFormat1BoxedMap(validate(arg, configuration)); } + @Override + public UriReferenceFormat1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriTemplateFormat.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriTemplateFormat.java index 2724eebd809..16dead22e86 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriTemplateFormat.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriTemplateFormat.java @@ -35,78 +35,54 @@ public class UriTemplateFormat { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class UriTemplateFormat1Boxed permits UriTemplateFormat1BoxedVoid, UriTemplateFormat1BoxedBoolean, UriTemplateFormat1BoxedNumber, UriTemplateFormat1BoxedString, UriTemplateFormat1BoxedList, UriTemplateFormat1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface UriTemplateFormat1Boxed permits UriTemplateFormat1BoxedVoid, UriTemplateFormat1BoxedBoolean, UriTemplateFormat1BoxedNumber, UriTemplateFormat1BoxedString, UriTemplateFormat1BoxedList, UriTemplateFormat1BoxedMap { + @Nullable Object getData(); } - public static final class UriTemplateFormat1BoxedVoid extends UriTemplateFormat1Boxed { - public final Void data; - private UriTemplateFormat1BoxedVoid(Void data) { - this.data = data; - } + public record UriTemplateFormat1BoxedVoid(Void data) implements UriTemplateFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UriTemplateFormat1BoxedBoolean extends UriTemplateFormat1Boxed { - public final boolean data; - private UriTemplateFormat1BoxedBoolean(boolean data) { - this.data = data; - } + public record UriTemplateFormat1BoxedBoolean(boolean data) implements UriTemplateFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UriTemplateFormat1BoxedNumber extends UriTemplateFormat1Boxed { - public final Number data; - private UriTemplateFormat1BoxedNumber(Number data) { - this.data = data; - } + public record UriTemplateFormat1BoxedNumber(Number data) implements UriTemplateFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UriTemplateFormat1BoxedString extends UriTemplateFormat1Boxed { - public final String data; - private UriTemplateFormat1BoxedString(String data) { - this.data = data; - } + public record UriTemplateFormat1BoxedString(String data) implements UriTemplateFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UriTemplateFormat1BoxedList extends UriTemplateFormat1Boxed { - public final FrozenList<@Nullable Object> data; - private UriTemplateFormat1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record UriTemplateFormat1BoxedList(FrozenList<@Nullable Object> data) implements UriTemplateFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UriTemplateFormat1BoxedMap extends UriTemplateFormat1Boxed { - public final FrozenMap<@Nullable Object> data; - private UriTemplateFormat1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record UriTemplateFormat1BoxedMap(FrozenMap<@Nullable Object> data) implements UriTemplateFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class UriTemplateFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, UriTemplateFormat1BoxedList>, MapSchemaValidator, UriTemplateFormat1BoxedMap> { + public static class UriTemplateFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, UriTemplateFormat1BoxedList>, MapSchemaValidator, UriTemplateFormat1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -211,11 +187,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -246,11 +222,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -329,5 +305,24 @@ public UriTemplateFormat1BoxedList validateAndBox(List arg, SchemaConfigurati public UriTemplateFormat1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new UriTemplateFormat1BoxedMap(validate(arg, configuration)); } + @Override + public UriTemplateFormat1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/mediatype/MediaType.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/mediatype/MediaType.java index 7e55f79c911..e8392d15eda 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/mediatype/MediaType.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/mediatype/MediaType.java @@ -1,11 +1,8 @@ package org.openapijsonschematools.client.mediatype; import org.openapijsonschematools.client.schemas.validation.JsonSchema; -import org.checkerframework.checker.nullness.qual.Nullable; -import java.util.Map; - -public class MediaType { +public interface MediaType, U> { /* * Used to store request and response body schema information * encoding: @@ -14,16 +11,6 @@ public class MediaType { * The encoding object SHALL only apply to requestBody objects when the media type is * multipart or application/x-www-form-urlencoded. */ - public final T schema; - public final @Nullable Map encoding; - - public MediaType(T schema, @Nullable Map encoding) { - this.schema = schema; - this.encoding = encoding; - } - - public MediaType(T schema) { - this.schema = schema; - this.encoding = null; - } + T schema(); + U encoding(); } \ No newline at end of file diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/requestbody/RequestBodySerializer.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/requestbody/RequestBodySerializer.java index 3fdbcdbfde4..e221acb164a 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/requestbody/RequestBodySerializer.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/requestbody/RequestBodySerializer.java @@ -1,28 +1,32 @@ package org.openapijsonschematools.client.requestbody; -import org.openapijsonschematools.client.mediatype.MediaType; - import java.net.http.HttpRequest; import org.checkerframework.checker.nullness.qual.Nullable; import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.ToNumberPolicy; +import org.openapijsonschematools.client.schemas.validation.JsonSchema; import java.util.Map; import java.util.regex.Pattern; -public abstract class RequestBodySerializer { +public abstract class RequestBodySerializer { /* * Describes a single request body * content: contentType to MediaType schema info */ - public final Map> content; + public final Map content; public final boolean required; private static final Pattern jsonContentTypePattern = Pattern.compile( "application/[^+]*[+]?(json);?.*" ); - private static final Gson gson = new Gson(); + private static final Gson gson = new GsonBuilder() + .setObjectToNumberStrategy(ToNumberPolicy.LONG_OR_DOUBLE) + .setNumberToNumberStrategy(ToNumberPolicy.LONG_OR_DOUBLE) + .create(); private static final String textPlainContentType = "text/plain"; - public RequestBodySerializer(Map> content, boolean required) { + public RequestBodySerializer(Map content, boolean required) { this.content = content; this.required = required; } @@ -31,8 +35,13 @@ protected static boolean contentTypeIsJson(String contentType) { return jsonContentTypePattern.matcher(contentType).find(); } + @SuppressWarnings("nullness") + private String toJson(@Nullable Object body) { + return gson.toJson(body); + } + private SerializedRequestBody serializeJson(String contentType, @Nullable Object body) { - String jsonText = gson.toJson(body); + String jsonText = toJson(body); return new SerializedRequestBody(contentType, HttpRequest.BodyPublishers.ofString(jsonText)); } @@ -40,7 +49,7 @@ private SerializedRequestBody serializeTextPlain(String contentType, @Nullable O if (body instanceof String stringBody) { return new SerializedRequestBody(contentType, HttpRequest.BodyPublishers.ofString(stringBody)); } - throw new RuntimeException("Invalid non-string data type of "+body.getClass().getName()+" for text/plain body serialization"); + throw new RuntimeException("Invalid non-string data type of "+JsonSchema.getClass(body)+" for text/plain body serialization"); } protected SerializedRequestBody serialize(String contentType, @Nullable Object body) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/response/ApiResponse.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/response/ApiResponse.java new file mode 100644 index 00000000000..dab55e0f2da --- /dev/null +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/response/ApiResponse.java @@ -0,0 +1,9 @@ +package org.openapijsonschematools.client.response; + +import java.net.http.HttpResponse; + +public interface ApiResponse { + HttpResponse response(); + SealedBodyOutputClass body(); + HeaderOutputClass headers(); +} \ No newline at end of file diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/response/DeserializedApiResponse.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/response/DeserializedApiResponse.java new file mode 100644 index 00000000000..1e88d82646c --- /dev/null +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/response/DeserializedApiResponse.java @@ -0,0 +1,8 @@ +package org.openapijsonschematools.client.response; + +import java.net.http.HttpResponse; + +public record DeserializedApiResponse(HttpResponse response, + SealedBodyOutputClass body, + HeaderOutputClass headers) implements ApiResponse { +} \ No newline at end of file diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/response/ResponseDeserializer.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/response/ResponseDeserializer.java new file mode 100644 index 00000000000..766af80f088 --- /dev/null +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/response/ResponseDeserializer.java @@ -0,0 +1,83 @@ +package org.openapijsonschematools.client.response; + +import java.net.http.HttpHeaders; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.Map; +import java.util.Optional; +import java.util.regex.Pattern; + +import org.checkerframework.checker.nullness.qual.Nullable; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.ToNumberPolicy; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.schemas.validation.JsonSchema; + +public abstract class ResponseDeserializer { + public final Map content; + public final @Nullable Map headers; // todo change the value to header + private static final Pattern jsonContentTypePattern = Pattern.compile( + "application/[^+]*[+]?(json);?.*" + ); + private static final Gson gson = new GsonBuilder() + .setObjectToNumberStrategy(ToNumberPolicy.LONG_OR_DOUBLE) + .setNumberToNumberStrategy(ToNumberPolicy.LONG_OR_DOUBLE) + .create(); + protected static final String textPlainContentType = "text/plain"; + + public ResponseDeserializer(Map content) { + this.content = content; + this.headers = null; + } + + protected abstract SealedBodyClass getBody(String contentType, byte[] body, SchemaConfiguration configuration); + protected abstract HeaderClass getHeaders(HttpHeaders headers); + + protected @Nullable Object deserializeJson(byte[] body) { + String bodyStr = new String(body, StandardCharsets.UTF_8); + return gson.fromJson(bodyStr, Object.class); + } + + protected String deserializeTextPlain(byte[] body) { + return new String(body, StandardCharsets.UTF_8); + } + + protected static boolean contentTypeIsJson(String contentType) { + return jsonContentTypePattern.matcher(contentType).find(); + } + + protected static boolean contentTypeIsTextPlain(String contentType) { + return textPlainContentType.equals(contentType); + } + + protected T deserializeBody(String contentType, byte[] body, JsonSchema schema, SchemaConfiguration configuration) { + if (contentTypeIsJson(contentType)) { + @Nullable Object bodyData = deserializeJson(body); + return schema.validateAndBox(bodyData, configuration); + } else if (contentTypeIsTextPlain(contentType)) { + String bodyData = deserializeTextPlain(body); + return schema.validateAndBox(bodyData, configuration); + } + throw new RuntimeException("Deserialization for contentType="+contentType+" has not yet been implemented."); + } + + public ApiResponse deserialize(HttpResponse response, SchemaConfiguration configuration) { + Optional contentTypeInfo = response.headers().firstValue("Content-Type"); + if (contentTypeInfo.isEmpty()) { + throw new RuntimeException("Invalid response returned, Content-Type header is missing and it must be included"); + } + String contentType = contentTypeInfo.get(); + if (content != null && !content.containsKey(contentType)) { + throw new RuntimeException( + "Invalid contentType returned. contentType="+contentType+" was returned "+ + "when only "+content.keySet()+" are defined for statusCode="+response.statusCode() + ); + } + byte[] bodyBytes = response.body(); + SealedBodyClass body = getBody(contentType, bodyBytes, configuration); + HeaderClass headers = getHeaders(response.headers()); + return new DeserializedApiResponse<>(response, body, headers); + } +} \ No newline at end of file diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/AnyTypeJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/AnyTypeJsonSchema.java index ee6800e54ad..0ffcae114bd 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/AnyTypeJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/AnyTypeJsonSchema.java @@ -31,71 +31,47 @@ import java.util.UUID; public class AnyTypeJsonSchema { - public static abstract sealed class AnyTypeJsonSchema1Boxed permits AnyTypeJsonSchema1BoxedVoid, AnyTypeJsonSchema1BoxedBoolean, AnyTypeJsonSchema1BoxedNumber, AnyTypeJsonSchema1BoxedString, AnyTypeJsonSchema1BoxedList, AnyTypeJsonSchema1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface AnyTypeJsonSchema1Boxed permits AnyTypeJsonSchema1BoxedVoid, AnyTypeJsonSchema1BoxedBoolean, AnyTypeJsonSchema1BoxedNumber, AnyTypeJsonSchema1BoxedString, AnyTypeJsonSchema1BoxedList, AnyTypeJsonSchema1BoxedMap { + @Nullable Object getData(); } - public static final class AnyTypeJsonSchema1BoxedVoid extends AnyTypeJsonSchema1Boxed { - public final Void data; - private AnyTypeJsonSchema1BoxedVoid(Void data) { - this.data = data; - } + public record AnyTypeJsonSchema1BoxedVoid(Void data) implements AnyTypeJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AnyTypeJsonSchema1BoxedBoolean extends AnyTypeJsonSchema1Boxed { - public final boolean data; - private AnyTypeJsonSchema1BoxedBoolean(boolean data) { - this.data = data; - } + public record AnyTypeJsonSchema1BoxedBoolean(boolean data) implements AnyTypeJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AnyTypeJsonSchema1BoxedNumber extends AnyTypeJsonSchema1Boxed { - public final Number data; - private AnyTypeJsonSchema1BoxedNumber(Number data) { - this.data = data; - } + public record AnyTypeJsonSchema1BoxedNumber(Number data) implements AnyTypeJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AnyTypeJsonSchema1BoxedString extends AnyTypeJsonSchema1Boxed { - public final String data; - private AnyTypeJsonSchema1BoxedString(String data) { - this.data = data; - } + public record AnyTypeJsonSchema1BoxedString(String data) implements AnyTypeJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AnyTypeJsonSchema1BoxedList extends AnyTypeJsonSchema1Boxed { - public final FrozenList<@Nullable Object> data; - private AnyTypeJsonSchema1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record AnyTypeJsonSchema1BoxedList(FrozenList<@Nullable Object> data) implements AnyTypeJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AnyTypeJsonSchema1BoxedMap extends AnyTypeJsonSchema1Boxed { - public final FrozenMap<@Nullable Object> data; - private AnyTypeJsonSchema1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record AnyTypeJsonSchema1BoxedMap(FrozenMap<@Nullable Object> data) implements AnyTypeJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class AnyTypeJsonSchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, AnyTypeJsonSchema1BoxedList>, MapSchemaValidator, AnyTypeJsonSchema1BoxedMap> { + public static class AnyTypeJsonSchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, AnyTypeJsonSchema1BoxedList>, MapSchemaValidator, AnyTypeJsonSchema1BoxedMap> { private static @Nullable AnyTypeJsonSchema1 instance = null; protected AnyTypeJsonSchema1() { @@ -192,11 +168,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object castItem = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; @@ -227,11 +203,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object castValue = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } @@ -291,25 +267,50 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public AnyTypeJsonSchema1BoxedVoid validateAndBox(Void arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new AnyTypeJsonSchema1BoxedVoid(validate(arg, configuration)); } + @Override public AnyTypeJsonSchema1BoxedBoolean validateAndBox(boolean arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new AnyTypeJsonSchema1BoxedBoolean(validate(arg, configuration)); } + @Override public AnyTypeJsonSchema1BoxedNumber validateAndBox(Number arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new AnyTypeJsonSchema1BoxedNumber(validate(arg, configuration)); } + @Override public AnyTypeJsonSchema1BoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new AnyTypeJsonSchema1BoxedString(validate(arg, configuration)); } + @Override public AnyTypeJsonSchema1BoxedList validateAndBox(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new AnyTypeJsonSchema1BoxedList(validate(arg, configuration)); } + @Override public AnyTypeJsonSchema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new AnyTypeJsonSchema1BoxedMap(validate(arg, configuration)); } + + @Override + public AnyTypeJsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } \ No newline at end of file diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/BooleanJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/BooleanJsonSchema.java index 9cb93203682..2cceae9d49f 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/BooleanJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/BooleanJsonSchema.java @@ -18,20 +18,16 @@ import java.util.Set; public class BooleanJsonSchema { - public static abstract sealed class BooleanJsonSchema1Boxed permits BooleanJsonSchema1BoxedBoolean { - public abstract @Nullable Object data(); + public sealed interface BooleanJsonSchema1Boxed permits BooleanJsonSchema1BoxedBoolean { + @Nullable Object getData(); } - public static final class BooleanJsonSchema1BoxedBoolean extends BooleanJsonSchema1Boxed { - public final boolean data; - private BooleanJsonSchema1BoxedBoolean(boolean data) { - this.data = data; - } + public record BooleanJsonSchema1BoxedBoolean(boolean data) implements BooleanJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class BooleanJsonSchema1 extends JsonSchema implements BooleanSchemaValidator { + public static class BooleanJsonSchema1 extends JsonSchema implements BooleanSchemaValidator { private static @Nullable BooleanJsonSchema1 instance = null; protected BooleanJsonSchema1() { @@ -80,5 +76,14 @@ public boolean validate(boolean arg, SchemaConfiguration configuration) throws V public BooleanJsonSchema1BoxedBoolean validateAndBox(boolean arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new BooleanJsonSchema1BoxedBoolean(validate(arg, configuration)); } + + @Override + public BooleanJsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } \ No newline at end of file diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DateJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DateJsonSchema.java index 48da817d9b1..15b5ca67f26 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DateJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DateJsonSchema.java @@ -19,21 +19,17 @@ import java.util.Set; public class DateJsonSchema { - public static abstract sealed class DateJsonSchema1Boxed permits DateJsonSchema1BoxedString { - public abstract @Nullable Object data(); + public sealed interface DateJsonSchema1Boxed permits DateJsonSchema1BoxedString { + @Nullable Object getData(); } - public static final class DateJsonSchema1BoxedString extends DateJsonSchema1Boxed { - public final String data; - private DateJsonSchema1BoxedString(String data) { - this.data = data; - } + public record DateJsonSchema1BoxedString(String data) implements DateJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class DateJsonSchema1 extends JsonSchema implements StringSchemaValidator { + public static class DateJsonSchema1 extends JsonSchema implements StringSchemaValidator { private static @Nullable DateJsonSchema1 instance = null; protected DateJsonSchema1() { @@ -87,5 +83,13 @@ public String validate(LocalDate arg, SchemaConfiguration configuration) throws public DateJsonSchema1BoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new DateJsonSchema1BoxedString(validate(arg, configuration)); } + + @Override + public DateJsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } \ No newline at end of file diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DateTimeJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DateTimeJsonSchema.java index 9e048ab2c07..e695f3c2ac9 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DateTimeJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DateTimeJsonSchema.java @@ -19,21 +19,17 @@ import java.util.Set; public class DateTimeJsonSchema { - public static abstract sealed class DateTimeJsonSchema1Boxed permits DateTimeJsonSchema1BoxedString { - public abstract @Nullable Object data(); + public sealed interface DateTimeJsonSchema1Boxed permits DateTimeJsonSchema1BoxedString { + @Nullable Object getData(); } - public static final class DateTimeJsonSchema1BoxedString extends DateTimeJsonSchema1Boxed { - public final String data; - private DateTimeJsonSchema1BoxedString(String data) { - this.data = data; - } + public record DateTimeJsonSchema1BoxedString(String data) implements DateTimeJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class DateTimeJsonSchema1 extends JsonSchema implements StringSchemaValidator { + public static class DateTimeJsonSchema1 extends JsonSchema implements StringSchemaValidator { private static @Nullable DateTimeJsonSchema1 instance = null; protected DateTimeJsonSchema1() { @@ -87,5 +83,13 @@ public String validate(ZonedDateTime arg, SchemaConfiguration configuration) thr public DateTimeJsonSchema1BoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new DateTimeJsonSchema1BoxedString(validate(arg, configuration)); } + + @Override + public DateTimeJsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } \ No newline at end of file diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DecimalJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DecimalJsonSchema.java index af820a6b251..f961e94f802 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DecimalJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DecimalJsonSchema.java @@ -18,21 +18,17 @@ import java.util.Set; public class DecimalJsonSchema { - public static abstract sealed class DecimalJsonSchema1Boxed permits DecimalJsonSchema1BoxedString { - public abstract @Nullable Object data(); + public sealed interface DecimalJsonSchema1Boxed permits DecimalJsonSchema1BoxedString { + @Nullable Object getData(); } - public static final class DecimalJsonSchema1BoxedString extends DecimalJsonSchema1Boxed { - public final String data; - private DecimalJsonSchema1BoxedString(String data) { - this.data = data; - } + public record DecimalJsonSchema1BoxedString(String data) implements DecimalJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class DecimalJsonSchema1 extends JsonSchema implements StringSchemaValidator { + public static class DecimalJsonSchema1 extends JsonSchema implements StringSchemaValidator { private static @Nullable DecimalJsonSchema1 instance = null; protected DecimalJsonSchema1() { @@ -80,5 +76,13 @@ public String validate(String arg, SchemaConfiguration configuration) throws Val public DecimalJsonSchema1BoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new DecimalJsonSchema1BoxedString(validate(arg, configuration)); } + + @Override + public DecimalJsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } \ No newline at end of file diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DoubleJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DoubleJsonSchema.java index 8219f3ca213..56f7894f670 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DoubleJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DoubleJsonSchema.java @@ -18,21 +18,17 @@ import java.util.Set; public class DoubleJsonSchema { - public static abstract sealed class DoubleJsonSchema1Boxed permits DoubleJsonSchema1BoxedNumber { - public abstract @Nullable Object data(); + public sealed interface DoubleJsonSchema1Boxed permits DoubleJsonSchema1BoxedNumber { + @Nullable Object getData(); } - public static final class DoubleJsonSchema1BoxedNumber extends DoubleJsonSchema1Boxed { - public final Number data; - private DoubleJsonSchema1BoxedNumber(Number data) { - this.data = data; - } + public record DoubleJsonSchema1BoxedNumber(Number data) implements DoubleJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class DoubleJsonSchema1 extends JsonSchema implements NumberSchemaValidator { + public static class DoubleJsonSchema1 extends JsonSchema implements NumberSchemaValidator { private static @Nullable DoubleJsonSchema1 instance = null; protected DoubleJsonSchema1() { @@ -84,5 +80,13 @@ public double validate(double arg, SchemaConfiguration configuration) { public DoubleJsonSchema1BoxedNumber validateAndBox(Number arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new DoubleJsonSchema1BoxedNumber(validate(arg, configuration)); } + + @Override + public DoubleJsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } \ No newline at end of file diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/FloatJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/FloatJsonSchema.java index 42e3806e845..65221627b46 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/FloatJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/FloatJsonSchema.java @@ -18,21 +18,17 @@ import java.util.Set; public class FloatJsonSchema { - public static abstract sealed class FloatJsonSchema1Boxed permits FloatJsonSchema1BoxedNumber { - public abstract @Nullable Object data(); + public sealed interface FloatJsonSchema1Boxed permits FloatJsonSchema1BoxedNumber { + @Nullable Object getData(); } - public static final class FloatJsonSchema1BoxedNumber extends FloatJsonSchema1Boxed { - public final Number data; - private FloatJsonSchema1BoxedNumber(Number data) { - this.data = data; - } + public record FloatJsonSchema1BoxedNumber(Number data) implements FloatJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class FloatJsonSchema1 extends JsonSchema implements NumberSchemaValidator { + public static class FloatJsonSchema1 extends JsonSchema implements NumberSchemaValidator { private static @Nullable FloatJsonSchema1 instance = null; protected FloatJsonSchema1() { @@ -84,5 +80,13 @@ public float validate(float arg, SchemaConfiguration configuration) { public FloatJsonSchema1BoxedNumber validateAndBox(Number arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new FloatJsonSchema1BoxedNumber(validate(arg, configuration)); } + + @Override + public FloatJsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/Int32JsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/Int32JsonSchema.java index c9ae84e53f4..836fa1db724 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/Int32JsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/Int32JsonSchema.java @@ -18,21 +18,17 @@ import java.util.Set; public class Int32JsonSchema { - public static abstract sealed class Int32JsonSchema1Boxed permits Int32JsonSchema1BoxedNumber { - public abstract @Nullable Object data(); + public sealed interface Int32JsonSchema1Boxed permits Int32JsonSchema1BoxedNumber { + @Nullable Object getData(); } - public static final class Int32JsonSchema1BoxedNumber extends Int32JsonSchema1Boxed { - public final Number data; - private Int32JsonSchema1BoxedNumber(Number data) { - this.data = data; - } + public record Int32JsonSchema1BoxedNumber(Number data) implements Int32JsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Int32JsonSchema1 extends JsonSchema implements NumberSchemaValidator { + public static class Int32JsonSchema1 extends JsonSchema implements NumberSchemaValidator { private static @Nullable Int32JsonSchema1 instance = null; protected Int32JsonSchema1() { @@ -91,5 +87,13 @@ public float validate(float arg, SchemaConfiguration configuration) throws Valid public Int32JsonSchema1BoxedNumber validateAndBox(Number arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Int32JsonSchema1BoxedNumber(validate(arg, configuration)); } + + @Override + public Int32JsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } \ No newline at end of file diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/Int64JsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/Int64JsonSchema.java index e74999992ef..da3f9d8d5f7 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/Int64JsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/Int64JsonSchema.java @@ -18,21 +18,17 @@ import java.util.Set; public class Int64JsonSchema { - public static abstract sealed class Int64JsonSchema1Boxed permits Int64JsonSchema1BoxedNumber { - public abstract @Nullable Object data(); + public sealed interface Int64JsonSchema1Boxed permits Int64JsonSchema1BoxedNumber { + @Nullable Object getData(); } - public static final class Int64JsonSchema1BoxedNumber extends Int64JsonSchema1Boxed { - public final Number data; - private Int64JsonSchema1BoxedNumber(Number data) { - this.data = data; - } + public record Int64JsonSchema1BoxedNumber(Number data) implements Int64JsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Int64JsonSchema1 extends JsonSchema implements NumberSchemaValidator { + public static class Int64JsonSchema1 extends JsonSchema implements NumberSchemaValidator { private static @Nullable Int64JsonSchema1 instance = null; protected Int64JsonSchema1() { @@ -101,5 +97,13 @@ public double validate(double arg, SchemaConfiguration configuration) throws Val public Int64JsonSchema1BoxedNumber validateAndBox(Number arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Int64JsonSchema1BoxedNumber(validate(arg, configuration)); } + + @Override + public Int64JsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } \ No newline at end of file diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/IntJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/IntJsonSchema.java index 42568a55f34..6205c5b4380 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/IntJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/IntJsonSchema.java @@ -18,21 +18,17 @@ import java.util.Set; public class IntJsonSchema { - public static abstract sealed class IntJsonSchema1Boxed permits IntJsonSchema1BoxedNumber { - public abstract @Nullable Object data(); + public sealed interface IntJsonSchema1Boxed permits IntJsonSchema1BoxedNumber { + @Nullable Object getData(); } - public static final class IntJsonSchema1BoxedNumber extends IntJsonSchema1Boxed { - public final Number data; - private IntJsonSchema1BoxedNumber(Number data) { - this.data = data; - } + public record IntJsonSchema1BoxedNumber(Number data) implements IntJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class IntJsonSchema1 extends JsonSchema implements NumberSchemaValidator { + public static class IntJsonSchema1 extends JsonSchema implements NumberSchemaValidator { private static @Nullable IntJsonSchema1 instance = null; protected IntJsonSchema1() { @@ -101,5 +97,13 @@ public double validate(double arg, SchemaConfiguration configuration) throws Val public IntJsonSchema1BoxedNumber validateAndBox(Number arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new IntJsonSchema1BoxedNumber(validate(arg, configuration)); } + + @Override + public IntJsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } \ No newline at end of file diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/ListJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/ListJsonSchema.java index 855e63d6573..7ebb3106467 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/ListJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/ListJsonSchema.java @@ -21,21 +21,17 @@ import java.util.Set; public class ListJsonSchema { - public static abstract sealed class ListJsonSchema1Boxed permits ListJsonSchema1BoxedList { - public abstract @Nullable Object data(); + public sealed interface ListJsonSchema1Boxed permits ListJsonSchema1BoxedList { + @Nullable Object getData(); } - public static final class ListJsonSchema1BoxedList extends ListJsonSchema1Boxed { - public final FrozenList<@Nullable Object> data; - private ListJsonSchema1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record ListJsonSchema1BoxedList(FrozenList<@Nullable Object> data) implements ListJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ListJsonSchema1 extends JsonSchema implements ListSchemaValidator, ListJsonSchema1BoxedList> { + public static class ListJsonSchema1 extends JsonSchema implements ListSchemaValidator, ListJsonSchema1BoxedList> { private static @Nullable ListJsonSchema1 instance = null; protected ListJsonSchema1() { @@ -58,11 +54,11 @@ public static ListJsonSchema1 getInstance() { for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object castItem = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; @@ -101,5 +97,13 @@ public static ListJsonSchema1 getInstance() { public ListJsonSchema1BoxedList validateAndBox(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ListJsonSchema1BoxedList(validate(arg, configuration)); } + + @Override + public ListJsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/MapJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/MapJsonSchema.java index 568471e3c8d..47e141dac53 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/MapJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/MapJsonSchema.java @@ -22,21 +22,17 @@ import java.util.Set; public class MapJsonSchema { - public static abstract sealed class MapJsonSchema1Boxed permits MapJsonSchema1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface MapJsonSchema1Boxed permits MapJsonSchema1BoxedMap { + @Nullable Object getData(); } - public static final class MapJsonSchema1BoxedMap extends MapJsonSchema1Boxed { - public final FrozenMap<@Nullable Object> data; - private MapJsonSchema1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record MapJsonSchema1BoxedMap(FrozenMap<@Nullable Object> data) implements MapJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class MapJsonSchema1 extends JsonSchema implements MapSchemaValidator, MapJsonSchema1BoxedMap> { + public static class MapJsonSchema1 extends JsonSchema implements MapSchemaValidator, MapJsonSchema1BoxedMap> { private static @Nullable MapJsonSchema1 instance = null; protected MapJsonSchema1() { @@ -64,11 +60,11 @@ public static MapJsonSchema1 getInstance() { List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object castValue = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } @@ -105,5 +101,13 @@ public static MapJsonSchema1 getInstance() { public MapJsonSchema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new MapJsonSchema1BoxedMap(validate(arg, configuration)); } + + @Override + public MapJsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NotAnyTypeJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NotAnyTypeJsonSchema.java index 705bb7aa6b9..de1ed91b0cd 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NotAnyTypeJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NotAnyTypeJsonSchema.java @@ -31,71 +31,47 @@ import java.util.UUID; public class NotAnyTypeJsonSchema { - public static abstract sealed class NotAnyTypeJsonSchema1Boxed permits NotAnyTypeJsonSchema1BoxedVoid, NotAnyTypeJsonSchema1BoxedBoolean, NotAnyTypeJsonSchema1BoxedNumber, NotAnyTypeJsonSchema1BoxedString, NotAnyTypeJsonSchema1BoxedList, NotAnyTypeJsonSchema1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface NotAnyTypeJsonSchema1Boxed permits NotAnyTypeJsonSchema1BoxedVoid, NotAnyTypeJsonSchema1BoxedBoolean, NotAnyTypeJsonSchema1BoxedNumber, NotAnyTypeJsonSchema1BoxedString, NotAnyTypeJsonSchema1BoxedList, NotAnyTypeJsonSchema1BoxedMap { + @Nullable Object getData(); } - public static final class NotAnyTypeJsonSchema1BoxedVoid extends NotAnyTypeJsonSchema1Boxed { - public final Void data; - private NotAnyTypeJsonSchema1BoxedVoid(Void data) { - this.data = data; - } + public record NotAnyTypeJsonSchema1BoxedVoid(Void data) implements NotAnyTypeJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NotAnyTypeJsonSchema1BoxedBoolean extends NotAnyTypeJsonSchema1Boxed { - public final boolean data; - private NotAnyTypeJsonSchema1BoxedBoolean(boolean data) { - this.data = data; - } + public record NotAnyTypeJsonSchema1BoxedBoolean(boolean data) implements NotAnyTypeJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NotAnyTypeJsonSchema1BoxedNumber extends NotAnyTypeJsonSchema1Boxed { - public final Number data; - private NotAnyTypeJsonSchema1BoxedNumber(Number data) { - this.data = data; - } + public record NotAnyTypeJsonSchema1BoxedNumber(Number data) implements NotAnyTypeJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NotAnyTypeJsonSchema1BoxedString extends NotAnyTypeJsonSchema1Boxed { - public final String data; - private NotAnyTypeJsonSchema1BoxedString(String data) { - this.data = data; - } + public record NotAnyTypeJsonSchema1BoxedString(String data) implements NotAnyTypeJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NotAnyTypeJsonSchema1BoxedList extends NotAnyTypeJsonSchema1Boxed { - public final FrozenList<@Nullable Object> data; - private NotAnyTypeJsonSchema1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record NotAnyTypeJsonSchema1BoxedList(FrozenList<@Nullable Object> data) implements NotAnyTypeJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NotAnyTypeJsonSchema1BoxedMap extends NotAnyTypeJsonSchema1Boxed { - public final FrozenMap<@Nullable Object> data; - private NotAnyTypeJsonSchema1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record NotAnyTypeJsonSchema1BoxedMap(FrozenMap<@Nullable Object> data) implements NotAnyTypeJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class NotAnyTypeJsonSchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, NotAnyTypeJsonSchema1BoxedList>, MapSchemaValidator, NotAnyTypeJsonSchema1BoxedMap> { + public static class NotAnyTypeJsonSchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, NotAnyTypeJsonSchema1BoxedList>, MapSchemaValidator, NotAnyTypeJsonSchema1BoxedMap> { private static @Nullable NotAnyTypeJsonSchema1 instance = null; protected NotAnyTypeJsonSchema1() { @@ -194,11 +170,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object castItem = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; @@ -229,11 +205,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object castValue = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } @@ -293,25 +269,50 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public NotAnyTypeJsonSchema1BoxedVoid validateAndBox(Void arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new NotAnyTypeJsonSchema1BoxedVoid(validate(arg, configuration)); } + @Override public NotAnyTypeJsonSchema1BoxedBoolean validateAndBox(boolean arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new NotAnyTypeJsonSchema1BoxedBoolean(validate(arg, configuration)); } + @Override public NotAnyTypeJsonSchema1BoxedNumber validateAndBox(Number arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new NotAnyTypeJsonSchema1BoxedNumber(validate(arg, configuration)); } + @Override public NotAnyTypeJsonSchema1BoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new NotAnyTypeJsonSchema1BoxedString(validate(arg, configuration)); } + @Override public NotAnyTypeJsonSchema1BoxedList validateAndBox(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new NotAnyTypeJsonSchema1BoxedList(validate(arg, configuration)); } + @Override public NotAnyTypeJsonSchema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new NotAnyTypeJsonSchema1BoxedMap(validate(arg, configuration)); } + + @Override + public NotAnyTypeJsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } \ No newline at end of file diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NullJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NullJsonSchema.java index 5882a7f23e5..d028dbf295e 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NullJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NullJsonSchema.java @@ -18,21 +18,17 @@ import java.util.Set; public class NullJsonSchema { - public static abstract sealed class NullJsonSchema1Boxed permits NullJsonSchema1BoxedVoid { - public abstract @Nullable Object data(); + public sealed interface NullJsonSchema1Boxed permits NullJsonSchema1BoxedVoid { + @Nullable Object getData(); } - public static final class NullJsonSchema1BoxedVoid extends NullJsonSchema1Boxed { - public final Void data; - private NullJsonSchema1BoxedVoid(Void data) { - this.data = data; - } + public record NullJsonSchema1BoxedVoid(Void data) implements NullJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class NullJsonSchema1 extends JsonSchema implements NullSchemaValidator { + public static class NullJsonSchema1 extends JsonSchema implements NullSchemaValidator { private static @Nullable NullJsonSchema1 instance = null; protected NullJsonSchema1() { @@ -79,5 +75,14 @@ public Void validate(Void arg, SchemaConfiguration configuration) throws Validat public NullJsonSchema1BoxedVoid validateAndBox(Void arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new NullJsonSchema1BoxedVoid(validate(arg, configuration)); } + + @Override + public NullJsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NumberJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NumberJsonSchema.java index 1340dcc4420..5c33b047d95 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NumberJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NumberJsonSchema.java @@ -18,21 +18,17 @@ import java.util.Set; public class NumberJsonSchema { - public static abstract sealed class NumberJsonSchema1Boxed permits NumberJsonSchema1BoxedNumber { - public abstract @Nullable Object data(); + public sealed interface NumberJsonSchema1Boxed permits NumberJsonSchema1BoxedNumber { + @Nullable Object getData(); } - public static final class NumberJsonSchema1BoxedNumber extends NumberJsonSchema1Boxed { - public final Number data; - private NumberJsonSchema1BoxedNumber(Number data) { - this.data = data; - } + public record NumberJsonSchema1BoxedNumber(Number data) implements NumberJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class NumberJsonSchema1 extends JsonSchema implements NumberSchemaValidator { + public static class NumberJsonSchema1 extends JsonSchema implements NumberSchemaValidator { private static @Nullable NumberJsonSchema1 instance = null; protected NumberJsonSchema1() { @@ -100,5 +96,13 @@ public double validate(double arg, SchemaConfiguration configuration) { public NumberJsonSchema1BoxedNumber validateAndBox(Number arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new NumberJsonSchema1BoxedNumber(validate(arg, configuration)); } + + @Override + public NumberJsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } \ No newline at end of file diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/StringJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/StringJsonSchema.java index 2cd0e21f94d..749f5faba63 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/StringJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/StringJsonSchema.java @@ -21,20 +21,16 @@ import java.util.UUID; public class StringJsonSchema { - public static abstract sealed class StringJsonSchema1Boxed permits StringJsonSchema1BoxedString { - public abstract @Nullable Object data(); + public sealed interface StringJsonSchema1Boxed permits StringJsonSchema1BoxedString { + @Nullable Object getData(); } - public static final class StringJsonSchema1BoxedString extends StringJsonSchema1Boxed { - public final String data; - private StringJsonSchema1BoxedString(String data) { - this.data = data; - } + public record StringJsonSchema1BoxedString(String data) implements StringJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class StringJsonSchema1 extends JsonSchema implements StringSchemaValidator { + public static class StringJsonSchema1 extends JsonSchema implements StringSchemaValidator { private static @Nullable StringJsonSchema1 instance = null; protected StringJsonSchema1() { @@ -99,5 +95,13 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public StringJsonSchema1BoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new StringJsonSchema1BoxedString(validate(arg, configuration)); } + + @Override + public StringJsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/UuidJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/UuidJsonSchema.java index 2506b53a958..c2087929db7 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/UuidJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/UuidJsonSchema.java @@ -19,21 +19,17 @@ import java.util.UUID; public class UuidJsonSchema { - public static abstract sealed class UuidJsonSchema1Boxed permits UuidJsonSchema1BoxedString { - public abstract @Nullable Object data(); + public sealed interface UuidJsonSchema1Boxed permits UuidJsonSchema1BoxedString { + @Nullable Object getData(); } - public static final class UuidJsonSchema1BoxedString extends UuidJsonSchema1Boxed { - public final String data; - private UuidJsonSchema1BoxedString(String data) { - this.data = data; - } + public record UuidJsonSchema1BoxedString(String data) implements UuidJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class UuidJsonSchema1 extends JsonSchema implements StringSchemaValidator { + public static class UuidJsonSchema1 extends JsonSchema implements StringSchemaValidator { private static @Nullable UuidJsonSchema1 instance = null; protected UuidJsonSchema1() { @@ -87,5 +83,13 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public UuidJsonSchema1BoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new UuidJsonSchema1BoxedString(validate(arg, configuration)); } + + @Override + public UuidJsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } \ No newline at end of file diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/AdditionalPropertiesValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/AdditionalPropertiesValidator.java index 2548452a115..64d9f476798 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/AdditionalPropertiesValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/AdditionalPropertiesValidator.java @@ -43,7 +43,7 @@ public class AdditionalPropertiesValidator implements KeywordValidator { data.validationMetadata().validatedPathToSchemas(), data.validationMetadata().seenClasses() ); - JsonSchema addPropsSchema = JsonSchemaFactory.getInstance(additionalProperties); + JsonSchema addPropsSchema = JsonSchemaFactory.getInstance(additionalProperties); if (propValidationMetadata.validationRanEarlier(addPropsSchema)) { // todo add_deeper_validated_schemas continue; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/AllOfValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/AllOfValidator.java index 583017ea6b5..eb6bcf21d4a 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/AllOfValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/AllOfValidator.java @@ -11,8 +11,8 @@ public class AllOfValidator implements KeywordValidator { return null; } PathToSchemasMap pathToSchemas = new PathToSchemasMap(); - for(Class allOfClass: allOf) { - JsonSchema allOfSchema = JsonSchemaFactory.getInstance(allOfClass); + for(Class> allOfClass: allOf) { + JsonSchema allOfSchema = JsonSchemaFactory.getInstance(allOfClass); PathToSchemasMap otherPathToSchemas = JsonSchema.validate(allOfSchema, data.arg(), data.validationMetadata()); pathToSchemas.update(otherPathToSchemas); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/AnyOfValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/AnyOfValidator.java index 062fa2eecdc..d466518d3fe 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/AnyOfValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/AnyOfValidator.java @@ -16,8 +16,8 @@ public class AnyOfValidator implements KeywordValidator { return null; } PathToSchemasMap pathToSchemas = new PathToSchemasMap(); - List> validatedAnyOfClasses = new ArrayList<>(); - for(Class anyOfClass: anyOf) { + List>> validatedAnyOfClasses = new ArrayList<>(); + for(Class> anyOfClass: anyOf) { if (anyOfClass == data.schema().getClass()) { /* optimistically assume that schema will pass validation @@ -27,7 +27,7 @@ public class AnyOfValidator implements KeywordValidator { continue; } try { - JsonSchema anyOfSchema = JsonSchemaFactory.getInstance(anyOfClass); + JsonSchema anyOfSchema = JsonSchemaFactory.getInstance(anyOfClass); PathToSchemasMap otherPathToSchemas = JsonSchema.validate(anyOfSchema, data.arg(), data.validationMetadata()); validatedAnyOfClasses.add(anyOfClass); pathToSchemas.update(otherPathToSchemas); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/DependentSchemasValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/DependentSchemasValidator.java index 940157d3b48..e329529fe8a 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/DependentSchemasValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/DependentSchemasValidator.java @@ -25,13 +25,13 @@ public class DependentSchemasValidator implements KeywordValidator { presentProperties.add((String) key); } } - for(Map.Entry> entry: dependentSchemas.entrySet()) { + for(Map.Entry>> entry: dependentSchemas.entrySet()) { String propName = entry.getKey(); if (!presentProperties.contains(propName)) { continue; } - Class dependentSchemaClass = entry.getValue(); - JsonSchema dependentSchema = JsonSchemaFactory.getInstance(dependentSchemaClass); + Class> dependentSchemaClass = entry.getValue(); + JsonSchema dependentSchema = JsonSchemaFactory.getInstance(dependentSchemaClass); PathToSchemasMap otherPathToSchemas = JsonSchema.validate(dependentSchema, mapArg, data.validationMetadata()); pathToSchemas.update(otherPathToSchemas); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ElseValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ElseValidator.java index b0ba9ecbc0a..3f50d9326c4 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ElseValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ElseValidator.java @@ -22,7 +22,7 @@ public class ElseValidator implements KeywordValidator { // if validation is true return null; } - JsonSchema elseSchemaInstance = JsonSchemaFactory.getInstance(elseSchema); + JsonSchema elseSchemaInstance = JsonSchemaFactory.getInstance(elseSchema); PathToSchemasMap pathToSchemas = new PathToSchemasMap(); var elsePathToSchemas = JsonSchema.validate(elseSchemaInstance, data.arg(), data.validationMetadata()); // todo capture validation error and describe it as an else error? diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ItemsValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ItemsValidator.java index 5bd194d47a9..1b03c0b3094 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ItemsValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ItemsValidator.java @@ -22,7 +22,7 @@ public class ItemsValidator implements KeywordValidator { } PathToSchemasMap pathToSchemas = new PathToSchemasMap(); int minIndex = data.schema().prefixItems != null ? data.schema().prefixItems.size() : 0; - JsonSchema itemsSchema = JsonSchemaFactory.getInstance(items); + JsonSchema itemsSchema = JsonSchemaFactory.getInstance(items); for(int i = minIndex; i < listArg.size(); i++) { List itemPathToItem = new ArrayList<>(data.validationMetadata().pathToItem()); itemPathToItem.add(i); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchema.java index 10d636e6b9d..beb7460b86c 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchema.java @@ -17,11 +17,11 @@ import java.util.UUID; import java.util.regex.Pattern; -public abstract class JsonSchema { +public abstract class JsonSchema { public final @Nullable Set> type; public final @Nullable String format; - public final @Nullable Class items; - public final @Nullable Map> properties; + public final @Nullable Class> items; + public final @Nullable Map>> properties; public final @Nullable Set required; public final @Nullable Number exclusiveMaximum; public final @Nullable Number exclusiveMinimum; @@ -34,11 +34,11 @@ public abstract class JsonSchema { public final @Nullable Number maximum; public final @Nullable Number minimum; public final @Nullable BigDecimal multipleOf; - public final @Nullable Class additionalProperties; - public final @Nullable List> allOf; - public final @Nullable List> anyOf; - public final @Nullable List> oneOf; - public final @Nullable Class not; + public final @Nullable Class> additionalProperties; + public final @Nullable List>> allOf; + public final @Nullable List>> anyOf; + public final @Nullable List>> oneOf; + public final @Nullable Class> not; public final @Nullable Boolean uniqueItems; public final @Nullable Set<@Nullable Object> enumValues; public final @Nullable Pattern pattern; @@ -46,19 +46,19 @@ public abstract class JsonSchema { public final boolean defaultValueSet; public final @Nullable Object constValue; public final boolean constValueSet; - public final @Nullable Class contains; + public final @Nullable Class> contains; public final @Nullable Integer maxContains; public final @Nullable Integer minContains; - public final @Nullable Class propertyNames; + public final @Nullable Class> propertyNames; public final @Nullable Map> dependentRequired; - public final @Nullable Map> dependentSchemas; - public final @Nullable Map> patternProperties; - public final @Nullable List> prefixItems; - public final @Nullable Class ifSchema; - public final @Nullable Class then; - public final @Nullable Class elseSchema; - public final @Nullable Class unevaluatedItems; - public final @Nullable Class unevaluatedProperties; + public final @Nullable Map>> dependentSchemas; + public final @Nullable Map>> patternProperties; + public final @Nullable List>> prefixItems; + public final @Nullable Class> ifSchema; + public final @Nullable Class> then; + public final @Nullable Class> elseSchema; + public final @Nullable Class> unevaluatedItems; + public final @Nullable Class> unevaluatedProperties; private final LinkedHashMap keywordToValidator; protected JsonSchema(JsonSchemaInfo jsonSchemaInfo) { @@ -223,6 +223,7 @@ protected JsonSchema(JsonSchemaInfo jsonSchemaInfo) { public abstract @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) throws InvalidTypeException; public abstract @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws InvalidTypeException, ValidationException; + public abstract T validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws InvalidTypeException, ValidationException; private List getContainsPathToSchemas( @Nullable Object arg, @@ -231,7 +232,7 @@ private List getContainsPathToSchemas( if (!(arg instanceof List listArg) || contains == null) { return new ArrayList<>(); } - JsonSchema containsSchema = JsonSchemaFactory.getInstance(contains); + JsonSchema containsSchema = JsonSchemaFactory.getInstance(contains); @Nullable List containsPathToSchemas = new ArrayList<>(); for(int i = 0; i < listArg.size(); i++) { PathToSchemasMap thesePathToSchemas = new PathToSchemasMap(); @@ -279,13 +280,13 @@ private PathToSchemasMap getPatternPropertiesPathToSchemas( validationMetadata.validatedPathToSchemas(), validationMetadata.seenClasses() ); - for (Map.Entry> patternPropEntry: patternProperties.entrySet()) { + for (Map.Entry>> patternPropEntry: patternProperties.entrySet()) { if (!patternPropEntry.getKey().matcher(key).find()) { continue; } - Class patternPropClass = patternPropEntry.getValue(); - JsonSchema patternPropSchema = JsonSchemaFactory.getInstance(patternPropClass); + Class> patternPropClass = patternPropEntry.getValue(); + JsonSchema patternPropSchema = JsonSchemaFactory.getInstance(patternPropClass); PathToSchemasMap otherPathToSchemas = JsonSchema.validate(patternPropSchema, entry.getValue(), propValidationMetadata); pathToSchemas.update(otherPathToSchemas); } @@ -300,7 +301,7 @@ private PathToSchemasMap getIfPathToSchemas( if (ifSchema == null) { return new PathToSchemasMap(); } - JsonSchema ifSchemaInstance = JsonSchemaFactory.getInstance(ifSchema); + JsonSchema ifSchemaInstance = JsonSchemaFactory.getInstance(ifSchema); PathToSchemasMap pathToSchemas = new PathToSchemasMap(); try { var otherPathToSchemas = JsonSchema.validate(ifSchemaInstance, arg, validationMetadata); @@ -310,7 +311,7 @@ private PathToSchemasMap getIfPathToSchemas( } public static PathToSchemasMap validate( - JsonSchema jsonSchema, + JsonSchema jsonSchema, @Nullable Object arg, ValidationMetadata validationMetadata ) throws ValidationException { @@ -361,7 +362,7 @@ public static PathToSchemasMap validate( if (!pathToSchemas.containsKey(pathToItem)) { pathToSchemas.put(validationMetadata.pathToItem(), new LinkedHashMap<>()); } - @Nullable LinkedHashMap schemas = pathToSchemas.get(pathToItem); + @Nullable LinkedHashMap, Void> schemas = pathToSchemas.get(pathToItem); if (schemas != null) { schemas.put(jsonSchema, null); } @@ -467,19 +468,19 @@ public String getNewInstance(String arg, List pathToItem, PathToSchemasM return arg; } - protected static PathToSchemasMap getPathToSchemas(JsonSchema jsonSchema, @Nullable Object arg, ValidationMetadata validationMetadata, Set> pathSet) { + protected static PathToSchemasMap getPathToSchemas(JsonSchema jsonSchema, @Nullable Object arg, ValidationMetadata validationMetadata, Set> pathSet) { PathToSchemasMap pathToSchemasMap = new PathToSchemasMap(); // todo add check of validationMetadata.validationRanEarlier(this) PathToSchemasMap otherPathToSchemas = validate(jsonSchema, arg, validationMetadata); pathToSchemasMap.update(otherPathToSchemas); for (var schemas: pathToSchemasMap.values()) { - JsonSchema firstSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema firstSchema = schemas.entrySet().iterator().next().getKey(); schemas.clear(); schemas.put(firstSchema, null); } pathSet.removeAll(pathToSchemasMap.keySet()); if (!pathSet.isEmpty()) { - LinkedHashMap unsetAnyTypeSchema = new LinkedHashMap<>(); + LinkedHashMap, Void> unsetAnyTypeSchema = new LinkedHashMap<>(); unsetAnyTypeSchema.put(UnsetAnyTypeJsonSchema.UnsetAnyTypeJsonSchema1.getInstance(), null); for (List pathToItem: pathSet) { pathToSchemasMap.put(pathToItem, unsetAnyTypeSchema); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchemaFactory.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchemaFactory.java index 7c9b6402f2b..24729ac172d 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchemaFactory.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchemaFactory.java @@ -10,10 +10,10 @@ public class JsonSchemaFactory { - static Map, JsonSchema> classToInstance = new HashMap<>(); + static Map>, JsonSchema> classToInstance = new HashMap<>(); - public static V getInstance(Class schemaCls) { - @Nullable JsonSchema cacheInst = classToInstance.get(schemaCls); + public static > V getInstance(Class schemaCls) { + @Nullable JsonSchema cacheInst = classToInstance.get(schemaCls); if (cacheInst != null) { assert schemaCls.isInstance(cacheInst); return schemaCls.cast(cacheInst); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchemaInfo.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchemaInfo.java index 8791c1c29ea..0a95fbbae6a 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchemaInfo.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchemaInfo.java @@ -18,13 +18,13 @@ public JsonSchemaInfo format(String format) { this.format = format; return this; } - public @Nullable Class items = null; - public JsonSchemaInfo items(Class items) { + public @Nullable Class> items = null; + public JsonSchemaInfo items(Class> items) { this.items = items; return this; } - public @Nullable Map> properties = null; - public JsonSchemaInfo properties(Map> properties) { + public @Nullable Map>> properties = null; + public JsonSchemaInfo properties(Map>> properties) { this.properties = properties; return this; } @@ -88,28 +88,28 @@ public JsonSchemaInfo multipleOf(BigDecimal multipleOf) { this.multipleOf = multipleOf; return this; } - public @Nullable Class additionalProperties; - public JsonSchemaInfo additionalProperties(Class additionalProperties) { + public @Nullable Class> additionalProperties; + public JsonSchemaInfo additionalProperties(Class> additionalProperties) { this.additionalProperties = additionalProperties; return this; } - public @Nullable List> allOf = null; - public JsonSchemaInfo allOf(List> allOf) { + public @Nullable List>> allOf = null; + public JsonSchemaInfo allOf(List>> allOf) { this.allOf = allOf; return this; } - public @Nullable List> anyOf = null; - public JsonSchemaInfo anyOf(List> anyOf) { + public @Nullable List>> anyOf = null; + public JsonSchemaInfo anyOf(List>> anyOf) { this.anyOf = anyOf; return this; } - public @Nullable List> oneOf = null; - public JsonSchemaInfo oneOf(List> oneOf) { + public @Nullable List>> oneOf = null; + public JsonSchemaInfo oneOf(List>> oneOf) { this.oneOf = oneOf; return this; } - public @Nullable Class not = null; - public JsonSchemaInfo not(Class not) { + public @Nullable Class> not = null; + public JsonSchemaInfo not(Class> not) { this.not = not; return this; } @@ -142,8 +142,8 @@ public JsonSchemaInfo constValue(@Nullable Object constValue) { this.constValueSet = true; return this; } - public @Nullable Class contains = null; - public JsonSchemaInfo contains(Class contains) { + public @Nullable Class> contains = null; + public JsonSchemaInfo contains(Class> contains) { this.contains = contains; return this; } @@ -157,8 +157,8 @@ public JsonSchemaInfo minContains(Integer minContains) { this.minContains = minContains; return this; } - public @Nullable Class propertyNames = null; - public JsonSchemaInfo propertyNames(Class propertyNames) { + public @Nullable Class> propertyNames = null; + public JsonSchemaInfo propertyNames(Class> propertyNames) { this.propertyNames = propertyNames; return this; } @@ -167,43 +167,43 @@ public JsonSchemaInfo dependentRequired(Map> dependentRequir this.dependentRequired = dependentRequired; return this; } - public @Nullable Map> dependentSchemas = null; - public JsonSchemaInfo dependentSchemas(Map> dependentSchemas) { + public @Nullable Map>> dependentSchemas = null; + public JsonSchemaInfo dependentSchemas(Map>> dependentSchemas) { this.dependentSchemas = dependentSchemas; return this; } - public @Nullable Map> patternProperties = null; - public JsonSchemaInfo patternProperties(Map> patternProperties) { + public @Nullable Map>> patternProperties = null; + public JsonSchemaInfo patternProperties(Map>> patternProperties) { this.patternProperties = patternProperties; return this; } - public @Nullable List> prefixItems = null; - public JsonSchemaInfo prefixItems(List> prefixItems) { + public @Nullable List>> prefixItems = null; + public JsonSchemaInfo prefixItems(List>> prefixItems) { this.prefixItems = prefixItems; return this; } - public @Nullable Class ifSchema = null; - public JsonSchemaInfo ifSchema(Class ifSchema) { + public @Nullable Class> ifSchema = null; + public JsonSchemaInfo ifSchema(Class> ifSchema) { this.ifSchema = ifSchema; return this; } - public @Nullable Class then = null; - public JsonSchemaInfo then(Class then) { + public @Nullable Class> then = null; + public JsonSchemaInfo then(Class> then) { this.then = then; return this; } - public @Nullable Class elseSchema = null; - public JsonSchemaInfo elseSchema(Class elseSchema) { + public @Nullable Class> elseSchema = null; + public JsonSchemaInfo elseSchema(Class> elseSchema) { this.elseSchema = elseSchema; return this; } - public @Nullable Class unevaluatedItems = null; - public JsonSchemaInfo unevaluatedItems(Class unevaluatedItems) { + public @Nullable Class> unevaluatedItems = null; + public JsonSchemaInfo unevaluatedItems(Class> unevaluatedItems) { this.unevaluatedItems = unevaluatedItems; return this; } - public @Nullable Class unevaluatedProperties = null; - public JsonSchemaInfo unevaluatedProperties(Class unevaluatedProperties) { + public @Nullable Class> unevaluatedProperties = null; + public JsonSchemaInfo unevaluatedProperties(Class> unevaluatedProperties) { this.unevaluatedProperties = unevaluatedProperties; return this; } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/NotValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/NotValidator.java index aa61be1b624..b077e2056a1 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/NotValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/NotValidator.java @@ -14,7 +14,7 @@ public class NotValidator implements KeywordValidator { } PathToSchemasMap pathToSchemas; try { - JsonSchema notSchema = JsonSchemaFactory.getInstance(not); + JsonSchema notSchema = JsonSchemaFactory.getInstance(not); pathToSchemas = JsonSchema.validate(notSchema, data.arg(), data.validationMetadata()); } catch (ValidationException e) { return null; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/OneOfValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/OneOfValidator.java index f84f7796a8c..3c4f4b5a085 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/OneOfValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/OneOfValidator.java @@ -16,8 +16,8 @@ public class OneOfValidator implements KeywordValidator { return null; } PathToSchemasMap pathToSchemas = new PathToSchemasMap(); - List> validatedOneOfClasses = new ArrayList<>(); - for(Class oneOfClass: oneOf) { + List>> validatedOneOfClasses = new ArrayList<>(); + for(Class> oneOfClass: oneOf) { if (oneOfClass == data.schema().getClass()) { /* optimistically assume that schema will pass validation @@ -27,7 +27,7 @@ public class OneOfValidator implements KeywordValidator { continue; } try { - JsonSchema oneOfSchema = JsonSchemaFactory.getInstance(oneOfClass); + JsonSchema oneOfSchema = JsonSchemaFactory.getInstance(oneOfClass); PathToSchemasMap otherPathToSchemas = JsonSchema.validate(oneOfSchema, data.arg(), data.validationMetadata()); validatedOneOfClasses.add(oneOfClass); pathToSchemas.update(otherPathToSchemas); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PathToSchemasMap.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PathToSchemasMap.java index 6e199334d4c..a3ce89066a2 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PathToSchemasMap.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PathToSchemasMap.java @@ -5,12 +5,12 @@ import java.util.Map; @SuppressWarnings("serial") -public class PathToSchemasMap extends LinkedHashMap, LinkedHashMap> { +public class PathToSchemasMap extends LinkedHashMap, LinkedHashMap, Void>> { public void update(PathToSchemasMap other) { - for (Map.Entry, LinkedHashMap> entry: other.entrySet()) { + for (Map.Entry, LinkedHashMap, Void>> entry: other.entrySet()) { List pathToItem = entry.getKey(); - LinkedHashMap otherSchemas = entry.getValue(); + LinkedHashMap, Void> otherSchemas = entry.getValue(); if (containsKey(pathToItem)) { get(pathToItem).putAll(otherSchemas); } else { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PrefixItemsValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PrefixItemsValidator.java index 00e5b17607b..237bc250190 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PrefixItemsValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PrefixItemsValidator.java @@ -31,7 +31,7 @@ public class PrefixItemsValidator implements KeywordValidator { data.validationMetadata().validatedPathToSchemas(), data.validationMetadata().seenClasses() ); - JsonSchema itemsSchema = JsonSchemaFactory.getInstance(prefixItems.get(i)); + JsonSchema itemsSchema = JsonSchemaFactory.getInstance(prefixItems.get(i)); PathToSchemasMap otherPathToSchemas = JsonSchema.validate(itemsSchema, listArg.get(i), itemValidationMetadata); pathToSchemas.update(otherPathToSchemas); } diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PropertiesValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PropertiesValidator.java index 17bccdd666a..b8ddd6fcb46 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PropertiesValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PropertiesValidator.java @@ -27,7 +27,7 @@ public class PropertiesValidator implements KeywordValidator { presentProperties.add((String) key); } } - for(Map.Entry> entry: properties.entrySet()) { + for(Map.Entry>> entry: properties.entrySet()) { String propName = entry.getKey(); if (!presentProperties.contains(propName)) { continue; @@ -41,8 +41,8 @@ public class PropertiesValidator implements KeywordValidator { data.validationMetadata().validatedPathToSchemas(), data.validationMetadata().seenClasses() ); - Class propClass = entry.getValue(); - JsonSchema propSchema = JsonSchemaFactory.getInstance(propClass); + Class> propClass = entry.getValue(); + JsonSchema propSchema = JsonSchemaFactory.getInstance(propClass); if (propValidationMetadata.validationRanEarlier(propSchema)) { // todo add_deeper_validated_schemas continue; diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PropertyEntry.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PropertyEntry.java index aaaede643a0..8261eda6d49 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PropertyEntry.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PropertyEntry.java @@ -3,8 +3,8 @@ import java.util.AbstractMap; @SuppressWarnings("serial") -public class PropertyEntry extends AbstractMap.SimpleEntry> { - public PropertyEntry(String key, Class value) { +public class PropertyEntry extends AbstractMap.SimpleEntry>> { + public PropertyEntry(String key, Class> value) { super(key, value); } -} +} \ No newline at end of file diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PropertyNamesValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PropertyNamesValidator.java index 55ea80b0382..087cd308b11 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PropertyNamesValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PropertyNamesValidator.java @@ -18,7 +18,7 @@ public class PropertyNamesValidator implements KeywordValidator { if (!(data.arg() instanceof Map mapArg)) { return null; } - JsonSchema propertyNamesSchema = JsonSchemaFactory.getInstance(propertyNames); + JsonSchema propertyNamesSchema = JsonSchemaFactory.getInstance(propertyNames); for (Object objKey: mapArg.keySet()) { if (objKey instanceof String key) { List propPathToItem = new ArrayList<>(data.validationMetadata().pathToItem()); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ThenValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ThenValidator.java index ad97e0e554e..bf599bc812f 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ThenValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ThenValidator.java @@ -22,7 +22,7 @@ public class ThenValidator implements KeywordValidator { // if validation is false return null; } - JsonSchema thenSchema = JsonSchemaFactory.getInstance(then); + JsonSchema thenSchema = JsonSchemaFactory.getInstance(then); PathToSchemasMap pathToSchemas = new PathToSchemasMap(); var thenPathToSchemas = JsonSchema.validate(thenSchema, data.arg(), data.validationMetadata()); // todo capture validation error and describe it as an then error? diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UnevaluatedItemsValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UnevaluatedItemsValidator.java index cfb88550525..8903d0b19a7 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UnevaluatedItemsValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UnevaluatedItemsValidator.java @@ -26,7 +26,7 @@ public class UnevaluatedItemsValidator implements KeywordValidator { } PathToSchemasMap pathToSchemas = new PathToSchemasMap(); int minIndex = data.schema().prefixItems != null ? data.schema().prefixItems.size() : 0; - JsonSchema unevaluatedItemsSchema = JsonSchemaFactory.getInstance(unevaluatedItems); + JsonSchema unevaluatedItemsSchema = JsonSchemaFactory.getInstance(unevaluatedItems); for(int i = minIndex; i < listArg.size(); i++) { List itemPathToItem = new ArrayList<>(data.validationMetadata().pathToItem()); itemPathToItem.add(i); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UnevaluatedPropertiesValidator.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UnevaluatedPropertiesValidator.java index abc7f7e86f9..344c0cfab1b 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UnevaluatedPropertiesValidator.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UnevaluatedPropertiesValidator.java @@ -24,7 +24,7 @@ public class UnevaluatedPropertiesValidator implements KeywordValidator { return null; } PathToSchemasMap pathToSchemas = new PathToSchemasMap(); - JsonSchema unevaluatedPropertiesSchema = JsonSchemaFactory.getInstance(unevaluatedProperties); + JsonSchema unevaluatedPropertiesSchema = JsonSchemaFactory.getInstance(unevaluatedProperties); for(Map.Entry entry: mapArg.entrySet()) { if (!(entry.getKey() instanceof String propName)) { throw new InvalidTypeException("Map keys must be strings"); diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UnsetAnyTypeJsonSchema.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UnsetAnyTypeJsonSchema.java index 90b9e3b1870..1c23a427dd0 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UnsetAnyTypeJsonSchema.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UnsetAnyTypeJsonSchema.java @@ -19,70 +19,46 @@ import java.util.UUID; public class UnsetAnyTypeJsonSchema { - public static abstract sealed class UnsetAnyTypeJsonSchema1Boxed permits UnsetAnyTypeJsonSchema1BoxedVoid, UnsetAnyTypeJsonSchema1BoxedBoolean, UnsetAnyTypeJsonSchema1BoxedNumber, UnsetAnyTypeJsonSchema1BoxedString, UnsetAnyTypeJsonSchema1BoxedList, UnsetAnyTypeJsonSchema1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface UnsetAnyTypeJsonSchema1Boxed permits UnsetAnyTypeJsonSchema1BoxedVoid, UnsetAnyTypeJsonSchema1BoxedBoolean, UnsetAnyTypeJsonSchema1BoxedNumber, UnsetAnyTypeJsonSchema1BoxedString, UnsetAnyTypeJsonSchema1BoxedList, UnsetAnyTypeJsonSchema1BoxedMap { + @Nullable Object getData(); } - public static final class UnsetAnyTypeJsonSchema1BoxedVoid extends UnsetAnyTypeJsonSchema1Boxed { - public final Void data; - private UnsetAnyTypeJsonSchema1BoxedVoid(Void data) { - this.data = data; - } + public record UnsetAnyTypeJsonSchema1BoxedVoid(Void data) implements UnsetAnyTypeJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UnsetAnyTypeJsonSchema1BoxedBoolean extends UnsetAnyTypeJsonSchema1Boxed { - public final boolean data; - private UnsetAnyTypeJsonSchema1BoxedBoolean(boolean data) { - this.data = data; - } + public record UnsetAnyTypeJsonSchema1BoxedBoolean(boolean data) implements UnsetAnyTypeJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UnsetAnyTypeJsonSchema1BoxedNumber extends UnsetAnyTypeJsonSchema1Boxed { - public final Number data; - private UnsetAnyTypeJsonSchema1BoxedNumber(Number data) { - this.data = data; - } + public record UnsetAnyTypeJsonSchema1BoxedNumber(Number data) implements UnsetAnyTypeJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UnsetAnyTypeJsonSchema1BoxedString extends UnsetAnyTypeJsonSchema1Boxed { - public final String data; - private UnsetAnyTypeJsonSchema1BoxedString(String data) { - this.data = data; - } + public record UnsetAnyTypeJsonSchema1BoxedString(String data) implements UnsetAnyTypeJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UnsetAnyTypeJsonSchema1BoxedList extends UnsetAnyTypeJsonSchema1Boxed { - public final FrozenList<@Nullable Object> data; - private UnsetAnyTypeJsonSchema1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record UnsetAnyTypeJsonSchema1BoxedList(FrozenList<@Nullable Object> data) implements UnsetAnyTypeJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UnsetAnyTypeJsonSchema1BoxedMap extends UnsetAnyTypeJsonSchema1Boxed { - public final FrozenMap<@Nullable Object> data; - private UnsetAnyTypeJsonSchema1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record UnsetAnyTypeJsonSchema1BoxedMap(FrozenMap<@Nullable Object> data) implements UnsetAnyTypeJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class UnsetAnyTypeJsonSchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, UnsetAnyTypeJsonSchema1BoxedList>, MapSchemaValidator, UnsetAnyTypeJsonSchema1BoxedMap> { + public static class UnsetAnyTypeJsonSchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, UnsetAnyTypeJsonSchema1BoxedList>, MapSchemaValidator, UnsetAnyTypeJsonSchema1BoxedMap> { private static @Nullable UnsetAnyTypeJsonSchema1 instance = null; protected UnsetAnyTypeJsonSchema1() { @@ -179,11 +155,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object castItem = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; @@ -214,11 +190,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object castValue = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } @@ -278,25 +254,50 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public UnsetAnyTypeJsonSchema1BoxedVoid validateAndBox(Void arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new UnsetAnyTypeJsonSchema1BoxedVoid(validate(arg, configuration)); } + @Override public UnsetAnyTypeJsonSchema1BoxedBoolean validateAndBox(boolean arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new UnsetAnyTypeJsonSchema1BoxedBoolean(validate(arg, configuration)); } + @Override public UnsetAnyTypeJsonSchema1BoxedNumber validateAndBox(Number arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new UnsetAnyTypeJsonSchema1BoxedNumber(validate(arg, configuration)); } + @Override public UnsetAnyTypeJsonSchema1BoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new UnsetAnyTypeJsonSchema1BoxedString(validate(arg, configuration)); } + @Override public UnsetAnyTypeJsonSchema1BoxedList validateAndBox(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new UnsetAnyTypeJsonSchema1BoxedList(validate(arg, configuration)); } + @Override public UnsetAnyTypeJsonSchema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new UnsetAnyTypeJsonSchema1BoxedMap(validate(arg, configuration)); } + + @Override + public UnsetAnyTypeJsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } \ No newline at end of file diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ValidationData.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ValidationData.java index d5c4f5de75a..1563757d83a 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ValidationData.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ValidationData.java @@ -5,7 +5,7 @@ import java.util.List; public record ValidationData( - JsonSchema schema, + JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata, @Nullable List containsPathToSchemas, @@ -14,7 +14,7 @@ public record ValidationData( @Nullable PathToSchemasMap knownPathToSchemas ) { public ValidationData( - JsonSchema schema, + JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata ) { diff --git a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ValidationMetadata.java b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ValidationMetadata.java index 8d83f3b6207..9756257f507 100644 --- a/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ValidationMetadata.java +++ b/samples/client/3_0_3_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ValidationMetadata.java @@ -13,8 +13,8 @@ public record ValidationMetadata( Set> seenClasses ) { - public boolean validationRanEarlier(JsonSchema schema) { - @Nullable Map validatedSchemas = validatedPathToSchemas.get(pathToItem); + public boolean validationRanEarlier(JsonSchema schema) { + @Nullable Map, Void> validatedSchemas = validatedPathToSchemas.get(pathToItem); if (validatedSchemas != null && validatedSchemas.containsKey(schema)) { return true; } diff --git a/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/requestbody/RequestBodySerializerTest.java b/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/requestbody/RequestBodySerializerTest.java index 0c618ead730..250d1e0f530 100644 --- a/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/requestbody/RequestBodySerializerTest.java +++ b/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/requestbody/RequestBodySerializerTest.java @@ -2,7 +2,8 @@ import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.schemas.MapJsonSchema; +import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.StringJsonSchema; import org.checkerframework.checker.nullness.qual.Nullable; import org.junit.Assert; @@ -11,73 +12,59 @@ import java.net.http.HttpResponse; import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; +import java.util.AbstractMap; import java.util.List; import java.util.Map; import java.util.concurrent.Flow; public final class RequestBodySerializerTest { + public sealed interface SealedMediaType permits ApplicationjsonMediaType, TextplainMediaType {} + public record ApplicationjsonMediaType(AnyTypeJsonSchema.AnyTypeJsonSchema1 schema) implements SealedMediaType {} + public record TextplainMediaType(StringJsonSchema.StringJsonSchema1 schema) implements SealedMediaType {} - public static abstract sealed class SealedRequestBody permits ApplicationjsonRequestBody, TextplainRequestBody {} - public static final class ApplicationjsonRequestBody extends SealedRequestBody implements GenericRequestBody<@Nullable Object> { - private final String contentType; - private final @Nullable Object body; - public ApplicationjsonRequestBody(@Nullable Object body) { - contentType = "application/json"; - this.body = body; - } + public sealed interface SealedRequestBody permits ApplicationjsonRequestBody, TextplainRequestBody {} + public record ApplicationjsonRequestBody(AnyTypeJsonSchema.AnyTypeJsonSchema1Boxed body) implements SealedRequestBody, GenericRequestBody<@Nullable Object> { @Override public String contentType() { - return contentType; - } - - @Override - public @Nullable Object body() { - return body; + return "application/json"; } } - public static final class TextplainRequestBody extends SealedRequestBody implements GenericRequestBody<@Nullable Object> { - private final String contentType; - private final @Nullable Object body; - public TextplainRequestBody(@Nullable Object body) { - contentType = "text/plain"; - this.body = body; - } + public record TextplainRequestBody(StringJsonSchema.StringJsonSchema1Boxed body) implements SealedRequestBody, GenericRequestBody<@Nullable Object> { @Override public String contentType() { - return contentType; - } - - @Override - public @Nullable Object body() { - return body; + return "text/plain"; } } - public static class MyRequestBodySerializer extends RequestBodySerializer { + public static class MyRequestBodySerializer extends RequestBodySerializer { public MyRequestBodySerializer() { - super(Map.of(), true); + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType(AnyTypeJsonSchema.AnyTypeJsonSchema1.getInstance())), + new AbstractMap.SimpleEntry<>("text/plain", new TextplainMediaType(StringJsonSchema.StringJsonSchema1.getInstance())) + ), + true); } public SerializedRequestBody serialize(SealedRequestBody requestBody) { if (requestBody instanceof ApplicationjsonRequestBody requestBody0) { - return serialize(requestBody0.contentType(), requestBody0.body()); + return serialize(requestBody0.contentType(), requestBody0.body().getData()); } else { TextplainRequestBody requestBody1 = (TextplainRequestBody) requestBody; - return serialize(requestBody1.contentType(), requestBody1.body()); + return serialize(requestBody1.contentType(), requestBody1.body().getData()); } } } @Test public void testContentTypeIsJson() { - var serializer = new MyRequestBodySerializer(); - Assert.assertTrue(serializer.contentTypeIsJson("application/json")); - Assert.assertTrue(serializer.contentTypeIsJson("application/json; charset=UTF-8")); - Assert.assertTrue(serializer.contentTypeIsJson("application/json-patch+json")); - Assert.assertTrue(serializer.contentTypeIsJson("application/geo+json")); + Assert.assertTrue(RequestBodySerializer.contentTypeIsJson("application/json")); + Assert.assertTrue(RequestBodySerializer.contentTypeIsJson("application/json; charset=UTF-8")); + Assert.assertTrue(RequestBodySerializer.contentTypeIsJson("application/json-patch+json")); + Assert.assertTrue(RequestBodySerializer.contentTypeIsJson("application/geo+json")); - Assert.assertFalse(serializer.contentTypeIsJson("application/octet-stream")); - Assert.assertFalse(serializer.contentTypeIsJson("text/plain")); + Assert.assertFalse(RequestBodySerializer.contentTypeIsJson("application/octet-stream")); + Assert.assertFalse(RequestBodySerializer.contentTypeIsJson("text/plain")); } static final class StringSubscriber implements Flow.Subscriber { @@ -101,63 +88,91 @@ private String getJsonBody(SerializedRequestBody requestBody) { var bodySubscriber = HttpResponse.BodySubscribers.ofString(StandardCharsets.UTF_8); var flowSubscriber = new StringSubscriber(bodySubscriber); requestBody.bodyPublisher.subscribe(flowSubscriber); - return bodySubscriber.getBody().toCompletableFuture().join(); } @Test public void testSerializeApplicationJson() { + SchemaConfiguration configuration = new SchemaConfiguration(JsonSchemaKeywordFlags.ofNone()); var serializer = new MyRequestBodySerializer(); String jsonBody; - SerializedRequestBody requestBody = serializer.serialize(new ApplicationjsonRequestBody(1)); + SerializedRequestBody requestBody = serializer.serialize( + new ApplicationjsonRequestBody( + AnyTypeJsonSchema.AnyTypeJsonSchema1.getInstance().validateAndBox(1, configuration) + ) + ); Assert.assertEquals("application/json", requestBody.contentType); jsonBody = getJsonBody(requestBody); Assert.assertEquals(jsonBody, "1"); - requestBody = serializer.serialize(new ApplicationjsonRequestBody(3.14)); + requestBody = serializer.serialize( + new ApplicationjsonRequestBody( + AnyTypeJsonSchema.AnyTypeJsonSchema1.getInstance().validateAndBox(3.14, configuration) + ) + ); jsonBody = getJsonBody(requestBody); Assert.assertEquals(jsonBody, "3.14"); - requestBody = serializer.serialize(new ApplicationjsonRequestBody(null)); + requestBody = serializer.serialize( + new ApplicationjsonRequestBody( + AnyTypeJsonSchema.AnyTypeJsonSchema1.getInstance().validateAndBox((Void) null, configuration) + ) + ); jsonBody = getJsonBody(requestBody); Assert.assertEquals(jsonBody, "null"); - requestBody = serializer.serialize(new ApplicationjsonRequestBody(true)); + requestBody = serializer.serialize( + new ApplicationjsonRequestBody( + AnyTypeJsonSchema.AnyTypeJsonSchema1.getInstance().validateAndBox(true, configuration) + ) + ); jsonBody = getJsonBody(requestBody); Assert.assertEquals(jsonBody, "true"); - requestBody = serializer.serialize(new ApplicationjsonRequestBody(false)); + requestBody = serializer.serialize( + new ApplicationjsonRequestBody( + AnyTypeJsonSchema.AnyTypeJsonSchema1.getInstance().validateAndBox(false, configuration) + ) + ); jsonBody = getJsonBody(requestBody); Assert.assertEquals(jsonBody, "false"); - - requestBody = serializer.serialize(new ApplicationjsonRequestBody(List.of())); + requestBody = serializer.serialize( + new ApplicationjsonRequestBody( + AnyTypeJsonSchema.AnyTypeJsonSchema1.getInstance().validateAndBox(List.of(), configuration) + ) + ); jsonBody = getJsonBody(requestBody); Assert.assertEquals(jsonBody, "[]"); - requestBody = serializer.serialize(new ApplicationjsonRequestBody(Map.of())); + requestBody = serializer.serialize( + new ApplicationjsonRequestBody( + AnyTypeJsonSchema.AnyTypeJsonSchema1.getInstance().validateAndBox(Map.of(), configuration) + ) + ); jsonBody = getJsonBody(requestBody); Assert.assertEquals(jsonBody, "{}"); - SchemaConfiguration configuration = new SchemaConfiguration(JsonSchemaKeywordFlags.ofNone()); - MapJsonSchema.MapJsonSchema1 mapJsonSchema = MapJsonSchema.MapJsonSchema1.getInstance(); - var frozenMap = mapJsonSchema.validate(Map.of("k1", "v1", "k2", "v2"), configuration); - requestBody = serializer.serialize(new ApplicationjsonRequestBody(frozenMap)); + requestBody = serializer.serialize( + new ApplicationjsonRequestBody( + AnyTypeJsonSchema.AnyTypeJsonSchema1.getInstance().validateAndBox(Map.of("k1", "v1", "k2", "v2"), configuration) + ) + ); jsonBody = getJsonBody(requestBody); Assert.assertEquals(jsonBody, "{\"k2\":\"v2\",\"k1\":\"v1\"}"); } @Test public void testSerializeTextPlain() { + SchemaConfiguration configuration = new SchemaConfiguration(JsonSchemaKeywordFlags.ofNone()); var serializer = new MyRequestBodySerializer(); - SerializedRequestBody requestBody = serializer.serialize(new TextplainRequestBody("a")); + SerializedRequestBody requestBody = serializer.serialize( + new TextplainRequestBody( + StringJsonSchema.StringJsonSchema1.getInstance().validateAndBox("a", configuration) + ) + ); Assert.assertEquals("text/plain", requestBody.contentType); String textBody = getJsonBody(requestBody); Assert.assertEquals(textBody, "a"); - - Assert.assertThrows( - RuntimeException.class, - () -> serializer.serialize(new TextplainRequestBody(null)) - ); } } \ No newline at end of file diff --git a/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/response/ResponseDeserializerTest.java b/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/response/ResponseDeserializerTest.java new file mode 100644 index 00000000000..50795dc89a9 --- /dev/null +++ b/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/response/ResponseDeserializerTest.java @@ -0,0 +1,255 @@ +package org.openapijsonschematools.client.response; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.ToNumberPolicy; +import org.checkerframework.checker.nullness.qual.Nullable; +import org.junit.Assert; +import org.junit.Test; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.StringJsonSchema; + +import javax.net.ssl.SSLSession; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpHeaders; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.function.BiPredicate; + +public class ResponseDeserializerTest { + private static final Gson gson = new GsonBuilder() + .setObjectToNumberStrategy(ToNumberPolicy.LONG_OR_DOUBLE) + .setNumberToNumberStrategy(ToNumberPolicy.LONG_OR_DOUBLE) + .create(); + public sealed interface SealedResponseBody permits ApplicationjsonBody, TextplainBody { } + + public record ApplicationjsonBody(AnyTypeJsonSchema.AnyTypeJsonSchema1Boxed body) implements SealedResponseBody { } + + public record TextplainBody(StringJsonSchema.StringJsonSchema1Boxed body) implements SealedResponseBody {} + + public sealed interface SealedMediaType permits ApplicationjsonMediatype, TextplainMediatype { } + + public record ApplicationjsonMediatype(AnyTypeJsonSchema.AnyTypeJsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediatype() { + this(AnyTypeJsonSchema.AnyTypeJsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + + public record TextplainMediatype(StringJsonSchema.StringJsonSchema1 schema) implements SealedMediaType, MediaType { + public TextplainMediatype() { + this(StringJsonSchema.StringJsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + + public static class MyResponseDeserializer extends ResponseDeserializer { + + public MyResponseDeserializer() { + super(Map.of("application/json", new ApplicationjsonMediatype(), "text/plain", new TextplainMediatype())); + } + + @Override + protected SealedResponseBody getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + SealedMediaType mediaType = content.get(contentType); + if (mediaType == null) { + throw new RuntimeException("Invalid contentType was received back from the server that does not exist in the openapi document"); + } + if (mediaType instanceof ApplicationjsonMediatype thisMediaType) { + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonBody(deserializedBody); + } else { + TextplainMediatype thisMediaType = (TextplainMediatype) mediaType; + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new TextplainBody(deserializedBody); + } + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } + + public static class BytesHttpResponse implements HttpResponse { + private final byte[] body; + private final HttpHeaders headers; + private final HttpRequest request; + private final URI uri; + private final HttpClient.Version version; + public BytesHttpResponse(byte[] body, String contentType) { + this.body = body; + BiPredicate headerFilter = (key, val) -> true; + headers = HttpHeaders.of(Map.of("Content-Type", List.of(contentType)), headerFilter); + uri = URI.create("https://abc.com/"); + request = HttpRequest.newBuilder().uri(uri).build(); + version = HttpClient.Version.HTTP_2; + } + + @Override + public int statusCode() { + return 202; + } + + @Override + public HttpRequest request() { + return request; + } + + @Override + public Optional> previousResponse() { + return Optional.empty(); + } + + @Override + public HttpHeaders headers() { + return headers; + } + + @Override + public byte[] body() { + return body; + } + + @Override + public Optional sslSession() { + return Optional.empty(); + } + + @Override + public URI uri() { + return uri; + } + + @Override + public HttpClient.Version version() { + return version; + } + } + + @SuppressWarnings("nullness") + private String toJson(@Nullable Object body) { + return gson.toJson(body); + } + + @SuppressWarnings("nullness") + private void assertNull(@Nullable Object object) { + Assert.assertNull(object); + } + + @Test + public void testDeserializeApplicationJsonNull() { + var deserializer = new MyResponseDeserializer(); + byte[] bodyBytes = toJson(null).getBytes(StandardCharsets.UTF_8); + BytesHttpResponse response = new BytesHttpResponse(bodyBytes, "application/json"); + SchemaConfiguration configuration = new SchemaConfiguration(JsonSchemaKeywordFlags.ofNone()); + ApiResponse apiResponse = deserializer.deserialize(response, configuration); + Assert.assertEquals(response, apiResponse.response()); + if (!(apiResponse.body() instanceof ApplicationjsonBody jsonBody)) { + throw new RuntimeException("body must be type ApplicationjsonBody"); + } + if (!(jsonBody.body() instanceof AnyTypeJsonSchema.AnyTypeJsonSchema1BoxedVoid boxedVoid)) { + throw new RuntimeException("body must be type AnyTypeJsonSchema1BoxedVoid"); + } + assertNull(boxedVoid.data()); + } + + @Test + public void testDeserializeApplicationJsonTrue() { + var deserializer = new MyResponseDeserializer(); + byte[] bodyBytes = toJson(true).getBytes(StandardCharsets.UTF_8); + BytesHttpResponse response = new BytesHttpResponse(bodyBytes, "application/json"); + SchemaConfiguration configuration = new SchemaConfiguration(JsonSchemaKeywordFlags.ofNone()); + ApiResponse apiResponse = deserializer.deserialize(response, configuration); + Assert.assertEquals(response, apiResponse.response()); + if (!(apiResponse.body() instanceof ApplicationjsonBody jsonBody)) { + throw new RuntimeException("body must be type ApplicationjsonBody"); + } + if (!(jsonBody.body() instanceof AnyTypeJsonSchema.AnyTypeJsonSchema1BoxedBoolean boxedBoolean)) { + throw new RuntimeException("body must be type AnyTypeJsonSchema1BoxedBoolean"); + } + Assert.assertTrue(boxedBoolean.data()); + } + + @Test + public void testDeserializeApplicationJsonFalse() { + var deserializer = new MyResponseDeserializer(); + byte[] bodyBytes = toJson(false).getBytes(StandardCharsets.UTF_8); + BytesHttpResponse response = new BytesHttpResponse(bodyBytes, "application/json"); + SchemaConfiguration configuration = new SchemaConfiguration(JsonSchemaKeywordFlags.ofNone()); + ApiResponse apiResponse = deserializer.deserialize(response, configuration); + Assert.assertEquals(response, apiResponse.response()); + if (!(apiResponse.body() instanceof ApplicationjsonBody jsonBody)) { + throw new RuntimeException("body must be type ApplicationjsonBody"); + } + if (!(jsonBody.body() instanceof AnyTypeJsonSchema.AnyTypeJsonSchema1BoxedBoolean boxedBoolean)) { + throw new RuntimeException("body must be type AnyTypeJsonSchema1BoxedBoolean"); + } + Assert.assertFalse(boxedBoolean.data()); + } + + @Test + public void testDeserializeApplicationJsonInt() { + var deserializer = new MyResponseDeserializer(); + byte[] bodyBytes = toJson(1).getBytes(StandardCharsets.UTF_8); + BytesHttpResponse response = new BytesHttpResponse(bodyBytes, "application/json"); + SchemaConfiguration configuration = new SchemaConfiguration(JsonSchemaKeywordFlags.ofNone()); + ApiResponse apiResponse = deserializer.deserialize(response, configuration); + Assert.assertEquals(response, apiResponse.response()); + if (!(apiResponse.body() instanceof ApplicationjsonBody jsonBody)) { + throw new RuntimeException("body must be type ApplicationjsonBody"); + } + if (!(jsonBody.body() instanceof AnyTypeJsonSchema.AnyTypeJsonSchema1BoxedNumber boxedNumber)) { + throw new RuntimeException("body must be type AnyTypeJsonSchema1BoxedNumber"); + } + Assert.assertEquals(boxedNumber.data(), 1L); + } + + @Test + public void testDeserializeApplicationJsonFloat() { + var deserializer = new MyResponseDeserializer(); + byte[] bodyBytes = toJson(3.14).getBytes(StandardCharsets.UTF_8); + BytesHttpResponse response = new BytesHttpResponse(bodyBytes, "application/json"); + SchemaConfiguration configuration = new SchemaConfiguration(JsonSchemaKeywordFlags.ofNone()); + ApiResponse apiResponse = deserializer.deserialize(response, configuration); + Assert.assertEquals(response, apiResponse.response()); + if (!(apiResponse.body() instanceof ApplicationjsonBody jsonBody)) { + throw new RuntimeException("body must be type ApplicationjsonBody"); + } + if (!(jsonBody.body() instanceof AnyTypeJsonSchema.AnyTypeJsonSchema1BoxedNumber boxedNumber)) { + throw new RuntimeException("body must be type AnyTypeJsonSchema1BoxedNumber"); + } + Assert.assertEquals(boxedNumber.data(), 3.14); + } + + @Test + public void testDeserializeApplicationJsonString() { + var deserializer = new MyResponseDeserializer(); + byte[] bodyBytes = toJson("a").getBytes(StandardCharsets.UTF_8); + BytesHttpResponse response = new BytesHttpResponse(bodyBytes, "application/json"); + SchemaConfiguration configuration = new SchemaConfiguration(JsonSchemaKeywordFlags.ofNone()); + ApiResponse apiResponse = deserializer.deserialize(response, configuration); + Assert.assertEquals(response, apiResponse.response()); + if (!(apiResponse.body() instanceof ApplicationjsonBody jsonBody)) { + throw new RuntimeException("body must be type ApplicationjsonBody"); + } + if (!(jsonBody.body() instanceof AnyTypeJsonSchema.AnyTypeJsonSchema1BoxedString boxedString)) { + throw new RuntimeException("body must be type AnyTypeJsonSchema1BoxedString"); + } + Assert.assertEquals(boxedString.data(), "a"); + } +} \ No newline at end of file diff --git a/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/ArrayTypeSchemaTest.java b/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/ArrayTypeSchemaTest.java index a5cb7cd0519..42dfcabf0d0 100644 --- a/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/ArrayTypeSchemaTest.java +++ b/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/ArrayTypeSchemaTest.java @@ -31,16 +31,12 @@ public class ArrayTypeSchemaTest { new LinkedHashSet<>() ); - public static abstract sealed class ArrayWithItemsSchemaBoxed permits ArrayWithItemsSchemaBoxedList { + public sealed interface ArrayWithItemsSchemaBoxed permits ArrayWithItemsSchemaBoxedList { } - public static final class ArrayWithItemsSchemaBoxedList extends ArrayWithItemsSchemaBoxed { - public final FrozenList data; - private ArrayWithItemsSchemaBoxedList(FrozenList data) { - this.data = data; - } + public record ArrayWithItemsSchemaBoxedList(FrozenList data) implements ArrayWithItemsSchemaBoxed { } - public static class ArrayWithItemsSchema extends JsonSchema implements ListSchemaValidator, ArrayWithItemsSchemaBoxedList> { + public static class ArrayWithItemsSchema extends JsonSchema implements ListSchemaValidator, ArrayWithItemsSchemaBoxedList> { public ArrayWithItemsSchema() { super(new JsonSchemaInfo() .type(Set.of(List.class)) @@ -55,11 +51,11 @@ public FrozenList getNewInstance(List arg, List pathToItem, P for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object castItem = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(castItem instanceof String)) { throw new InvalidTypeException("Instantiated type of item is invalid"); @@ -100,6 +96,14 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); } + + @Override + public ArrayWithItemsSchemaBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws InvalidTypeException, ValidationException { + if (arg instanceof List listArg) { + return new ArrayWithItemsSchemaBoxedList(validate(listArg, configuration)); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class ArrayWithOutputClsSchemaList extends FrozenList { @@ -112,15 +116,11 @@ public static ArrayWithOutputClsSchemaList of(List arg, SchemaConfigurat } } - public static abstract sealed class ArrayWithOutputClsSchemaBoxed permits ArrayWithOutputClsSchemaBoxedList { + public sealed interface ArrayWithOutputClsSchemaBoxed permits ArrayWithOutputClsSchemaBoxedList { } - public static final class ArrayWithOutputClsSchemaBoxedList extends ArrayWithOutputClsSchemaBoxed { - public final ArrayWithOutputClsSchemaList data; - private ArrayWithOutputClsSchemaBoxedList(ArrayWithOutputClsSchemaList data) { - this.data = data; - } + public record ArrayWithOutputClsSchemaBoxedList(ArrayWithOutputClsSchemaList data) implements ArrayWithOutputClsSchemaBoxed { } - public static class ArrayWithOutputClsSchema extends JsonSchema implements ListSchemaValidator { + public static class ArrayWithOutputClsSchema extends JsonSchema implements ListSchemaValidator { public ArrayWithOutputClsSchema() { super(new JsonSchemaInfo() .type(Set.of(List.class)) @@ -136,11 +136,11 @@ public ArrayWithOutputClsSchemaList getNewInstance(List arg, List pat for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object castItem = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(castItem instanceof String)) { throw new InvalidTypeException("Instantiated type of item is invalid"); @@ -182,6 +182,14 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); } + + @Override + public ArrayWithOutputClsSchemaBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws InvalidTypeException, ValidationException { + if (arg instanceof List listArg) { + return new ArrayWithOutputClsSchemaBoxedList(validate(listArg, configuration)); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } @Test diff --git a/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/ObjectTypeSchemaTest.java b/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/ObjectTypeSchemaTest.java index acd412b00d1..02729b0f046 100644 --- a/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/ObjectTypeSchemaTest.java +++ b/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/ObjectTypeSchemaTest.java @@ -33,15 +33,11 @@ public class ObjectTypeSchemaTest { new LinkedHashSet<>() ); - public static abstract sealed class ObjectWithPropsSchemaBoxed permits ObjectWithPropsSchemaBoxedMap { + public sealed interface ObjectWithPropsSchemaBoxed permits ObjectWithPropsSchemaBoxedMap { } - public static final class ObjectWithPropsSchemaBoxedMap extends ObjectWithPropsSchemaBoxed { - public final FrozenMap<@Nullable Object> data; - private ObjectWithPropsSchemaBoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record ObjectWithPropsSchemaBoxedMap(FrozenMap<@Nullable Object> data) implements ObjectWithPropsSchemaBoxed { } - public static class ObjectWithPropsSchema extends JsonSchema implements MapSchemaValidator, ObjectWithPropsSchemaBoxedMap> { + public static class ObjectWithPropsSchema extends JsonSchema implements MapSchemaValidator, ObjectWithPropsSchemaBoxedMap> { private static @Nullable ObjectWithPropsSchema instance = null; private ObjectWithPropsSchema() { super(new JsonSchemaInfo() @@ -72,11 +68,11 @@ public static ObjectWithPropsSchema getInstance() { List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object castValue = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } @@ -113,18 +109,22 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); } + + @Override + public ObjectWithPropsSchemaBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws InvalidTypeException, ValidationException { + if (arg instanceof Map mapArg) { + return new ObjectWithPropsSchemaBoxedMap(validate(mapArg, configuration)); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class ObjectWithAddpropsSchemaBoxed permits ObjectWithAddpropsSchemaBoxedMap { + public sealed interface ObjectWithAddpropsSchemaBoxed permits ObjectWithAddpropsSchemaBoxedMap { } - public static final class ObjectWithAddpropsSchemaBoxedMap extends ObjectWithAddpropsSchemaBoxed { - public final FrozenMap data; - private ObjectWithAddpropsSchemaBoxedMap(FrozenMap data) { - this.data = data; - } + public record ObjectWithAddpropsSchemaBoxedMap(FrozenMap data) implements ObjectWithAddpropsSchemaBoxed { } - public static class ObjectWithAddpropsSchema extends JsonSchema implements MapSchemaValidator, ObjectWithAddpropsSchemaBoxedMap> { + public static class ObjectWithAddpropsSchema extends JsonSchema implements MapSchemaValidator, ObjectWithAddpropsSchemaBoxedMap> { private static @Nullable ObjectWithAddpropsSchema instance = null; private ObjectWithAddpropsSchema() { super(new JsonSchemaInfo() @@ -152,11 +152,11 @@ public FrozenMap getNewInstance(Map arg, List pathToItem, List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object castValue = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(castValue instanceof String)) { throw new InvalidTypeException("Invalid type for property value"); @@ -189,6 +189,14 @@ public ObjectWithAddpropsSchemaBoxedMap validateAndBox(Map arg, SchemaConf throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); } + @Override + public ObjectWithAddpropsSchemaBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws InvalidTypeException, ValidationException { + if (arg instanceof Map mapArg) { + return new ObjectWithAddpropsSchemaBoxedMap(validate(mapArg, configuration)); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + @Override public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof Map) { @@ -198,15 +206,11 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } } - public static abstract sealed class ObjectWithPropsAndAddpropsSchemaBoxed permits ObjectWithPropsAndAddpropsSchemaBoxedMap { + public sealed interface ObjectWithPropsAndAddpropsSchemaBoxed permits ObjectWithPropsAndAddpropsSchemaBoxedMap { } - public static final class ObjectWithPropsAndAddpropsSchemaBoxedMap extends ObjectWithPropsAndAddpropsSchemaBoxed { - public final FrozenMap<@Nullable Object> data; - private ObjectWithPropsAndAddpropsSchemaBoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record ObjectWithPropsAndAddpropsSchemaBoxedMap(FrozenMap<@Nullable Object> data) implements ObjectWithPropsAndAddpropsSchemaBoxed { } - public static class ObjectWithPropsAndAddpropsSchema extends JsonSchema implements MapSchemaValidator, ObjectWithPropsAndAddpropsSchemaBoxedMap> { + public static class ObjectWithPropsAndAddpropsSchema extends JsonSchema implements MapSchemaValidator, ObjectWithPropsAndAddpropsSchemaBoxedMap> { private static @Nullable ObjectWithPropsAndAddpropsSchema instance = null; private ObjectWithPropsAndAddpropsSchema() { super(new JsonSchemaInfo() @@ -237,11 +241,11 @@ public static ObjectWithPropsAndAddpropsSchema getInstance() { List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object castValue = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } @@ -271,6 +275,14 @@ public ObjectWithPropsAndAddpropsSchemaBoxedMap validateAndBox(Map arg, Sc throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); } + @Override + public ObjectWithPropsAndAddpropsSchemaBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws InvalidTypeException, ValidationException { + if (arg instanceof Map mapArg) { + return new ObjectWithPropsAndAddpropsSchemaBoxedMap(validate(mapArg, configuration)); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + @Override public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof Map) { @@ -290,15 +302,11 @@ public static ObjectWithOutputTypeSchemaMap of(Map arg, SchemaCo } } - public static abstract sealed class ObjectWithOutputTypeSchemaBoxed permits ObjectWithOutputTypeSchemaBoxedMap { + public sealed interface ObjectWithOutputTypeSchemaBoxed permits ObjectWithOutputTypeSchemaBoxedMap { } - public static final class ObjectWithOutputTypeSchemaBoxedMap extends ObjectWithOutputTypeSchemaBoxed { - public final ObjectWithOutputTypeSchemaMap data; - private ObjectWithOutputTypeSchemaBoxedMap(ObjectWithOutputTypeSchemaMap data) { - this.data = data; - } + public record ObjectWithOutputTypeSchemaBoxedMap(ObjectWithOutputTypeSchemaMap data) implements ObjectWithOutputTypeSchemaBoxed { } - public static class ObjectWithOutputTypeSchema extends JsonSchema implements MapSchemaValidator { + public static class ObjectWithOutputTypeSchema extends JsonSchema implements MapSchemaValidator { private static @Nullable ObjectWithOutputTypeSchema instance = null; public ObjectWithOutputTypeSchema() { super(new JsonSchemaInfo() @@ -328,11 +336,11 @@ public ObjectWithOutputTypeSchemaMap getNewInstance(Map arg, List List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object castValue = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } @@ -362,6 +370,14 @@ public ObjectWithOutputTypeSchemaBoxedMap validateAndBox(Map arg, SchemaCo throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); } + @Override + public ObjectWithOutputTypeSchemaBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws InvalidTypeException, ValidationException { + if (arg instanceof Map mapArg) { + return new ObjectWithOutputTypeSchemaBoxedMap(validate(mapArg, configuration)); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + @Override public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof FrozenMap) { diff --git a/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/AdditionalPropertiesValidatorTest.java b/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/AdditionalPropertiesValidatorTest.java index 5bf7ee3b6b5..40a01c9983d 100644 --- a/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/AdditionalPropertiesValidatorTest.java +++ b/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/AdditionalPropertiesValidatorTest.java @@ -18,7 +18,10 @@ import java.util.Set; public class AdditionalPropertiesValidatorTest { - public static class ObjectWithPropsSchema extends JsonSchema { + public sealed interface ObjectWithPropsSchemaBoxed permits ObjectWithPropsSchemaBoxedMap {} + public record ObjectWithPropsSchemaBoxedMap() implements ObjectWithPropsSchemaBoxed {} + + public static class ObjectWithPropsSchema extends JsonSchema { private static @Nullable ObjectWithPropsSchema instance = null; private ObjectWithPropsSchema() { super(new JsonSchemaInfo() @@ -53,6 +56,11 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); } + + @Override + public ObjectWithPropsSchemaBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws InvalidTypeException, ValidationException { + return new ObjectWithPropsSchemaBoxedMap(); + } } @SuppressWarnings("nullness") @@ -88,7 +96,7 @@ public void testCorrectPropertySucceeds() { List expectedPathToItem = new ArrayList<>(); expectedPathToItem.add("args[0]"); expectedPathToItem.add("someAddProp"); - LinkedHashMap expectedClasses = new LinkedHashMap<>(); + LinkedHashMap, Void> expectedClasses = new LinkedHashMap<>(); StringJsonSchema.StringJsonSchema1 schema = JsonSchemaFactory.getInstance(StringJsonSchema.StringJsonSchema1.class); expectedClasses.put(schema, null); PathToSchemasMap expectedPathToSchemas = new PathToSchemasMap(); diff --git a/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/ItemsValidatorTest.java b/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/ItemsValidatorTest.java index f9f01dcb28a..e0e4a0c859e 100644 --- a/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/ItemsValidatorTest.java +++ b/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/ItemsValidatorTest.java @@ -21,7 +21,10 @@ private void assertNull(@Nullable Object object) { Assert.assertNull(object); } - public static class ArrayWithItemsSchema extends JsonSchema { + public sealed interface ArrayWithItemsSchemaBoxed permits ArrayWithItemsSchemaBoxedList {} + public record ArrayWithItemsSchemaBoxedList() implements ArrayWithItemsSchemaBoxed {} + + public static class ArrayWithItemsSchema extends JsonSchema { public ArrayWithItemsSchema() { super(new JsonSchemaInfo() .type(Set.of(List.class)) @@ -44,6 +47,11 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); } + + @Override + public ArrayWithItemsSchemaBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws InvalidTypeException, ValidationException { + return new ArrayWithItemsSchemaBoxedList(); + } } @Test @@ -72,7 +80,7 @@ public void testCorrectItemsSucceeds() { List expectedPathToItem = new ArrayList<>(); expectedPathToItem.add("args[0]"); expectedPathToItem.add(0); - LinkedHashMap expectedClasses = new LinkedHashMap<>(); + LinkedHashMap, Void> expectedClasses = new LinkedHashMap<>(); StringJsonSchema.StringJsonSchema1 schema = JsonSchemaFactory.getInstance(StringJsonSchema.StringJsonSchema1.class); expectedClasses.put(schema, null); PathToSchemasMap expectedPathToSchemas = new PathToSchemasMap(); diff --git a/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/JsonSchemaTest.java b/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/JsonSchemaTest.java index 525222b9ad7..8a14df7edd6 100644 --- a/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/JsonSchemaTest.java +++ b/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/JsonSchemaTest.java @@ -13,39 +13,49 @@ import java.util.List; import java.util.Set; -class SomeSchema extends JsonSchema { - private static @Nullable SomeSchema instance = null; - protected SomeSchema() { - super(new JsonSchemaInfo() - .type(Set.of(String.class)) - ); - } +sealed interface SomeSchemaBoxed permits SomeSchemaBoxedString {} +record SomeSchemaBoxedString() implements SomeSchemaBoxed {} + +public class JsonSchemaTest { + sealed interface SomeSchemaBoxed permits SomeSchemaBoxedString {} + record SomeSchemaBoxedString() implements SomeSchemaBoxed {} - public static SomeSchema getInstance() { - if (instance == null) { - instance = new SomeSchema(); + static class SomeSchema extends JsonSchema { + private static @Nullable SomeSchema instance = null; + protected SomeSchema() { + super(new JsonSchemaInfo() + .type(Set.of(String.class)) + ); } - return instance; - } - @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { - if (arg instanceof String) { - return arg; + public static SomeSchema getInstance() { + if (instance == null) { + instance = new SomeSchema(); + } + return instance; } - throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); - } - @Override - public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws InvalidTypeException, ValidationException { - if (arg instanceof String) { - return arg; + @Override + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + if (arg instanceof String) { + return arg; + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } - throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } -} -public class JsonSchemaTest { + @Override + public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws InvalidTypeException, ValidationException { + if (arg instanceof String) { + return arg; + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + + @Override + public SomeSchemaBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws InvalidTypeException, ValidationException { + return new SomeSchemaBoxedString(); + } + } @Test public void testValidateSucceeds() { @@ -63,7 +73,7 @@ public void testValidateSucceeds() { validationMetadata ); PathToSchemasMap expectedPathToSchemas = new PathToSchemasMap(); - LinkedHashMap validatedClasses = new LinkedHashMap<>(); + LinkedHashMap, Void> validatedClasses = new LinkedHashMap<>(); validatedClasses.put(schema, null); expectedPathToSchemas.put(pathToItem, validatedClasses); Assert.assertEquals(pathToSchemas, expectedPathToSchemas); diff --git a/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/PropertiesValidatorTest.java b/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/PropertiesValidatorTest.java index 5a6edbe7299..492f45af0c7 100644 --- a/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/PropertiesValidatorTest.java +++ b/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/PropertiesValidatorTest.java @@ -17,7 +17,10 @@ import java.util.Set; public class PropertiesValidatorTest { - public static class ObjectWithPropsSchema extends JsonSchema { + public sealed interface ObjectWithPropsSchemaBoxed permits ObjectWithPropsSchemaBoxedMap {} + public record ObjectWithPropsSchemaBoxedMap() implements ObjectWithPropsSchemaBoxed {} + + public static class ObjectWithPropsSchema extends JsonSchema { private ObjectWithPropsSchema() { super(new JsonSchemaInfo() .type(Set.of(Map.class)) @@ -43,6 +46,11 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); } + + @Override + public ObjectWithPropsSchemaBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws InvalidTypeException, ValidationException { + return new ObjectWithPropsSchemaBoxedMap(); + } } @SuppressWarnings("nullness") @@ -76,7 +84,7 @@ public void testCorrectPropertySucceeds() { List expectedPathToItem = new ArrayList<>(); expectedPathToItem.add("args[0]"); expectedPathToItem.add("someString"); - LinkedHashMap expectedClasses = new LinkedHashMap<>(); + LinkedHashMap, Void> expectedClasses = new LinkedHashMap<>(); expectedClasses.put(JsonSchemaFactory.getInstance(StringJsonSchema.StringJsonSchema1.class), null); PathToSchemasMap expectedPathToSchemas = new PathToSchemasMap(); expectedPathToSchemas.put(expectedPathToItem, expectedClasses); diff --git a/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/RequiredValidatorTest.java b/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/RequiredValidatorTest.java index d2264b9a967..65ff030d74b 100644 --- a/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/RequiredValidatorTest.java +++ b/samples/client/3_0_3_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/RequiredValidatorTest.java @@ -15,7 +15,10 @@ import java.util.Set; public class RequiredValidatorTest { - public static class ObjectWithRequiredSchema extends JsonSchema { + public sealed interface ObjectWithRequiredSchemaBoxed permits ObjectWithRequiredSchemaBoxedMap {} + public record ObjectWithRequiredSchemaBoxedMap() implements ObjectWithRequiredSchemaBoxed {} + + public static class ObjectWithRequiredSchema extends JsonSchema { private ObjectWithRequiredSchema() { super(new JsonSchemaInfo() .type(Set.of(Map.class)) @@ -39,6 +42,11 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); } + + @Override + public ObjectWithRequiredSchemaBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws InvalidTypeException, ValidationException { + return new ObjectWithRequiredSchemaBoxedMap(); + } } @SuppressWarnings("nullness") diff --git a/samples/client/3_1_0_unit_test/java/.openapi-generator/FILES b/samples/client/3_1_0_unit_test/java/.openapi-generator/FILES index cbe0194263f..3de3fb07006 100644 --- a/samples/client/3_1_0_unit_test/java/.openapi-generator/FILES +++ b/samples/client/3_1_0_unit_test/java/.openapi-generator/FILES @@ -302,6 +302,9 @@ src/main/java/org/openapijsonschematools/client/parameter/ParameterStyle.java src/main/java/org/openapijsonschematools/client/requestbody/GenericRequestBody.java src/main/java/org/openapijsonschematools/client/requestbody/RequestBodySerializer.java src/main/java/org/openapijsonschematools/client/requestbody/SerializedRequestBody.java +src/main/java/org/openapijsonschematools/client/response/ApiResponse.java +src/main/java/org/openapijsonschematools/client/response/DeserializedApiResponse.java +src/main/java/org/openapijsonschematools/client/response/ResponseDeserializer.java src/main/java/org/openapijsonschematools/client/schemas/AnyTypeJsonSchema.java src/main/java/org/openapijsonschematools/client/schemas/BooleanJsonSchema.java src/main/java/org/openapijsonschematools/client/schemas/DateJsonSchema.java @@ -404,6 +407,7 @@ src/main/java/org/openapijsonschematools/client/servers/ServerWithVariables.java src/main/java/org/openapijsonschematools/client/servers/ServerWithoutVariables.java src/test/java/org/openapijsonschematools/client/configurations/JsonSchemaKeywordFlagsTest.java src/test/java/org/openapijsonschematools/client/requestbody/RequestBodySerializerTest.java +src/test/java/org/openapijsonschematools/client/response/ResponseDeserializerTest.java src/test/java/org/openapijsonschematools/client/schemas/AnyTypeSchemaTest.java src/test/java/org/openapijsonschematools/client/schemas/ArrayTypeSchemaTest.java src/test/java/org/openapijsonschematools/client/schemas/BooleanSchemaTest.java diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/ASchemaGivenForPrefixitems.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/ASchemaGivenForPrefixitems.md index 60f18cc8ef6..4e7390d7215 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/ASchemaGivenForPrefixitems.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/ASchemaGivenForPrefixitems.md @@ -4,7 +4,7 @@ public class ASchemaGivenForPrefixitems
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated list payloads, extends FrozenList - classes to build inputs for list payloads @@ -12,25 +12,25 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ASchemaGivenForPrefixitems.ASchemaGivenForPrefixitems1Boxed](#aschemagivenforprefixitems1boxed)
abstract sealed validated payload class | -| static class | [ASchemaGivenForPrefixitems.ASchemaGivenForPrefixitems1BoxedVoid](#aschemagivenforprefixitems1boxedvoid)
boxed class to store validated null payloads | -| static class | [ASchemaGivenForPrefixitems.ASchemaGivenForPrefixitems1BoxedBoolean](#aschemagivenforprefixitems1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [ASchemaGivenForPrefixitems.ASchemaGivenForPrefixitems1BoxedNumber](#aschemagivenforprefixitems1boxednumber)
boxed class to store validated Number payloads | -| static class | [ASchemaGivenForPrefixitems.ASchemaGivenForPrefixitems1BoxedString](#aschemagivenforprefixitems1boxedstring)
boxed class to store validated String payloads | -| static class | [ASchemaGivenForPrefixitems.ASchemaGivenForPrefixitems1BoxedList](#aschemagivenforprefixitems1boxedlist)
boxed class to store validated List payloads | -| static class | [ASchemaGivenForPrefixitems.ASchemaGivenForPrefixitems1BoxedMap](#aschemagivenforprefixitems1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ASchemaGivenForPrefixitems.ASchemaGivenForPrefixitems1Boxed](#aschemagivenforprefixitems1boxed)
sealed interface for validated payloads | +| record | [ASchemaGivenForPrefixitems.ASchemaGivenForPrefixitems1BoxedVoid](#aschemagivenforprefixitems1boxedvoid)
boxed class to store validated null payloads | +| record | [ASchemaGivenForPrefixitems.ASchemaGivenForPrefixitems1BoxedBoolean](#aschemagivenforprefixitems1boxedboolean)
boxed class to store validated boolean payloads | +| record | [ASchemaGivenForPrefixitems.ASchemaGivenForPrefixitems1BoxedNumber](#aschemagivenforprefixitems1boxednumber)
boxed class to store validated Number payloads | +| record | [ASchemaGivenForPrefixitems.ASchemaGivenForPrefixitems1BoxedString](#aschemagivenforprefixitems1boxedstring)
boxed class to store validated String payloads | +| record | [ASchemaGivenForPrefixitems.ASchemaGivenForPrefixitems1BoxedList](#aschemagivenforprefixitems1boxedlist)
boxed class to store validated List payloads | +| record | [ASchemaGivenForPrefixitems.ASchemaGivenForPrefixitems1BoxedMap](#aschemagivenforprefixitems1boxedmap)
boxed class to store validated Map payloads | | static class | [ASchemaGivenForPrefixitems.ASchemaGivenForPrefixitems1](#aschemagivenforprefixitems1)
schema class | -| static class | [ASchemaGivenForPrefixitems.Schema1Boxed](#schema1boxed)
abstract sealed validated payload class | -| static class | [ASchemaGivenForPrefixitems.Schema1BoxedString](#schema1boxedstring)
boxed class to store validated String payloads | +| sealed interface | [ASchemaGivenForPrefixitems.Schema1Boxed](#schema1boxed)
sealed interface for validated payloads | +| record | [ASchemaGivenForPrefixitems.Schema1BoxedString](#schema1boxedstring)
boxed class to store validated String payloads | | static class | [ASchemaGivenForPrefixitems.Schema1](#schema1)
schema class | -| static class | [ASchemaGivenForPrefixitems.Schema0Boxed](#schema0boxed)
abstract sealed validated payload class | -| static class | [ASchemaGivenForPrefixitems.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | +| sealed interface | [ASchemaGivenForPrefixitems.Schema0Boxed](#schema0boxed)
sealed interface for validated payloads | +| record | [ASchemaGivenForPrefixitems.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | | static class | [ASchemaGivenForPrefixitems.Schema0](#schema0)
schema class | | static class | [ASchemaGivenForPrefixitems.ASchemaGivenForPrefixitemsListBuilder](#aschemagivenforprefixitemslistbuilder)
builder for List payloads | | static class | [ASchemaGivenForPrefixitems.ASchemaGivenForPrefixitemsList](#aschemagivenforprefixitemslist)
output class for List payloads | ## ASchemaGivenForPrefixitems1Boxed -public static abstract sealed class ASchemaGivenForPrefixitems1Boxed
+public sealed interface ASchemaGivenForPrefixitems1Boxed
permits
[ASchemaGivenForPrefixitems1BoxedVoid](#aschemagivenforprefixitems1boxedvoid), [ASchemaGivenForPrefixitems1BoxedBoolean](#aschemagivenforprefixitems1boxedboolean), @@ -39,103 +39,109 @@ permits
[ASchemaGivenForPrefixitems1BoxedList](#aschemagivenforprefixitems1boxedlist), [ASchemaGivenForPrefixitems1BoxedMap](#aschemagivenforprefixitems1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ASchemaGivenForPrefixitems1BoxedVoid -public static final class ASchemaGivenForPrefixitems1BoxedVoid
-extends [ASchemaGivenForPrefixitems1Boxed](#aschemagivenforprefixitems1boxed) +public record ASchemaGivenForPrefixitems1BoxedVoid
+implements [ASchemaGivenForPrefixitems1Boxed](#aschemagivenforprefixitems1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ASchemaGivenForPrefixitems1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ASchemaGivenForPrefixitems1BoxedBoolean -public static final class ASchemaGivenForPrefixitems1BoxedBoolean
-extends [ASchemaGivenForPrefixitems1Boxed](#aschemagivenforprefixitems1boxed) +public record ASchemaGivenForPrefixitems1BoxedBoolean
+implements [ASchemaGivenForPrefixitems1Boxed](#aschemagivenforprefixitems1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ASchemaGivenForPrefixitems1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ASchemaGivenForPrefixitems1BoxedNumber -public static final class ASchemaGivenForPrefixitems1BoxedNumber
-extends [ASchemaGivenForPrefixitems1Boxed](#aschemagivenforprefixitems1boxed) +public record ASchemaGivenForPrefixitems1BoxedNumber
+implements [ASchemaGivenForPrefixitems1Boxed](#aschemagivenforprefixitems1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ASchemaGivenForPrefixitems1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ASchemaGivenForPrefixitems1BoxedString -public static final class ASchemaGivenForPrefixitems1BoxedString
-extends [ASchemaGivenForPrefixitems1Boxed](#aschemagivenforprefixitems1boxed) +public record ASchemaGivenForPrefixitems1BoxedString
+implements [ASchemaGivenForPrefixitems1Boxed](#aschemagivenforprefixitems1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ASchemaGivenForPrefixitems1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ASchemaGivenForPrefixitems1BoxedList -public static final class ASchemaGivenForPrefixitems1BoxedList
-extends [ASchemaGivenForPrefixitems1Boxed](#aschemagivenforprefixitems1boxed) +public record ASchemaGivenForPrefixitems1BoxedList
+implements [ASchemaGivenForPrefixitems1Boxed](#aschemagivenforprefixitems1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ASchemaGivenForPrefixitems1BoxedList([ASchemaGivenForPrefixitemsList](#aschemagivenforprefixitemslist) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [ASchemaGivenForPrefixitemsList](#aschemagivenforprefixitemslist) | data
validated payload | +| [ASchemaGivenForPrefixitemsList](#aschemagivenforprefixitemslist) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ASchemaGivenForPrefixitems1BoxedMap -public static final class ASchemaGivenForPrefixitems1BoxedMap
-extends [ASchemaGivenForPrefixitems1Boxed](#aschemagivenforprefixitems1boxed) +public record ASchemaGivenForPrefixitems1BoxedMap
+implements [ASchemaGivenForPrefixitems1Boxed](#aschemagivenforprefixitems1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ASchemaGivenForPrefixitems1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ASchemaGivenForPrefixitems1 public static class ASchemaGivenForPrefixitems1
@@ -167,29 +173,32 @@ A schema class that validates payloads | [ASchemaGivenForPrefixitems1BoxedBoolean](#aschemagivenforprefixitems1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [ASchemaGivenForPrefixitems1BoxedMap](#aschemagivenforprefixitems1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [ASchemaGivenForPrefixitems1BoxedList](#aschemagivenforprefixitems1boxedlist) | validateAndBox([List](#aschemagivenforprefixitemslistbuilder) arg, SchemaConfiguration configuration) | +| [ASchemaGivenForPrefixitems1Boxed](#aschemagivenforprefixitems1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema1Boxed -public static abstract sealed class Schema1Boxed
+public sealed interface Schema1Boxed
permits
[Schema1BoxedString](#schema1boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema1BoxedString -public static final class Schema1BoxedString
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedString
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1 public static class Schema1
@@ -203,27 +212,28 @@ A schema class that validates payloads | validateAndBox | ## Schema0Boxed -public static abstract sealed class Schema0Boxed
+public sealed interface Schema0Boxed
permits
[Schema0BoxedNumber](#schema0boxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema0BoxedNumber -public static final class Schema0BoxedNumber
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedNumber
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0 public static class Schema0
diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/AdditionalItemsAreAllowedByDefault.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/AdditionalItemsAreAllowedByDefault.md index 0212093a2a9..05046febeb6 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/AdditionalItemsAreAllowedByDefault.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/AdditionalItemsAreAllowedByDefault.md @@ -4,7 +4,7 @@ public class AdditionalItemsAreAllowedByDefault
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated list payloads, extends FrozenList - classes to build inputs for list payloads @@ -12,22 +12,22 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [AdditionalItemsAreAllowedByDefault.AdditionalItemsAreAllowedByDefault1Boxed](#additionalitemsareallowedbydefault1boxed)
abstract sealed validated payload class | -| static class | [AdditionalItemsAreAllowedByDefault.AdditionalItemsAreAllowedByDefault1BoxedVoid](#additionalitemsareallowedbydefault1boxedvoid)
boxed class to store validated null payloads | -| static class | [AdditionalItemsAreAllowedByDefault.AdditionalItemsAreAllowedByDefault1BoxedBoolean](#additionalitemsareallowedbydefault1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [AdditionalItemsAreAllowedByDefault.AdditionalItemsAreAllowedByDefault1BoxedNumber](#additionalitemsareallowedbydefault1boxednumber)
boxed class to store validated Number payloads | -| static class | [AdditionalItemsAreAllowedByDefault.AdditionalItemsAreAllowedByDefault1BoxedString](#additionalitemsareallowedbydefault1boxedstring)
boxed class to store validated String payloads | -| static class | [AdditionalItemsAreAllowedByDefault.AdditionalItemsAreAllowedByDefault1BoxedList](#additionalitemsareallowedbydefault1boxedlist)
boxed class to store validated List payloads | -| static class | [AdditionalItemsAreAllowedByDefault.AdditionalItemsAreAllowedByDefault1BoxedMap](#additionalitemsareallowedbydefault1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AdditionalItemsAreAllowedByDefault.AdditionalItemsAreAllowedByDefault1Boxed](#additionalitemsareallowedbydefault1boxed)
sealed interface for validated payloads | +| record | [AdditionalItemsAreAllowedByDefault.AdditionalItemsAreAllowedByDefault1BoxedVoid](#additionalitemsareallowedbydefault1boxedvoid)
boxed class to store validated null payloads | +| record | [AdditionalItemsAreAllowedByDefault.AdditionalItemsAreAllowedByDefault1BoxedBoolean](#additionalitemsareallowedbydefault1boxedboolean)
boxed class to store validated boolean payloads | +| record | [AdditionalItemsAreAllowedByDefault.AdditionalItemsAreAllowedByDefault1BoxedNumber](#additionalitemsareallowedbydefault1boxednumber)
boxed class to store validated Number payloads | +| record | [AdditionalItemsAreAllowedByDefault.AdditionalItemsAreAllowedByDefault1BoxedString](#additionalitemsareallowedbydefault1boxedstring)
boxed class to store validated String payloads | +| record | [AdditionalItemsAreAllowedByDefault.AdditionalItemsAreAllowedByDefault1BoxedList](#additionalitemsareallowedbydefault1boxedlist)
boxed class to store validated List payloads | +| record | [AdditionalItemsAreAllowedByDefault.AdditionalItemsAreAllowedByDefault1BoxedMap](#additionalitemsareallowedbydefault1boxedmap)
boxed class to store validated Map payloads | | static class | [AdditionalItemsAreAllowedByDefault.AdditionalItemsAreAllowedByDefault1](#additionalitemsareallowedbydefault1)
schema class | -| static class | [AdditionalItemsAreAllowedByDefault.Schema0Boxed](#schema0boxed)
abstract sealed validated payload class | -| static class | [AdditionalItemsAreAllowedByDefault.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | +| sealed interface | [AdditionalItemsAreAllowedByDefault.Schema0Boxed](#schema0boxed)
sealed interface for validated payloads | +| record | [AdditionalItemsAreAllowedByDefault.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | | static class | [AdditionalItemsAreAllowedByDefault.Schema0](#schema0)
schema class | | static class | [AdditionalItemsAreAllowedByDefault.AdditionalItemsAreAllowedByDefaultListBuilder](#additionalitemsareallowedbydefaultlistbuilder)
builder for List payloads | | static class | [AdditionalItemsAreAllowedByDefault.AdditionalItemsAreAllowedByDefaultList](#additionalitemsareallowedbydefaultlist)
output class for List payloads | ## AdditionalItemsAreAllowedByDefault1Boxed -public static abstract sealed class AdditionalItemsAreAllowedByDefault1Boxed
+public sealed interface AdditionalItemsAreAllowedByDefault1Boxed
permits
[AdditionalItemsAreAllowedByDefault1BoxedVoid](#additionalitemsareallowedbydefault1boxedvoid), [AdditionalItemsAreAllowedByDefault1BoxedBoolean](#additionalitemsareallowedbydefault1boxedboolean), @@ -36,103 +36,109 @@ permits
[AdditionalItemsAreAllowedByDefault1BoxedList](#additionalitemsareallowedbydefault1boxedlist), [AdditionalItemsAreAllowedByDefault1BoxedMap](#additionalitemsareallowedbydefault1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AdditionalItemsAreAllowedByDefault1BoxedVoid -public static final class AdditionalItemsAreAllowedByDefault1BoxedVoid
-extends [AdditionalItemsAreAllowedByDefault1Boxed](#additionalitemsareallowedbydefault1boxed) +public record AdditionalItemsAreAllowedByDefault1BoxedVoid
+implements [AdditionalItemsAreAllowedByDefault1Boxed](#additionalitemsareallowedbydefault1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalItemsAreAllowedByDefault1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalItemsAreAllowedByDefault1BoxedBoolean -public static final class AdditionalItemsAreAllowedByDefault1BoxedBoolean
-extends [AdditionalItemsAreAllowedByDefault1Boxed](#additionalitemsareallowedbydefault1boxed) +public record AdditionalItemsAreAllowedByDefault1BoxedBoolean
+implements [AdditionalItemsAreAllowedByDefault1Boxed](#additionalitemsareallowedbydefault1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalItemsAreAllowedByDefault1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalItemsAreAllowedByDefault1BoxedNumber -public static final class AdditionalItemsAreAllowedByDefault1BoxedNumber
-extends [AdditionalItemsAreAllowedByDefault1Boxed](#additionalitemsareallowedbydefault1boxed) +public record AdditionalItemsAreAllowedByDefault1BoxedNumber
+implements [AdditionalItemsAreAllowedByDefault1Boxed](#additionalitemsareallowedbydefault1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalItemsAreAllowedByDefault1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalItemsAreAllowedByDefault1BoxedString -public static final class AdditionalItemsAreAllowedByDefault1BoxedString
-extends [AdditionalItemsAreAllowedByDefault1Boxed](#additionalitemsareallowedbydefault1boxed) +public record AdditionalItemsAreAllowedByDefault1BoxedString
+implements [AdditionalItemsAreAllowedByDefault1Boxed](#additionalitemsareallowedbydefault1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalItemsAreAllowedByDefault1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalItemsAreAllowedByDefault1BoxedList -public static final class AdditionalItemsAreAllowedByDefault1BoxedList
-extends [AdditionalItemsAreAllowedByDefault1Boxed](#additionalitemsareallowedbydefault1boxed) +public record AdditionalItemsAreAllowedByDefault1BoxedList
+implements [AdditionalItemsAreAllowedByDefault1Boxed](#additionalitemsareallowedbydefault1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalItemsAreAllowedByDefault1BoxedList([AdditionalItemsAreAllowedByDefaultList](#additionalitemsareallowedbydefaultlist) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [AdditionalItemsAreAllowedByDefaultList](#additionalitemsareallowedbydefaultlist) | data
validated payload | +| [AdditionalItemsAreAllowedByDefaultList](#additionalitemsareallowedbydefaultlist) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalItemsAreAllowedByDefault1BoxedMap -public static final class AdditionalItemsAreAllowedByDefault1BoxedMap
-extends [AdditionalItemsAreAllowedByDefault1Boxed](#additionalitemsareallowedbydefault1boxed) +public record AdditionalItemsAreAllowedByDefault1BoxedMap
+implements [AdditionalItemsAreAllowedByDefault1Boxed](#additionalitemsareallowedbydefault1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalItemsAreAllowedByDefault1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalItemsAreAllowedByDefault1 public static class AdditionalItemsAreAllowedByDefault1
@@ -164,29 +170,32 @@ A schema class that validates payloads | [AdditionalItemsAreAllowedByDefault1BoxedBoolean](#additionalitemsareallowedbydefault1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [AdditionalItemsAreAllowedByDefault1BoxedMap](#additionalitemsareallowedbydefault1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [AdditionalItemsAreAllowedByDefault1BoxedList](#additionalitemsareallowedbydefault1boxedlist) | validateAndBox([List](#additionalitemsareallowedbydefaultlistbuilder) arg, SchemaConfiguration configuration) | +| [AdditionalItemsAreAllowedByDefault1Boxed](#additionalitemsareallowedbydefault1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema0Boxed -public static abstract sealed class Schema0Boxed
+public sealed interface Schema0Boxed
permits
[Schema0BoxedNumber](#schema0boxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema0BoxedNumber -public static final class Schema0BoxedNumber
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedNumber
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0 public static class Schema0
diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/AdditionalpropertiesAreAllowedByDefault.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/AdditionalpropertiesAreAllowedByDefault.md index 3d0102a4a24..b7e5ca27e35 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/AdditionalpropertiesAreAllowedByDefault.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/AdditionalpropertiesAreAllowedByDefault.md @@ -4,7 +4,7 @@ public class AdditionalpropertiesAreAllowedByDefault
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,35 +12,35 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [AdditionalpropertiesAreAllowedByDefault.AdditionalpropertiesAreAllowedByDefault1Boxed](#additionalpropertiesareallowedbydefault1boxed)
abstract sealed validated payload class | -| static class | [AdditionalpropertiesAreAllowedByDefault.AdditionalpropertiesAreAllowedByDefault1BoxedVoid](#additionalpropertiesareallowedbydefault1boxedvoid)
boxed class to store validated null payloads | -| static class | [AdditionalpropertiesAreAllowedByDefault.AdditionalpropertiesAreAllowedByDefault1BoxedBoolean](#additionalpropertiesareallowedbydefault1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [AdditionalpropertiesAreAllowedByDefault.AdditionalpropertiesAreAllowedByDefault1BoxedNumber](#additionalpropertiesareallowedbydefault1boxednumber)
boxed class to store validated Number payloads | -| static class | [AdditionalpropertiesAreAllowedByDefault.AdditionalpropertiesAreAllowedByDefault1BoxedString](#additionalpropertiesareallowedbydefault1boxedstring)
boxed class to store validated String payloads | -| static class | [AdditionalpropertiesAreAllowedByDefault.AdditionalpropertiesAreAllowedByDefault1BoxedList](#additionalpropertiesareallowedbydefault1boxedlist)
boxed class to store validated List payloads | -| static class | [AdditionalpropertiesAreAllowedByDefault.AdditionalpropertiesAreAllowedByDefault1BoxedMap](#additionalpropertiesareallowedbydefault1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AdditionalpropertiesAreAllowedByDefault.AdditionalpropertiesAreAllowedByDefault1Boxed](#additionalpropertiesareallowedbydefault1boxed)
sealed interface for validated payloads | +| record | [AdditionalpropertiesAreAllowedByDefault.AdditionalpropertiesAreAllowedByDefault1BoxedVoid](#additionalpropertiesareallowedbydefault1boxedvoid)
boxed class to store validated null payloads | +| record | [AdditionalpropertiesAreAllowedByDefault.AdditionalpropertiesAreAllowedByDefault1BoxedBoolean](#additionalpropertiesareallowedbydefault1boxedboolean)
boxed class to store validated boolean payloads | +| record | [AdditionalpropertiesAreAllowedByDefault.AdditionalpropertiesAreAllowedByDefault1BoxedNumber](#additionalpropertiesareallowedbydefault1boxednumber)
boxed class to store validated Number payloads | +| record | [AdditionalpropertiesAreAllowedByDefault.AdditionalpropertiesAreAllowedByDefault1BoxedString](#additionalpropertiesareallowedbydefault1boxedstring)
boxed class to store validated String payloads | +| record | [AdditionalpropertiesAreAllowedByDefault.AdditionalpropertiesAreAllowedByDefault1BoxedList](#additionalpropertiesareallowedbydefault1boxedlist)
boxed class to store validated List payloads | +| record | [AdditionalpropertiesAreAllowedByDefault.AdditionalpropertiesAreAllowedByDefault1BoxedMap](#additionalpropertiesareallowedbydefault1boxedmap)
boxed class to store validated Map payloads | | static class | [AdditionalpropertiesAreAllowedByDefault.AdditionalpropertiesAreAllowedByDefault1](#additionalpropertiesareallowedbydefault1)
schema class | | static class | [AdditionalpropertiesAreAllowedByDefault.AdditionalpropertiesAreAllowedByDefaultMapBuilder](#additionalpropertiesareallowedbydefaultmapbuilder)
builder for Map payloads | | static class | [AdditionalpropertiesAreAllowedByDefault.AdditionalpropertiesAreAllowedByDefaultMap](#additionalpropertiesareallowedbydefaultmap)
output class for Map payloads | -| static class | [AdditionalpropertiesAreAllowedByDefault.BarBoxed](#barboxed)
abstract sealed validated payload class | -| static class | [AdditionalpropertiesAreAllowedByDefault.BarBoxedVoid](#barboxedvoid)
boxed class to store validated null payloads | -| static class | [AdditionalpropertiesAreAllowedByDefault.BarBoxedBoolean](#barboxedboolean)
boxed class to store validated boolean payloads | -| static class | [AdditionalpropertiesAreAllowedByDefault.BarBoxedNumber](#barboxednumber)
boxed class to store validated Number payloads | -| static class | [AdditionalpropertiesAreAllowedByDefault.BarBoxedString](#barboxedstring)
boxed class to store validated String payloads | -| static class | [AdditionalpropertiesAreAllowedByDefault.BarBoxedList](#barboxedlist)
boxed class to store validated List payloads | -| static class | [AdditionalpropertiesAreAllowedByDefault.BarBoxedMap](#barboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AdditionalpropertiesAreAllowedByDefault.BarBoxed](#barboxed)
sealed interface for validated payloads | +| record | [AdditionalpropertiesAreAllowedByDefault.BarBoxedVoid](#barboxedvoid)
boxed class to store validated null payloads | +| record | [AdditionalpropertiesAreAllowedByDefault.BarBoxedBoolean](#barboxedboolean)
boxed class to store validated boolean payloads | +| record | [AdditionalpropertiesAreAllowedByDefault.BarBoxedNumber](#barboxednumber)
boxed class to store validated Number payloads | +| record | [AdditionalpropertiesAreAllowedByDefault.BarBoxedString](#barboxedstring)
boxed class to store validated String payloads | +| record | [AdditionalpropertiesAreAllowedByDefault.BarBoxedList](#barboxedlist)
boxed class to store validated List payloads | +| record | [AdditionalpropertiesAreAllowedByDefault.BarBoxedMap](#barboxedmap)
boxed class to store validated Map payloads | | static class | [AdditionalpropertiesAreAllowedByDefault.Bar](#bar)
schema class | -| static class | [AdditionalpropertiesAreAllowedByDefault.FooBoxed](#fooboxed)
abstract sealed validated payload class | -| static class | [AdditionalpropertiesAreAllowedByDefault.FooBoxedVoid](#fooboxedvoid)
boxed class to store validated null payloads | -| static class | [AdditionalpropertiesAreAllowedByDefault.FooBoxedBoolean](#fooboxedboolean)
boxed class to store validated boolean payloads | -| static class | [AdditionalpropertiesAreAllowedByDefault.FooBoxedNumber](#fooboxednumber)
boxed class to store validated Number payloads | -| static class | [AdditionalpropertiesAreAllowedByDefault.FooBoxedString](#fooboxedstring)
boxed class to store validated String payloads | -| static class | [AdditionalpropertiesAreAllowedByDefault.FooBoxedList](#fooboxedlist)
boxed class to store validated List payloads | -| static class | [AdditionalpropertiesAreAllowedByDefault.FooBoxedMap](#fooboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AdditionalpropertiesAreAllowedByDefault.FooBoxed](#fooboxed)
sealed interface for validated payloads | +| record | [AdditionalpropertiesAreAllowedByDefault.FooBoxedVoid](#fooboxedvoid)
boxed class to store validated null payloads | +| record | [AdditionalpropertiesAreAllowedByDefault.FooBoxedBoolean](#fooboxedboolean)
boxed class to store validated boolean payloads | +| record | [AdditionalpropertiesAreAllowedByDefault.FooBoxedNumber](#fooboxednumber)
boxed class to store validated Number payloads | +| record | [AdditionalpropertiesAreAllowedByDefault.FooBoxedString](#fooboxedstring)
boxed class to store validated String payloads | +| record | [AdditionalpropertiesAreAllowedByDefault.FooBoxedList](#fooboxedlist)
boxed class to store validated List payloads | +| record | [AdditionalpropertiesAreAllowedByDefault.FooBoxedMap](#fooboxedmap)
boxed class to store validated Map payloads | | static class | [AdditionalpropertiesAreAllowedByDefault.Foo](#foo)
schema class | ## AdditionalpropertiesAreAllowedByDefault1Boxed -public static abstract sealed class AdditionalpropertiesAreAllowedByDefault1Boxed
+public sealed interface AdditionalpropertiesAreAllowedByDefault1Boxed
permits
[AdditionalpropertiesAreAllowedByDefault1BoxedVoid](#additionalpropertiesareallowedbydefault1boxedvoid), [AdditionalpropertiesAreAllowedByDefault1BoxedBoolean](#additionalpropertiesareallowedbydefault1boxedboolean), @@ -49,103 +49,109 @@ permits
[AdditionalpropertiesAreAllowedByDefault1BoxedList](#additionalpropertiesareallowedbydefault1boxedlist), [AdditionalpropertiesAreAllowedByDefault1BoxedMap](#additionalpropertiesareallowedbydefault1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AdditionalpropertiesAreAllowedByDefault1BoxedVoid -public static final class AdditionalpropertiesAreAllowedByDefault1BoxedVoid
-extends [AdditionalpropertiesAreAllowedByDefault1Boxed](#additionalpropertiesareallowedbydefault1boxed) +public record AdditionalpropertiesAreAllowedByDefault1BoxedVoid
+implements [AdditionalpropertiesAreAllowedByDefault1Boxed](#additionalpropertiesareallowedbydefault1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalpropertiesAreAllowedByDefault1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalpropertiesAreAllowedByDefault1BoxedBoolean -public static final class AdditionalpropertiesAreAllowedByDefault1BoxedBoolean
-extends [AdditionalpropertiesAreAllowedByDefault1Boxed](#additionalpropertiesareallowedbydefault1boxed) +public record AdditionalpropertiesAreAllowedByDefault1BoxedBoolean
+implements [AdditionalpropertiesAreAllowedByDefault1Boxed](#additionalpropertiesareallowedbydefault1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalpropertiesAreAllowedByDefault1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalpropertiesAreAllowedByDefault1BoxedNumber -public static final class AdditionalpropertiesAreAllowedByDefault1BoxedNumber
-extends [AdditionalpropertiesAreAllowedByDefault1Boxed](#additionalpropertiesareallowedbydefault1boxed) +public record AdditionalpropertiesAreAllowedByDefault1BoxedNumber
+implements [AdditionalpropertiesAreAllowedByDefault1Boxed](#additionalpropertiesareallowedbydefault1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalpropertiesAreAllowedByDefault1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalpropertiesAreAllowedByDefault1BoxedString -public static final class AdditionalpropertiesAreAllowedByDefault1BoxedString
-extends [AdditionalpropertiesAreAllowedByDefault1Boxed](#additionalpropertiesareallowedbydefault1boxed) +public record AdditionalpropertiesAreAllowedByDefault1BoxedString
+implements [AdditionalpropertiesAreAllowedByDefault1Boxed](#additionalpropertiesareallowedbydefault1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalpropertiesAreAllowedByDefault1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalpropertiesAreAllowedByDefault1BoxedList -public static final class AdditionalpropertiesAreAllowedByDefault1BoxedList
-extends [AdditionalpropertiesAreAllowedByDefault1Boxed](#additionalpropertiesareallowedbydefault1boxed) +public record AdditionalpropertiesAreAllowedByDefault1BoxedList
+implements [AdditionalpropertiesAreAllowedByDefault1Boxed](#additionalpropertiesareallowedbydefault1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalpropertiesAreAllowedByDefault1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalpropertiesAreAllowedByDefault1BoxedMap -public static final class AdditionalpropertiesAreAllowedByDefault1BoxedMap
-extends [AdditionalpropertiesAreAllowedByDefault1Boxed](#additionalpropertiesareallowedbydefault1boxed) +public record AdditionalpropertiesAreAllowedByDefault1BoxedMap
+implements [AdditionalpropertiesAreAllowedByDefault1Boxed](#additionalpropertiesareallowedbydefault1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalpropertiesAreAllowedByDefault1BoxedMap([AdditionalpropertiesAreAllowedByDefaultMap](#additionalpropertiesareallowedbydefaultmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [AdditionalpropertiesAreAllowedByDefaultMap](#additionalpropertiesareallowedbydefaultmap) | data
validated payload | +| [AdditionalpropertiesAreAllowedByDefaultMap](#additionalpropertiesareallowedbydefaultmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalpropertiesAreAllowedByDefault1 public static class AdditionalpropertiesAreAllowedByDefault1
@@ -177,7 +183,9 @@ A schema class that validates payloads | [AdditionalpropertiesAreAllowedByDefault1BoxedBoolean](#additionalpropertiesareallowedbydefault1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [AdditionalpropertiesAreAllowedByDefault1BoxedMap](#additionalpropertiesareallowedbydefault1boxedmap) | validateAndBox([Map<?, ?>](#additionalpropertiesareallowedbydefaultmapbuilder) arg, SchemaConfiguration configuration) | | [AdditionalpropertiesAreAllowedByDefault1BoxedList](#additionalpropertiesareallowedbydefault1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [AdditionalpropertiesAreAllowedByDefault1Boxed](#additionalpropertiesareallowedbydefault1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## AdditionalpropertiesAreAllowedByDefaultMapBuilder public class AdditionalpropertiesAreAllowedByDefaultMapBuilder
builder for `Map` @@ -236,7 +244,7 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## BarBoxed -public static abstract sealed class BarBoxed
+public sealed interface BarBoxed
permits
[BarBoxedVoid](#barboxedvoid), [BarBoxedBoolean](#barboxedboolean), @@ -245,103 +253,109 @@ permits
[BarBoxedList](#barboxedlist), [BarBoxedMap](#barboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## BarBoxedVoid -public static final class BarBoxedVoid
-extends [BarBoxed](#barboxed) +public record BarBoxedVoid
+implements [BarBoxed](#barboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BarBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## BarBoxedBoolean -public static final class BarBoxedBoolean
-extends [BarBoxed](#barboxed) +public record BarBoxedBoolean
+implements [BarBoxed](#barboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BarBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## BarBoxedNumber -public static final class BarBoxedNumber
-extends [BarBoxed](#barboxed) +public record BarBoxedNumber
+implements [BarBoxed](#barboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BarBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## BarBoxedString -public static final class BarBoxedString
-extends [BarBoxed](#barboxed) +public record BarBoxedString
+implements [BarBoxed](#barboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BarBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## BarBoxedList -public static final class BarBoxedList
-extends [BarBoxed](#barboxed) +public record BarBoxedList
+implements [BarBoxed](#barboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BarBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## BarBoxedMap -public static final class BarBoxedMap
-extends [BarBoxed](#barboxed) +public record BarBoxedMap
+implements [BarBoxed](#barboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BarBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Bar public static class Bar
@@ -355,7 +369,7 @@ A schema class that validates payloads | validateAndBox | ## FooBoxed -public static abstract sealed class FooBoxed
+public sealed interface FooBoxed
permits
[FooBoxedVoid](#fooboxedvoid), [FooBoxedBoolean](#fooboxedboolean), @@ -364,103 +378,109 @@ permits
[FooBoxedList](#fooboxedlist), [FooBoxedMap](#fooboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## FooBoxedVoid -public static final class FooBoxedVoid
-extends [FooBoxed](#fooboxed) +public record FooBoxedVoid
+implements [FooBoxed](#fooboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FooBoxedBoolean -public static final class FooBoxedBoolean
-extends [FooBoxed](#fooboxed) +public record FooBoxedBoolean
+implements [FooBoxed](#fooboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FooBoxedNumber -public static final class FooBoxedNumber
-extends [FooBoxed](#fooboxed) +public record FooBoxedNumber
+implements [FooBoxed](#fooboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FooBoxedString -public static final class FooBoxedString
-extends [FooBoxed](#fooboxed) +public record FooBoxedString
+implements [FooBoxed](#fooboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FooBoxedList -public static final class FooBoxedList
-extends [FooBoxed](#fooboxed) +public record FooBoxedList
+implements [FooBoxed](#fooboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FooBoxedMap -public static final class FooBoxedMap
-extends [FooBoxed](#fooboxed) +public record FooBoxedMap
+implements [FooBoxed](#fooboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Foo public static class Foo
diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/AdditionalpropertiesCanExistByItself.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/AdditionalpropertiesCanExistByItself.md index 159c5b6a253..b2488de4fd8 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/AdditionalpropertiesCanExistByItself.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/AdditionalpropertiesCanExistByItself.md @@ -4,7 +4,7 @@ public class AdditionalpropertiesCanExistByItself
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,37 +12,38 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [AdditionalpropertiesCanExistByItself.AdditionalpropertiesCanExistByItself1Boxed](#additionalpropertiescanexistbyitself1boxed)
abstract sealed validated payload class | -| static class | [AdditionalpropertiesCanExistByItself.AdditionalpropertiesCanExistByItself1BoxedMap](#additionalpropertiescanexistbyitself1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AdditionalpropertiesCanExistByItself.AdditionalpropertiesCanExistByItself1Boxed](#additionalpropertiescanexistbyitself1boxed)
sealed interface for validated payloads | +| record | [AdditionalpropertiesCanExistByItself.AdditionalpropertiesCanExistByItself1BoxedMap](#additionalpropertiescanexistbyitself1boxedmap)
boxed class to store validated Map payloads | | static class | [AdditionalpropertiesCanExistByItself.AdditionalpropertiesCanExistByItself1](#additionalpropertiescanexistbyitself1)
schema class | | static class | [AdditionalpropertiesCanExistByItself.AdditionalpropertiesCanExistByItselfMapBuilder](#additionalpropertiescanexistbyitselfmapbuilder)
builder for Map payloads | | static class | [AdditionalpropertiesCanExistByItself.AdditionalpropertiesCanExistByItselfMap](#additionalpropertiescanexistbyitselfmap)
output class for Map payloads | -| static class | [AdditionalpropertiesCanExistByItself.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
abstract sealed validated payload class | -| static class | [AdditionalpropertiesCanExistByItself.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | +| sealed interface | [AdditionalpropertiesCanExistByItself.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
sealed interface for validated payloads | +| record | [AdditionalpropertiesCanExistByItself.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | | static class | [AdditionalpropertiesCanExistByItself.AdditionalProperties](#additionalproperties)
schema class | ## AdditionalpropertiesCanExistByItself1Boxed -public static abstract sealed class AdditionalpropertiesCanExistByItself1Boxed
+public sealed interface AdditionalpropertiesCanExistByItself1Boxed
permits
[AdditionalpropertiesCanExistByItself1BoxedMap](#additionalpropertiescanexistbyitself1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AdditionalpropertiesCanExistByItself1BoxedMap -public static final class AdditionalpropertiesCanExistByItself1BoxedMap
-extends [AdditionalpropertiesCanExistByItself1Boxed](#additionalpropertiescanexistbyitself1boxed) +public record AdditionalpropertiesCanExistByItself1BoxedMap
+implements [AdditionalpropertiesCanExistByItself1Boxed](#additionalpropertiescanexistbyitself1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalpropertiesCanExistByItself1BoxedMap([AdditionalpropertiesCanExistByItselfMap](#additionalpropertiescanexistbyitselfmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [AdditionalpropertiesCanExistByItselfMap](#additionalpropertiescanexistbyitselfmap) | data
validated payload | +| [AdditionalpropertiesCanExistByItselfMap](#additionalpropertiescanexistbyitselfmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalpropertiesCanExistByItself1 public static class AdditionalpropertiesCanExistByItself1
@@ -87,7 +88,9 @@ AdditionalpropertiesCanExistByItself.AdditionalpropertiesCanExistByItselfMap val | ----------------- | ---------------------- | | [AdditionalpropertiesCanExistByItselfMap](#additionalpropertiescanexistbyitselfmap) | validate([Map<?, ?>](#additionalpropertiescanexistbyitselfmapbuilder) arg, SchemaConfiguration configuration) | | [AdditionalpropertiesCanExistByItself1BoxedMap](#additionalpropertiescanexistbyitself1boxedmap) | validateAndBox([Map<?, ?>](#additionalpropertiescanexistbyitselfmapbuilder) arg, SchemaConfiguration configuration) | +| [AdditionalpropertiesCanExistByItself1Boxed](#additionalpropertiescanexistbyitself1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## AdditionalpropertiesCanExistByItselfMapBuilder public class AdditionalpropertiesCanExistByItselfMapBuilder
builder for `Map` @@ -118,27 +121,28 @@ A class to store validated Map payloads | boolean | getAdditionalProperty(String name)
provides type safety for additional properties | ## AdditionalPropertiesBoxed -public static abstract sealed class AdditionalPropertiesBoxed
+public sealed interface AdditionalPropertiesBoxed
permits
[AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AdditionalPropertiesBoxedBoolean -public static final class AdditionalPropertiesBoxedBoolean
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedBoolean
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalProperties public static class AdditionalProperties
diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/AdditionalpropertiesDoesNotLookInApplicators.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/AdditionalpropertiesDoesNotLookInApplicators.md index dbdf5ac09cb..d76f03d1168 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/AdditionalpropertiesDoesNotLookInApplicators.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/AdditionalpropertiesDoesNotLookInApplicators.md @@ -4,7 +4,7 @@ public class AdditionalpropertiesDoesNotLookInApplicators
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,40 +12,40 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [AdditionalpropertiesDoesNotLookInApplicators.AdditionalpropertiesDoesNotLookInApplicators1Boxed](#additionalpropertiesdoesnotlookinapplicators1boxed)
abstract sealed validated payload class | -| static class | [AdditionalpropertiesDoesNotLookInApplicators.AdditionalpropertiesDoesNotLookInApplicators1BoxedVoid](#additionalpropertiesdoesnotlookinapplicators1boxedvoid)
boxed class to store validated null payloads | -| static class | [AdditionalpropertiesDoesNotLookInApplicators.AdditionalpropertiesDoesNotLookInApplicators1BoxedBoolean](#additionalpropertiesdoesnotlookinapplicators1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [AdditionalpropertiesDoesNotLookInApplicators.AdditionalpropertiesDoesNotLookInApplicators1BoxedNumber](#additionalpropertiesdoesnotlookinapplicators1boxednumber)
boxed class to store validated Number payloads | -| static class | [AdditionalpropertiesDoesNotLookInApplicators.AdditionalpropertiesDoesNotLookInApplicators1BoxedString](#additionalpropertiesdoesnotlookinapplicators1boxedstring)
boxed class to store validated String payloads | -| static class | [AdditionalpropertiesDoesNotLookInApplicators.AdditionalpropertiesDoesNotLookInApplicators1BoxedList](#additionalpropertiesdoesnotlookinapplicators1boxedlist)
boxed class to store validated List payloads | -| static class | [AdditionalpropertiesDoesNotLookInApplicators.AdditionalpropertiesDoesNotLookInApplicators1BoxedMap](#additionalpropertiesdoesnotlookinapplicators1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AdditionalpropertiesDoesNotLookInApplicators.AdditionalpropertiesDoesNotLookInApplicators1Boxed](#additionalpropertiesdoesnotlookinapplicators1boxed)
sealed interface for validated payloads | +| record | [AdditionalpropertiesDoesNotLookInApplicators.AdditionalpropertiesDoesNotLookInApplicators1BoxedVoid](#additionalpropertiesdoesnotlookinapplicators1boxedvoid)
boxed class to store validated null payloads | +| record | [AdditionalpropertiesDoesNotLookInApplicators.AdditionalpropertiesDoesNotLookInApplicators1BoxedBoolean](#additionalpropertiesdoesnotlookinapplicators1boxedboolean)
boxed class to store validated boolean payloads | +| record | [AdditionalpropertiesDoesNotLookInApplicators.AdditionalpropertiesDoesNotLookInApplicators1BoxedNumber](#additionalpropertiesdoesnotlookinapplicators1boxednumber)
boxed class to store validated Number payloads | +| record | [AdditionalpropertiesDoesNotLookInApplicators.AdditionalpropertiesDoesNotLookInApplicators1BoxedString](#additionalpropertiesdoesnotlookinapplicators1boxedstring)
boxed class to store validated String payloads | +| record | [AdditionalpropertiesDoesNotLookInApplicators.AdditionalpropertiesDoesNotLookInApplicators1BoxedList](#additionalpropertiesdoesnotlookinapplicators1boxedlist)
boxed class to store validated List payloads | +| record | [AdditionalpropertiesDoesNotLookInApplicators.AdditionalpropertiesDoesNotLookInApplicators1BoxedMap](#additionalpropertiesdoesnotlookinapplicators1boxedmap)
boxed class to store validated Map payloads | | static class | [AdditionalpropertiesDoesNotLookInApplicators.AdditionalpropertiesDoesNotLookInApplicators1](#additionalpropertiesdoesnotlookinapplicators1)
schema class | | static class | [AdditionalpropertiesDoesNotLookInApplicators.AdditionalpropertiesDoesNotLookInApplicatorsMapBuilder](#additionalpropertiesdoesnotlookinapplicatorsmapbuilder)
builder for Map payloads | | static class | [AdditionalpropertiesDoesNotLookInApplicators.AdditionalpropertiesDoesNotLookInApplicatorsMap](#additionalpropertiesdoesnotlookinapplicatorsmap)
output class for Map payloads | -| static class | [AdditionalpropertiesDoesNotLookInApplicators.Schema0Boxed](#schema0boxed)
abstract sealed validated payload class | -| static class | [AdditionalpropertiesDoesNotLookInApplicators.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | -| static class | [AdditionalpropertiesDoesNotLookInApplicators.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | -| static class | [AdditionalpropertiesDoesNotLookInApplicators.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | -| static class | [AdditionalpropertiesDoesNotLookInApplicators.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | -| static class | [AdditionalpropertiesDoesNotLookInApplicators.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | -| static class | [AdditionalpropertiesDoesNotLookInApplicators.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AdditionalpropertiesDoesNotLookInApplicators.Schema0Boxed](#schema0boxed)
sealed interface for validated payloads | +| record | [AdditionalpropertiesDoesNotLookInApplicators.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | +| record | [AdditionalpropertiesDoesNotLookInApplicators.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | +| record | [AdditionalpropertiesDoesNotLookInApplicators.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | +| record | [AdditionalpropertiesDoesNotLookInApplicators.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | +| record | [AdditionalpropertiesDoesNotLookInApplicators.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | +| record | [AdditionalpropertiesDoesNotLookInApplicators.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | | static class | [AdditionalpropertiesDoesNotLookInApplicators.Schema0](#schema0)
schema class | | static class | [AdditionalpropertiesDoesNotLookInApplicators.Schema0MapBuilder](#schema0mapbuilder)
builder for Map payloads | | static class | [AdditionalpropertiesDoesNotLookInApplicators.Schema0Map](#schema0map)
output class for Map payloads | -| static class | [AdditionalpropertiesDoesNotLookInApplicators.FooBoxed](#fooboxed)
abstract sealed validated payload class | -| static class | [AdditionalpropertiesDoesNotLookInApplicators.FooBoxedVoid](#fooboxedvoid)
boxed class to store validated null payloads | -| static class | [AdditionalpropertiesDoesNotLookInApplicators.FooBoxedBoolean](#fooboxedboolean)
boxed class to store validated boolean payloads | -| static class | [AdditionalpropertiesDoesNotLookInApplicators.FooBoxedNumber](#fooboxednumber)
boxed class to store validated Number payloads | -| static class | [AdditionalpropertiesDoesNotLookInApplicators.FooBoxedString](#fooboxedstring)
boxed class to store validated String payloads | -| static class | [AdditionalpropertiesDoesNotLookInApplicators.FooBoxedList](#fooboxedlist)
boxed class to store validated List payloads | -| static class | [AdditionalpropertiesDoesNotLookInApplicators.FooBoxedMap](#fooboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AdditionalpropertiesDoesNotLookInApplicators.FooBoxed](#fooboxed)
sealed interface for validated payloads | +| record | [AdditionalpropertiesDoesNotLookInApplicators.FooBoxedVoid](#fooboxedvoid)
boxed class to store validated null payloads | +| record | [AdditionalpropertiesDoesNotLookInApplicators.FooBoxedBoolean](#fooboxedboolean)
boxed class to store validated boolean payloads | +| record | [AdditionalpropertiesDoesNotLookInApplicators.FooBoxedNumber](#fooboxednumber)
boxed class to store validated Number payloads | +| record | [AdditionalpropertiesDoesNotLookInApplicators.FooBoxedString](#fooboxedstring)
boxed class to store validated String payloads | +| record | [AdditionalpropertiesDoesNotLookInApplicators.FooBoxedList](#fooboxedlist)
boxed class to store validated List payloads | +| record | [AdditionalpropertiesDoesNotLookInApplicators.FooBoxedMap](#fooboxedmap)
boxed class to store validated Map payloads | | static class | [AdditionalpropertiesDoesNotLookInApplicators.Foo](#foo)
schema class | -| static class | [AdditionalpropertiesDoesNotLookInApplicators.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
abstract sealed validated payload class | -| static class | [AdditionalpropertiesDoesNotLookInApplicators.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | +| sealed interface | [AdditionalpropertiesDoesNotLookInApplicators.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
sealed interface for validated payloads | +| record | [AdditionalpropertiesDoesNotLookInApplicators.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | | static class | [AdditionalpropertiesDoesNotLookInApplicators.AdditionalProperties](#additionalproperties)
schema class | ## AdditionalpropertiesDoesNotLookInApplicators1Boxed -public static abstract sealed class AdditionalpropertiesDoesNotLookInApplicators1Boxed
+public sealed interface AdditionalpropertiesDoesNotLookInApplicators1Boxed
permits
[AdditionalpropertiesDoesNotLookInApplicators1BoxedVoid](#additionalpropertiesdoesnotlookinapplicators1boxedvoid), [AdditionalpropertiesDoesNotLookInApplicators1BoxedBoolean](#additionalpropertiesdoesnotlookinapplicators1boxedboolean), @@ -54,103 +54,109 @@ permits
[AdditionalpropertiesDoesNotLookInApplicators1BoxedList](#additionalpropertiesdoesnotlookinapplicators1boxedlist), [AdditionalpropertiesDoesNotLookInApplicators1BoxedMap](#additionalpropertiesdoesnotlookinapplicators1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AdditionalpropertiesDoesNotLookInApplicators1BoxedVoid -public static final class AdditionalpropertiesDoesNotLookInApplicators1BoxedVoid
-extends [AdditionalpropertiesDoesNotLookInApplicators1Boxed](#additionalpropertiesdoesnotlookinapplicators1boxed) +public record AdditionalpropertiesDoesNotLookInApplicators1BoxedVoid
+implements [AdditionalpropertiesDoesNotLookInApplicators1Boxed](#additionalpropertiesdoesnotlookinapplicators1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalpropertiesDoesNotLookInApplicators1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalpropertiesDoesNotLookInApplicators1BoxedBoolean -public static final class AdditionalpropertiesDoesNotLookInApplicators1BoxedBoolean
-extends [AdditionalpropertiesDoesNotLookInApplicators1Boxed](#additionalpropertiesdoesnotlookinapplicators1boxed) +public record AdditionalpropertiesDoesNotLookInApplicators1BoxedBoolean
+implements [AdditionalpropertiesDoesNotLookInApplicators1Boxed](#additionalpropertiesdoesnotlookinapplicators1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalpropertiesDoesNotLookInApplicators1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalpropertiesDoesNotLookInApplicators1BoxedNumber -public static final class AdditionalpropertiesDoesNotLookInApplicators1BoxedNumber
-extends [AdditionalpropertiesDoesNotLookInApplicators1Boxed](#additionalpropertiesdoesnotlookinapplicators1boxed) +public record AdditionalpropertiesDoesNotLookInApplicators1BoxedNumber
+implements [AdditionalpropertiesDoesNotLookInApplicators1Boxed](#additionalpropertiesdoesnotlookinapplicators1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalpropertiesDoesNotLookInApplicators1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalpropertiesDoesNotLookInApplicators1BoxedString -public static final class AdditionalpropertiesDoesNotLookInApplicators1BoxedString
-extends [AdditionalpropertiesDoesNotLookInApplicators1Boxed](#additionalpropertiesdoesnotlookinapplicators1boxed) +public record AdditionalpropertiesDoesNotLookInApplicators1BoxedString
+implements [AdditionalpropertiesDoesNotLookInApplicators1Boxed](#additionalpropertiesdoesnotlookinapplicators1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalpropertiesDoesNotLookInApplicators1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalpropertiesDoesNotLookInApplicators1BoxedList -public static final class AdditionalpropertiesDoesNotLookInApplicators1BoxedList
-extends [AdditionalpropertiesDoesNotLookInApplicators1Boxed](#additionalpropertiesdoesnotlookinapplicators1boxed) +public record AdditionalpropertiesDoesNotLookInApplicators1BoxedList
+implements [AdditionalpropertiesDoesNotLookInApplicators1Boxed](#additionalpropertiesdoesnotlookinapplicators1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalpropertiesDoesNotLookInApplicators1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalpropertiesDoesNotLookInApplicators1BoxedMap -public static final class AdditionalpropertiesDoesNotLookInApplicators1BoxedMap
-extends [AdditionalpropertiesDoesNotLookInApplicators1Boxed](#additionalpropertiesdoesnotlookinapplicators1boxed) +public record AdditionalpropertiesDoesNotLookInApplicators1BoxedMap
+implements [AdditionalpropertiesDoesNotLookInApplicators1Boxed](#additionalpropertiesdoesnotlookinapplicators1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalpropertiesDoesNotLookInApplicators1BoxedMap([AdditionalpropertiesDoesNotLookInApplicatorsMap](#additionalpropertiesdoesnotlookinapplicatorsmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [AdditionalpropertiesDoesNotLookInApplicatorsMap](#additionalpropertiesdoesnotlookinapplicatorsmap) | data
validated payload | +| [AdditionalpropertiesDoesNotLookInApplicatorsMap](#additionalpropertiesdoesnotlookinapplicatorsmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalpropertiesDoesNotLookInApplicators1 public static class AdditionalpropertiesDoesNotLookInApplicators1
@@ -183,7 +189,9 @@ A schema class that validates payloads | [AdditionalpropertiesDoesNotLookInApplicators1BoxedBoolean](#additionalpropertiesdoesnotlookinapplicators1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [AdditionalpropertiesDoesNotLookInApplicators1BoxedMap](#additionalpropertiesdoesnotlookinapplicators1boxedmap) | validateAndBox([Map<?, ?>](#additionalpropertiesdoesnotlookinapplicatorsmapbuilder) arg, SchemaConfiguration configuration) | | [AdditionalpropertiesDoesNotLookInApplicators1BoxedList](#additionalpropertiesdoesnotlookinapplicators1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [AdditionalpropertiesDoesNotLookInApplicators1Boxed](#additionalpropertiesdoesnotlookinapplicators1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## AdditionalpropertiesDoesNotLookInApplicatorsMapBuilder public class AdditionalpropertiesDoesNotLookInApplicatorsMapBuilder
builder for `Map` @@ -214,7 +222,7 @@ A class to store validated Map payloads | boolean | getAdditionalProperty(String name)
provides type safety for additional properties | ## Schema0Boxed -public static abstract sealed class Schema0Boxed
+public sealed interface Schema0Boxed
permits
[Schema0BoxedVoid](#schema0boxedvoid), [Schema0BoxedBoolean](#schema0boxedboolean), @@ -223,103 +231,109 @@ permits
[Schema0BoxedList](#schema0boxedlist), [Schema0BoxedMap](#schema0boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema0BoxedVoid -public static final class Schema0BoxedVoid
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedVoid
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedBoolean -public static final class Schema0BoxedBoolean
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedBoolean
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedNumber -public static final class Schema0BoxedNumber
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedNumber
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedString -public static final class Schema0BoxedString
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedString
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedList -public static final class Schema0BoxedList
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedList
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedMap -public static final class Schema0BoxedMap
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedMap
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedMap([Schema0Map](#schema0map) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [Schema0Map](#schema0map) | data
validated payload | +| [Schema0Map](#schema0map) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0 public static class Schema0
@@ -351,7 +365,9 @@ A schema class that validates payloads | [Schema0BoxedBoolean](#schema0boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Schema0BoxedMap](#schema0boxedmap) | validateAndBox([Map<?, ?>](#schema0mapbuilder) arg, SchemaConfiguration configuration) | | [Schema0BoxedList](#schema0boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Schema0Boxed](#schema0boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema0MapBuilder public class Schema0MapBuilder
builder for `Map` @@ -400,7 +416,7 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## FooBoxed -public static abstract sealed class FooBoxed
+public sealed interface FooBoxed
permits
[FooBoxedVoid](#fooboxedvoid), [FooBoxedBoolean](#fooboxedboolean), @@ -409,103 +425,109 @@ permits
[FooBoxedList](#fooboxedlist), [FooBoxedMap](#fooboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## FooBoxedVoid -public static final class FooBoxedVoid
-extends [FooBoxed](#fooboxed) +public record FooBoxedVoid
+implements [FooBoxed](#fooboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FooBoxedBoolean -public static final class FooBoxedBoolean
-extends [FooBoxed](#fooboxed) +public record FooBoxedBoolean
+implements [FooBoxed](#fooboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FooBoxedNumber -public static final class FooBoxedNumber
-extends [FooBoxed](#fooboxed) +public record FooBoxedNumber
+implements [FooBoxed](#fooboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FooBoxedString -public static final class FooBoxedString
-extends [FooBoxed](#fooboxed) +public record FooBoxedString
+implements [FooBoxed](#fooboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FooBoxedList -public static final class FooBoxedList
-extends [FooBoxed](#fooboxed) +public record FooBoxedList
+implements [FooBoxed](#fooboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FooBoxedMap -public static final class FooBoxedMap
-extends [FooBoxed](#fooboxed) +public record FooBoxedMap
+implements [FooBoxed](#fooboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Foo public static class Foo
@@ -519,27 +541,28 @@ A schema class that validates payloads | validateAndBox | ## AdditionalPropertiesBoxed -public static abstract sealed class AdditionalPropertiesBoxed
+public sealed interface AdditionalPropertiesBoxed
permits
[AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AdditionalPropertiesBoxedBoolean -public static final class AdditionalPropertiesBoxedBoolean
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedBoolean
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalProperties public static class AdditionalProperties
diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/AdditionalpropertiesWithNullValuedInstanceProperties.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/AdditionalpropertiesWithNullValuedInstanceProperties.md index d23e8a28a1c..751eb1820fc 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/AdditionalpropertiesWithNullValuedInstanceProperties.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/AdditionalpropertiesWithNullValuedInstanceProperties.md @@ -4,7 +4,7 @@ public class AdditionalpropertiesWithNullValuedInstanceProperties
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,37 +12,38 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [AdditionalpropertiesWithNullValuedInstanceProperties.AdditionalpropertiesWithNullValuedInstanceProperties1Boxed](#additionalpropertieswithnullvaluedinstanceproperties1boxed)
abstract sealed validated payload class | -| static class | [AdditionalpropertiesWithNullValuedInstanceProperties.AdditionalpropertiesWithNullValuedInstanceProperties1BoxedMap](#additionalpropertieswithnullvaluedinstanceproperties1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AdditionalpropertiesWithNullValuedInstanceProperties.AdditionalpropertiesWithNullValuedInstanceProperties1Boxed](#additionalpropertieswithnullvaluedinstanceproperties1boxed)
sealed interface for validated payloads | +| record | [AdditionalpropertiesWithNullValuedInstanceProperties.AdditionalpropertiesWithNullValuedInstanceProperties1BoxedMap](#additionalpropertieswithnullvaluedinstanceproperties1boxedmap)
boxed class to store validated Map payloads | | static class | [AdditionalpropertiesWithNullValuedInstanceProperties.AdditionalpropertiesWithNullValuedInstanceProperties1](#additionalpropertieswithnullvaluedinstanceproperties1)
schema class | | static class | [AdditionalpropertiesWithNullValuedInstanceProperties.AdditionalpropertiesWithNullValuedInstancePropertiesMapBuilder](#additionalpropertieswithnullvaluedinstancepropertiesmapbuilder)
builder for Map payloads | | static class | [AdditionalpropertiesWithNullValuedInstanceProperties.AdditionalpropertiesWithNullValuedInstancePropertiesMap](#additionalpropertieswithnullvaluedinstancepropertiesmap)
output class for Map payloads | -| static class | [AdditionalpropertiesWithNullValuedInstanceProperties.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
abstract sealed validated payload class | -| static class | [AdditionalpropertiesWithNullValuedInstanceProperties.AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid)
boxed class to store validated null payloads | +| sealed interface | [AdditionalpropertiesWithNullValuedInstanceProperties.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
sealed interface for validated payloads | +| record | [AdditionalpropertiesWithNullValuedInstanceProperties.AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid)
boxed class to store validated null payloads | | static class | [AdditionalpropertiesWithNullValuedInstanceProperties.AdditionalProperties](#additionalproperties)
schema class | ## AdditionalpropertiesWithNullValuedInstanceProperties1Boxed -public static abstract sealed class AdditionalpropertiesWithNullValuedInstanceProperties1Boxed
+public sealed interface AdditionalpropertiesWithNullValuedInstanceProperties1Boxed
permits
[AdditionalpropertiesWithNullValuedInstanceProperties1BoxedMap](#additionalpropertieswithnullvaluedinstanceproperties1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AdditionalpropertiesWithNullValuedInstanceProperties1BoxedMap -public static final class AdditionalpropertiesWithNullValuedInstanceProperties1BoxedMap
-extends [AdditionalpropertiesWithNullValuedInstanceProperties1Boxed](#additionalpropertieswithnullvaluedinstanceproperties1boxed) +public record AdditionalpropertiesWithNullValuedInstanceProperties1BoxedMap
+implements [AdditionalpropertiesWithNullValuedInstanceProperties1Boxed](#additionalpropertieswithnullvaluedinstanceproperties1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalpropertiesWithNullValuedInstanceProperties1BoxedMap([AdditionalpropertiesWithNullValuedInstancePropertiesMap](#additionalpropertieswithnullvaluedinstancepropertiesmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [AdditionalpropertiesWithNullValuedInstancePropertiesMap](#additionalpropertieswithnullvaluedinstancepropertiesmap) | data
validated payload | +| [AdditionalpropertiesWithNullValuedInstancePropertiesMap](#additionalpropertieswithnullvaluedinstancepropertiesmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalpropertiesWithNullValuedInstanceProperties1 public static class AdditionalpropertiesWithNullValuedInstanceProperties1
@@ -87,7 +88,9 @@ AdditionalpropertiesWithNullValuedInstanceProperties.AdditionalpropertiesWithNul | ----------------- | ---------------------- | | [AdditionalpropertiesWithNullValuedInstancePropertiesMap](#additionalpropertieswithnullvaluedinstancepropertiesmap) | validate([Map<?, ?>](#additionalpropertieswithnullvaluedinstancepropertiesmapbuilder) arg, SchemaConfiguration configuration) | | [AdditionalpropertiesWithNullValuedInstanceProperties1BoxedMap](#additionalpropertieswithnullvaluedinstanceproperties1boxedmap) | validateAndBox([Map<?, ?>](#additionalpropertieswithnullvaluedinstancepropertiesmapbuilder) arg, SchemaConfiguration configuration) | +| [AdditionalpropertiesWithNullValuedInstanceProperties1Boxed](#additionalpropertieswithnullvaluedinstanceproperties1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## AdditionalpropertiesWithNullValuedInstancePropertiesMapBuilder public class AdditionalpropertiesWithNullValuedInstancePropertiesMapBuilder
builder for `Map` @@ -118,27 +121,28 @@ A class to store validated Map payloads | Void | getAdditionalProperty(String name)
provides type safety for additional properties | ## AdditionalPropertiesBoxed -public static abstract sealed class AdditionalPropertiesBoxed
+public sealed interface AdditionalPropertiesBoxed
permits
[AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AdditionalPropertiesBoxedVoid -public static final class AdditionalPropertiesBoxedVoid
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedVoid
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalProperties public static class AdditionalProperties
diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/AdditionalpropertiesWithSchema.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/AdditionalpropertiesWithSchema.md index bd1c2e3b15d..3566614cf82 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/AdditionalpropertiesWithSchema.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/AdditionalpropertiesWithSchema.md @@ -4,7 +4,7 @@ public class AdditionalpropertiesWithSchema
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,53 +12,54 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [AdditionalpropertiesWithSchema.AdditionalpropertiesWithSchema1Boxed](#additionalpropertieswithschema1boxed)
abstract sealed validated payload class | -| static class | [AdditionalpropertiesWithSchema.AdditionalpropertiesWithSchema1BoxedMap](#additionalpropertieswithschema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AdditionalpropertiesWithSchema.AdditionalpropertiesWithSchema1Boxed](#additionalpropertieswithschema1boxed)
sealed interface for validated payloads | +| record | [AdditionalpropertiesWithSchema.AdditionalpropertiesWithSchema1BoxedMap](#additionalpropertieswithschema1boxedmap)
boxed class to store validated Map payloads | | static class | [AdditionalpropertiesWithSchema.AdditionalpropertiesWithSchema1](#additionalpropertieswithschema1)
schema class | | static class | [AdditionalpropertiesWithSchema.AdditionalpropertiesWithSchemaMapBuilder](#additionalpropertieswithschemamapbuilder)
builder for Map payloads | | static class | [AdditionalpropertiesWithSchema.AdditionalpropertiesWithSchemaMap](#additionalpropertieswithschemamap)
output class for Map payloads | -| static class | [AdditionalpropertiesWithSchema.BarBoxed](#barboxed)
abstract sealed validated payload class | -| static class | [AdditionalpropertiesWithSchema.BarBoxedVoid](#barboxedvoid)
boxed class to store validated null payloads | -| static class | [AdditionalpropertiesWithSchema.BarBoxedBoolean](#barboxedboolean)
boxed class to store validated boolean payloads | -| static class | [AdditionalpropertiesWithSchema.BarBoxedNumber](#barboxednumber)
boxed class to store validated Number payloads | -| static class | [AdditionalpropertiesWithSchema.BarBoxedString](#barboxedstring)
boxed class to store validated String payloads | -| static class | [AdditionalpropertiesWithSchema.BarBoxedList](#barboxedlist)
boxed class to store validated List payloads | -| static class | [AdditionalpropertiesWithSchema.BarBoxedMap](#barboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AdditionalpropertiesWithSchema.BarBoxed](#barboxed)
sealed interface for validated payloads | +| record | [AdditionalpropertiesWithSchema.BarBoxedVoid](#barboxedvoid)
boxed class to store validated null payloads | +| record | [AdditionalpropertiesWithSchema.BarBoxedBoolean](#barboxedboolean)
boxed class to store validated boolean payloads | +| record | [AdditionalpropertiesWithSchema.BarBoxedNumber](#barboxednumber)
boxed class to store validated Number payloads | +| record | [AdditionalpropertiesWithSchema.BarBoxedString](#barboxedstring)
boxed class to store validated String payloads | +| record | [AdditionalpropertiesWithSchema.BarBoxedList](#barboxedlist)
boxed class to store validated List payloads | +| record | [AdditionalpropertiesWithSchema.BarBoxedMap](#barboxedmap)
boxed class to store validated Map payloads | | static class | [AdditionalpropertiesWithSchema.Bar](#bar)
schema class | -| static class | [AdditionalpropertiesWithSchema.FooBoxed](#fooboxed)
abstract sealed validated payload class | -| static class | [AdditionalpropertiesWithSchema.FooBoxedVoid](#fooboxedvoid)
boxed class to store validated null payloads | -| static class | [AdditionalpropertiesWithSchema.FooBoxedBoolean](#fooboxedboolean)
boxed class to store validated boolean payloads | -| static class | [AdditionalpropertiesWithSchema.FooBoxedNumber](#fooboxednumber)
boxed class to store validated Number payloads | -| static class | [AdditionalpropertiesWithSchema.FooBoxedString](#fooboxedstring)
boxed class to store validated String payloads | -| static class | [AdditionalpropertiesWithSchema.FooBoxedList](#fooboxedlist)
boxed class to store validated List payloads | -| static class | [AdditionalpropertiesWithSchema.FooBoxedMap](#fooboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AdditionalpropertiesWithSchema.FooBoxed](#fooboxed)
sealed interface for validated payloads | +| record | [AdditionalpropertiesWithSchema.FooBoxedVoid](#fooboxedvoid)
boxed class to store validated null payloads | +| record | [AdditionalpropertiesWithSchema.FooBoxedBoolean](#fooboxedboolean)
boxed class to store validated boolean payloads | +| record | [AdditionalpropertiesWithSchema.FooBoxedNumber](#fooboxednumber)
boxed class to store validated Number payloads | +| record | [AdditionalpropertiesWithSchema.FooBoxedString](#fooboxedstring)
boxed class to store validated String payloads | +| record | [AdditionalpropertiesWithSchema.FooBoxedList](#fooboxedlist)
boxed class to store validated List payloads | +| record | [AdditionalpropertiesWithSchema.FooBoxedMap](#fooboxedmap)
boxed class to store validated Map payloads | | static class | [AdditionalpropertiesWithSchema.Foo](#foo)
schema class | -| static class | [AdditionalpropertiesWithSchema.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
abstract sealed validated payload class | -| static class | [AdditionalpropertiesWithSchema.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | +| sealed interface | [AdditionalpropertiesWithSchema.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
sealed interface for validated payloads | +| record | [AdditionalpropertiesWithSchema.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | | static class | [AdditionalpropertiesWithSchema.AdditionalProperties](#additionalproperties)
schema class | ## AdditionalpropertiesWithSchema1Boxed -public static abstract sealed class AdditionalpropertiesWithSchema1Boxed
+public sealed interface AdditionalpropertiesWithSchema1Boxed
permits
[AdditionalpropertiesWithSchema1BoxedMap](#additionalpropertieswithschema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AdditionalpropertiesWithSchema1BoxedMap -public static final class AdditionalpropertiesWithSchema1BoxedMap
-extends [AdditionalpropertiesWithSchema1Boxed](#additionalpropertieswithschema1boxed) +public record AdditionalpropertiesWithSchema1BoxedMap
+implements [AdditionalpropertiesWithSchema1Boxed](#additionalpropertieswithschema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalpropertiesWithSchema1BoxedMap([AdditionalpropertiesWithSchemaMap](#additionalpropertieswithschemamap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [AdditionalpropertiesWithSchemaMap](#additionalpropertieswithschemamap) | data
validated payload | +| [AdditionalpropertiesWithSchemaMap](#additionalpropertieswithschemamap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalpropertiesWithSchema1 public static class AdditionalpropertiesWithSchema1
@@ -104,7 +105,9 @@ AdditionalpropertiesWithSchema.AdditionalpropertiesWithSchemaMap validatedPayloa | ----------------- | ---------------------- | | [AdditionalpropertiesWithSchemaMap](#additionalpropertieswithschemamap) | validate([Map<?, ?>](#additionalpropertieswithschemamapbuilder) arg, SchemaConfiguration configuration) | | [AdditionalpropertiesWithSchema1BoxedMap](#additionalpropertieswithschema1boxedmap) | validateAndBox([Map<?, ?>](#additionalpropertieswithschemamapbuilder) arg, SchemaConfiguration configuration) | +| [AdditionalpropertiesWithSchema1Boxed](#additionalpropertieswithschema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## AdditionalpropertiesWithSchemaMapBuilder public class AdditionalpropertiesWithSchemaMapBuilder
builder for `Map` @@ -155,7 +158,7 @@ A class to store validated Map payloads | boolean | getAdditionalProperty(String name)
provides type safety for additional properties | ## BarBoxed -public static abstract sealed class BarBoxed
+public sealed interface BarBoxed
permits
[BarBoxedVoid](#barboxedvoid), [BarBoxedBoolean](#barboxedboolean), @@ -164,103 +167,109 @@ permits
[BarBoxedList](#barboxedlist), [BarBoxedMap](#barboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## BarBoxedVoid -public static final class BarBoxedVoid
-extends [BarBoxed](#barboxed) +public record BarBoxedVoid
+implements [BarBoxed](#barboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BarBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## BarBoxedBoolean -public static final class BarBoxedBoolean
-extends [BarBoxed](#barboxed) +public record BarBoxedBoolean
+implements [BarBoxed](#barboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BarBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## BarBoxedNumber -public static final class BarBoxedNumber
-extends [BarBoxed](#barboxed) +public record BarBoxedNumber
+implements [BarBoxed](#barboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BarBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## BarBoxedString -public static final class BarBoxedString
-extends [BarBoxed](#barboxed) +public record BarBoxedString
+implements [BarBoxed](#barboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BarBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## BarBoxedList -public static final class BarBoxedList
-extends [BarBoxed](#barboxed) +public record BarBoxedList
+implements [BarBoxed](#barboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BarBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## BarBoxedMap -public static final class BarBoxedMap
-extends [BarBoxed](#barboxed) +public record BarBoxedMap
+implements [BarBoxed](#barboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BarBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Bar public static class Bar
@@ -274,7 +283,7 @@ A schema class that validates payloads | validateAndBox | ## FooBoxed -public static abstract sealed class FooBoxed
+public sealed interface FooBoxed
permits
[FooBoxedVoid](#fooboxedvoid), [FooBoxedBoolean](#fooboxedboolean), @@ -283,103 +292,109 @@ permits
[FooBoxedList](#fooboxedlist), [FooBoxedMap](#fooboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## FooBoxedVoid -public static final class FooBoxedVoid
-extends [FooBoxed](#fooboxed) +public record FooBoxedVoid
+implements [FooBoxed](#fooboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FooBoxedBoolean -public static final class FooBoxedBoolean
-extends [FooBoxed](#fooboxed) +public record FooBoxedBoolean
+implements [FooBoxed](#fooboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FooBoxedNumber -public static final class FooBoxedNumber
-extends [FooBoxed](#fooboxed) +public record FooBoxedNumber
+implements [FooBoxed](#fooboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FooBoxedString -public static final class FooBoxedString
-extends [FooBoxed](#fooboxed) +public record FooBoxedString
+implements [FooBoxed](#fooboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FooBoxedList -public static final class FooBoxedList
-extends [FooBoxed](#fooboxed) +public record FooBoxedList
+implements [FooBoxed](#fooboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FooBoxedMap -public static final class FooBoxedMap
-extends [FooBoxed](#fooboxed) +public record FooBoxedMap
+implements [FooBoxed](#fooboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Foo public static class Foo
@@ -393,27 +408,28 @@ A schema class that validates payloads | validateAndBox | ## AdditionalPropertiesBoxed -public static abstract sealed class AdditionalPropertiesBoxed
+public sealed interface AdditionalPropertiesBoxed
permits
[AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AdditionalPropertiesBoxedBoolean -public static final class AdditionalPropertiesBoxedBoolean
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedBoolean
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalProperties public static class AdditionalProperties
diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/Allof.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/Allof.md index 208abe021c6..079e4fe18ca 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/Allof.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/Allof.md @@ -4,7 +4,7 @@ public class Allof
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,43 +12,43 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Allof.Allof1Boxed](#allof1boxed)
abstract sealed validated payload class | -| static class | [Allof.Allof1BoxedVoid](#allof1boxedvoid)
boxed class to store validated null payloads | -| static class | [Allof.Allof1BoxedBoolean](#allof1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [Allof.Allof1BoxedNumber](#allof1boxednumber)
boxed class to store validated Number payloads | -| static class | [Allof.Allof1BoxedString](#allof1boxedstring)
boxed class to store validated String payloads | -| static class | [Allof.Allof1BoxedList](#allof1boxedlist)
boxed class to store validated List payloads | -| static class | [Allof.Allof1BoxedMap](#allof1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [Allof.Allof1Boxed](#allof1boxed)
sealed interface for validated payloads | +| record | [Allof.Allof1BoxedVoid](#allof1boxedvoid)
boxed class to store validated null payloads | +| record | [Allof.Allof1BoxedBoolean](#allof1boxedboolean)
boxed class to store validated boolean payloads | +| record | [Allof.Allof1BoxedNumber](#allof1boxednumber)
boxed class to store validated Number payloads | +| record | [Allof.Allof1BoxedString](#allof1boxedstring)
boxed class to store validated String payloads | +| record | [Allof.Allof1BoxedList](#allof1boxedlist)
boxed class to store validated List payloads | +| record | [Allof.Allof1BoxedMap](#allof1boxedmap)
boxed class to store validated Map payloads | | static class | [Allof.Allof1](#allof1)
schema class | -| static class | [Allof.Schema1Boxed](#schema1boxed)
abstract sealed validated payload class | -| static class | [Allof.Schema1BoxedVoid](#schema1boxedvoid)
boxed class to store validated null payloads | -| static class | [Allof.Schema1BoxedBoolean](#schema1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [Allof.Schema1BoxedNumber](#schema1boxednumber)
boxed class to store validated Number payloads | -| static class | [Allof.Schema1BoxedString](#schema1boxedstring)
boxed class to store validated String payloads | -| static class | [Allof.Schema1BoxedList](#schema1boxedlist)
boxed class to store validated List payloads | -| static class | [Allof.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [Allof.Schema1Boxed](#schema1boxed)
sealed interface for validated payloads | +| record | [Allof.Schema1BoxedVoid](#schema1boxedvoid)
boxed class to store validated null payloads | +| record | [Allof.Schema1BoxedBoolean](#schema1boxedboolean)
boxed class to store validated boolean payloads | +| record | [Allof.Schema1BoxedNumber](#schema1boxednumber)
boxed class to store validated Number payloads | +| record | [Allof.Schema1BoxedString](#schema1boxedstring)
boxed class to store validated String payloads | +| record | [Allof.Schema1BoxedList](#schema1boxedlist)
boxed class to store validated List payloads | +| record | [Allof.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | | static class | [Allof.Schema1](#schema1)
schema class | | static class | [Allof.Schema1MapBuilder](#schema1mapbuilder)
builder for Map payloads | | static class | [Allof.Schema1Map](#schema1map)
output class for Map payloads | -| static class | [Allof.FooBoxed](#fooboxed)
abstract sealed validated payload class | -| static class | [Allof.FooBoxedString](#fooboxedstring)
boxed class to store validated String payloads | +| sealed interface | [Allof.FooBoxed](#fooboxed)
sealed interface for validated payloads | +| record | [Allof.FooBoxedString](#fooboxedstring)
boxed class to store validated String payloads | | static class | [Allof.Foo](#foo)
schema class | -| static class | [Allof.Schema0Boxed](#schema0boxed)
abstract sealed validated payload class | -| static class | [Allof.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | -| static class | [Allof.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | -| static class | [Allof.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | -| static class | [Allof.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | -| static class | [Allof.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | -| static class | [Allof.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [Allof.Schema0Boxed](#schema0boxed)
sealed interface for validated payloads | +| record | [Allof.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | +| record | [Allof.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | +| record | [Allof.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | +| record | [Allof.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | +| record | [Allof.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | +| record | [Allof.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | | static class | [Allof.Schema0](#schema0)
schema class | | static class | [Allof.Schema0MapBuilder](#schema0mapbuilder)
builder for Map payloads | | static class | [Allof.Schema0Map](#schema0map)
output class for Map payloads | -| static class | [Allof.BarBoxed](#barboxed)
abstract sealed validated payload class | -| static class | [Allof.BarBoxedNumber](#barboxednumber)
boxed class to store validated Number payloads | +| sealed interface | [Allof.BarBoxed](#barboxed)
sealed interface for validated payloads | +| record | [Allof.BarBoxedNumber](#barboxednumber)
boxed class to store validated Number payloads | | static class | [Allof.Bar](#bar)
schema class | ## Allof1Boxed -public static abstract sealed class Allof1Boxed
+public sealed interface Allof1Boxed
permits
[Allof1BoxedVoid](#allof1boxedvoid), [Allof1BoxedBoolean](#allof1boxedboolean), @@ -57,103 +57,109 @@ permits
[Allof1BoxedList](#allof1boxedlist), [Allof1BoxedMap](#allof1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Allof1BoxedVoid -public static final class Allof1BoxedVoid
-extends [Allof1Boxed](#allof1boxed) +public record Allof1BoxedVoid
+implements [Allof1Boxed](#allof1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Allof1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Allof1BoxedBoolean -public static final class Allof1BoxedBoolean
-extends [Allof1Boxed](#allof1boxed) +public record Allof1BoxedBoolean
+implements [Allof1Boxed](#allof1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Allof1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Allof1BoxedNumber -public static final class Allof1BoxedNumber
-extends [Allof1Boxed](#allof1boxed) +public record Allof1BoxedNumber
+implements [Allof1Boxed](#allof1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Allof1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Allof1BoxedString -public static final class Allof1BoxedString
-extends [Allof1Boxed](#allof1boxed) +public record Allof1BoxedString
+implements [Allof1Boxed](#allof1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Allof1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Allof1BoxedList -public static final class Allof1BoxedList
-extends [Allof1Boxed](#allof1boxed) +public record Allof1BoxedList
+implements [Allof1Boxed](#allof1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Allof1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Allof1BoxedMap -public static final class Allof1BoxedMap
-extends [Allof1Boxed](#allof1boxed) +public record Allof1BoxedMap
+implements [Allof1Boxed](#allof1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Allof1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Allof1 public static class Allof1
@@ -185,9 +191,11 @@ A schema class that validates payloads | [Allof1BoxedBoolean](#allof1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Allof1BoxedMap](#allof1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [Allof1BoxedList](#allof1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Allof1Boxed](#allof1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema1Boxed -public static abstract sealed class Schema1Boxed
+public sealed interface Schema1Boxed
permits
[Schema1BoxedVoid](#schema1boxedvoid), [Schema1BoxedBoolean](#schema1boxedboolean), @@ -196,103 +204,109 @@ permits
[Schema1BoxedList](#schema1boxedlist), [Schema1BoxedMap](#schema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema1BoxedVoid -public static final class Schema1BoxedVoid
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedVoid
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedBoolean -public static final class Schema1BoxedBoolean
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedBoolean
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedNumber -public static final class Schema1BoxedNumber
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedNumber
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedString -public static final class Schema1BoxedString
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedString
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedList -public static final class Schema1BoxedList
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedList
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedMap -public static final class Schema1BoxedMap
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedMap
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedMap([Schema1Map](#schema1map) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [Schema1Map](#schema1map) | data
validated payload | +| [Schema1Map](#schema1map) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1 public static class Schema1
@@ -325,7 +339,9 @@ A schema class that validates payloads | [Schema1BoxedBoolean](#schema1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Schema1BoxedMap](#schema1boxedmap) | validateAndBox([Map<?, ?>](#schema1mapbuilder) arg, SchemaConfiguration configuration) | | [Schema1BoxedList](#schema1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Schema1Boxed](#schema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema1Map0Builder public class Schema1Map0Builder
builder for `Map` @@ -381,27 +397,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## FooBoxed -public static abstract sealed class FooBoxed
+public sealed interface FooBoxed
permits
[FooBoxedString](#fooboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## FooBoxedString -public static final class FooBoxedString
-extends [FooBoxed](#fooboxed) +public record FooBoxedString
+implements [FooBoxed](#fooboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Foo public static class Foo
@@ -415,7 +432,7 @@ A schema class that validates payloads | validateAndBox | ## Schema0Boxed -public static abstract sealed class Schema0Boxed
+public sealed interface Schema0Boxed
permits
[Schema0BoxedVoid](#schema0boxedvoid), [Schema0BoxedBoolean](#schema0boxedboolean), @@ -424,103 +441,109 @@ permits
[Schema0BoxedList](#schema0boxedlist), [Schema0BoxedMap](#schema0boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema0BoxedVoid -public static final class Schema0BoxedVoid
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedVoid
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedBoolean -public static final class Schema0BoxedBoolean
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedBoolean
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedNumber -public static final class Schema0BoxedNumber
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedNumber
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedString -public static final class Schema0BoxedString
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedString
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedList -public static final class Schema0BoxedList
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedList
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedMap -public static final class Schema0BoxedMap
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedMap
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedMap([Schema0Map](#schema0map) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [Schema0Map](#schema0map) | data
validated payload | +| [Schema0Map](#schema0map) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0 public static class Schema0
@@ -553,7 +576,9 @@ A schema class that validates payloads | [Schema0BoxedBoolean](#schema0boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Schema0BoxedMap](#schema0boxedmap) | validateAndBox([Map<?, ?>](#schema0mapbuilder) arg, SchemaConfiguration configuration) | | [Schema0BoxedList](#schema0boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Schema0Boxed](#schema0boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema0Map0Builder public class Schema0Map0Builder
builder for `Map` @@ -612,27 +637,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## BarBoxed -public static abstract sealed class BarBoxed
+public sealed interface BarBoxed
permits
[BarBoxedNumber](#barboxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## BarBoxedNumber -public static final class BarBoxedNumber
-extends [BarBoxed](#barboxed) +public record BarBoxedNumber
+implements [BarBoxed](#barboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BarBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Bar public static class Bar
diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/AllofCombinedWithAnyofOneof.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/AllofCombinedWithAnyofOneof.md index 6a21dc5716c..8aa4f4859ce 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/AllofCombinedWithAnyofOneof.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/AllofCombinedWithAnyofOneof.md @@ -4,47 +4,47 @@ public class AllofCombinedWithAnyofOneof
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [AllofCombinedWithAnyofOneof.AllofCombinedWithAnyofOneof1Boxed](#allofcombinedwithanyofoneof1boxed)
abstract sealed validated payload class | -| static class | [AllofCombinedWithAnyofOneof.AllofCombinedWithAnyofOneof1BoxedVoid](#allofcombinedwithanyofoneof1boxedvoid)
boxed class to store validated null payloads | -| static class | [AllofCombinedWithAnyofOneof.AllofCombinedWithAnyofOneof1BoxedBoolean](#allofcombinedwithanyofoneof1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [AllofCombinedWithAnyofOneof.AllofCombinedWithAnyofOneof1BoxedNumber](#allofcombinedwithanyofoneof1boxednumber)
boxed class to store validated Number payloads | -| static class | [AllofCombinedWithAnyofOneof.AllofCombinedWithAnyofOneof1BoxedString](#allofcombinedwithanyofoneof1boxedstring)
boxed class to store validated String payloads | -| static class | [AllofCombinedWithAnyofOneof.AllofCombinedWithAnyofOneof1BoxedList](#allofcombinedwithanyofoneof1boxedlist)
boxed class to store validated List payloads | -| static class | [AllofCombinedWithAnyofOneof.AllofCombinedWithAnyofOneof1BoxedMap](#allofcombinedwithanyofoneof1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AllofCombinedWithAnyofOneof.AllofCombinedWithAnyofOneof1Boxed](#allofcombinedwithanyofoneof1boxed)
sealed interface for validated payloads | +| record | [AllofCombinedWithAnyofOneof.AllofCombinedWithAnyofOneof1BoxedVoid](#allofcombinedwithanyofoneof1boxedvoid)
boxed class to store validated null payloads | +| record | [AllofCombinedWithAnyofOneof.AllofCombinedWithAnyofOneof1BoxedBoolean](#allofcombinedwithanyofoneof1boxedboolean)
boxed class to store validated boolean payloads | +| record | [AllofCombinedWithAnyofOneof.AllofCombinedWithAnyofOneof1BoxedNumber](#allofcombinedwithanyofoneof1boxednumber)
boxed class to store validated Number payloads | +| record | [AllofCombinedWithAnyofOneof.AllofCombinedWithAnyofOneof1BoxedString](#allofcombinedwithanyofoneof1boxedstring)
boxed class to store validated String payloads | +| record | [AllofCombinedWithAnyofOneof.AllofCombinedWithAnyofOneof1BoxedList](#allofcombinedwithanyofoneof1boxedlist)
boxed class to store validated List payloads | +| record | [AllofCombinedWithAnyofOneof.AllofCombinedWithAnyofOneof1BoxedMap](#allofcombinedwithanyofoneof1boxedmap)
boxed class to store validated Map payloads | | static class | [AllofCombinedWithAnyofOneof.AllofCombinedWithAnyofOneof1](#allofcombinedwithanyofoneof1)
schema class | -| static class | [AllofCombinedWithAnyofOneof.Schema0Boxed](#schema0boxed)
abstract sealed validated payload class | -| static class | [AllofCombinedWithAnyofOneof.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | -| static class | [AllofCombinedWithAnyofOneof.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | -| static class | [AllofCombinedWithAnyofOneof.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | -| static class | [AllofCombinedWithAnyofOneof.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | -| static class | [AllofCombinedWithAnyofOneof.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | -| static class | [AllofCombinedWithAnyofOneof.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AllofCombinedWithAnyofOneof.Schema0Boxed](#schema0boxed)
sealed interface for validated payloads | +| record | [AllofCombinedWithAnyofOneof.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | +| record | [AllofCombinedWithAnyofOneof.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | +| record | [AllofCombinedWithAnyofOneof.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | +| record | [AllofCombinedWithAnyofOneof.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | +| record | [AllofCombinedWithAnyofOneof.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | +| record | [AllofCombinedWithAnyofOneof.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | | static class | [AllofCombinedWithAnyofOneof.Schema0](#schema0)
schema class | -| static class | [AllofCombinedWithAnyofOneof.Schema01Boxed](#schema01boxed)
abstract sealed validated payload class | -| static class | [AllofCombinedWithAnyofOneof.Schema01BoxedVoid](#schema01boxedvoid)
boxed class to store validated null payloads | -| static class | [AllofCombinedWithAnyofOneof.Schema01BoxedBoolean](#schema01boxedboolean)
boxed class to store validated boolean payloads | -| static class | [AllofCombinedWithAnyofOneof.Schema01BoxedNumber](#schema01boxednumber)
boxed class to store validated Number payloads | -| static class | [AllofCombinedWithAnyofOneof.Schema01BoxedString](#schema01boxedstring)
boxed class to store validated String payloads | -| static class | [AllofCombinedWithAnyofOneof.Schema01BoxedList](#schema01boxedlist)
boxed class to store validated List payloads | -| static class | [AllofCombinedWithAnyofOneof.Schema01BoxedMap](#schema01boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AllofCombinedWithAnyofOneof.Schema01Boxed](#schema01boxed)
sealed interface for validated payloads | +| record | [AllofCombinedWithAnyofOneof.Schema01BoxedVoid](#schema01boxedvoid)
boxed class to store validated null payloads | +| record | [AllofCombinedWithAnyofOneof.Schema01BoxedBoolean](#schema01boxedboolean)
boxed class to store validated boolean payloads | +| record | [AllofCombinedWithAnyofOneof.Schema01BoxedNumber](#schema01boxednumber)
boxed class to store validated Number payloads | +| record | [AllofCombinedWithAnyofOneof.Schema01BoxedString](#schema01boxedstring)
boxed class to store validated String payloads | +| record | [AllofCombinedWithAnyofOneof.Schema01BoxedList](#schema01boxedlist)
boxed class to store validated List payloads | +| record | [AllofCombinedWithAnyofOneof.Schema01BoxedMap](#schema01boxedmap)
boxed class to store validated Map payloads | | static class | [AllofCombinedWithAnyofOneof.Schema01](#schema01)
schema class | -| static class | [AllofCombinedWithAnyofOneof.Schema02Boxed](#schema02boxed)
abstract sealed validated payload class | -| static class | [AllofCombinedWithAnyofOneof.Schema02BoxedVoid](#schema02boxedvoid)
boxed class to store validated null payloads | -| static class | [AllofCombinedWithAnyofOneof.Schema02BoxedBoolean](#schema02boxedboolean)
boxed class to store validated boolean payloads | -| static class | [AllofCombinedWithAnyofOneof.Schema02BoxedNumber](#schema02boxednumber)
boxed class to store validated Number payloads | -| static class | [AllofCombinedWithAnyofOneof.Schema02BoxedString](#schema02boxedstring)
boxed class to store validated String payloads | -| static class | [AllofCombinedWithAnyofOneof.Schema02BoxedList](#schema02boxedlist)
boxed class to store validated List payloads | -| static class | [AllofCombinedWithAnyofOneof.Schema02BoxedMap](#schema02boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AllofCombinedWithAnyofOneof.Schema02Boxed](#schema02boxed)
sealed interface for validated payloads | +| record | [AllofCombinedWithAnyofOneof.Schema02BoxedVoid](#schema02boxedvoid)
boxed class to store validated null payloads | +| record | [AllofCombinedWithAnyofOneof.Schema02BoxedBoolean](#schema02boxedboolean)
boxed class to store validated boolean payloads | +| record | [AllofCombinedWithAnyofOneof.Schema02BoxedNumber](#schema02boxednumber)
boxed class to store validated Number payloads | +| record | [AllofCombinedWithAnyofOneof.Schema02BoxedString](#schema02boxedstring)
boxed class to store validated String payloads | +| record | [AllofCombinedWithAnyofOneof.Schema02BoxedList](#schema02boxedlist)
boxed class to store validated List payloads | +| record | [AllofCombinedWithAnyofOneof.Schema02BoxedMap](#schema02boxedmap)
boxed class to store validated Map payloads | | static class | [AllofCombinedWithAnyofOneof.Schema02](#schema02)
schema class | ## AllofCombinedWithAnyofOneof1Boxed -public static abstract sealed class AllofCombinedWithAnyofOneof1Boxed
+public sealed interface AllofCombinedWithAnyofOneof1Boxed
permits
[AllofCombinedWithAnyofOneof1BoxedVoid](#allofcombinedwithanyofoneof1boxedvoid), [AllofCombinedWithAnyofOneof1BoxedBoolean](#allofcombinedwithanyofoneof1boxedboolean), @@ -53,103 +53,109 @@ permits
[AllofCombinedWithAnyofOneof1BoxedList](#allofcombinedwithanyofoneof1boxedlist), [AllofCombinedWithAnyofOneof1BoxedMap](#allofcombinedwithanyofoneof1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AllofCombinedWithAnyofOneof1BoxedVoid -public static final class AllofCombinedWithAnyofOneof1BoxedVoid
-extends [AllofCombinedWithAnyofOneof1Boxed](#allofcombinedwithanyofoneof1boxed) +public record AllofCombinedWithAnyofOneof1BoxedVoid
+implements [AllofCombinedWithAnyofOneof1Boxed](#allofcombinedwithanyofoneof1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofCombinedWithAnyofOneof1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofCombinedWithAnyofOneof1BoxedBoolean -public static final class AllofCombinedWithAnyofOneof1BoxedBoolean
-extends [AllofCombinedWithAnyofOneof1Boxed](#allofcombinedwithanyofoneof1boxed) +public record AllofCombinedWithAnyofOneof1BoxedBoolean
+implements [AllofCombinedWithAnyofOneof1Boxed](#allofcombinedwithanyofoneof1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofCombinedWithAnyofOneof1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofCombinedWithAnyofOneof1BoxedNumber -public static final class AllofCombinedWithAnyofOneof1BoxedNumber
-extends [AllofCombinedWithAnyofOneof1Boxed](#allofcombinedwithanyofoneof1boxed) +public record AllofCombinedWithAnyofOneof1BoxedNumber
+implements [AllofCombinedWithAnyofOneof1Boxed](#allofcombinedwithanyofoneof1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofCombinedWithAnyofOneof1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofCombinedWithAnyofOneof1BoxedString -public static final class AllofCombinedWithAnyofOneof1BoxedString
-extends [AllofCombinedWithAnyofOneof1Boxed](#allofcombinedwithanyofoneof1boxed) +public record AllofCombinedWithAnyofOneof1BoxedString
+implements [AllofCombinedWithAnyofOneof1Boxed](#allofcombinedwithanyofoneof1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofCombinedWithAnyofOneof1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofCombinedWithAnyofOneof1BoxedList -public static final class AllofCombinedWithAnyofOneof1BoxedList
-extends [AllofCombinedWithAnyofOneof1Boxed](#allofcombinedwithanyofoneof1boxed) +public record AllofCombinedWithAnyofOneof1BoxedList
+implements [AllofCombinedWithAnyofOneof1Boxed](#allofcombinedwithanyofoneof1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofCombinedWithAnyofOneof1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofCombinedWithAnyofOneof1BoxedMap -public static final class AllofCombinedWithAnyofOneof1BoxedMap
-extends [AllofCombinedWithAnyofOneof1Boxed](#allofcombinedwithanyofoneof1boxed) +public record AllofCombinedWithAnyofOneof1BoxedMap
+implements [AllofCombinedWithAnyofOneof1Boxed](#allofcombinedwithanyofoneof1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofCombinedWithAnyofOneof1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofCombinedWithAnyofOneof1 public static class AllofCombinedWithAnyofOneof1
@@ -183,9 +189,11 @@ A schema class that validates payloads | [AllofCombinedWithAnyofOneof1BoxedBoolean](#allofcombinedwithanyofoneof1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [AllofCombinedWithAnyofOneof1BoxedMap](#allofcombinedwithanyofoneof1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [AllofCombinedWithAnyofOneof1BoxedList](#allofcombinedwithanyofoneof1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [AllofCombinedWithAnyofOneof1Boxed](#allofcombinedwithanyofoneof1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema0Boxed -public static abstract sealed class Schema0Boxed
+public sealed interface Schema0Boxed
permits
[Schema0BoxedVoid](#schema0boxedvoid), [Schema0BoxedBoolean](#schema0boxedboolean), @@ -194,103 +202,109 @@ permits
[Schema0BoxedList](#schema0boxedlist), [Schema0BoxedMap](#schema0boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema0BoxedVoid -public static final class Schema0BoxedVoid
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedVoid
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedBoolean -public static final class Schema0BoxedBoolean
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedBoolean
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedNumber -public static final class Schema0BoxedNumber
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedNumber
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedString -public static final class Schema0BoxedString
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedString
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedList -public static final class Schema0BoxedList
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedList
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedMap -public static final class Schema0BoxedMap
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedMap
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0 public static class Schema0
@@ -322,9 +336,11 @@ A schema class that validates payloads | [Schema0BoxedBoolean](#schema0boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Schema0BoxedMap](#schema0boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [Schema0BoxedList](#schema0boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Schema0Boxed](#schema0boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema01Boxed -public static abstract sealed class Schema01Boxed
+public sealed interface Schema01Boxed
permits
[Schema01BoxedVoid](#schema01boxedvoid), [Schema01BoxedBoolean](#schema01boxedboolean), @@ -333,103 +349,109 @@ permits
[Schema01BoxedList](#schema01boxedlist), [Schema01BoxedMap](#schema01boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema01BoxedVoid -public static final class Schema01BoxedVoid
-extends [Schema01Boxed](#schema01boxed) +public record Schema01BoxedVoid
+implements [Schema01Boxed](#schema01boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema01BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema01BoxedBoolean -public static final class Schema01BoxedBoolean
-extends [Schema01Boxed](#schema01boxed) +public record Schema01BoxedBoolean
+implements [Schema01Boxed](#schema01boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema01BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema01BoxedNumber -public static final class Schema01BoxedNumber
-extends [Schema01Boxed](#schema01boxed) +public record Schema01BoxedNumber
+implements [Schema01Boxed](#schema01boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema01BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema01BoxedString -public static final class Schema01BoxedString
-extends [Schema01Boxed](#schema01boxed) +public record Schema01BoxedString
+implements [Schema01Boxed](#schema01boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema01BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema01BoxedList -public static final class Schema01BoxedList
-extends [Schema01Boxed](#schema01boxed) +public record Schema01BoxedList
+implements [Schema01Boxed](#schema01boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema01BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema01BoxedMap -public static final class Schema01BoxedMap
-extends [Schema01Boxed](#schema01boxed) +public record Schema01BoxedMap
+implements [Schema01Boxed](#schema01boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema01BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema01 public static class Schema01
@@ -461,9 +483,11 @@ A schema class that validates payloads | [Schema01BoxedBoolean](#schema01boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Schema01BoxedMap](#schema01boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [Schema01BoxedList](#schema01boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Schema01Boxed](#schema01boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema02Boxed -public static abstract sealed class Schema02Boxed
+public sealed interface Schema02Boxed
permits
[Schema02BoxedVoid](#schema02boxedvoid), [Schema02BoxedBoolean](#schema02boxedboolean), @@ -472,103 +496,109 @@ permits
[Schema02BoxedList](#schema02boxedlist), [Schema02BoxedMap](#schema02boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema02BoxedVoid -public static final class Schema02BoxedVoid
-extends [Schema02Boxed](#schema02boxed) +public record Schema02BoxedVoid
+implements [Schema02Boxed](#schema02boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema02BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema02BoxedBoolean -public static final class Schema02BoxedBoolean
-extends [Schema02Boxed](#schema02boxed) +public record Schema02BoxedBoolean
+implements [Schema02Boxed](#schema02boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema02BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema02BoxedNumber -public static final class Schema02BoxedNumber
-extends [Schema02Boxed](#schema02boxed) +public record Schema02BoxedNumber
+implements [Schema02Boxed](#schema02boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema02BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema02BoxedString -public static final class Schema02BoxedString
-extends [Schema02Boxed](#schema02boxed) +public record Schema02BoxedString
+implements [Schema02Boxed](#schema02boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema02BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema02BoxedList -public static final class Schema02BoxedList
-extends [Schema02Boxed](#schema02boxed) +public record Schema02BoxedList
+implements [Schema02Boxed](#schema02boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema02BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema02BoxedMap -public static final class Schema02BoxedMap
-extends [Schema02Boxed](#schema02boxed) +public record Schema02BoxedMap
+implements [Schema02Boxed](#schema02boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema02BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema02 public static class Schema02
@@ -600,5 +630,7 @@ A schema class that validates payloads | [Schema02BoxedBoolean](#schema02boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Schema02BoxedMap](#schema02boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [Schema02BoxedList](#schema02boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Schema02Boxed](#schema02boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/AllofSimpleTypes.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/AllofSimpleTypes.md index 0d06f2192b5..6e506fe215a 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/AllofSimpleTypes.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/AllofSimpleTypes.md @@ -4,39 +4,39 @@ public class AllofSimpleTypes
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [AllofSimpleTypes.AllofSimpleTypes1Boxed](#allofsimpletypes1boxed)
abstract sealed validated payload class | -| static class | [AllofSimpleTypes.AllofSimpleTypes1BoxedVoid](#allofsimpletypes1boxedvoid)
boxed class to store validated null payloads | -| static class | [AllofSimpleTypes.AllofSimpleTypes1BoxedBoolean](#allofsimpletypes1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [AllofSimpleTypes.AllofSimpleTypes1BoxedNumber](#allofsimpletypes1boxednumber)
boxed class to store validated Number payloads | -| static class | [AllofSimpleTypes.AllofSimpleTypes1BoxedString](#allofsimpletypes1boxedstring)
boxed class to store validated String payloads | -| static class | [AllofSimpleTypes.AllofSimpleTypes1BoxedList](#allofsimpletypes1boxedlist)
boxed class to store validated List payloads | -| static class | [AllofSimpleTypes.AllofSimpleTypes1BoxedMap](#allofsimpletypes1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AllofSimpleTypes.AllofSimpleTypes1Boxed](#allofsimpletypes1boxed)
sealed interface for validated payloads | +| record | [AllofSimpleTypes.AllofSimpleTypes1BoxedVoid](#allofsimpletypes1boxedvoid)
boxed class to store validated null payloads | +| record | [AllofSimpleTypes.AllofSimpleTypes1BoxedBoolean](#allofsimpletypes1boxedboolean)
boxed class to store validated boolean payloads | +| record | [AllofSimpleTypes.AllofSimpleTypes1BoxedNumber](#allofsimpletypes1boxednumber)
boxed class to store validated Number payloads | +| record | [AllofSimpleTypes.AllofSimpleTypes1BoxedString](#allofsimpletypes1boxedstring)
boxed class to store validated String payloads | +| record | [AllofSimpleTypes.AllofSimpleTypes1BoxedList](#allofsimpletypes1boxedlist)
boxed class to store validated List payloads | +| record | [AllofSimpleTypes.AllofSimpleTypes1BoxedMap](#allofsimpletypes1boxedmap)
boxed class to store validated Map payloads | | static class | [AllofSimpleTypes.AllofSimpleTypes1](#allofsimpletypes1)
schema class | -| static class | [AllofSimpleTypes.Schema1Boxed](#schema1boxed)
abstract sealed validated payload class | -| static class | [AllofSimpleTypes.Schema1BoxedVoid](#schema1boxedvoid)
boxed class to store validated null payloads | -| static class | [AllofSimpleTypes.Schema1BoxedBoolean](#schema1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [AllofSimpleTypes.Schema1BoxedNumber](#schema1boxednumber)
boxed class to store validated Number payloads | -| static class | [AllofSimpleTypes.Schema1BoxedString](#schema1boxedstring)
boxed class to store validated String payloads | -| static class | [AllofSimpleTypes.Schema1BoxedList](#schema1boxedlist)
boxed class to store validated List payloads | -| static class | [AllofSimpleTypes.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AllofSimpleTypes.Schema1Boxed](#schema1boxed)
sealed interface for validated payloads | +| record | [AllofSimpleTypes.Schema1BoxedVoid](#schema1boxedvoid)
boxed class to store validated null payloads | +| record | [AllofSimpleTypes.Schema1BoxedBoolean](#schema1boxedboolean)
boxed class to store validated boolean payloads | +| record | [AllofSimpleTypes.Schema1BoxedNumber](#schema1boxednumber)
boxed class to store validated Number payloads | +| record | [AllofSimpleTypes.Schema1BoxedString](#schema1boxedstring)
boxed class to store validated String payloads | +| record | [AllofSimpleTypes.Schema1BoxedList](#schema1boxedlist)
boxed class to store validated List payloads | +| record | [AllofSimpleTypes.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | | static class | [AllofSimpleTypes.Schema1](#schema1)
schema class | -| static class | [AllofSimpleTypes.Schema0Boxed](#schema0boxed)
abstract sealed validated payload class | -| static class | [AllofSimpleTypes.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | -| static class | [AllofSimpleTypes.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | -| static class | [AllofSimpleTypes.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | -| static class | [AllofSimpleTypes.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | -| static class | [AllofSimpleTypes.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | -| static class | [AllofSimpleTypes.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AllofSimpleTypes.Schema0Boxed](#schema0boxed)
sealed interface for validated payloads | +| record | [AllofSimpleTypes.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | +| record | [AllofSimpleTypes.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | +| record | [AllofSimpleTypes.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | +| record | [AllofSimpleTypes.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | +| record | [AllofSimpleTypes.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | +| record | [AllofSimpleTypes.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | | static class | [AllofSimpleTypes.Schema0](#schema0)
schema class | ## AllofSimpleTypes1Boxed -public static abstract sealed class AllofSimpleTypes1Boxed
+public sealed interface AllofSimpleTypes1Boxed
permits
[AllofSimpleTypes1BoxedVoid](#allofsimpletypes1boxedvoid), [AllofSimpleTypes1BoxedBoolean](#allofsimpletypes1boxedboolean), @@ -45,103 +45,109 @@ permits
[AllofSimpleTypes1BoxedList](#allofsimpletypes1boxedlist), [AllofSimpleTypes1BoxedMap](#allofsimpletypes1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AllofSimpleTypes1BoxedVoid -public static final class AllofSimpleTypes1BoxedVoid
-extends [AllofSimpleTypes1Boxed](#allofsimpletypes1boxed) +public record AllofSimpleTypes1BoxedVoid
+implements [AllofSimpleTypes1Boxed](#allofsimpletypes1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofSimpleTypes1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofSimpleTypes1BoxedBoolean -public static final class AllofSimpleTypes1BoxedBoolean
-extends [AllofSimpleTypes1Boxed](#allofsimpletypes1boxed) +public record AllofSimpleTypes1BoxedBoolean
+implements [AllofSimpleTypes1Boxed](#allofsimpletypes1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofSimpleTypes1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofSimpleTypes1BoxedNumber -public static final class AllofSimpleTypes1BoxedNumber
-extends [AllofSimpleTypes1Boxed](#allofsimpletypes1boxed) +public record AllofSimpleTypes1BoxedNumber
+implements [AllofSimpleTypes1Boxed](#allofsimpletypes1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofSimpleTypes1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofSimpleTypes1BoxedString -public static final class AllofSimpleTypes1BoxedString
-extends [AllofSimpleTypes1Boxed](#allofsimpletypes1boxed) +public record AllofSimpleTypes1BoxedString
+implements [AllofSimpleTypes1Boxed](#allofsimpletypes1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofSimpleTypes1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofSimpleTypes1BoxedList -public static final class AllofSimpleTypes1BoxedList
-extends [AllofSimpleTypes1Boxed](#allofsimpletypes1boxed) +public record AllofSimpleTypes1BoxedList
+implements [AllofSimpleTypes1Boxed](#allofsimpletypes1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofSimpleTypes1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofSimpleTypes1BoxedMap -public static final class AllofSimpleTypes1BoxedMap
-extends [AllofSimpleTypes1Boxed](#allofsimpletypes1boxed) +public record AllofSimpleTypes1BoxedMap
+implements [AllofSimpleTypes1Boxed](#allofsimpletypes1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofSimpleTypes1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofSimpleTypes1 public static class AllofSimpleTypes1
@@ -173,9 +179,11 @@ A schema class that validates payloads | [AllofSimpleTypes1BoxedBoolean](#allofsimpletypes1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [AllofSimpleTypes1BoxedMap](#allofsimpletypes1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [AllofSimpleTypes1BoxedList](#allofsimpletypes1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [AllofSimpleTypes1Boxed](#allofsimpletypes1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema1Boxed -public static abstract sealed class Schema1Boxed
+public sealed interface Schema1Boxed
permits
[Schema1BoxedVoid](#schema1boxedvoid), [Schema1BoxedBoolean](#schema1boxedboolean), @@ -184,103 +192,109 @@ permits
[Schema1BoxedList](#schema1boxedlist), [Schema1BoxedMap](#schema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema1BoxedVoid -public static final class Schema1BoxedVoid
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedVoid
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedBoolean -public static final class Schema1BoxedBoolean
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedBoolean
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedNumber -public static final class Schema1BoxedNumber
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedNumber
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedString -public static final class Schema1BoxedString
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedString
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedList -public static final class Schema1BoxedList
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedList
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedMap -public static final class Schema1BoxedMap
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedMap
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1 public static class Schema1
@@ -312,9 +326,11 @@ A schema class that validates payloads | [Schema1BoxedBoolean](#schema1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Schema1BoxedMap](#schema1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [Schema1BoxedList](#schema1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Schema1Boxed](#schema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema0Boxed -public static abstract sealed class Schema0Boxed
+public sealed interface Schema0Boxed
permits
[Schema0BoxedVoid](#schema0boxedvoid), [Schema0BoxedBoolean](#schema0boxedboolean), @@ -323,103 +339,109 @@ permits
[Schema0BoxedList](#schema0boxedlist), [Schema0BoxedMap](#schema0boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema0BoxedVoid -public static final class Schema0BoxedVoid
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedVoid
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedBoolean -public static final class Schema0BoxedBoolean
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedBoolean
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedNumber -public static final class Schema0BoxedNumber
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedNumber
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedString -public static final class Schema0BoxedString
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedString
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedList -public static final class Schema0BoxedList
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedList
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedMap -public static final class Schema0BoxedMap
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedMap
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0 public static class Schema0
@@ -451,5 +473,7 @@ A schema class that validates payloads | [Schema0BoxedBoolean](#schema0boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Schema0BoxedMap](#schema0boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [Schema0BoxedList](#schema0boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Schema0Boxed](#schema0boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/AllofWithBaseSchema.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/AllofWithBaseSchema.md index 02f0f53d81e..81125243a09 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/AllofWithBaseSchema.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/AllofWithBaseSchema.md @@ -4,7 +4,7 @@ public class AllofWithBaseSchema
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,48 +12,48 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [AllofWithBaseSchema.AllofWithBaseSchema1Boxed](#allofwithbaseschema1boxed)
abstract sealed validated payload class | -| static class | [AllofWithBaseSchema.AllofWithBaseSchema1BoxedVoid](#allofwithbaseschema1boxedvoid)
boxed class to store validated null payloads | -| static class | [AllofWithBaseSchema.AllofWithBaseSchema1BoxedBoolean](#allofwithbaseschema1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [AllofWithBaseSchema.AllofWithBaseSchema1BoxedNumber](#allofwithbaseschema1boxednumber)
boxed class to store validated Number payloads | -| static class | [AllofWithBaseSchema.AllofWithBaseSchema1BoxedString](#allofwithbaseschema1boxedstring)
boxed class to store validated String payloads | -| static class | [AllofWithBaseSchema.AllofWithBaseSchema1BoxedList](#allofwithbaseschema1boxedlist)
boxed class to store validated List payloads | -| static class | [AllofWithBaseSchema.AllofWithBaseSchema1BoxedMap](#allofwithbaseschema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AllofWithBaseSchema.AllofWithBaseSchema1Boxed](#allofwithbaseschema1boxed)
sealed interface for validated payloads | +| record | [AllofWithBaseSchema.AllofWithBaseSchema1BoxedVoid](#allofwithbaseschema1boxedvoid)
boxed class to store validated null payloads | +| record | [AllofWithBaseSchema.AllofWithBaseSchema1BoxedBoolean](#allofwithbaseschema1boxedboolean)
boxed class to store validated boolean payloads | +| record | [AllofWithBaseSchema.AllofWithBaseSchema1BoxedNumber](#allofwithbaseschema1boxednumber)
boxed class to store validated Number payloads | +| record | [AllofWithBaseSchema.AllofWithBaseSchema1BoxedString](#allofwithbaseschema1boxedstring)
boxed class to store validated String payloads | +| record | [AllofWithBaseSchema.AllofWithBaseSchema1BoxedList](#allofwithbaseschema1boxedlist)
boxed class to store validated List payloads | +| record | [AllofWithBaseSchema.AllofWithBaseSchema1BoxedMap](#allofwithbaseschema1boxedmap)
boxed class to store validated Map payloads | | static class | [AllofWithBaseSchema.AllofWithBaseSchema1](#allofwithbaseschema1)
schema class | | static class | [AllofWithBaseSchema.AllofWithBaseSchemaMapBuilder](#allofwithbaseschemamapbuilder)
builder for Map payloads | | static class | [AllofWithBaseSchema.AllofWithBaseSchemaMap](#allofwithbaseschemamap)
output class for Map payloads | -| static class | [AllofWithBaseSchema.BarBoxed](#barboxed)
abstract sealed validated payload class | -| static class | [AllofWithBaseSchema.BarBoxedNumber](#barboxednumber)
boxed class to store validated Number payloads | +| sealed interface | [AllofWithBaseSchema.BarBoxed](#barboxed)
sealed interface for validated payloads | +| record | [AllofWithBaseSchema.BarBoxedNumber](#barboxednumber)
boxed class to store validated Number payloads | | static class | [AllofWithBaseSchema.Bar](#bar)
schema class | -| static class | [AllofWithBaseSchema.Schema1Boxed](#schema1boxed)
abstract sealed validated payload class | -| static class | [AllofWithBaseSchema.Schema1BoxedVoid](#schema1boxedvoid)
boxed class to store validated null payloads | -| static class | [AllofWithBaseSchema.Schema1BoxedBoolean](#schema1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [AllofWithBaseSchema.Schema1BoxedNumber](#schema1boxednumber)
boxed class to store validated Number payloads | -| static class | [AllofWithBaseSchema.Schema1BoxedString](#schema1boxedstring)
boxed class to store validated String payloads | -| static class | [AllofWithBaseSchema.Schema1BoxedList](#schema1boxedlist)
boxed class to store validated List payloads | -| static class | [AllofWithBaseSchema.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AllofWithBaseSchema.Schema1Boxed](#schema1boxed)
sealed interface for validated payloads | +| record | [AllofWithBaseSchema.Schema1BoxedVoid](#schema1boxedvoid)
boxed class to store validated null payloads | +| record | [AllofWithBaseSchema.Schema1BoxedBoolean](#schema1boxedboolean)
boxed class to store validated boolean payloads | +| record | [AllofWithBaseSchema.Schema1BoxedNumber](#schema1boxednumber)
boxed class to store validated Number payloads | +| record | [AllofWithBaseSchema.Schema1BoxedString](#schema1boxedstring)
boxed class to store validated String payloads | +| record | [AllofWithBaseSchema.Schema1BoxedList](#schema1boxedlist)
boxed class to store validated List payloads | +| record | [AllofWithBaseSchema.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | | static class | [AllofWithBaseSchema.Schema1](#schema1)
schema class | | static class | [AllofWithBaseSchema.Schema1MapBuilder](#schema1mapbuilder)
builder for Map payloads | | static class | [AllofWithBaseSchema.Schema1Map](#schema1map)
output class for Map payloads | -| static class | [AllofWithBaseSchema.BazBoxed](#bazboxed)
abstract sealed validated payload class | -| static class | [AllofWithBaseSchema.BazBoxedVoid](#bazboxedvoid)
boxed class to store validated null payloads | +| sealed interface | [AllofWithBaseSchema.BazBoxed](#bazboxed)
sealed interface for validated payloads | +| record | [AllofWithBaseSchema.BazBoxedVoid](#bazboxedvoid)
boxed class to store validated null payloads | | static class | [AllofWithBaseSchema.Baz](#baz)
schema class | -| static class | [AllofWithBaseSchema.Schema0Boxed](#schema0boxed)
abstract sealed validated payload class | -| static class | [AllofWithBaseSchema.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | -| static class | [AllofWithBaseSchema.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | -| static class | [AllofWithBaseSchema.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | -| static class | [AllofWithBaseSchema.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | -| static class | [AllofWithBaseSchema.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | -| static class | [AllofWithBaseSchema.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AllofWithBaseSchema.Schema0Boxed](#schema0boxed)
sealed interface for validated payloads | +| record | [AllofWithBaseSchema.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | +| record | [AllofWithBaseSchema.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | +| record | [AllofWithBaseSchema.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | +| record | [AllofWithBaseSchema.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | +| record | [AllofWithBaseSchema.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | +| record | [AllofWithBaseSchema.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | | static class | [AllofWithBaseSchema.Schema0](#schema0)
schema class | | static class | [AllofWithBaseSchema.Schema0MapBuilder](#schema0mapbuilder)
builder for Map payloads | | static class | [AllofWithBaseSchema.Schema0Map](#schema0map)
output class for Map payloads | -| static class | [AllofWithBaseSchema.FooBoxed](#fooboxed)
abstract sealed validated payload class | -| static class | [AllofWithBaseSchema.FooBoxedString](#fooboxedstring)
boxed class to store validated String payloads | +| sealed interface | [AllofWithBaseSchema.FooBoxed](#fooboxed)
sealed interface for validated payloads | +| record | [AllofWithBaseSchema.FooBoxedString](#fooboxedstring)
boxed class to store validated String payloads | | static class | [AllofWithBaseSchema.Foo](#foo)
schema class | ## AllofWithBaseSchema1Boxed -public static abstract sealed class AllofWithBaseSchema1Boxed
+public sealed interface AllofWithBaseSchema1Boxed
permits
[AllofWithBaseSchema1BoxedVoid](#allofwithbaseschema1boxedvoid), [AllofWithBaseSchema1BoxedBoolean](#allofwithbaseschema1boxedboolean), @@ -62,103 +62,109 @@ permits
[AllofWithBaseSchema1BoxedList](#allofwithbaseschema1boxedlist), [AllofWithBaseSchema1BoxedMap](#allofwithbaseschema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AllofWithBaseSchema1BoxedVoid -public static final class AllofWithBaseSchema1BoxedVoid
-extends [AllofWithBaseSchema1Boxed](#allofwithbaseschema1boxed) +public record AllofWithBaseSchema1BoxedVoid
+implements [AllofWithBaseSchema1Boxed](#allofwithbaseschema1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofWithBaseSchema1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofWithBaseSchema1BoxedBoolean -public static final class AllofWithBaseSchema1BoxedBoolean
-extends [AllofWithBaseSchema1Boxed](#allofwithbaseschema1boxed) +public record AllofWithBaseSchema1BoxedBoolean
+implements [AllofWithBaseSchema1Boxed](#allofwithbaseschema1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofWithBaseSchema1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofWithBaseSchema1BoxedNumber -public static final class AllofWithBaseSchema1BoxedNumber
-extends [AllofWithBaseSchema1Boxed](#allofwithbaseschema1boxed) +public record AllofWithBaseSchema1BoxedNumber
+implements [AllofWithBaseSchema1Boxed](#allofwithbaseschema1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofWithBaseSchema1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofWithBaseSchema1BoxedString -public static final class AllofWithBaseSchema1BoxedString
-extends [AllofWithBaseSchema1Boxed](#allofwithbaseschema1boxed) +public record AllofWithBaseSchema1BoxedString
+implements [AllofWithBaseSchema1Boxed](#allofwithbaseschema1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofWithBaseSchema1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofWithBaseSchema1BoxedList -public static final class AllofWithBaseSchema1BoxedList
-extends [AllofWithBaseSchema1Boxed](#allofwithbaseschema1boxed) +public record AllofWithBaseSchema1BoxedList
+implements [AllofWithBaseSchema1Boxed](#allofwithbaseschema1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofWithBaseSchema1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofWithBaseSchema1BoxedMap -public static final class AllofWithBaseSchema1BoxedMap
-extends [AllofWithBaseSchema1Boxed](#allofwithbaseschema1boxed) +public record AllofWithBaseSchema1BoxedMap
+implements [AllofWithBaseSchema1Boxed](#allofwithbaseschema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofWithBaseSchema1BoxedMap([AllofWithBaseSchemaMap](#allofwithbaseschemamap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [AllofWithBaseSchemaMap](#allofwithbaseschemamap) | data
validated payload | +| [AllofWithBaseSchemaMap](#allofwithbaseschemamap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofWithBaseSchema1 public static class AllofWithBaseSchema1
@@ -192,7 +198,9 @@ A schema class that validates payloads | [AllofWithBaseSchema1BoxedBoolean](#allofwithbaseschema1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [AllofWithBaseSchema1BoxedMap](#allofwithbaseschema1boxedmap) | validateAndBox([Map<?, ?>](#allofwithbaseschemamapbuilder) arg, SchemaConfiguration configuration) | | [AllofWithBaseSchema1BoxedList](#allofwithbaseschema1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [AllofWithBaseSchema1Boxed](#allofwithbaseschema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## AllofWithBaseSchemaMap0Builder public class AllofWithBaseSchemaMap0Builder
builder for `Map` @@ -251,27 +259,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## BarBoxed -public static abstract sealed class BarBoxed
+public sealed interface BarBoxed
permits
[BarBoxedNumber](#barboxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## BarBoxedNumber -public static final class BarBoxedNumber
-extends [BarBoxed](#barboxed) +public record BarBoxedNumber
+implements [BarBoxed](#barboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BarBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Bar public static class Bar
@@ -285,7 +294,7 @@ A schema class that validates payloads | validateAndBox | ## Schema1Boxed -public static abstract sealed class Schema1Boxed
+public sealed interface Schema1Boxed
permits
[Schema1BoxedVoid](#schema1boxedvoid), [Schema1BoxedBoolean](#schema1boxedboolean), @@ -294,103 +303,109 @@ permits
[Schema1BoxedList](#schema1boxedlist), [Schema1BoxedMap](#schema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema1BoxedVoid -public static final class Schema1BoxedVoid
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedVoid
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedBoolean -public static final class Schema1BoxedBoolean
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedBoolean
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedNumber -public static final class Schema1BoxedNumber
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedNumber
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedString -public static final class Schema1BoxedString
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedString
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedList -public static final class Schema1BoxedList
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedList
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedMap -public static final class Schema1BoxedMap
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedMap
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedMap([Schema1Map](#schema1map) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [Schema1Map](#schema1map) | data
validated payload | +| [Schema1Map](#schema1map) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1 public static class Schema1
@@ -423,7 +438,9 @@ A schema class that validates payloads | [Schema1BoxedBoolean](#schema1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Schema1BoxedMap](#schema1boxedmap) | validateAndBox([Map<?, ?>](#schema1mapbuilder) arg, SchemaConfiguration configuration) | | [Schema1BoxedList](#schema1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Schema1Boxed](#schema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema1Map0Builder public class Schema1Map0Builder
builder for `Map` @@ -479,27 +496,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## BazBoxed -public static abstract sealed class BazBoxed
+public sealed interface BazBoxed
permits
[BazBoxedVoid](#bazboxedvoid) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## BazBoxedVoid -public static final class BazBoxedVoid
-extends [BazBoxed](#bazboxed) +public record BazBoxedVoid
+implements [BazBoxed](#bazboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BazBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Baz public static class Baz
@@ -513,7 +531,7 @@ A schema class that validates payloads | validateAndBox | ## Schema0Boxed -public static abstract sealed class Schema0Boxed
+public sealed interface Schema0Boxed
permits
[Schema0BoxedVoid](#schema0boxedvoid), [Schema0BoxedBoolean](#schema0boxedboolean), @@ -522,103 +540,109 @@ permits
[Schema0BoxedList](#schema0boxedlist), [Schema0BoxedMap](#schema0boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema0BoxedVoid -public static final class Schema0BoxedVoid
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedVoid
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedBoolean -public static final class Schema0BoxedBoolean
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedBoolean
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedNumber -public static final class Schema0BoxedNumber
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedNumber
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedString -public static final class Schema0BoxedString
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedString
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedList -public static final class Schema0BoxedList
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedList
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedMap -public static final class Schema0BoxedMap
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedMap
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedMap([Schema0Map](#schema0map) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [Schema0Map](#schema0map) | data
validated payload | +| [Schema0Map](#schema0map) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0 public static class Schema0
@@ -651,7 +675,9 @@ A schema class that validates payloads | [Schema0BoxedBoolean](#schema0boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Schema0BoxedMap](#schema0boxedmap) | validateAndBox([Map<?, ?>](#schema0mapbuilder) arg, SchemaConfiguration configuration) | | [Schema0BoxedList](#schema0boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Schema0Boxed](#schema0boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema0Map0Builder public class Schema0Map0Builder
builder for `Map` @@ -707,27 +733,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## FooBoxed -public static abstract sealed class FooBoxed
+public sealed interface FooBoxed
permits
[FooBoxedString](#fooboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## FooBoxedString -public static final class FooBoxedString
-extends [FooBoxed](#fooboxed) +public record FooBoxedString
+implements [FooBoxed](#fooboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Foo public static class Foo
diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/AllofWithOneEmptySchema.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/AllofWithOneEmptySchema.md index 8bb3b9ca2ec..353eef7b1a4 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/AllofWithOneEmptySchema.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/AllofWithOneEmptySchema.md @@ -4,31 +4,31 @@ public class AllofWithOneEmptySchema
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [AllofWithOneEmptySchema.AllofWithOneEmptySchema1Boxed](#allofwithoneemptyschema1boxed)
abstract sealed validated payload class | -| static class | [AllofWithOneEmptySchema.AllofWithOneEmptySchema1BoxedVoid](#allofwithoneemptyschema1boxedvoid)
boxed class to store validated null payloads | -| static class | [AllofWithOneEmptySchema.AllofWithOneEmptySchema1BoxedBoolean](#allofwithoneemptyschema1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [AllofWithOneEmptySchema.AllofWithOneEmptySchema1BoxedNumber](#allofwithoneemptyschema1boxednumber)
boxed class to store validated Number payloads | -| static class | [AllofWithOneEmptySchema.AllofWithOneEmptySchema1BoxedString](#allofwithoneemptyschema1boxedstring)
boxed class to store validated String payloads | -| static class | [AllofWithOneEmptySchema.AllofWithOneEmptySchema1BoxedList](#allofwithoneemptyschema1boxedlist)
boxed class to store validated List payloads | -| static class | [AllofWithOneEmptySchema.AllofWithOneEmptySchema1BoxedMap](#allofwithoneemptyschema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AllofWithOneEmptySchema.AllofWithOneEmptySchema1Boxed](#allofwithoneemptyschema1boxed)
sealed interface for validated payloads | +| record | [AllofWithOneEmptySchema.AllofWithOneEmptySchema1BoxedVoid](#allofwithoneemptyschema1boxedvoid)
boxed class to store validated null payloads | +| record | [AllofWithOneEmptySchema.AllofWithOneEmptySchema1BoxedBoolean](#allofwithoneemptyschema1boxedboolean)
boxed class to store validated boolean payloads | +| record | [AllofWithOneEmptySchema.AllofWithOneEmptySchema1BoxedNumber](#allofwithoneemptyschema1boxednumber)
boxed class to store validated Number payloads | +| record | [AllofWithOneEmptySchema.AllofWithOneEmptySchema1BoxedString](#allofwithoneemptyschema1boxedstring)
boxed class to store validated String payloads | +| record | [AllofWithOneEmptySchema.AllofWithOneEmptySchema1BoxedList](#allofwithoneemptyschema1boxedlist)
boxed class to store validated List payloads | +| record | [AllofWithOneEmptySchema.AllofWithOneEmptySchema1BoxedMap](#allofwithoneemptyschema1boxedmap)
boxed class to store validated Map payloads | | static class | [AllofWithOneEmptySchema.AllofWithOneEmptySchema1](#allofwithoneemptyschema1)
schema class | -| static class | [AllofWithOneEmptySchema.Schema0Boxed](#schema0boxed)
abstract sealed validated payload class | -| static class | [AllofWithOneEmptySchema.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | -| static class | [AllofWithOneEmptySchema.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | -| static class | [AllofWithOneEmptySchema.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | -| static class | [AllofWithOneEmptySchema.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | -| static class | [AllofWithOneEmptySchema.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | -| static class | [AllofWithOneEmptySchema.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AllofWithOneEmptySchema.Schema0Boxed](#schema0boxed)
sealed interface for validated payloads | +| record | [AllofWithOneEmptySchema.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | +| record | [AllofWithOneEmptySchema.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | +| record | [AllofWithOneEmptySchema.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | +| record | [AllofWithOneEmptySchema.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | +| record | [AllofWithOneEmptySchema.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | +| record | [AllofWithOneEmptySchema.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | | static class | [AllofWithOneEmptySchema.Schema0](#schema0)
schema class | ## AllofWithOneEmptySchema1Boxed -public static abstract sealed class AllofWithOneEmptySchema1Boxed
+public sealed interface AllofWithOneEmptySchema1Boxed
permits
[AllofWithOneEmptySchema1BoxedVoid](#allofwithoneemptyschema1boxedvoid), [AllofWithOneEmptySchema1BoxedBoolean](#allofwithoneemptyschema1boxedboolean), @@ -37,103 +37,109 @@ permits
[AllofWithOneEmptySchema1BoxedList](#allofwithoneemptyschema1boxedlist), [AllofWithOneEmptySchema1BoxedMap](#allofwithoneemptyschema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AllofWithOneEmptySchema1BoxedVoid -public static final class AllofWithOneEmptySchema1BoxedVoid
-extends [AllofWithOneEmptySchema1Boxed](#allofwithoneemptyschema1boxed) +public record AllofWithOneEmptySchema1BoxedVoid
+implements [AllofWithOneEmptySchema1Boxed](#allofwithoneemptyschema1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofWithOneEmptySchema1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofWithOneEmptySchema1BoxedBoolean -public static final class AllofWithOneEmptySchema1BoxedBoolean
-extends [AllofWithOneEmptySchema1Boxed](#allofwithoneemptyschema1boxed) +public record AllofWithOneEmptySchema1BoxedBoolean
+implements [AllofWithOneEmptySchema1Boxed](#allofwithoneemptyschema1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofWithOneEmptySchema1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofWithOneEmptySchema1BoxedNumber -public static final class AllofWithOneEmptySchema1BoxedNumber
-extends [AllofWithOneEmptySchema1Boxed](#allofwithoneemptyschema1boxed) +public record AllofWithOneEmptySchema1BoxedNumber
+implements [AllofWithOneEmptySchema1Boxed](#allofwithoneemptyschema1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofWithOneEmptySchema1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofWithOneEmptySchema1BoxedString -public static final class AllofWithOneEmptySchema1BoxedString
-extends [AllofWithOneEmptySchema1Boxed](#allofwithoneemptyschema1boxed) +public record AllofWithOneEmptySchema1BoxedString
+implements [AllofWithOneEmptySchema1Boxed](#allofwithoneemptyschema1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofWithOneEmptySchema1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofWithOneEmptySchema1BoxedList -public static final class AllofWithOneEmptySchema1BoxedList
-extends [AllofWithOneEmptySchema1Boxed](#allofwithoneemptyschema1boxed) +public record AllofWithOneEmptySchema1BoxedList
+implements [AllofWithOneEmptySchema1Boxed](#allofwithoneemptyschema1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofWithOneEmptySchema1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofWithOneEmptySchema1BoxedMap -public static final class AllofWithOneEmptySchema1BoxedMap
-extends [AllofWithOneEmptySchema1Boxed](#allofwithoneemptyschema1boxed) +public record AllofWithOneEmptySchema1BoxedMap
+implements [AllofWithOneEmptySchema1Boxed](#allofwithoneemptyschema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofWithOneEmptySchema1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofWithOneEmptySchema1 public static class AllofWithOneEmptySchema1
@@ -165,9 +171,11 @@ A schema class that validates payloads | [AllofWithOneEmptySchema1BoxedBoolean](#allofwithoneemptyschema1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [AllofWithOneEmptySchema1BoxedMap](#allofwithoneemptyschema1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [AllofWithOneEmptySchema1BoxedList](#allofwithoneemptyschema1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [AllofWithOneEmptySchema1Boxed](#allofwithoneemptyschema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema0Boxed -public static abstract sealed class Schema0Boxed
+public sealed interface Schema0Boxed
permits
[Schema0BoxedVoid](#schema0boxedvoid), [Schema0BoxedBoolean](#schema0boxedboolean), @@ -176,103 +184,109 @@ permits
[Schema0BoxedList](#schema0boxedlist), [Schema0BoxedMap](#schema0boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema0BoxedVoid -public static final class Schema0BoxedVoid
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedVoid
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedBoolean -public static final class Schema0BoxedBoolean
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedBoolean
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedNumber -public static final class Schema0BoxedNumber
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedNumber
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedString -public static final class Schema0BoxedString
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedString
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedList -public static final class Schema0BoxedList
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedList
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedMap -public static final class Schema0BoxedMap
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedMap
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0 public static class Schema0
diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/AllofWithTheFirstEmptySchema.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/AllofWithTheFirstEmptySchema.md index 60262417c7c..f4341590119 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/AllofWithTheFirstEmptySchema.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/AllofWithTheFirstEmptySchema.md @@ -4,34 +4,34 @@ public class AllofWithTheFirstEmptySchema
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [AllofWithTheFirstEmptySchema.AllofWithTheFirstEmptySchema1Boxed](#allofwiththefirstemptyschema1boxed)
abstract sealed validated payload class | -| static class | [AllofWithTheFirstEmptySchema.AllofWithTheFirstEmptySchema1BoxedVoid](#allofwiththefirstemptyschema1boxedvoid)
boxed class to store validated null payloads | -| static class | [AllofWithTheFirstEmptySchema.AllofWithTheFirstEmptySchema1BoxedBoolean](#allofwiththefirstemptyschema1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [AllofWithTheFirstEmptySchema.AllofWithTheFirstEmptySchema1BoxedNumber](#allofwiththefirstemptyschema1boxednumber)
boxed class to store validated Number payloads | -| static class | [AllofWithTheFirstEmptySchema.AllofWithTheFirstEmptySchema1BoxedString](#allofwiththefirstemptyschema1boxedstring)
boxed class to store validated String payloads | -| static class | [AllofWithTheFirstEmptySchema.AllofWithTheFirstEmptySchema1BoxedList](#allofwiththefirstemptyschema1boxedlist)
boxed class to store validated List payloads | -| static class | [AllofWithTheFirstEmptySchema.AllofWithTheFirstEmptySchema1BoxedMap](#allofwiththefirstemptyschema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AllofWithTheFirstEmptySchema.AllofWithTheFirstEmptySchema1Boxed](#allofwiththefirstemptyschema1boxed)
sealed interface for validated payloads | +| record | [AllofWithTheFirstEmptySchema.AllofWithTheFirstEmptySchema1BoxedVoid](#allofwiththefirstemptyschema1boxedvoid)
boxed class to store validated null payloads | +| record | [AllofWithTheFirstEmptySchema.AllofWithTheFirstEmptySchema1BoxedBoolean](#allofwiththefirstemptyschema1boxedboolean)
boxed class to store validated boolean payloads | +| record | [AllofWithTheFirstEmptySchema.AllofWithTheFirstEmptySchema1BoxedNumber](#allofwiththefirstemptyschema1boxednumber)
boxed class to store validated Number payloads | +| record | [AllofWithTheFirstEmptySchema.AllofWithTheFirstEmptySchema1BoxedString](#allofwiththefirstemptyschema1boxedstring)
boxed class to store validated String payloads | +| record | [AllofWithTheFirstEmptySchema.AllofWithTheFirstEmptySchema1BoxedList](#allofwiththefirstemptyschema1boxedlist)
boxed class to store validated List payloads | +| record | [AllofWithTheFirstEmptySchema.AllofWithTheFirstEmptySchema1BoxedMap](#allofwiththefirstemptyschema1boxedmap)
boxed class to store validated Map payloads | | static class | [AllofWithTheFirstEmptySchema.AllofWithTheFirstEmptySchema1](#allofwiththefirstemptyschema1)
schema class | -| static class | [AllofWithTheFirstEmptySchema.Schema1Boxed](#schema1boxed)
abstract sealed validated payload class | -| static class | [AllofWithTheFirstEmptySchema.Schema1BoxedNumber](#schema1boxednumber)
boxed class to store validated Number payloads | +| sealed interface | [AllofWithTheFirstEmptySchema.Schema1Boxed](#schema1boxed)
sealed interface for validated payloads | +| record | [AllofWithTheFirstEmptySchema.Schema1BoxedNumber](#schema1boxednumber)
boxed class to store validated Number payloads | | static class | [AllofWithTheFirstEmptySchema.Schema1](#schema1)
schema class | -| static class | [AllofWithTheFirstEmptySchema.Schema0Boxed](#schema0boxed)
abstract sealed validated payload class | -| static class | [AllofWithTheFirstEmptySchema.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | -| static class | [AllofWithTheFirstEmptySchema.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | -| static class | [AllofWithTheFirstEmptySchema.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | -| static class | [AllofWithTheFirstEmptySchema.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | -| static class | [AllofWithTheFirstEmptySchema.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | -| static class | [AllofWithTheFirstEmptySchema.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AllofWithTheFirstEmptySchema.Schema0Boxed](#schema0boxed)
sealed interface for validated payloads | +| record | [AllofWithTheFirstEmptySchema.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | +| record | [AllofWithTheFirstEmptySchema.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | +| record | [AllofWithTheFirstEmptySchema.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | +| record | [AllofWithTheFirstEmptySchema.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | +| record | [AllofWithTheFirstEmptySchema.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | +| record | [AllofWithTheFirstEmptySchema.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | | static class | [AllofWithTheFirstEmptySchema.Schema0](#schema0)
schema class | ## AllofWithTheFirstEmptySchema1Boxed -public static abstract sealed class AllofWithTheFirstEmptySchema1Boxed
+public sealed interface AllofWithTheFirstEmptySchema1Boxed
permits
[AllofWithTheFirstEmptySchema1BoxedVoid](#allofwiththefirstemptyschema1boxedvoid), [AllofWithTheFirstEmptySchema1BoxedBoolean](#allofwiththefirstemptyschema1boxedboolean), @@ -40,103 +40,109 @@ permits
[AllofWithTheFirstEmptySchema1BoxedList](#allofwiththefirstemptyschema1boxedlist), [AllofWithTheFirstEmptySchema1BoxedMap](#allofwiththefirstemptyschema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AllofWithTheFirstEmptySchema1BoxedVoid -public static final class AllofWithTheFirstEmptySchema1BoxedVoid
-extends [AllofWithTheFirstEmptySchema1Boxed](#allofwiththefirstemptyschema1boxed) +public record AllofWithTheFirstEmptySchema1BoxedVoid
+implements [AllofWithTheFirstEmptySchema1Boxed](#allofwiththefirstemptyschema1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofWithTheFirstEmptySchema1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofWithTheFirstEmptySchema1BoxedBoolean -public static final class AllofWithTheFirstEmptySchema1BoxedBoolean
-extends [AllofWithTheFirstEmptySchema1Boxed](#allofwiththefirstemptyschema1boxed) +public record AllofWithTheFirstEmptySchema1BoxedBoolean
+implements [AllofWithTheFirstEmptySchema1Boxed](#allofwiththefirstemptyschema1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofWithTheFirstEmptySchema1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofWithTheFirstEmptySchema1BoxedNumber -public static final class AllofWithTheFirstEmptySchema1BoxedNumber
-extends [AllofWithTheFirstEmptySchema1Boxed](#allofwiththefirstemptyschema1boxed) +public record AllofWithTheFirstEmptySchema1BoxedNumber
+implements [AllofWithTheFirstEmptySchema1Boxed](#allofwiththefirstemptyschema1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofWithTheFirstEmptySchema1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofWithTheFirstEmptySchema1BoxedString -public static final class AllofWithTheFirstEmptySchema1BoxedString
-extends [AllofWithTheFirstEmptySchema1Boxed](#allofwiththefirstemptyschema1boxed) +public record AllofWithTheFirstEmptySchema1BoxedString
+implements [AllofWithTheFirstEmptySchema1Boxed](#allofwiththefirstemptyschema1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofWithTheFirstEmptySchema1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofWithTheFirstEmptySchema1BoxedList -public static final class AllofWithTheFirstEmptySchema1BoxedList
-extends [AllofWithTheFirstEmptySchema1Boxed](#allofwiththefirstemptyschema1boxed) +public record AllofWithTheFirstEmptySchema1BoxedList
+implements [AllofWithTheFirstEmptySchema1Boxed](#allofwiththefirstemptyschema1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofWithTheFirstEmptySchema1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofWithTheFirstEmptySchema1BoxedMap -public static final class AllofWithTheFirstEmptySchema1BoxedMap
-extends [AllofWithTheFirstEmptySchema1Boxed](#allofwiththefirstemptyschema1boxed) +public record AllofWithTheFirstEmptySchema1BoxedMap
+implements [AllofWithTheFirstEmptySchema1Boxed](#allofwiththefirstemptyschema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofWithTheFirstEmptySchema1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofWithTheFirstEmptySchema1 public static class AllofWithTheFirstEmptySchema1
@@ -168,29 +174,32 @@ A schema class that validates payloads | [AllofWithTheFirstEmptySchema1BoxedBoolean](#allofwiththefirstemptyschema1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [AllofWithTheFirstEmptySchema1BoxedMap](#allofwiththefirstemptyschema1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [AllofWithTheFirstEmptySchema1BoxedList](#allofwiththefirstemptyschema1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [AllofWithTheFirstEmptySchema1Boxed](#allofwiththefirstemptyschema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema1Boxed -public static abstract sealed class Schema1Boxed
+public sealed interface Schema1Boxed
permits
[Schema1BoxedNumber](#schema1boxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema1BoxedNumber -public static final class Schema1BoxedNumber
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedNumber
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1 public static class Schema1
@@ -204,7 +213,7 @@ A schema class that validates payloads | validateAndBox | ## Schema0Boxed -public static abstract sealed class Schema0Boxed
+public sealed interface Schema0Boxed
permits
[Schema0BoxedVoid](#schema0boxedvoid), [Schema0BoxedBoolean](#schema0boxedboolean), @@ -213,103 +222,109 @@ permits
[Schema0BoxedList](#schema0boxedlist), [Schema0BoxedMap](#schema0boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema0BoxedVoid -public static final class Schema0BoxedVoid
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedVoid
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedBoolean -public static final class Schema0BoxedBoolean
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedBoolean
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedNumber -public static final class Schema0BoxedNumber
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedNumber
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedString -public static final class Schema0BoxedString
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedString
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedList -public static final class Schema0BoxedList
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedList
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedMap -public static final class Schema0BoxedMap
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedMap
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0 public static class Schema0
diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/AllofWithTheLastEmptySchema.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/AllofWithTheLastEmptySchema.md index f43f920d986..6d626d52eb9 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/AllofWithTheLastEmptySchema.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/AllofWithTheLastEmptySchema.md @@ -4,34 +4,34 @@ public class AllofWithTheLastEmptySchema
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [AllofWithTheLastEmptySchema.AllofWithTheLastEmptySchema1Boxed](#allofwiththelastemptyschema1boxed)
abstract sealed validated payload class | -| static class | [AllofWithTheLastEmptySchema.AllofWithTheLastEmptySchema1BoxedVoid](#allofwiththelastemptyschema1boxedvoid)
boxed class to store validated null payloads | -| static class | [AllofWithTheLastEmptySchema.AllofWithTheLastEmptySchema1BoxedBoolean](#allofwiththelastemptyschema1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [AllofWithTheLastEmptySchema.AllofWithTheLastEmptySchema1BoxedNumber](#allofwiththelastemptyschema1boxednumber)
boxed class to store validated Number payloads | -| static class | [AllofWithTheLastEmptySchema.AllofWithTheLastEmptySchema1BoxedString](#allofwiththelastemptyschema1boxedstring)
boxed class to store validated String payloads | -| static class | [AllofWithTheLastEmptySchema.AllofWithTheLastEmptySchema1BoxedList](#allofwiththelastemptyschema1boxedlist)
boxed class to store validated List payloads | -| static class | [AllofWithTheLastEmptySchema.AllofWithTheLastEmptySchema1BoxedMap](#allofwiththelastemptyschema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AllofWithTheLastEmptySchema.AllofWithTheLastEmptySchema1Boxed](#allofwiththelastemptyschema1boxed)
sealed interface for validated payloads | +| record | [AllofWithTheLastEmptySchema.AllofWithTheLastEmptySchema1BoxedVoid](#allofwiththelastemptyschema1boxedvoid)
boxed class to store validated null payloads | +| record | [AllofWithTheLastEmptySchema.AllofWithTheLastEmptySchema1BoxedBoolean](#allofwiththelastemptyschema1boxedboolean)
boxed class to store validated boolean payloads | +| record | [AllofWithTheLastEmptySchema.AllofWithTheLastEmptySchema1BoxedNumber](#allofwiththelastemptyschema1boxednumber)
boxed class to store validated Number payloads | +| record | [AllofWithTheLastEmptySchema.AllofWithTheLastEmptySchema1BoxedString](#allofwiththelastemptyschema1boxedstring)
boxed class to store validated String payloads | +| record | [AllofWithTheLastEmptySchema.AllofWithTheLastEmptySchema1BoxedList](#allofwiththelastemptyschema1boxedlist)
boxed class to store validated List payloads | +| record | [AllofWithTheLastEmptySchema.AllofWithTheLastEmptySchema1BoxedMap](#allofwiththelastemptyschema1boxedmap)
boxed class to store validated Map payloads | | static class | [AllofWithTheLastEmptySchema.AllofWithTheLastEmptySchema1](#allofwiththelastemptyschema1)
schema class | -| static class | [AllofWithTheLastEmptySchema.Schema1Boxed](#schema1boxed)
abstract sealed validated payload class | -| static class | [AllofWithTheLastEmptySchema.Schema1BoxedVoid](#schema1boxedvoid)
boxed class to store validated null payloads | -| static class | [AllofWithTheLastEmptySchema.Schema1BoxedBoolean](#schema1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [AllofWithTheLastEmptySchema.Schema1BoxedNumber](#schema1boxednumber)
boxed class to store validated Number payloads | -| static class | [AllofWithTheLastEmptySchema.Schema1BoxedString](#schema1boxedstring)
boxed class to store validated String payloads | -| static class | [AllofWithTheLastEmptySchema.Schema1BoxedList](#schema1boxedlist)
boxed class to store validated List payloads | -| static class | [AllofWithTheLastEmptySchema.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AllofWithTheLastEmptySchema.Schema1Boxed](#schema1boxed)
sealed interface for validated payloads | +| record | [AllofWithTheLastEmptySchema.Schema1BoxedVoid](#schema1boxedvoid)
boxed class to store validated null payloads | +| record | [AllofWithTheLastEmptySchema.Schema1BoxedBoolean](#schema1boxedboolean)
boxed class to store validated boolean payloads | +| record | [AllofWithTheLastEmptySchema.Schema1BoxedNumber](#schema1boxednumber)
boxed class to store validated Number payloads | +| record | [AllofWithTheLastEmptySchema.Schema1BoxedString](#schema1boxedstring)
boxed class to store validated String payloads | +| record | [AllofWithTheLastEmptySchema.Schema1BoxedList](#schema1boxedlist)
boxed class to store validated List payloads | +| record | [AllofWithTheLastEmptySchema.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | | static class | [AllofWithTheLastEmptySchema.Schema1](#schema1)
schema class | -| static class | [AllofWithTheLastEmptySchema.Schema0Boxed](#schema0boxed)
abstract sealed validated payload class | -| static class | [AllofWithTheLastEmptySchema.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | +| sealed interface | [AllofWithTheLastEmptySchema.Schema0Boxed](#schema0boxed)
sealed interface for validated payloads | +| record | [AllofWithTheLastEmptySchema.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | | static class | [AllofWithTheLastEmptySchema.Schema0](#schema0)
schema class | ## AllofWithTheLastEmptySchema1Boxed -public static abstract sealed class AllofWithTheLastEmptySchema1Boxed
+public sealed interface AllofWithTheLastEmptySchema1Boxed
permits
[AllofWithTheLastEmptySchema1BoxedVoid](#allofwiththelastemptyschema1boxedvoid), [AllofWithTheLastEmptySchema1BoxedBoolean](#allofwiththelastemptyschema1boxedboolean), @@ -40,103 +40,109 @@ permits
[AllofWithTheLastEmptySchema1BoxedList](#allofwiththelastemptyschema1boxedlist), [AllofWithTheLastEmptySchema1BoxedMap](#allofwiththelastemptyschema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AllofWithTheLastEmptySchema1BoxedVoid -public static final class AllofWithTheLastEmptySchema1BoxedVoid
-extends [AllofWithTheLastEmptySchema1Boxed](#allofwiththelastemptyschema1boxed) +public record AllofWithTheLastEmptySchema1BoxedVoid
+implements [AllofWithTheLastEmptySchema1Boxed](#allofwiththelastemptyschema1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofWithTheLastEmptySchema1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofWithTheLastEmptySchema1BoxedBoolean -public static final class AllofWithTheLastEmptySchema1BoxedBoolean
-extends [AllofWithTheLastEmptySchema1Boxed](#allofwiththelastemptyschema1boxed) +public record AllofWithTheLastEmptySchema1BoxedBoolean
+implements [AllofWithTheLastEmptySchema1Boxed](#allofwiththelastemptyschema1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofWithTheLastEmptySchema1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofWithTheLastEmptySchema1BoxedNumber -public static final class AllofWithTheLastEmptySchema1BoxedNumber
-extends [AllofWithTheLastEmptySchema1Boxed](#allofwiththelastemptyschema1boxed) +public record AllofWithTheLastEmptySchema1BoxedNumber
+implements [AllofWithTheLastEmptySchema1Boxed](#allofwiththelastemptyschema1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofWithTheLastEmptySchema1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofWithTheLastEmptySchema1BoxedString -public static final class AllofWithTheLastEmptySchema1BoxedString
-extends [AllofWithTheLastEmptySchema1Boxed](#allofwiththelastemptyschema1boxed) +public record AllofWithTheLastEmptySchema1BoxedString
+implements [AllofWithTheLastEmptySchema1Boxed](#allofwiththelastemptyschema1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofWithTheLastEmptySchema1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofWithTheLastEmptySchema1BoxedList -public static final class AllofWithTheLastEmptySchema1BoxedList
-extends [AllofWithTheLastEmptySchema1Boxed](#allofwiththelastemptyschema1boxed) +public record AllofWithTheLastEmptySchema1BoxedList
+implements [AllofWithTheLastEmptySchema1Boxed](#allofwiththelastemptyschema1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofWithTheLastEmptySchema1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofWithTheLastEmptySchema1BoxedMap -public static final class AllofWithTheLastEmptySchema1BoxedMap
-extends [AllofWithTheLastEmptySchema1Boxed](#allofwiththelastemptyschema1boxed) +public record AllofWithTheLastEmptySchema1BoxedMap
+implements [AllofWithTheLastEmptySchema1Boxed](#allofwiththelastemptyschema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofWithTheLastEmptySchema1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofWithTheLastEmptySchema1 public static class AllofWithTheLastEmptySchema1
@@ -168,9 +174,11 @@ A schema class that validates payloads | [AllofWithTheLastEmptySchema1BoxedBoolean](#allofwiththelastemptyschema1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [AllofWithTheLastEmptySchema1BoxedMap](#allofwiththelastemptyschema1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [AllofWithTheLastEmptySchema1BoxedList](#allofwiththelastemptyschema1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [AllofWithTheLastEmptySchema1Boxed](#allofwiththelastemptyschema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema1Boxed -public static abstract sealed class Schema1Boxed
+public sealed interface Schema1Boxed
permits
[Schema1BoxedVoid](#schema1boxedvoid), [Schema1BoxedBoolean](#schema1boxedboolean), @@ -179,103 +187,109 @@ permits
[Schema1BoxedList](#schema1boxedlist), [Schema1BoxedMap](#schema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema1BoxedVoid -public static final class Schema1BoxedVoid
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedVoid
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedBoolean -public static final class Schema1BoxedBoolean
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedBoolean
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedNumber -public static final class Schema1BoxedNumber
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedNumber
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedString -public static final class Schema1BoxedString
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedString
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedList -public static final class Schema1BoxedList
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedList
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedMap -public static final class Schema1BoxedMap
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedMap
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1 public static class Schema1
@@ -289,27 +303,28 @@ A schema class that validates payloads | validateAndBox | ## Schema0Boxed -public static abstract sealed class Schema0Boxed
+public sealed interface Schema0Boxed
permits
[Schema0BoxedNumber](#schema0boxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema0BoxedNumber -public static final class Schema0BoxedNumber
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedNumber
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0 public static class Schema0
diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/AllofWithTwoEmptySchemas.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/AllofWithTwoEmptySchemas.md index e72c6155a05..4875f70770c 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/AllofWithTwoEmptySchemas.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/AllofWithTwoEmptySchemas.md @@ -4,39 +4,39 @@ public class AllofWithTwoEmptySchemas
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [AllofWithTwoEmptySchemas.AllofWithTwoEmptySchemas1Boxed](#allofwithtwoemptyschemas1boxed)
abstract sealed validated payload class | -| static class | [AllofWithTwoEmptySchemas.AllofWithTwoEmptySchemas1BoxedVoid](#allofwithtwoemptyschemas1boxedvoid)
boxed class to store validated null payloads | -| static class | [AllofWithTwoEmptySchemas.AllofWithTwoEmptySchemas1BoxedBoolean](#allofwithtwoemptyschemas1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [AllofWithTwoEmptySchemas.AllofWithTwoEmptySchemas1BoxedNumber](#allofwithtwoemptyschemas1boxednumber)
boxed class to store validated Number payloads | -| static class | [AllofWithTwoEmptySchemas.AllofWithTwoEmptySchemas1BoxedString](#allofwithtwoemptyschemas1boxedstring)
boxed class to store validated String payloads | -| static class | [AllofWithTwoEmptySchemas.AllofWithTwoEmptySchemas1BoxedList](#allofwithtwoemptyschemas1boxedlist)
boxed class to store validated List payloads | -| static class | [AllofWithTwoEmptySchemas.AllofWithTwoEmptySchemas1BoxedMap](#allofwithtwoemptyschemas1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AllofWithTwoEmptySchemas.AllofWithTwoEmptySchemas1Boxed](#allofwithtwoemptyschemas1boxed)
sealed interface for validated payloads | +| record | [AllofWithTwoEmptySchemas.AllofWithTwoEmptySchemas1BoxedVoid](#allofwithtwoemptyschemas1boxedvoid)
boxed class to store validated null payloads | +| record | [AllofWithTwoEmptySchemas.AllofWithTwoEmptySchemas1BoxedBoolean](#allofwithtwoemptyschemas1boxedboolean)
boxed class to store validated boolean payloads | +| record | [AllofWithTwoEmptySchemas.AllofWithTwoEmptySchemas1BoxedNumber](#allofwithtwoemptyschemas1boxednumber)
boxed class to store validated Number payloads | +| record | [AllofWithTwoEmptySchemas.AllofWithTwoEmptySchemas1BoxedString](#allofwithtwoemptyschemas1boxedstring)
boxed class to store validated String payloads | +| record | [AllofWithTwoEmptySchemas.AllofWithTwoEmptySchemas1BoxedList](#allofwithtwoemptyschemas1boxedlist)
boxed class to store validated List payloads | +| record | [AllofWithTwoEmptySchemas.AllofWithTwoEmptySchemas1BoxedMap](#allofwithtwoemptyschemas1boxedmap)
boxed class to store validated Map payloads | | static class | [AllofWithTwoEmptySchemas.AllofWithTwoEmptySchemas1](#allofwithtwoemptyschemas1)
schema class | -| static class | [AllofWithTwoEmptySchemas.Schema1Boxed](#schema1boxed)
abstract sealed validated payload class | -| static class | [AllofWithTwoEmptySchemas.Schema1BoxedVoid](#schema1boxedvoid)
boxed class to store validated null payloads | -| static class | [AllofWithTwoEmptySchemas.Schema1BoxedBoolean](#schema1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [AllofWithTwoEmptySchemas.Schema1BoxedNumber](#schema1boxednumber)
boxed class to store validated Number payloads | -| static class | [AllofWithTwoEmptySchemas.Schema1BoxedString](#schema1boxedstring)
boxed class to store validated String payloads | -| static class | [AllofWithTwoEmptySchemas.Schema1BoxedList](#schema1boxedlist)
boxed class to store validated List payloads | -| static class | [AllofWithTwoEmptySchemas.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AllofWithTwoEmptySchemas.Schema1Boxed](#schema1boxed)
sealed interface for validated payloads | +| record | [AllofWithTwoEmptySchemas.Schema1BoxedVoid](#schema1boxedvoid)
boxed class to store validated null payloads | +| record | [AllofWithTwoEmptySchemas.Schema1BoxedBoolean](#schema1boxedboolean)
boxed class to store validated boolean payloads | +| record | [AllofWithTwoEmptySchemas.Schema1BoxedNumber](#schema1boxednumber)
boxed class to store validated Number payloads | +| record | [AllofWithTwoEmptySchemas.Schema1BoxedString](#schema1boxedstring)
boxed class to store validated String payloads | +| record | [AllofWithTwoEmptySchemas.Schema1BoxedList](#schema1boxedlist)
boxed class to store validated List payloads | +| record | [AllofWithTwoEmptySchemas.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | | static class | [AllofWithTwoEmptySchemas.Schema1](#schema1)
schema class | -| static class | [AllofWithTwoEmptySchemas.Schema0Boxed](#schema0boxed)
abstract sealed validated payload class | -| static class | [AllofWithTwoEmptySchemas.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | -| static class | [AllofWithTwoEmptySchemas.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | -| static class | [AllofWithTwoEmptySchemas.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | -| static class | [AllofWithTwoEmptySchemas.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | -| static class | [AllofWithTwoEmptySchemas.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | -| static class | [AllofWithTwoEmptySchemas.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AllofWithTwoEmptySchemas.Schema0Boxed](#schema0boxed)
sealed interface for validated payloads | +| record | [AllofWithTwoEmptySchemas.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | +| record | [AllofWithTwoEmptySchemas.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | +| record | [AllofWithTwoEmptySchemas.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | +| record | [AllofWithTwoEmptySchemas.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | +| record | [AllofWithTwoEmptySchemas.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | +| record | [AllofWithTwoEmptySchemas.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | | static class | [AllofWithTwoEmptySchemas.Schema0](#schema0)
schema class | ## AllofWithTwoEmptySchemas1Boxed -public static abstract sealed class AllofWithTwoEmptySchemas1Boxed
+public sealed interface AllofWithTwoEmptySchemas1Boxed
permits
[AllofWithTwoEmptySchemas1BoxedVoid](#allofwithtwoemptyschemas1boxedvoid), [AllofWithTwoEmptySchemas1BoxedBoolean](#allofwithtwoemptyschemas1boxedboolean), @@ -45,103 +45,109 @@ permits
[AllofWithTwoEmptySchemas1BoxedList](#allofwithtwoemptyschemas1boxedlist), [AllofWithTwoEmptySchemas1BoxedMap](#allofwithtwoemptyschemas1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AllofWithTwoEmptySchemas1BoxedVoid -public static final class AllofWithTwoEmptySchemas1BoxedVoid
-extends [AllofWithTwoEmptySchemas1Boxed](#allofwithtwoemptyschemas1boxed) +public record AllofWithTwoEmptySchemas1BoxedVoid
+implements [AllofWithTwoEmptySchemas1Boxed](#allofwithtwoemptyschemas1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofWithTwoEmptySchemas1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofWithTwoEmptySchemas1BoxedBoolean -public static final class AllofWithTwoEmptySchemas1BoxedBoolean
-extends [AllofWithTwoEmptySchemas1Boxed](#allofwithtwoemptyschemas1boxed) +public record AllofWithTwoEmptySchemas1BoxedBoolean
+implements [AllofWithTwoEmptySchemas1Boxed](#allofwithtwoemptyschemas1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofWithTwoEmptySchemas1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofWithTwoEmptySchemas1BoxedNumber -public static final class AllofWithTwoEmptySchemas1BoxedNumber
-extends [AllofWithTwoEmptySchemas1Boxed](#allofwithtwoemptyschemas1boxed) +public record AllofWithTwoEmptySchemas1BoxedNumber
+implements [AllofWithTwoEmptySchemas1Boxed](#allofwithtwoemptyschemas1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofWithTwoEmptySchemas1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofWithTwoEmptySchemas1BoxedString -public static final class AllofWithTwoEmptySchemas1BoxedString
-extends [AllofWithTwoEmptySchemas1Boxed](#allofwithtwoemptyschemas1boxed) +public record AllofWithTwoEmptySchemas1BoxedString
+implements [AllofWithTwoEmptySchemas1Boxed](#allofwithtwoemptyschemas1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofWithTwoEmptySchemas1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofWithTwoEmptySchemas1BoxedList -public static final class AllofWithTwoEmptySchemas1BoxedList
-extends [AllofWithTwoEmptySchemas1Boxed](#allofwithtwoemptyschemas1boxed) +public record AllofWithTwoEmptySchemas1BoxedList
+implements [AllofWithTwoEmptySchemas1Boxed](#allofwithtwoemptyschemas1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofWithTwoEmptySchemas1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofWithTwoEmptySchemas1BoxedMap -public static final class AllofWithTwoEmptySchemas1BoxedMap
-extends [AllofWithTwoEmptySchemas1Boxed](#allofwithtwoemptyschemas1boxed) +public record AllofWithTwoEmptySchemas1BoxedMap
+implements [AllofWithTwoEmptySchemas1Boxed](#allofwithtwoemptyschemas1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AllofWithTwoEmptySchemas1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AllofWithTwoEmptySchemas1 public static class AllofWithTwoEmptySchemas1
@@ -173,9 +179,11 @@ A schema class that validates payloads | [AllofWithTwoEmptySchemas1BoxedBoolean](#allofwithtwoemptyschemas1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [AllofWithTwoEmptySchemas1BoxedMap](#allofwithtwoemptyschemas1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [AllofWithTwoEmptySchemas1BoxedList](#allofwithtwoemptyschemas1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [AllofWithTwoEmptySchemas1Boxed](#allofwithtwoemptyschemas1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema1Boxed -public static abstract sealed class Schema1Boxed
+public sealed interface Schema1Boxed
permits
[Schema1BoxedVoid](#schema1boxedvoid), [Schema1BoxedBoolean](#schema1boxedboolean), @@ -184,103 +192,109 @@ permits
[Schema1BoxedList](#schema1boxedlist), [Schema1BoxedMap](#schema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema1BoxedVoid -public static final class Schema1BoxedVoid
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedVoid
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedBoolean -public static final class Schema1BoxedBoolean
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedBoolean
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedNumber -public static final class Schema1BoxedNumber
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedNumber
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedString -public static final class Schema1BoxedString
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedString
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedList -public static final class Schema1BoxedList
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedList
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedMap -public static final class Schema1BoxedMap
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedMap
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1 public static class Schema1
@@ -294,7 +308,7 @@ A schema class that validates payloads | validateAndBox | ## Schema0Boxed -public static abstract sealed class Schema0Boxed
+public sealed interface Schema0Boxed
permits
[Schema0BoxedVoid](#schema0boxedvoid), [Schema0BoxedBoolean](#schema0boxedboolean), @@ -303,103 +317,109 @@ permits
[Schema0BoxedList](#schema0boxedlist), [Schema0BoxedMap](#schema0boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema0BoxedVoid -public static final class Schema0BoxedVoid
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedVoid
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedBoolean -public static final class Schema0BoxedBoolean
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedBoolean
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedNumber -public static final class Schema0BoxedNumber
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedNumber
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedString -public static final class Schema0BoxedString
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedString
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedList -public static final class Schema0BoxedList
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedList
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedMap -public static final class Schema0BoxedMap
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedMap
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0 public static class Schema0
diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/Anyof.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/Anyof.md index 8c0f413375b..316b94bb0d9 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/Anyof.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/Anyof.md @@ -4,34 +4,34 @@ public class Anyof
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Anyof.Anyof1Boxed](#anyof1boxed)
abstract sealed validated payload class | -| static class | [Anyof.Anyof1BoxedVoid](#anyof1boxedvoid)
boxed class to store validated null payloads | -| static class | [Anyof.Anyof1BoxedBoolean](#anyof1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [Anyof.Anyof1BoxedNumber](#anyof1boxednumber)
boxed class to store validated Number payloads | -| static class | [Anyof.Anyof1BoxedString](#anyof1boxedstring)
boxed class to store validated String payloads | -| static class | [Anyof.Anyof1BoxedList](#anyof1boxedlist)
boxed class to store validated List payloads | -| static class | [Anyof.Anyof1BoxedMap](#anyof1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [Anyof.Anyof1Boxed](#anyof1boxed)
sealed interface for validated payloads | +| record | [Anyof.Anyof1BoxedVoid](#anyof1boxedvoid)
boxed class to store validated null payloads | +| record | [Anyof.Anyof1BoxedBoolean](#anyof1boxedboolean)
boxed class to store validated boolean payloads | +| record | [Anyof.Anyof1BoxedNumber](#anyof1boxednumber)
boxed class to store validated Number payloads | +| record | [Anyof.Anyof1BoxedString](#anyof1boxedstring)
boxed class to store validated String payloads | +| record | [Anyof.Anyof1BoxedList](#anyof1boxedlist)
boxed class to store validated List payloads | +| record | [Anyof.Anyof1BoxedMap](#anyof1boxedmap)
boxed class to store validated Map payloads | | static class | [Anyof.Anyof1](#anyof1)
schema class | -| static class | [Anyof.Schema1Boxed](#schema1boxed)
abstract sealed validated payload class | -| static class | [Anyof.Schema1BoxedVoid](#schema1boxedvoid)
boxed class to store validated null payloads | -| static class | [Anyof.Schema1BoxedBoolean](#schema1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [Anyof.Schema1BoxedNumber](#schema1boxednumber)
boxed class to store validated Number payloads | -| static class | [Anyof.Schema1BoxedString](#schema1boxedstring)
boxed class to store validated String payloads | -| static class | [Anyof.Schema1BoxedList](#schema1boxedlist)
boxed class to store validated List payloads | -| static class | [Anyof.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [Anyof.Schema1Boxed](#schema1boxed)
sealed interface for validated payloads | +| record | [Anyof.Schema1BoxedVoid](#schema1boxedvoid)
boxed class to store validated null payloads | +| record | [Anyof.Schema1BoxedBoolean](#schema1boxedboolean)
boxed class to store validated boolean payloads | +| record | [Anyof.Schema1BoxedNumber](#schema1boxednumber)
boxed class to store validated Number payloads | +| record | [Anyof.Schema1BoxedString](#schema1boxedstring)
boxed class to store validated String payloads | +| record | [Anyof.Schema1BoxedList](#schema1boxedlist)
boxed class to store validated List payloads | +| record | [Anyof.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | | static class | [Anyof.Schema1](#schema1)
schema class | -| static class | [Anyof.Schema0Boxed](#schema0boxed)
abstract sealed validated payload class | -| static class | [Anyof.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | +| sealed interface | [Anyof.Schema0Boxed](#schema0boxed)
sealed interface for validated payloads | +| record | [Anyof.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | | static class | [Anyof.Schema0](#schema0)
schema class | ## Anyof1Boxed -public static abstract sealed class Anyof1Boxed
+public sealed interface Anyof1Boxed
permits
[Anyof1BoxedVoid](#anyof1boxedvoid), [Anyof1BoxedBoolean](#anyof1boxedboolean), @@ -40,103 +40,109 @@ permits
[Anyof1BoxedList](#anyof1boxedlist), [Anyof1BoxedMap](#anyof1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Anyof1BoxedVoid -public static final class Anyof1BoxedVoid
-extends [Anyof1Boxed](#anyof1boxed) +public record Anyof1BoxedVoid
+implements [Anyof1Boxed](#anyof1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Anyof1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Anyof1BoxedBoolean -public static final class Anyof1BoxedBoolean
-extends [Anyof1Boxed](#anyof1boxed) +public record Anyof1BoxedBoolean
+implements [Anyof1Boxed](#anyof1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Anyof1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Anyof1BoxedNumber -public static final class Anyof1BoxedNumber
-extends [Anyof1Boxed](#anyof1boxed) +public record Anyof1BoxedNumber
+implements [Anyof1Boxed](#anyof1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Anyof1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Anyof1BoxedString -public static final class Anyof1BoxedString
-extends [Anyof1Boxed](#anyof1boxed) +public record Anyof1BoxedString
+implements [Anyof1Boxed](#anyof1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Anyof1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Anyof1BoxedList -public static final class Anyof1BoxedList
-extends [Anyof1Boxed](#anyof1boxed) +public record Anyof1BoxedList
+implements [Anyof1Boxed](#anyof1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Anyof1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Anyof1BoxedMap -public static final class Anyof1BoxedMap
-extends [Anyof1Boxed](#anyof1boxed) +public record Anyof1BoxedMap
+implements [Anyof1Boxed](#anyof1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Anyof1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Anyof1 public static class Anyof1
@@ -168,9 +174,11 @@ A schema class that validates payloads | [Anyof1BoxedBoolean](#anyof1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Anyof1BoxedMap](#anyof1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [Anyof1BoxedList](#anyof1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Anyof1Boxed](#anyof1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema1Boxed -public static abstract sealed class Schema1Boxed
+public sealed interface Schema1Boxed
permits
[Schema1BoxedVoid](#schema1boxedvoid), [Schema1BoxedBoolean](#schema1boxedboolean), @@ -179,103 +187,109 @@ permits
[Schema1BoxedList](#schema1boxedlist), [Schema1BoxedMap](#schema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema1BoxedVoid -public static final class Schema1BoxedVoid
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedVoid
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedBoolean -public static final class Schema1BoxedBoolean
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedBoolean
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedNumber -public static final class Schema1BoxedNumber
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedNumber
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedString -public static final class Schema1BoxedString
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedString
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedList -public static final class Schema1BoxedList
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedList
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedMap -public static final class Schema1BoxedMap
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedMap
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1 public static class Schema1
@@ -307,29 +321,32 @@ A schema class that validates payloads | [Schema1BoxedBoolean](#schema1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Schema1BoxedMap](#schema1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [Schema1BoxedList](#schema1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Schema1Boxed](#schema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema0Boxed -public static abstract sealed class Schema0Boxed
+public sealed interface Schema0Boxed
permits
[Schema0BoxedNumber](#schema0boxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema0BoxedNumber -public static final class Schema0BoxedNumber
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedNumber
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0 public static class Schema0
diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/AnyofComplexTypes.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/AnyofComplexTypes.md index 3b0fde2e61d..9d0ee6763c9 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/AnyofComplexTypes.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/AnyofComplexTypes.md @@ -4,7 +4,7 @@ public class AnyofComplexTypes
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,43 +12,43 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [AnyofComplexTypes.AnyofComplexTypes1Boxed](#anyofcomplextypes1boxed)
abstract sealed validated payload class | -| static class | [AnyofComplexTypes.AnyofComplexTypes1BoxedVoid](#anyofcomplextypes1boxedvoid)
boxed class to store validated null payloads | -| static class | [AnyofComplexTypes.AnyofComplexTypes1BoxedBoolean](#anyofcomplextypes1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [AnyofComplexTypes.AnyofComplexTypes1BoxedNumber](#anyofcomplextypes1boxednumber)
boxed class to store validated Number payloads | -| static class | [AnyofComplexTypes.AnyofComplexTypes1BoxedString](#anyofcomplextypes1boxedstring)
boxed class to store validated String payloads | -| static class | [AnyofComplexTypes.AnyofComplexTypes1BoxedList](#anyofcomplextypes1boxedlist)
boxed class to store validated List payloads | -| static class | [AnyofComplexTypes.AnyofComplexTypes1BoxedMap](#anyofcomplextypes1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AnyofComplexTypes.AnyofComplexTypes1Boxed](#anyofcomplextypes1boxed)
sealed interface for validated payloads | +| record | [AnyofComplexTypes.AnyofComplexTypes1BoxedVoid](#anyofcomplextypes1boxedvoid)
boxed class to store validated null payloads | +| record | [AnyofComplexTypes.AnyofComplexTypes1BoxedBoolean](#anyofcomplextypes1boxedboolean)
boxed class to store validated boolean payloads | +| record | [AnyofComplexTypes.AnyofComplexTypes1BoxedNumber](#anyofcomplextypes1boxednumber)
boxed class to store validated Number payloads | +| record | [AnyofComplexTypes.AnyofComplexTypes1BoxedString](#anyofcomplextypes1boxedstring)
boxed class to store validated String payloads | +| record | [AnyofComplexTypes.AnyofComplexTypes1BoxedList](#anyofcomplextypes1boxedlist)
boxed class to store validated List payloads | +| record | [AnyofComplexTypes.AnyofComplexTypes1BoxedMap](#anyofcomplextypes1boxedmap)
boxed class to store validated Map payloads | | static class | [AnyofComplexTypes.AnyofComplexTypes1](#anyofcomplextypes1)
schema class | -| static class | [AnyofComplexTypes.Schema1Boxed](#schema1boxed)
abstract sealed validated payload class | -| static class | [AnyofComplexTypes.Schema1BoxedVoid](#schema1boxedvoid)
boxed class to store validated null payloads | -| static class | [AnyofComplexTypes.Schema1BoxedBoolean](#schema1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [AnyofComplexTypes.Schema1BoxedNumber](#schema1boxednumber)
boxed class to store validated Number payloads | -| static class | [AnyofComplexTypes.Schema1BoxedString](#schema1boxedstring)
boxed class to store validated String payloads | -| static class | [AnyofComplexTypes.Schema1BoxedList](#schema1boxedlist)
boxed class to store validated List payloads | -| static class | [AnyofComplexTypes.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AnyofComplexTypes.Schema1Boxed](#schema1boxed)
sealed interface for validated payloads | +| record | [AnyofComplexTypes.Schema1BoxedVoid](#schema1boxedvoid)
boxed class to store validated null payloads | +| record | [AnyofComplexTypes.Schema1BoxedBoolean](#schema1boxedboolean)
boxed class to store validated boolean payloads | +| record | [AnyofComplexTypes.Schema1BoxedNumber](#schema1boxednumber)
boxed class to store validated Number payloads | +| record | [AnyofComplexTypes.Schema1BoxedString](#schema1boxedstring)
boxed class to store validated String payloads | +| record | [AnyofComplexTypes.Schema1BoxedList](#schema1boxedlist)
boxed class to store validated List payloads | +| record | [AnyofComplexTypes.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | | static class | [AnyofComplexTypes.Schema1](#schema1)
schema class | | static class | [AnyofComplexTypes.Schema1MapBuilder](#schema1mapbuilder)
builder for Map payloads | | static class | [AnyofComplexTypes.Schema1Map](#schema1map)
output class for Map payloads | -| static class | [AnyofComplexTypes.FooBoxed](#fooboxed)
abstract sealed validated payload class | -| static class | [AnyofComplexTypes.FooBoxedString](#fooboxedstring)
boxed class to store validated String payloads | +| sealed interface | [AnyofComplexTypes.FooBoxed](#fooboxed)
sealed interface for validated payloads | +| record | [AnyofComplexTypes.FooBoxedString](#fooboxedstring)
boxed class to store validated String payloads | | static class | [AnyofComplexTypes.Foo](#foo)
schema class | -| static class | [AnyofComplexTypes.Schema0Boxed](#schema0boxed)
abstract sealed validated payload class | -| static class | [AnyofComplexTypes.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | -| static class | [AnyofComplexTypes.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | -| static class | [AnyofComplexTypes.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | -| static class | [AnyofComplexTypes.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | -| static class | [AnyofComplexTypes.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | -| static class | [AnyofComplexTypes.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AnyofComplexTypes.Schema0Boxed](#schema0boxed)
sealed interface for validated payloads | +| record | [AnyofComplexTypes.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | +| record | [AnyofComplexTypes.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | +| record | [AnyofComplexTypes.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | +| record | [AnyofComplexTypes.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | +| record | [AnyofComplexTypes.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | +| record | [AnyofComplexTypes.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | | static class | [AnyofComplexTypes.Schema0](#schema0)
schema class | | static class | [AnyofComplexTypes.Schema0MapBuilder](#schema0mapbuilder)
builder for Map payloads | | static class | [AnyofComplexTypes.Schema0Map](#schema0map)
output class for Map payloads | -| static class | [AnyofComplexTypes.BarBoxed](#barboxed)
abstract sealed validated payload class | -| static class | [AnyofComplexTypes.BarBoxedNumber](#barboxednumber)
boxed class to store validated Number payloads | +| sealed interface | [AnyofComplexTypes.BarBoxed](#barboxed)
sealed interface for validated payloads | +| record | [AnyofComplexTypes.BarBoxedNumber](#barboxednumber)
boxed class to store validated Number payloads | | static class | [AnyofComplexTypes.Bar](#bar)
schema class | ## AnyofComplexTypes1Boxed -public static abstract sealed class AnyofComplexTypes1Boxed
+public sealed interface AnyofComplexTypes1Boxed
permits
[AnyofComplexTypes1BoxedVoid](#anyofcomplextypes1boxedvoid), [AnyofComplexTypes1BoxedBoolean](#anyofcomplextypes1boxedboolean), @@ -57,103 +57,109 @@ permits
[AnyofComplexTypes1BoxedList](#anyofcomplextypes1boxedlist), [AnyofComplexTypes1BoxedMap](#anyofcomplextypes1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AnyofComplexTypes1BoxedVoid -public static final class AnyofComplexTypes1BoxedVoid
-extends [AnyofComplexTypes1Boxed](#anyofcomplextypes1boxed) +public record AnyofComplexTypes1BoxedVoid
+implements [AnyofComplexTypes1Boxed](#anyofcomplextypes1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AnyofComplexTypes1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AnyofComplexTypes1BoxedBoolean -public static final class AnyofComplexTypes1BoxedBoolean
-extends [AnyofComplexTypes1Boxed](#anyofcomplextypes1boxed) +public record AnyofComplexTypes1BoxedBoolean
+implements [AnyofComplexTypes1Boxed](#anyofcomplextypes1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AnyofComplexTypes1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AnyofComplexTypes1BoxedNumber -public static final class AnyofComplexTypes1BoxedNumber
-extends [AnyofComplexTypes1Boxed](#anyofcomplextypes1boxed) +public record AnyofComplexTypes1BoxedNumber
+implements [AnyofComplexTypes1Boxed](#anyofcomplextypes1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AnyofComplexTypes1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AnyofComplexTypes1BoxedString -public static final class AnyofComplexTypes1BoxedString
-extends [AnyofComplexTypes1Boxed](#anyofcomplextypes1boxed) +public record AnyofComplexTypes1BoxedString
+implements [AnyofComplexTypes1Boxed](#anyofcomplextypes1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AnyofComplexTypes1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AnyofComplexTypes1BoxedList -public static final class AnyofComplexTypes1BoxedList
-extends [AnyofComplexTypes1Boxed](#anyofcomplextypes1boxed) +public record AnyofComplexTypes1BoxedList
+implements [AnyofComplexTypes1Boxed](#anyofcomplextypes1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AnyofComplexTypes1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AnyofComplexTypes1BoxedMap -public static final class AnyofComplexTypes1BoxedMap
-extends [AnyofComplexTypes1Boxed](#anyofcomplextypes1boxed) +public record AnyofComplexTypes1BoxedMap
+implements [AnyofComplexTypes1Boxed](#anyofcomplextypes1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AnyofComplexTypes1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AnyofComplexTypes1 public static class AnyofComplexTypes1
@@ -185,9 +191,11 @@ A schema class that validates payloads | [AnyofComplexTypes1BoxedBoolean](#anyofcomplextypes1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [AnyofComplexTypes1BoxedMap](#anyofcomplextypes1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [AnyofComplexTypes1BoxedList](#anyofcomplextypes1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [AnyofComplexTypes1Boxed](#anyofcomplextypes1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema1Boxed -public static abstract sealed class Schema1Boxed
+public sealed interface Schema1Boxed
permits
[Schema1BoxedVoid](#schema1boxedvoid), [Schema1BoxedBoolean](#schema1boxedboolean), @@ -196,103 +204,109 @@ permits
[Schema1BoxedList](#schema1boxedlist), [Schema1BoxedMap](#schema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema1BoxedVoid -public static final class Schema1BoxedVoid
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedVoid
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedBoolean -public static final class Schema1BoxedBoolean
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedBoolean
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedNumber -public static final class Schema1BoxedNumber
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedNumber
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedString -public static final class Schema1BoxedString
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedString
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedList -public static final class Schema1BoxedList
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedList
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedMap -public static final class Schema1BoxedMap
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedMap
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedMap([Schema1Map](#schema1map) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [Schema1Map](#schema1map) | data
validated payload | +| [Schema1Map](#schema1map) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1 public static class Schema1
@@ -325,7 +339,9 @@ A schema class that validates payloads | [Schema1BoxedBoolean](#schema1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Schema1BoxedMap](#schema1boxedmap) | validateAndBox([Map<?, ?>](#schema1mapbuilder) arg, SchemaConfiguration configuration) | | [Schema1BoxedList](#schema1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Schema1Boxed](#schema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema1Map0Builder public class Schema1Map0Builder
builder for `Map` @@ -381,27 +397,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## FooBoxed -public static abstract sealed class FooBoxed
+public sealed interface FooBoxed
permits
[FooBoxedString](#fooboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## FooBoxedString -public static final class FooBoxedString
-extends [FooBoxed](#fooboxed) +public record FooBoxedString
+implements [FooBoxed](#fooboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Foo public static class Foo
@@ -415,7 +432,7 @@ A schema class that validates payloads | validateAndBox | ## Schema0Boxed -public static abstract sealed class Schema0Boxed
+public sealed interface Schema0Boxed
permits
[Schema0BoxedVoid](#schema0boxedvoid), [Schema0BoxedBoolean](#schema0boxedboolean), @@ -424,103 +441,109 @@ permits
[Schema0BoxedList](#schema0boxedlist), [Schema0BoxedMap](#schema0boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema0BoxedVoid -public static final class Schema0BoxedVoid
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedVoid
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedBoolean -public static final class Schema0BoxedBoolean
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedBoolean
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedNumber -public static final class Schema0BoxedNumber
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedNumber
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedString -public static final class Schema0BoxedString
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedString
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedList -public static final class Schema0BoxedList
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedList
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedMap -public static final class Schema0BoxedMap
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedMap
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedMap([Schema0Map](#schema0map) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [Schema0Map](#schema0map) | data
validated payload | +| [Schema0Map](#schema0map) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0 public static class Schema0
@@ -553,7 +576,9 @@ A schema class that validates payloads | [Schema0BoxedBoolean](#schema0boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Schema0BoxedMap](#schema0boxedmap) | validateAndBox([Map<?, ?>](#schema0mapbuilder) arg, SchemaConfiguration configuration) | | [Schema0BoxedList](#schema0boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Schema0Boxed](#schema0boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema0Map0Builder public class Schema0Map0Builder
builder for `Map` @@ -612,27 +637,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## BarBoxed -public static abstract sealed class BarBoxed
+public sealed interface BarBoxed
permits
[BarBoxedNumber](#barboxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## BarBoxedNumber -public static final class BarBoxedNumber
-extends [BarBoxed](#barboxed) +public record BarBoxedNumber
+implements [BarBoxed](#barboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BarBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Bar public static class Bar
diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/AnyofWithBaseSchema.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/AnyofWithBaseSchema.md index 4f9f5d6e379..d0b22fd2a54 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/AnyofWithBaseSchema.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/AnyofWithBaseSchema.md @@ -4,54 +4,55 @@ public class AnyofWithBaseSchema
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [AnyofWithBaseSchema.AnyofWithBaseSchema1Boxed](#anyofwithbaseschema1boxed)
abstract sealed validated payload class | -| static class | [AnyofWithBaseSchema.AnyofWithBaseSchema1BoxedString](#anyofwithbaseschema1boxedstring)
boxed class to store validated String payloads | +| sealed interface | [AnyofWithBaseSchema.AnyofWithBaseSchema1Boxed](#anyofwithbaseschema1boxed)
sealed interface for validated payloads | +| record | [AnyofWithBaseSchema.AnyofWithBaseSchema1BoxedString](#anyofwithbaseschema1boxedstring)
boxed class to store validated String payloads | | static class | [AnyofWithBaseSchema.AnyofWithBaseSchema1](#anyofwithbaseschema1)
schema class | -| static class | [AnyofWithBaseSchema.Schema1Boxed](#schema1boxed)
abstract sealed validated payload class | -| static class | [AnyofWithBaseSchema.Schema1BoxedVoid](#schema1boxedvoid)
boxed class to store validated null payloads | -| static class | [AnyofWithBaseSchema.Schema1BoxedBoolean](#schema1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [AnyofWithBaseSchema.Schema1BoxedNumber](#schema1boxednumber)
boxed class to store validated Number payloads | -| static class | [AnyofWithBaseSchema.Schema1BoxedString](#schema1boxedstring)
boxed class to store validated String payloads | -| static class | [AnyofWithBaseSchema.Schema1BoxedList](#schema1boxedlist)
boxed class to store validated List payloads | -| static class | [AnyofWithBaseSchema.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AnyofWithBaseSchema.Schema1Boxed](#schema1boxed)
sealed interface for validated payloads | +| record | [AnyofWithBaseSchema.Schema1BoxedVoid](#schema1boxedvoid)
boxed class to store validated null payloads | +| record | [AnyofWithBaseSchema.Schema1BoxedBoolean](#schema1boxedboolean)
boxed class to store validated boolean payloads | +| record | [AnyofWithBaseSchema.Schema1BoxedNumber](#schema1boxednumber)
boxed class to store validated Number payloads | +| record | [AnyofWithBaseSchema.Schema1BoxedString](#schema1boxedstring)
boxed class to store validated String payloads | +| record | [AnyofWithBaseSchema.Schema1BoxedList](#schema1boxedlist)
boxed class to store validated List payloads | +| record | [AnyofWithBaseSchema.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | | static class | [AnyofWithBaseSchema.Schema1](#schema1)
schema class | -| static class | [AnyofWithBaseSchema.Schema0Boxed](#schema0boxed)
abstract sealed validated payload class | -| static class | [AnyofWithBaseSchema.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | -| static class | [AnyofWithBaseSchema.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | -| static class | [AnyofWithBaseSchema.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | -| static class | [AnyofWithBaseSchema.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | -| static class | [AnyofWithBaseSchema.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | -| static class | [AnyofWithBaseSchema.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AnyofWithBaseSchema.Schema0Boxed](#schema0boxed)
sealed interface for validated payloads | +| record | [AnyofWithBaseSchema.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | +| record | [AnyofWithBaseSchema.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | +| record | [AnyofWithBaseSchema.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | +| record | [AnyofWithBaseSchema.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | +| record | [AnyofWithBaseSchema.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | +| record | [AnyofWithBaseSchema.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | | static class | [AnyofWithBaseSchema.Schema0](#schema0)
schema class | ## AnyofWithBaseSchema1Boxed -public static abstract sealed class AnyofWithBaseSchema1Boxed
+public sealed interface AnyofWithBaseSchema1Boxed
permits
[AnyofWithBaseSchema1BoxedString](#anyofwithbaseschema1boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AnyofWithBaseSchema1BoxedString -public static final class AnyofWithBaseSchema1BoxedString
-extends [AnyofWithBaseSchema1Boxed](#anyofwithbaseschema1boxed) +public record AnyofWithBaseSchema1BoxedString
+implements [AnyofWithBaseSchema1Boxed](#anyofwithbaseschema1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AnyofWithBaseSchema1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AnyofWithBaseSchema1 public static class AnyofWithBaseSchema1
@@ -92,9 +93,11 @@ String validatedPayload = AnyofWithBaseSchema.AnyofWithBaseSchema1.validate( | ----------------- | ---------------------- | | String | validate(String arg, SchemaConfiguration configuration) | | [AnyofWithBaseSchema1BoxedString](#anyofwithbaseschema1boxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [AnyofWithBaseSchema1Boxed](#anyofwithbaseschema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema1Boxed -public static abstract sealed class Schema1Boxed
+public sealed interface Schema1Boxed
permits
[Schema1BoxedVoid](#schema1boxedvoid), [Schema1BoxedBoolean](#schema1boxedboolean), @@ -103,103 +106,109 @@ permits
[Schema1BoxedList](#schema1boxedlist), [Schema1BoxedMap](#schema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema1BoxedVoid -public static final class Schema1BoxedVoid
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedVoid
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedBoolean -public static final class Schema1BoxedBoolean
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedBoolean
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedNumber -public static final class Schema1BoxedNumber
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedNumber
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedString -public static final class Schema1BoxedString
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedString
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedList -public static final class Schema1BoxedList
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedList
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedMap -public static final class Schema1BoxedMap
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedMap
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1 public static class Schema1
@@ -231,9 +240,11 @@ A schema class that validates payloads | [Schema1BoxedBoolean](#schema1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Schema1BoxedMap](#schema1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [Schema1BoxedList](#schema1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Schema1Boxed](#schema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema0Boxed -public static abstract sealed class Schema0Boxed
+public sealed interface Schema0Boxed
permits
[Schema0BoxedVoid](#schema0boxedvoid), [Schema0BoxedBoolean](#schema0boxedboolean), @@ -242,103 +253,109 @@ permits
[Schema0BoxedList](#schema0boxedlist), [Schema0BoxedMap](#schema0boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema0BoxedVoid -public static final class Schema0BoxedVoid
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedVoid
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedBoolean -public static final class Schema0BoxedBoolean
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedBoolean
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedNumber -public static final class Schema0BoxedNumber
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedNumber
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedString -public static final class Schema0BoxedString
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedString
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedList -public static final class Schema0BoxedList
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedList
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedMap -public static final class Schema0BoxedMap
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedMap
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0 public static class Schema0
@@ -370,5 +387,7 @@ A schema class that validates payloads | [Schema0BoxedBoolean](#schema0boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Schema0BoxedMap](#schema0boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [Schema0BoxedList](#schema0boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Schema0Boxed](#schema0boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/AnyofWithOneEmptySchema.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/AnyofWithOneEmptySchema.md index 420dfa38f67..863a2b98c1b 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/AnyofWithOneEmptySchema.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/AnyofWithOneEmptySchema.md @@ -4,34 +4,34 @@ public class AnyofWithOneEmptySchema
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [AnyofWithOneEmptySchema.AnyofWithOneEmptySchema1Boxed](#anyofwithoneemptyschema1boxed)
abstract sealed validated payload class | -| static class | [AnyofWithOneEmptySchema.AnyofWithOneEmptySchema1BoxedVoid](#anyofwithoneemptyschema1boxedvoid)
boxed class to store validated null payloads | -| static class | [AnyofWithOneEmptySchema.AnyofWithOneEmptySchema1BoxedBoolean](#anyofwithoneemptyschema1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [AnyofWithOneEmptySchema.AnyofWithOneEmptySchema1BoxedNumber](#anyofwithoneemptyschema1boxednumber)
boxed class to store validated Number payloads | -| static class | [AnyofWithOneEmptySchema.AnyofWithOneEmptySchema1BoxedString](#anyofwithoneemptyschema1boxedstring)
boxed class to store validated String payloads | -| static class | [AnyofWithOneEmptySchema.AnyofWithOneEmptySchema1BoxedList](#anyofwithoneemptyschema1boxedlist)
boxed class to store validated List payloads | -| static class | [AnyofWithOneEmptySchema.AnyofWithOneEmptySchema1BoxedMap](#anyofwithoneemptyschema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AnyofWithOneEmptySchema.AnyofWithOneEmptySchema1Boxed](#anyofwithoneemptyschema1boxed)
sealed interface for validated payloads | +| record | [AnyofWithOneEmptySchema.AnyofWithOneEmptySchema1BoxedVoid](#anyofwithoneemptyschema1boxedvoid)
boxed class to store validated null payloads | +| record | [AnyofWithOneEmptySchema.AnyofWithOneEmptySchema1BoxedBoolean](#anyofwithoneemptyschema1boxedboolean)
boxed class to store validated boolean payloads | +| record | [AnyofWithOneEmptySchema.AnyofWithOneEmptySchema1BoxedNumber](#anyofwithoneemptyschema1boxednumber)
boxed class to store validated Number payloads | +| record | [AnyofWithOneEmptySchema.AnyofWithOneEmptySchema1BoxedString](#anyofwithoneemptyschema1boxedstring)
boxed class to store validated String payloads | +| record | [AnyofWithOneEmptySchema.AnyofWithOneEmptySchema1BoxedList](#anyofwithoneemptyschema1boxedlist)
boxed class to store validated List payloads | +| record | [AnyofWithOneEmptySchema.AnyofWithOneEmptySchema1BoxedMap](#anyofwithoneemptyschema1boxedmap)
boxed class to store validated Map payloads | | static class | [AnyofWithOneEmptySchema.AnyofWithOneEmptySchema1](#anyofwithoneemptyschema1)
schema class | -| static class | [AnyofWithOneEmptySchema.Schema1Boxed](#schema1boxed)
abstract sealed validated payload class | -| static class | [AnyofWithOneEmptySchema.Schema1BoxedVoid](#schema1boxedvoid)
boxed class to store validated null payloads | -| static class | [AnyofWithOneEmptySchema.Schema1BoxedBoolean](#schema1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [AnyofWithOneEmptySchema.Schema1BoxedNumber](#schema1boxednumber)
boxed class to store validated Number payloads | -| static class | [AnyofWithOneEmptySchema.Schema1BoxedString](#schema1boxedstring)
boxed class to store validated String payloads | -| static class | [AnyofWithOneEmptySchema.Schema1BoxedList](#schema1boxedlist)
boxed class to store validated List payloads | -| static class | [AnyofWithOneEmptySchema.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AnyofWithOneEmptySchema.Schema1Boxed](#schema1boxed)
sealed interface for validated payloads | +| record | [AnyofWithOneEmptySchema.Schema1BoxedVoid](#schema1boxedvoid)
boxed class to store validated null payloads | +| record | [AnyofWithOneEmptySchema.Schema1BoxedBoolean](#schema1boxedboolean)
boxed class to store validated boolean payloads | +| record | [AnyofWithOneEmptySchema.Schema1BoxedNumber](#schema1boxednumber)
boxed class to store validated Number payloads | +| record | [AnyofWithOneEmptySchema.Schema1BoxedString](#schema1boxedstring)
boxed class to store validated String payloads | +| record | [AnyofWithOneEmptySchema.Schema1BoxedList](#schema1boxedlist)
boxed class to store validated List payloads | +| record | [AnyofWithOneEmptySchema.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | | static class | [AnyofWithOneEmptySchema.Schema1](#schema1)
schema class | -| static class | [AnyofWithOneEmptySchema.Schema0Boxed](#schema0boxed)
abstract sealed validated payload class | -| static class | [AnyofWithOneEmptySchema.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | +| sealed interface | [AnyofWithOneEmptySchema.Schema0Boxed](#schema0boxed)
sealed interface for validated payloads | +| record | [AnyofWithOneEmptySchema.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | | static class | [AnyofWithOneEmptySchema.Schema0](#schema0)
schema class | ## AnyofWithOneEmptySchema1Boxed -public static abstract sealed class AnyofWithOneEmptySchema1Boxed
+public sealed interface AnyofWithOneEmptySchema1Boxed
permits
[AnyofWithOneEmptySchema1BoxedVoid](#anyofwithoneemptyschema1boxedvoid), [AnyofWithOneEmptySchema1BoxedBoolean](#anyofwithoneemptyschema1boxedboolean), @@ -40,103 +40,109 @@ permits
[AnyofWithOneEmptySchema1BoxedList](#anyofwithoneemptyschema1boxedlist), [AnyofWithOneEmptySchema1BoxedMap](#anyofwithoneemptyschema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AnyofWithOneEmptySchema1BoxedVoid -public static final class AnyofWithOneEmptySchema1BoxedVoid
-extends [AnyofWithOneEmptySchema1Boxed](#anyofwithoneemptyschema1boxed) +public record AnyofWithOneEmptySchema1BoxedVoid
+implements [AnyofWithOneEmptySchema1Boxed](#anyofwithoneemptyschema1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AnyofWithOneEmptySchema1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AnyofWithOneEmptySchema1BoxedBoolean -public static final class AnyofWithOneEmptySchema1BoxedBoolean
-extends [AnyofWithOneEmptySchema1Boxed](#anyofwithoneemptyschema1boxed) +public record AnyofWithOneEmptySchema1BoxedBoolean
+implements [AnyofWithOneEmptySchema1Boxed](#anyofwithoneemptyschema1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AnyofWithOneEmptySchema1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AnyofWithOneEmptySchema1BoxedNumber -public static final class AnyofWithOneEmptySchema1BoxedNumber
-extends [AnyofWithOneEmptySchema1Boxed](#anyofwithoneemptyschema1boxed) +public record AnyofWithOneEmptySchema1BoxedNumber
+implements [AnyofWithOneEmptySchema1Boxed](#anyofwithoneemptyschema1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AnyofWithOneEmptySchema1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AnyofWithOneEmptySchema1BoxedString -public static final class AnyofWithOneEmptySchema1BoxedString
-extends [AnyofWithOneEmptySchema1Boxed](#anyofwithoneemptyschema1boxed) +public record AnyofWithOneEmptySchema1BoxedString
+implements [AnyofWithOneEmptySchema1Boxed](#anyofwithoneemptyschema1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AnyofWithOneEmptySchema1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AnyofWithOneEmptySchema1BoxedList -public static final class AnyofWithOneEmptySchema1BoxedList
-extends [AnyofWithOneEmptySchema1Boxed](#anyofwithoneemptyschema1boxed) +public record AnyofWithOneEmptySchema1BoxedList
+implements [AnyofWithOneEmptySchema1Boxed](#anyofwithoneemptyschema1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AnyofWithOneEmptySchema1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AnyofWithOneEmptySchema1BoxedMap -public static final class AnyofWithOneEmptySchema1BoxedMap
-extends [AnyofWithOneEmptySchema1Boxed](#anyofwithoneemptyschema1boxed) +public record AnyofWithOneEmptySchema1BoxedMap
+implements [AnyofWithOneEmptySchema1Boxed](#anyofwithoneemptyschema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AnyofWithOneEmptySchema1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AnyofWithOneEmptySchema1 public static class AnyofWithOneEmptySchema1
@@ -168,9 +174,11 @@ A schema class that validates payloads | [AnyofWithOneEmptySchema1BoxedBoolean](#anyofwithoneemptyschema1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [AnyofWithOneEmptySchema1BoxedMap](#anyofwithoneemptyschema1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [AnyofWithOneEmptySchema1BoxedList](#anyofwithoneemptyschema1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [AnyofWithOneEmptySchema1Boxed](#anyofwithoneemptyschema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema1Boxed -public static abstract sealed class Schema1Boxed
+public sealed interface Schema1Boxed
permits
[Schema1BoxedVoid](#schema1boxedvoid), [Schema1BoxedBoolean](#schema1boxedboolean), @@ -179,103 +187,109 @@ permits
[Schema1BoxedList](#schema1boxedlist), [Schema1BoxedMap](#schema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema1BoxedVoid -public static final class Schema1BoxedVoid
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedVoid
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedBoolean -public static final class Schema1BoxedBoolean
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedBoolean
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedNumber -public static final class Schema1BoxedNumber
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedNumber
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedString -public static final class Schema1BoxedString
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedString
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedList -public static final class Schema1BoxedList
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedList
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedMap -public static final class Schema1BoxedMap
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedMap
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1 public static class Schema1
@@ -289,27 +303,28 @@ A schema class that validates payloads | validateAndBox | ## Schema0Boxed -public static abstract sealed class Schema0Boxed
+public sealed interface Schema0Boxed
permits
[Schema0BoxedNumber](#schema0boxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema0BoxedNumber -public static final class Schema0BoxedNumber
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedNumber
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0 public static class Schema0
diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/ArrayTypeMatchesArrays.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/ArrayTypeMatchesArrays.md index b260b0f451d..a81c51803a8 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/ArrayTypeMatchesArrays.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/ArrayTypeMatchesArrays.md @@ -4,38 +4,39 @@ public class ArrayTypeMatchesArrays
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ArrayTypeMatchesArrays.ArrayTypeMatchesArrays1Boxed](#arraytypematchesarrays1boxed)
abstract sealed validated payload class | -| static class | [ArrayTypeMatchesArrays.ArrayTypeMatchesArrays1BoxedList](#arraytypematchesarrays1boxedlist)
boxed class to store validated List payloads | +| sealed interface | [ArrayTypeMatchesArrays.ArrayTypeMatchesArrays1Boxed](#arraytypematchesarrays1boxed)
sealed interface for validated payloads | +| record | [ArrayTypeMatchesArrays.ArrayTypeMatchesArrays1BoxedList](#arraytypematchesarrays1boxedlist)
boxed class to store validated List payloads | | static class | [ArrayTypeMatchesArrays.ArrayTypeMatchesArrays1](#arraytypematchesarrays1)
schema class | ## ArrayTypeMatchesArrays1Boxed -public static abstract sealed class ArrayTypeMatchesArrays1Boxed
+public sealed interface ArrayTypeMatchesArrays1Boxed
permits
[ArrayTypeMatchesArrays1BoxedList](#arraytypematchesarrays1boxedlist) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ArrayTypeMatchesArrays1BoxedList -public static final class ArrayTypeMatchesArrays1BoxedList
-extends [ArrayTypeMatchesArrays1Boxed](#arraytypematchesarrays1boxed) +public record ArrayTypeMatchesArrays1BoxedList
+implements [ArrayTypeMatchesArrays1Boxed](#arraytypematchesarrays1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ArrayTypeMatchesArrays1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ArrayTypeMatchesArrays1 public static class ArrayTypeMatchesArrays1
diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/BooleanTypeMatchesBooleans.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/BooleanTypeMatchesBooleans.md index 5b620b259bf..96a41c9abfc 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/BooleanTypeMatchesBooleans.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/BooleanTypeMatchesBooleans.md @@ -4,38 +4,39 @@ public class BooleanTypeMatchesBooleans
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [BooleanTypeMatchesBooleans.BooleanTypeMatchesBooleans1Boxed](#booleantypematchesbooleans1boxed)
abstract sealed validated payload class | -| static class | [BooleanTypeMatchesBooleans.BooleanTypeMatchesBooleans1BoxedBoolean](#booleantypematchesbooleans1boxedboolean)
boxed class to store validated boolean payloads | +| sealed interface | [BooleanTypeMatchesBooleans.BooleanTypeMatchesBooleans1Boxed](#booleantypematchesbooleans1boxed)
sealed interface for validated payloads | +| record | [BooleanTypeMatchesBooleans.BooleanTypeMatchesBooleans1BoxedBoolean](#booleantypematchesbooleans1boxedboolean)
boxed class to store validated boolean payloads | | static class | [BooleanTypeMatchesBooleans.BooleanTypeMatchesBooleans1](#booleantypematchesbooleans1)
schema class | ## BooleanTypeMatchesBooleans1Boxed -public static abstract sealed class BooleanTypeMatchesBooleans1Boxed
+public sealed interface BooleanTypeMatchesBooleans1Boxed
permits
[BooleanTypeMatchesBooleans1BoxedBoolean](#booleantypematchesbooleans1boxedboolean) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## BooleanTypeMatchesBooleans1BoxedBoolean -public static final class BooleanTypeMatchesBooleans1BoxedBoolean
-extends [BooleanTypeMatchesBooleans1Boxed](#booleantypematchesbooleans1boxed) +public record BooleanTypeMatchesBooleans1BoxedBoolean
+implements [BooleanTypeMatchesBooleans1Boxed](#booleantypematchesbooleans1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BooleanTypeMatchesBooleans1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## BooleanTypeMatchesBooleans1 public static class BooleanTypeMatchesBooleans1
diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/ByInt.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/ByInt.md index 377a402b485..a403f2e86af 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/ByInt.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/ByInt.md @@ -4,23 +4,23 @@ public class ByInt
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ByInt.ByInt1Boxed](#byint1boxed)
abstract sealed validated payload class | -| static class | [ByInt.ByInt1BoxedVoid](#byint1boxedvoid)
boxed class to store validated null payloads | -| static class | [ByInt.ByInt1BoxedBoolean](#byint1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [ByInt.ByInt1BoxedNumber](#byint1boxednumber)
boxed class to store validated Number payloads | -| static class | [ByInt.ByInt1BoxedString](#byint1boxedstring)
boxed class to store validated String payloads | -| static class | [ByInt.ByInt1BoxedList](#byint1boxedlist)
boxed class to store validated List payloads | -| static class | [ByInt.ByInt1BoxedMap](#byint1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ByInt.ByInt1Boxed](#byint1boxed)
sealed interface for validated payloads | +| record | [ByInt.ByInt1BoxedVoid](#byint1boxedvoid)
boxed class to store validated null payloads | +| record | [ByInt.ByInt1BoxedBoolean](#byint1boxedboolean)
boxed class to store validated boolean payloads | +| record | [ByInt.ByInt1BoxedNumber](#byint1boxednumber)
boxed class to store validated Number payloads | +| record | [ByInt.ByInt1BoxedString](#byint1boxedstring)
boxed class to store validated String payloads | +| record | [ByInt.ByInt1BoxedList](#byint1boxedlist)
boxed class to store validated List payloads | +| record | [ByInt.ByInt1BoxedMap](#byint1boxedmap)
boxed class to store validated Map payloads | | static class | [ByInt.ByInt1](#byint1)
schema class | ## ByInt1Boxed -public static abstract sealed class ByInt1Boxed
+public sealed interface ByInt1Boxed
permits
[ByInt1BoxedVoid](#byint1boxedvoid), [ByInt1BoxedBoolean](#byint1boxedboolean), @@ -29,103 +29,109 @@ permits
[ByInt1BoxedList](#byint1boxedlist), [ByInt1BoxedMap](#byint1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ByInt1BoxedVoid -public static final class ByInt1BoxedVoid
-extends [ByInt1Boxed](#byint1boxed) +public record ByInt1BoxedVoid
+implements [ByInt1Boxed](#byint1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ByInt1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ByInt1BoxedBoolean -public static final class ByInt1BoxedBoolean
-extends [ByInt1Boxed](#byint1boxed) +public record ByInt1BoxedBoolean
+implements [ByInt1Boxed](#byint1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ByInt1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ByInt1BoxedNumber -public static final class ByInt1BoxedNumber
-extends [ByInt1Boxed](#byint1boxed) +public record ByInt1BoxedNumber
+implements [ByInt1Boxed](#byint1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ByInt1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ByInt1BoxedString -public static final class ByInt1BoxedString
-extends [ByInt1Boxed](#byint1boxed) +public record ByInt1BoxedString
+implements [ByInt1Boxed](#byint1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ByInt1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ByInt1BoxedList -public static final class ByInt1BoxedList
-extends [ByInt1Boxed](#byint1boxed) +public record ByInt1BoxedList
+implements [ByInt1Boxed](#byint1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ByInt1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ByInt1BoxedMap -public static final class ByInt1BoxedMap
-extends [ByInt1Boxed](#byint1boxed) +public record ByInt1BoxedMap
+implements [ByInt1Boxed](#byint1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ByInt1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ByInt1 public static class ByInt1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [ByInt1BoxedBoolean](#byint1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [ByInt1BoxedMap](#byint1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [ByInt1BoxedList](#byint1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [ByInt1Boxed](#byint1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/ByNumber.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/ByNumber.md index 392dc99034c..18757b1d71f 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/ByNumber.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/ByNumber.md @@ -4,23 +4,23 @@ public class ByNumber
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ByNumber.ByNumber1Boxed](#bynumber1boxed)
abstract sealed validated payload class | -| static class | [ByNumber.ByNumber1BoxedVoid](#bynumber1boxedvoid)
boxed class to store validated null payloads | -| static class | [ByNumber.ByNumber1BoxedBoolean](#bynumber1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [ByNumber.ByNumber1BoxedNumber](#bynumber1boxednumber)
boxed class to store validated Number payloads | -| static class | [ByNumber.ByNumber1BoxedString](#bynumber1boxedstring)
boxed class to store validated String payloads | -| static class | [ByNumber.ByNumber1BoxedList](#bynumber1boxedlist)
boxed class to store validated List payloads | -| static class | [ByNumber.ByNumber1BoxedMap](#bynumber1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ByNumber.ByNumber1Boxed](#bynumber1boxed)
sealed interface for validated payloads | +| record | [ByNumber.ByNumber1BoxedVoid](#bynumber1boxedvoid)
boxed class to store validated null payloads | +| record | [ByNumber.ByNumber1BoxedBoolean](#bynumber1boxedboolean)
boxed class to store validated boolean payloads | +| record | [ByNumber.ByNumber1BoxedNumber](#bynumber1boxednumber)
boxed class to store validated Number payloads | +| record | [ByNumber.ByNumber1BoxedString](#bynumber1boxedstring)
boxed class to store validated String payloads | +| record | [ByNumber.ByNumber1BoxedList](#bynumber1boxedlist)
boxed class to store validated List payloads | +| record | [ByNumber.ByNumber1BoxedMap](#bynumber1boxedmap)
boxed class to store validated Map payloads | | static class | [ByNumber.ByNumber1](#bynumber1)
schema class | ## ByNumber1Boxed -public static abstract sealed class ByNumber1Boxed
+public sealed interface ByNumber1Boxed
permits
[ByNumber1BoxedVoid](#bynumber1boxedvoid), [ByNumber1BoxedBoolean](#bynumber1boxedboolean), @@ -29,103 +29,109 @@ permits
[ByNumber1BoxedList](#bynumber1boxedlist), [ByNumber1BoxedMap](#bynumber1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ByNumber1BoxedVoid -public static final class ByNumber1BoxedVoid
-extends [ByNumber1Boxed](#bynumber1boxed) +public record ByNumber1BoxedVoid
+implements [ByNumber1Boxed](#bynumber1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ByNumber1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ByNumber1BoxedBoolean -public static final class ByNumber1BoxedBoolean
-extends [ByNumber1Boxed](#bynumber1boxed) +public record ByNumber1BoxedBoolean
+implements [ByNumber1Boxed](#bynumber1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ByNumber1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ByNumber1BoxedNumber -public static final class ByNumber1BoxedNumber
-extends [ByNumber1Boxed](#bynumber1boxed) +public record ByNumber1BoxedNumber
+implements [ByNumber1Boxed](#bynumber1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ByNumber1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ByNumber1BoxedString -public static final class ByNumber1BoxedString
-extends [ByNumber1Boxed](#bynumber1boxed) +public record ByNumber1BoxedString
+implements [ByNumber1Boxed](#bynumber1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ByNumber1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ByNumber1BoxedList -public static final class ByNumber1BoxedList
-extends [ByNumber1Boxed](#bynumber1boxed) +public record ByNumber1BoxedList
+implements [ByNumber1Boxed](#bynumber1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ByNumber1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ByNumber1BoxedMap -public static final class ByNumber1BoxedMap
-extends [ByNumber1Boxed](#bynumber1boxed) +public record ByNumber1BoxedMap
+implements [ByNumber1Boxed](#bynumber1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ByNumber1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ByNumber1 public static class ByNumber1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [ByNumber1BoxedBoolean](#bynumber1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [ByNumber1BoxedMap](#bynumber1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [ByNumber1BoxedList](#bynumber1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [ByNumber1Boxed](#bynumber1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/BySmallNumber.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/BySmallNumber.md index a611d905af7..db570d6827a 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/BySmallNumber.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/BySmallNumber.md @@ -4,23 +4,23 @@ public class BySmallNumber
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [BySmallNumber.BySmallNumber1Boxed](#bysmallnumber1boxed)
abstract sealed validated payload class | -| static class | [BySmallNumber.BySmallNumber1BoxedVoid](#bysmallnumber1boxedvoid)
boxed class to store validated null payloads | -| static class | [BySmallNumber.BySmallNumber1BoxedBoolean](#bysmallnumber1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [BySmallNumber.BySmallNumber1BoxedNumber](#bysmallnumber1boxednumber)
boxed class to store validated Number payloads | -| static class | [BySmallNumber.BySmallNumber1BoxedString](#bysmallnumber1boxedstring)
boxed class to store validated String payloads | -| static class | [BySmallNumber.BySmallNumber1BoxedList](#bysmallnumber1boxedlist)
boxed class to store validated List payloads | -| static class | [BySmallNumber.BySmallNumber1BoxedMap](#bysmallnumber1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [BySmallNumber.BySmallNumber1Boxed](#bysmallnumber1boxed)
sealed interface for validated payloads | +| record | [BySmallNumber.BySmallNumber1BoxedVoid](#bysmallnumber1boxedvoid)
boxed class to store validated null payloads | +| record | [BySmallNumber.BySmallNumber1BoxedBoolean](#bysmallnumber1boxedboolean)
boxed class to store validated boolean payloads | +| record | [BySmallNumber.BySmallNumber1BoxedNumber](#bysmallnumber1boxednumber)
boxed class to store validated Number payloads | +| record | [BySmallNumber.BySmallNumber1BoxedString](#bysmallnumber1boxedstring)
boxed class to store validated String payloads | +| record | [BySmallNumber.BySmallNumber1BoxedList](#bysmallnumber1boxedlist)
boxed class to store validated List payloads | +| record | [BySmallNumber.BySmallNumber1BoxedMap](#bysmallnumber1boxedmap)
boxed class to store validated Map payloads | | static class | [BySmallNumber.BySmallNumber1](#bysmallnumber1)
schema class | ## BySmallNumber1Boxed -public static abstract sealed class BySmallNumber1Boxed
+public sealed interface BySmallNumber1Boxed
permits
[BySmallNumber1BoxedVoid](#bysmallnumber1boxedvoid), [BySmallNumber1BoxedBoolean](#bysmallnumber1boxedboolean), @@ -29,103 +29,109 @@ permits
[BySmallNumber1BoxedList](#bysmallnumber1boxedlist), [BySmallNumber1BoxedMap](#bysmallnumber1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## BySmallNumber1BoxedVoid -public static final class BySmallNumber1BoxedVoid
-extends [BySmallNumber1Boxed](#bysmallnumber1boxed) +public record BySmallNumber1BoxedVoid
+implements [BySmallNumber1Boxed](#bysmallnumber1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BySmallNumber1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## BySmallNumber1BoxedBoolean -public static final class BySmallNumber1BoxedBoolean
-extends [BySmallNumber1Boxed](#bysmallnumber1boxed) +public record BySmallNumber1BoxedBoolean
+implements [BySmallNumber1Boxed](#bysmallnumber1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BySmallNumber1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## BySmallNumber1BoxedNumber -public static final class BySmallNumber1BoxedNumber
-extends [BySmallNumber1Boxed](#bysmallnumber1boxed) +public record BySmallNumber1BoxedNumber
+implements [BySmallNumber1Boxed](#bysmallnumber1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BySmallNumber1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## BySmallNumber1BoxedString -public static final class BySmallNumber1BoxedString
-extends [BySmallNumber1Boxed](#bysmallnumber1boxed) +public record BySmallNumber1BoxedString
+implements [BySmallNumber1Boxed](#bysmallnumber1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BySmallNumber1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## BySmallNumber1BoxedList -public static final class BySmallNumber1BoxedList
-extends [BySmallNumber1Boxed](#bysmallnumber1boxed) +public record BySmallNumber1BoxedList
+implements [BySmallNumber1Boxed](#bysmallnumber1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BySmallNumber1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## BySmallNumber1BoxedMap -public static final class BySmallNumber1BoxedMap
-extends [BySmallNumber1Boxed](#bysmallnumber1boxed) +public record BySmallNumber1BoxedMap
+implements [BySmallNumber1Boxed](#bysmallnumber1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BySmallNumber1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## BySmallNumber1 public static class BySmallNumber1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [BySmallNumber1BoxedBoolean](#bysmallnumber1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [BySmallNumber1BoxedMap](#bysmallnumber1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [BySmallNumber1BoxedList](#bysmallnumber1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [BySmallNumber1Boxed](#bysmallnumber1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/ConstNulCharactersInStrings.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/ConstNulCharactersInStrings.md index ac1000de6c6..e406aa2b1d1 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/ConstNulCharactersInStrings.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/ConstNulCharactersInStrings.md @@ -4,25 +4,25 @@ public class ConstNulCharactersInStrings
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - enum classes ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ConstNulCharactersInStrings.ConstNulCharactersInStrings1Boxed](#constnulcharactersinstrings1boxed)
abstract sealed validated payload class | -| static class | [ConstNulCharactersInStrings.ConstNulCharactersInStrings1BoxedVoid](#constnulcharactersinstrings1boxedvoid)
boxed class to store validated null payloads | -| static class | [ConstNulCharactersInStrings.ConstNulCharactersInStrings1BoxedBoolean](#constnulcharactersinstrings1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [ConstNulCharactersInStrings.ConstNulCharactersInStrings1BoxedNumber](#constnulcharactersinstrings1boxednumber)
boxed class to store validated Number payloads | -| static class | [ConstNulCharactersInStrings.ConstNulCharactersInStrings1BoxedString](#constnulcharactersinstrings1boxedstring)
boxed class to store validated String payloads | -| static class | [ConstNulCharactersInStrings.ConstNulCharactersInStrings1BoxedList](#constnulcharactersinstrings1boxedlist)
boxed class to store validated List payloads | -| static class | [ConstNulCharactersInStrings.ConstNulCharactersInStrings1BoxedMap](#constnulcharactersinstrings1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ConstNulCharactersInStrings.ConstNulCharactersInStrings1Boxed](#constnulcharactersinstrings1boxed)
sealed interface for validated payloads | +| record | [ConstNulCharactersInStrings.ConstNulCharactersInStrings1BoxedVoid](#constnulcharactersinstrings1boxedvoid)
boxed class to store validated null payloads | +| record | [ConstNulCharactersInStrings.ConstNulCharactersInStrings1BoxedBoolean](#constnulcharactersinstrings1boxedboolean)
boxed class to store validated boolean payloads | +| record | [ConstNulCharactersInStrings.ConstNulCharactersInStrings1BoxedNumber](#constnulcharactersinstrings1boxednumber)
boxed class to store validated Number payloads | +| record | [ConstNulCharactersInStrings.ConstNulCharactersInStrings1BoxedString](#constnulcharactersinstrings1boxedstring)
boxed class to store validated String payloads | +| record | [ConstNulCharactersInStrings.ConstNulCharactersInStrings1BoxedList](#constnulcharactersinstrings1boxedlist)
boxed class to store validated List payloads | +| record | [ConstNulCharactersInStrings.ConstNulCharactersInStrings1BoxedMap](#constnulcharactersinstrings1boxedmap)
boxed class to store validated Map payloads | | static class | [ConstNulCharactersInStrings.ConstNulCharactersInStrings1](#constnulcharactersinstrings1)
schema class | | enum | [ConstNulCharactersInStrings.StringConstNulCharactersInStringsConst](#stringconstnulcharactersinstringsconst)
String enum | ## ConstNulCharactersInStrings1Boxed -public static abstract sealed class ConstNulCharactersInStrings1Boxed
+public sealed interface ConstNulCharactersInStrings1Boxed
permits
[ConstNulCharactersInStrings1BoxedVoid](#constnulcharactersinstrings1boxedvoid), [ConstNulCharactersInStrings1BoxedBoolean](#constnulcharactersinstrings1boxedboolean), @@ -31,103 +31,109 @@ permits
[ConstNulCharactersInStrings1BoxedList](#constnulcharactersinstrings1boxedlist), [ConstNulCharactersInStrings1BoxedMap](#constnulcharactersinstrings1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ConstNulCharactersInStrings1BoxedVoid -public static final class ConstNulCharactersInStrings1BoxedVoid
-extends [ConstNulCharactersInStrings1Boxed](#constnulcharactersinstrings1boxed) +public record ConstNulCharactersInStrings1BoxedVoid
+implements [ConstNulCharactersInStrings1Boxed](#constnulcharactersinstrings1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ConstNulCharactersInStrings1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ConstNulCharactersInStrings1BoxedBoolean -public static final class ConstNulCharactersInStrings1BoxedBoolean
-extends [ConstNulCharactersInStrings1Boxed](#constnulcharactersinstrings1boxed) +public record ConstNulCharactersInStrings1BoxedBoolean
+implements [ConstNulCharactersInStrings1Boxed](#constnulcharactersinstrings1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ConstNulCharactersInStrings1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ConstNulCharactersInStrings1BoxedNumber -public static final class ConstNulCharactersInStrings1BoxedNumber
-extends [ConstNulCharactersInStrings1Boxed](#constnulcharactersinstrings1boxed) +public record ConstNulCharactersInStrings1BoxedNumber
+implements [ConstNulCharactersInStrings1Boxed](#constnulcharactersinstrings1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ConstNulCharactersInStrings1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ConstNulCharactersInStrings1BoxedString -public static final class ConstNulCharactersInStrings1BoxedString
-extends [ConstNulCharactersInStrings1Boxed](#constnulcharactersinstrings1boxed) +public record ConstNulCharactersInStrings1BoxedString
+implements [ConstNulCharactersInStrings1Boxed](#constnulcharactersinstrings1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ConstNulCharactersInStrings1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ConstNulCharactersInStrings1BoxedList -public static final class ConstNulCharactersInStrings1BoxedList
-extends [ConstNulCharactersInStrings1Boxed](#constnulcharactersinstrings1boxed) +public record ConstNulCharactersInStrings1BoxedList
+implements [ConstNulCharactersInStrings1Boxed](#constnulcharactersinstrings1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ConstNulCharactersInStrings1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ConstNulCharactersInStrings1BoxedMap -public static final class ConstNulCharactersInStrings1BoxedMap
-extends [ConstNulCharactersInStrings1Boxed](#constnulcharactersinstrings1boxed) +public record ConstNulCharactersInStrings1BoxedMap
+implements [ConstNulCharactersInStrings1Boxed](#constnulcharactersinstrings1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ConstNulCharactersInStrings1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ConstNulCharactersInStrings1 public static class ConstNulCharactersInStrings1
@@ -159,7 +165,9 @@ A schema class that validates payloads | [ConstNulCharactersInStrings1BoxedBoolean](#constnulcharactersinstrings1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [ConstNulCharactersInStrings1BoxedMap](#constnulcharactersinstrings1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [ConstNulCharactersInStrings1BoxedList](#constnulcharactersinstrings1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [ConstNulCharactersInStrings1Boxed](#constnulcharactersinstrings1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## StringConstNulCharactersInStringsConst public enum StringConstNulCharactersInStringsConst
extends `Enum` diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/ContainsKeywordValidation.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/ContainsKeywordValidation.md index decc1ece47f..939c4213f16 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/ContainsKeywordValidation.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/ContainsKeywordValidation.md @@ -4,31 +4,31 @@ public class ContainsKeywordValidation
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ContainsKeywordValidation.ContainsKeywordValidation1Boxed](#containskeywordvalidation1boxed)
abstract sealed validated payload class | -| static class | [ContainsKeywordValidation.ContainsKeywordValidation1BoxedVoid](#containskeywordvalidation1boxedvoid)
boxed class to store validated null payloads | -| static class | [ContainsKeywordValidation.ContainsKeywordValidation1BoxedBoolean](#containskeywordvalidation1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [ContainsKeywordValidation.ContainsKeywordValidation1BoxedNumber](#containskeywordvalidation1boxednumber)
boxed class to store validated Number payloads | -| static class | [ContainsKeywordValidation.ContainsKeywordValidation1BoxedString](#containskeywordvalidation1boxedstring)
boxed class to store validated String payloads | -| static class | [ContainsKeywordValidation.ContainsKeywordValidation1BoxedList](#containskeywordvalidation1boxedlist)
boxed class to store validated List payloads | -| static class | [ContainsKeywordValidation.ContainsKeywordValidation1BoxedMap](#containskeywordvalidation1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ContainsKeywordValidation.ContainsKeywordValidation1Boxed](#containskeywordvalidation1boxed)
sealed interface for validated payloads | +| record | [ContainsKeywordValidation.ContainsKeywordValidation1BoxedVoid](#containskeywordvalidation1boxedvoid)
boxed class to store validated null payloads | +| record | [ContainsKeywordValidation.ContainsKeywordValidation1BoxedBoolean](#containskeywordvalidation1boxedboolean)
boxed class to store validated boolean payloads | +| record | [ContainsKeywordValidation.ContainsKeywordValidation1BoxedNumber](#containskeywordvalidation1boxednumber)
boxed class to store validated Number payloads | +| record | [ContainsKeywordValidation.ContainsKeywordValidation1BoxedString](#containskeywordvalidation1boxedstring)
boxed class to store validated String payloads | +| record | [ContainsKeywordValidation.ContainsKeywordValidation1BoxedList](#containskeywordvalidation1boxedlist)
boxed class to store validated List payloads | +| record | [ContainsKeywordValidation.ContainsKeywordValidation1BoxedMap](#containskeywordvalidation1boxedmap)
boxed class to store validated Map payloads | | static class | [ContainsKeywordValidation.ContainsKeywordValidation1](#containskeywordvalidation1)
schema class | -| static class | [ContainsKeywordValidation.ContainsBoxed](#containsboxed)
abstract sealed validated payload class | -| static class | [ContainsKeywordValidation.ContainsBoxedVoid](#containsboxedvoid)
boxed class to store validated null payloads | -| static class | [ContainsKeywordValidation.ContainsBoxedBoolean](#containsboxedboolean)
boxed class to store validated boolean payloads | -| static class | [ContainsKeywordValidation.ContainsBoxedNumber](#containsboxednumber)
boxed class to store validated Number payloads | -| static class | [ContainsKeywordValidation.ContainsBoxedString](#containsboxedstring)
boxed class to store validated String payloads | -| static class | [ContainsKeywordValidation.ContainsBoxedList](#containsboxedlist)
boxed class to store validated List payloads | -| static class | [ContainsKeywordValidation.ContainsBoxedMap](#containsboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ContainsKeywordValidation.ContainsBoxed](#containsboxed)
sealed interface for validated payloads | +| record | [ContainsKeywordValidation.ContainsBoxedVoid](#containsboxedvoid)
boxed class to store validated null payloads | +| record | [ContainsKeywordValidation.ContainsBoxedBoolean](#containsboxedboolean)
boxed class to store validated boolean payloads | +| record | [ContainsKeywordValidation.ContainsBoxedNumber](#containsboxednumber)
boxed class to store validated Number payloads | +| record | [ContainsKeywordValidation.ContainsBoxedString](#containsboxedstring)
boxed class to store validated String payloads | +| record | [ContainsKeywordValidation.ContainsBoxedList](#containsboxedlist)
boxed class to store validated List payloads | +| record | [ContainsKeywordValidation.ContainsBoxedMap](#containsboxedmap)
boxed class to store validated Map payloads | | static class | [ContainsKeywordValidation.Contains](#contains)
schema class | ## ContainsKeywordValidation1Boxed -public static abstract sealed class ContainsKeywordValidation1Boxed
+public sealed interface ContainsKeywordValidation1Boxed
permits
[ContainsKeywordValidation1BoxedVoid](#containskeywordvalidation1boxedvoid), [ContainsKeywordValidation1BoxedBoolean](#containskeywordvalidation1boxedboolean), @@ -37,103 +37,109 @@ permits
[ContainsKeywordValidation1BoxedList](#containskeywordvalidation1boxedlist), [ContainsKeywordValidation1BoxedMap](#containskeywordvalidation1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ContainsKeywordValidation1BoxedVoid -public static final class ContainsKeywordValidation1BoxedVoid
-extends [ContainsKeywordValidation1Boxed](#containskeywordvalidation1boxed) +public record ContainsKeywordValidation1BoxedVoid
+implements [ContainsKeywordValidation1Boxed](#containskeywordvalidation1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ContainsKeywordValidation1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ContainsKeywordValidation1BoxedBoolean -public static final class ContainsKeywordValidation1BoxedBoolean
-extends [ContainsKeywordValidation1Boxed](#containskeywordvalidation1boxed) +public record ContainsKeywordValidation1BoxedBoolean
+implements [ContainsKeywordValidation1Boxed](#containskeywordvalidation1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ContainsKeywordValidation1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ContainsKeywordValidation1BoxedNumber -public static final class ContainsKeywordValidation1BoxedNumber
-extends [ContainsKeywordValidation1Boxed](#containskeywordvalidation1boxed) +public record ContainsKeywordValidation1BoxedNumber
+implements [ContainsKeywordValidation1Boxed](#containskeywordvalidation1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ContainsKeywordValidation1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ContainsKeywordValidation1BoxedString -public static final class ContainsKeywordValidation1BoxedString
-extends [ContainsKeywordValidation1Boxed](#containskeywordvalidation1boxed) +public record ContainsKeywordValidation1BoxedString
+implements [ContainsKeywordValidation1Boxed](#containskeywordvalidation1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ContainsKeywordValidation1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ContainsKeywordValidation1BoxedList -public static final class ContainsKeywordValidation1BoxedList
-extends [ContainsKeywordValidation1Boxed](#containskeywordvalidation1boxed) +public record ContainsKeywordValidation1BoxedList
+implements [ContainsKeywordValidation1Boxed](#containskeywordvalidation1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ContainsKeywordValidation1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ContainsKeywordValidation1BoxedMap -public static final class ContainsKeywordValidation1BoxedMap
-extends [ContainsKeywordValidation1Boxed](#containskeywordvalidation1boxed) +public record ContainsKeywordValidation1BoxedMap
+implements [ContainsKeywordValidation1Boxed](#containskeywordvalidation1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ContainsKeywordValidation1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ContainsKeywordValidation1 public static class ContainsKeywordValidation1
@@ -165,9 +171,11 @@ A schema class that validates payloads | [ContainsKeywordValidation1BoxedBoolean](#containskeywordvalidation1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [ContainsKeywordValidation1BoxedMap](#containskeywordvalidation1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [ContainsKeywordValidation1BoxedList](#containskeywordvalidation1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [ContainsKeywordValidation1Boxed](#containskeywordvalidation1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ContainsBoxed -public static abstract sealed class ContainsBoxed
+public sealed interface ContainsBoxed
permits
[ContainsBoxedVoid](#containsboxedvoid), [ContainsBoxedBoolean](#containsboxedboolean), @@ -176,103 +184,109 @@ permits
[ContainsBoxedList](#containsboxedlist), [ContainsBoxedMap](#containsboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ContainsBoxedVoid -public static final class ContainsBoxedVoid
-extends [ContainsBoxed](#containsboxed) +public record ContainsBoxedVoid
+implements [ContainsBoxed](#containsboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ContainsBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ContainsBoxedBoolean -public static final class ContainsBoxedBoolean
-extends [ContainsBoxed](#containsboxed) +public record ContainsBoxedBoolean
+implements [ContainsBoxed](#containsboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ContainsBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ContainsBoxedNumber -public static final class ContainsBoxedNumber
-extends [ContainsBoxed](#containsboxed) +public record ContainsBoxedNumber
+implements [ContainsBoxed](#containsboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ContainsBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ContainsBoxedString -public static final class ContainsBoxedString
-extends [ContainsBoxed](#containsboxed) +public record ContainsBoxedString
+implements [ContainsBoxed](#containsboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ContainsBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ContainsBoxedList -public static final class ContainsBoxedList
-extends [ContainsBoxed](#containsboxed) +public record ContainsBoxedList
+implements [ContainsBoxed](#containsboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ContainsBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ContainsBoxedMap -public static final class ContainsBoxedMap
-extends [ContainsBoxed](#containsboxed) +public record ContainsBoxedMap
+implements [ContainsBoxed](#containsboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ContainsBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Contains public static class Contains
@@ -304,5 +318,7 @@ A schema class that validates payloads | [ContainsBoxedBoolean](#containsboxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [ContainsBoxedMap](#containsboxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [ContainsBoxedList](#containsboxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [ContainsBoxed](#containsboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/ContainsWithNullInstanceElements.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/ContainsWithNullInstanceElements.md index c434fd7f958..ff7b6e33b02 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/ContainsWithNullInstanceElements.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/ContainsWithNullInstanceElements.md @@ -4,26 +4,26 @@ public class ContainsWithNullInstanceElements
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ContainsWithNullInstanceElements.ContainsWithNullInstanceElements1Boxed](#containswithnullinstanceelements1boxed)
abstract sealed validated payload class | -| static class | [ContainsWithNullInstanceElements.ContainsWithNullInstanceElements1BoxedVoid](#containswithnullinstanceelements1boxedvoid)
boxed class to store validated null payloads | -| static class | [ContainsWithNullInstanceElements.ContainsWithNullInstanceElements1BoxedBoolean](#containswithnullinstanceelements1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [ContainsWithNullInstanceElements.ContainsWithNullInstanceElements1BoxedNumber](#containswithnullinstanceelements1boxednumber)
boxed class to store validated Number payloads | -| static class | [ContainsWithNullInstanceElements.ContainsWithNullInstanceElements1BoxedString](#containswithnullinstanceelements1boxedstring)
boxed class to store validated String payloads | -| static class | [ContainsWithNullInstanceElements.ContainsWithNullInstanceElements1BoxedList](#containswithnullinstanceelements1boxedlist)
boxed class to store validated List payloads | -| static class | [ContainsWithNullInstanceElements.ContainsWithNullInstanceElements1BoxedMap](#containswithnullinstanceelements1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ContainsWithNullInstanceElements.ContainsWithNullInstanceElements1Boxed](#containswithnullinstanceelements1boxed)
sealed interface for validated payloads | +| record | [ContainsWithNullInstanceElements.ContainsWithNullInstanceElements1BoxedVoid](#containswithnullinstanceelements1boxedvoid)
boxed class to store validated null payloads | +| record | [ContainsWithNullInstanceElements.ContainsWithNullInstanceElements1BoxedBoolean](#containswithnullinstanceelements1boxedboolean)
boxed class to store validated boolean payloads | +| record | [ContainsWithNullInstanceElements.ContainsWithNullInstanceElements1BoxedNumber](#containswithnullinstanceelements1boxednumber)
boxed class to store validated Number payloads | +| record | [ContainsWithNullInstanceElements.ContainsWithNullInstanceElements1BoxedString](#containswithnullinstanceelements1boxedstring)
boxed class to store validated String payloads | +| record | [ContainsWithNullInstanceElements.ContainsWithNullInstanceElements1BoxedList](#containswithnullinstanceelements1boxedlist)
boxed class to store validated List payloads | +| record | [ContainsWithNullInstanceElements.ContainsWithNullInstanceElements1BoxedMap](#containswithnullinstanceelements1boxedmap)
boxed class to store validated Map payloads | | static class | [ContainsWithNullInstanceElements.ContainsWithNullInstanceElements1](#containswithnullinstanceelements1)
schema class | -| static class | [ContainsWithNullInstanceElements.ContainsBoxed](#containsboxed)
abstract sealed validated payload class | -| static class | [ContainsWithNullInstanceElements.ContainsBoxedVoid](#containsboxedvoid)
boxed class to store validated null payloads | +| sealed interface | [ContainsWithNullInstanceElements.ContainsBoxed](#containsboxed)
sealed interface for validated payloads | +| record | [ContainsWithNullInstanceElements.ContainsBoxedVoid](#containsboxedvoid)
boxed class to store validated null payloads | | static class | [ContainsWithNullInstanceElements.Contains](#contains)
schema class | ## ContainsWithNullInstanceElements1Boxed -public static abstract sealed class ContainsWithNullInstanceElements1Boxed
+public sealed interface ContainsWithNullInstanceElements1Boxed
permits
[ContainsWithNullInstanceElements1BoxedVoid](#containswithnullinstanceelements1boxedvoid), [ContainsWithNullInstanceElements1BoxedBoolean](#containswithnullinstanceelements1boxedboolean), @@ -32,103 +32,109 @@ permits
[ContainsWithNullInstanceElements1BoxedList](#containswithnullinstanceelements1boxedlist), [ContainsWithNullInstanceElements1BoxedMap](#containswithnullinstanceelements1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ContainsWithNullInstanceElements1BoxedVoid -public static final class ContainsWithNullInstanceElements1BoxedVoid
-extends [ContainsWithNullInstanceElements1Boxed](#containswithnullinstanceelements1boxed) +public record ContainsWithNullInstanceElements1BoxedVoid
+implements [ContainsWithNullInstanceElements1Boxed](#containswithnullinstanceelements1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ContainsWithNullInstanceElements1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ContainsWithNullInstanceElements1BoxedBoolean -public static final class ContainsWithNullInstanceElements1BoxedBoolean
-extends [ContainsWithNullInstanceElements1Boxed](#containswithnullinstanceelements1boxed) +public record ContainsWithNullInstanceElements1BoxedBoolean
+implements [ContainsWithNullInstanceElements1Boxed](#containswithnullinstanceelements1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ContainsWithNullInstanceElements1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ContainsWithNullInstanceElements1BoxedNumber -public static final class ContainsWithNullInstanceElements1BoxedNumber
-extends [ContainsWithNullInstanceElements1Boxed](#containswithnullinstanceelements1boxed) +public record ContainsWithNullInstanceElements1BoxedNumber
+implements [ContainsWithNullInstanceElements1Boxed](#containswithnullinstanceelements1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ContainsWithNullInstanceElements1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ContainsWithNullInstanceElements1BoxedString -public static final class ContainsWithNullInstanceElements1BoxedString
-extends [ContainsWithNullInstanceElements1Boxed](#containswithnullinstanceelements1boxed) +public record ContainsWithNullInstanceElements1BoxedString
+implements [ContainsWithNullInstanceElements1Boxed](#containswithnullinstanceelements1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ContainsWithNullInstanceElements1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ContainsWithNullInstanceElements1BoxedList -public static final class ContainsWithNullInstanceElements1BoxedList
-extends [ContainsWithNullInstanceElements1Boxed](#containswithnullinstanceelements1boxed) +public record ContainsWithNullInstanceElements1BoxedList
+implements [ContainsWithNullInstanceElements1Boxed](#containswithnullinstanceelements1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ContainsWithNullInstanceElements1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ContainsWithNullInstanceElements1BoxedMap -public static final class ContainsWithNullInstanceElements1BoxedMap
-extends [ContainsWithNullInstanceElements1Boxed](#containswithnullinstanceelements1boxed) +public record ContainsWithNullInstanceElements1BoxedMap
+implements [ContainsWithNullInstanceElements1Boxed](#containswithnullinstanceelements1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ContainsWithNullInstanceElements1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ContainsWithNullInstanceElements1 public static class ContainsWithNullInstanceElements1
@@ -160,29 +166,32 @@ A schema class that validates payloads | [ContainsWithNullInstanceElements1BoxedBoolean](#containswithnullinstanceelements1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [ContainsWithNullInstanceElements1BoxedMap](#containswithnullinstanceelements1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [ContainsWithNullInstanceElements1BoxedList](#containswithnullinstanceelements1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [ContainsWithNullInstanceElements1Boxed](#containswithnullinstanceelements1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ContainsBoxed -public static abstract sealed class ContainsBoxed
+public sealed interface ContainsBoxed
permits
[ContainsBoxedVoid](#containsboxedvoid) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ContainsBoxedVoid -public static final class ContainsBoxedVoid
-extends [ContainsBoxed](#containsboxed) +public record ContainsBoxedVoid
+implements [ContainsBoxed](#containsboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ContainsBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Contains public static class Contains
diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/DateFormat.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/DateFormat.md index ecf0b1d60bb..8e7001d5b91 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/DateFormat.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/DateFormat.md @@ -4,23 +4,23 @@ public class DateFormat
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [DateFormat.DateFormat1Boxed](#dateformat1boxed)
abstract sealed validated payload class | -| static class | [DateFormat.DateFormat1BoxedVoid](#dateformat1boxedvoid)
boxed class to store validated null payloads | -| static class | [DateFormat.DateFormat1BoxedBoolean](#dateformat1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [DateFormat.DateFormat1BoxedNumber](#dateformat1boxednumber)
boxed class to store validated Number payloads | -| static class | [DateFormat.DateFormat1BoxedString](#dateformat1boxedstring)
boxed class to store validated String payloads | -| static class | [DateFormat.DateFormat1BoxedList](#dateformat1boxedlist)
boxed class to store validated List payloads | -| static class | [DateFormat.DateFormat1BoxedMap](#dateformat1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [DateFormat.DateFormat1Boxed](#dateformat1boxed)
sealed interface for validated payloads | +| record | [DateFormat.DateFormat1BoxedVoid](#dateformat1boxedvoid)
boxed class to store validated null payloads | +| record | [DateFormat.DateFormat1BoxedBoolean](#dateformat1boxedboolean)
boxed class to store validated boolean payloads | +| record | [DateFormat.DateFormat1BoxedNumber](#dateformat1boxednumber)
boxed class to store validated Number payloads | +| record | [DateFormat.DateFormat1BoxedString](#dateformat1boxedstring)
boxed class to store validated String payloads | +| record | [DateFormat.DateFormat1BoxedList](#dateformat1boxedlist)
boxed class to store validated List payloads | +| record | [DateFormat.DateFormat1BoxedMap](#dateformat1boxedmap)
boxed class to store validated Map payloads | | static class | [DateFormat.DateFormat1](#dateformat1)
schema class | ## DateFormat1Boxed -public static abstract sealed class DateFormat1Boxed
+public sealed interface DateFormat1Boxed
permits
[DateFormat1BoxedVoid](#dateformat1boxedvoid), [DateFormat1BoxedBoolean](#dateformat1boxedboolean), @@ -29,103 +29,109 @@ permits
[DateFormat1BoxedList](#dateformat1boxedlist), [DateFormat1BoxedMap](#dateformat1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## DateFormat1BoxedVoid -public static final class DateFormat1BoxedVoid
-extends [DateFormat1Boxed](#dateformat1boxed) +public record DateFormat1BoxedVoid
+implements [DateFormat1Boxed](#dateformat1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DateFormat1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## DateFormat1BoxedBoolean -public static final class DateFormat1BoxedBoolean
-extends [DateFormat1Boxed](#dateformat1boxed) +public record DateFormat1BoxedBoolean
+implements [DateFormat1Boxed](#dateformat1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DateFormat1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## DateFormat1BoxedNumber -public static final class DateFormat1BoxedNumber
-extends [DateFormat1Boxed](#dateformat1boxed) +public record DateFormat1BoxedNumber
+implements [DateFormat1Boxed](#dateformat1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DateFormat1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## DateFormat1BoxedString -public static final class DateFormat1BoxedString
-extends [DateFormat1Boxed](#dateformat1boxed) +public record DateFormat1BoxedString
+implements [DateFormat1Boxed](#dateformat1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DateFormat1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## DateFormat1BoxedList -public static final class DateFormat1BoxedList
-extends [DateFormat1Boxed](#dateformat1boxed) +public record DateFormat1BoxedList
+implements [DateFormat1Boxed](#dateformat1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DateFormat1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## DateFormat1BoxedMap -public static final class DateFormat1BoxedMap
-extends [DateFormat1Boxed](#dateformat1boxed) +public record DateFormat1BoxedMap
+implements [DateFormat1Boxed](#dateformat1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DateFormat1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## DateFormat1 public static class DateFormat1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [DateFormat1BoxedBoolean](#dateformat1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [DateFormat1BoxedMap](#dateformat1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [DateFormat1BoxedList](#dateformat1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [DateFormat1Boxed](#dateformat1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/DateTimeFormat.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/DateTimeFormat.md index 43524236e9c..dc179875fd1 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/DateTimeFormat.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/DateTimeFormat.md @@ -4,23 +4,23 @@ public class DateTimeFormat
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [DateTimeFormat.DateTimeFormat1Boxed](#datetimeformat1boxed)
abstract sealed validated payload class | -| static class | [DateTimeFormat.DateTimeFormat1BoxedVoid](#datetimeformat1boxedvoid)
boxed class to store validated null payloads | -| static class | [DateTimeFormat.DateTimeFormat1BoxedBoolean](#datetimeformat1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [DateTimeFormat.DateTimeFormat1BoxedNumber](#datetimeformat1boxednumber)
boxed class to store validated Number payloads | -| static class | [DateTimeFormat.DateTimeFormat1BoxedString](#datetimeformat1boxedstring)
boxed class to store validated String payloads | -| static class | [DateTimeFormat.DateTimeFormat1BoxedList](#datetimeformat1boxedlist)
boxed class to store validated List payloads | -| static class | [DateTimeFormat.DateTimeFormat1BoxedMap](#datetimeformat1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [DateTimeFormat.DateTimeFormat1Boxed](#datetimeformat1boxed)
sealed interface for validated payloads | +| record | [DateTimeFormat.DateTimeFormat1BoxedVoid](#datetimeformat1boxedvoid)
boxed class to store validated null payloads | +| record | [DateTimeFormat.DateTimeFormat1BoxedBoolean](#datetimeformat1boxedboolean)
boxed class to store validated boolean payloads | +| record | [DateTimeFormat.DateTimeFormat1BoxedNumber](#datetimeformat1boxednumber)
boxed class to store validated Number payloads | +| record | [DateTimeFormat.DateTimeFormat1BoxedString](#datetimeformat1boxedstring)
boxed class to store validated String payloads | +| record | [DateTimeFormat.DateTimeFormat1BoxedList](#datetimeformat1boxedlist)
boxed class to store validated List payloads | +| record | [DateTimeFormat.DateTimeFormat1BoxedMap](#datetimeformat1boxedmap)
boxed class to store validated Map payloads | | static class | [DateTimeFormat.DateTimeFormat1](#datetimeformat1)
schema class | ## DateTimeFormat1Boxed -public static abstract sealed class DateTimeFormat1Boxed
+public sealed interface DateTimeFormat1Boxed
permits
[DateTimeFormat1BoxedVoid](#datetimeformat1boxedvoid), [DateTimeFormat1BoxedBoolean](#datetimeformat1boxedboolean), @@ -29,103 +29,109 @@ permits
[DateTimeFormat1BoxedList](#datetimeformat1boxedlist), [DateTimeFormat1BoxedMap](#datetimeformat1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## DateTimeFormat1BoxedVoid -public static final class DateTimeFormat1BoxedVoid
-extends [DateTimeFormat1Boxed](#datetimeformat1boxed) +public record DateTimeFormat1BoxedVoid
+implements [DateTimeFormat1Boxed](#datetimeformat1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DateTimeFormat1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## DateTimeFormat1BoxedBoolean -public static final class DateTimeFormat1BoxedBoolean
-extends [DateTimeFormat1Boxed](#datetimeformat1boxed) +public record DateTimeFormat1BoxedBoolean
+implements [DateTimeFormat1Boxed](#datetimeformat1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DateTimeFormat1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## DateTimeFormat1BoxedNumber -public static final class DateTimeFormat1BoxedNumber
-extends [DateTimeFormat1Boxed](#datetimeformat1boxed) +public record DateTimeFormat1BoxedNumber
+implements [DateTimeFormat1Boxed](#datetimeformat1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DateTimeFormat1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## DateTimeFormat1BoxedString -public static final class DateTimeFormat1BoxedString
-extends [DateTimeFormat1Boxed](#datetimeformat1boxed) +public record DateTimeFormat1BoxedString
+implements [DateTimeFormat1Boxed](#datetimeformat1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DateTimeFormat1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## DateTimeFormat1BoxedList -public static final class DateTimeFormat1BoxedList
-extends [DateTimeFormat1Boxed](#datetimeformat1boxed) +public record DateTimeFormat1BoxedList
+implements [DateTimeFormat1Boxed](#datetimeformat1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DateTimeFormat1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## DateTimeFormat1BoxedMap -public static final class DateTimeFormat1BoxedMap
-extends [DateTimeFormat1Boxed](#datetimeformat1boxed) +public record DateTimeFormat1BoxedMap
+implements [DateTimeFormat1Boxed](#datetimeformat1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DateTimeFormat1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## DateTimeFormat1 public static class DateTimeFormat1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [DateTimeFormat1BoxedBoolean](#datetimeformat1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [DateTimeFormat1BoxedMap](#datetimeformat1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [DateTimeFormat1BoxedList](#datetimeformat1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [DateTimeFormat1Boxed](#datetimeformat1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/DependentSchemasDependenciesWithEscapedCharacters.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/DependentSchemasDependenciesWithEscapedCharacters.md index ee583b0780d..cb50a64bfc5 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/DependentSchemasDependenciesWithEscapedCharacters.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/DependentSchemasDependenciesWithEscapedCharacters.md @@ -4,7 +4,7 @@ public class DependentSchemasDependenciesWithEscapedCharacters
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,35 +12,35 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [DependentSchemasDependenciesWithEscapedCharacters.DependentSchemasDependenciesWithEscapedCharacters1Boxed](#dependentschemasdependencieswithescapedcharacters1boxed)
abstract sealed validated payload class | -| static class | [DependentSchemasDependenciesWithEscapedCharacters.DependentSchemasDependenciesWithEscapedCharacters1BoxedVoid](#dependentschemasdependencieswithescapedcharacters1boxedvoid)
boxed class to store validated null payloads | -| static class | [DependentSchemasDependenciesWithEscapedCharacters.DependentSchemasDependenciesWithEscapedCharacters1BoxedBoolean](#dependentschemasdependencieswithescapedcharacters1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [DependentSchemasDependenciesWithEscapedCharacters.DependentSchemasDependenciesWithEscapedCharacters1BoxedNumber](#dependentschemasdependencieswithescapedcharacters1boxednumber)
boxed class to store validated Number payloads | -| static class | [DependentSchemasDependenciesWithEscapedCharacters.DependentSchemasDependenciesWithEscapedCharacters1BoxedString](#dependentschemasdependencieswithescapedcharacters1boxedstring)
boxed class to store validated String payloads | -| static class | [DependentSchemasDependenciesWithEscapedCharacters.DependentSchemasDependenciesWithEscapedCharacters1BoxedList](#dependentschemasdependencieswithescapedcharacters1boxedlist)
boxed class to store validated List payloads | -| static class | [DependentSchemasDependenciesWithEscapedCharacters.DependentSchemasDependenciesWithEscapedCharacters1BoxedMap](#dependentschemasdependencieswithescapedcharacters1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [DependentSchemasDependenciesWithEscapedCharacters.DependentSchemasDependenciesWithEscapedCharacters1Boxed](#dependentschemasdependencieswithescapedcharacters1boxed)
sealed interface for validated payloads | +| record | [DependentSchemasDependenciesWithEscapedCharacters.DependentSchemasDependenciesWithEscapedCharacters1BoxedVoid](#dependentschemasdependencieswithescapedcharacters1boxedvoid)
boxed class to store validated null payloads | +| record | [DependentSchemasDependenciesWithEscapedCharacters.DependentSchemasDependenciesWithEscapedCharacters1BoxedBoolean](#dependentschemasdependencieswithescapedcharacters1boxedboolean)
boxed class to store validated boolean payloads | +| record | [DependentSchemasDependenciesWithEscapedCharacters.DependentSchemasDependenciesWithEscapedCharacters1BoxedNumber](#dependentschemasdependencieswithescapedcharacters1boxednumber)
boxed class to store validated Number payloads | +| record | [DependentSchemasDependenciesWithEscapedCharacters.DependentSchemasDependenciesWithEscapedCharacters1BoxedString](#dependentschemasdependencieswithescapedcharacters1boxedstring)
boxed class to store validated String payloads | +| record | [DependentSchemasDependenciesWithEscapedCharacters.DependentSchemasDependenciesWithEscapedCharacters1BoxedList](#dependentschemasdependencieswithescapedcharacters1boxedlist)
boxed class to store validated List payloads | +| record | [DependentSchemasDependenciesWithEscapedCharacters.DependentSchemasDependenciesWithEscapedCharacters1BoxedMap](#dependentschemasdependencieswithescapedcharacters1boxedmap)
boxed class to store validated Map payloads | | static class | [DependentSchemasDependenciesWithEscapedCharacters.DependentSchemasDependenciesWithEscapedCharacters1](#dependentschemasdependencieswithescapedcharacters1)
schema class | -| static class | [DependentSchemasDependenciesWithEscapedCharacters.FoobarBoxed](#foobarboxed)
abstract sealed validated payload class | -| static class | [DependentSchemasDependenciesWithEscapedCharacters.FoobarBoxedVoid](#foobarboxedvoid)
boxed class to store validated null payloads | -| static class | [DependentSchemasDependenciesWithEscapedCharacters.FoobarBoxedBoolean](#foobarboxedboolean)
boxed class to store validated boolean payloads | -| static class | [DependentSchemasDependenciesWithEscapedCharacters.FoobarBoxedNumber](#foobarboxednumber)
boxed class to store validated Number payloads | -| static class | [DependentSchemasDependenciesWithEscapedCharacters.FoobarBoxedString](#foobarboxedstring)
boxed class to store validated String payloads | -| static class | [DependentSchemasDependenciesWithEscapedCharacters.FoobarBoxedList](#foobarboxedlist)
boxed class to store validated List payloads | -| static class | [DependentSchemasDependenciesWithEscapedCharacters.FoobarBoxedMap](#foobarboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [DependentSchemasDependenciesWithEscapedCharacters.FoobarBoxed](#foobarboxed)
sealed interface for validated payloads | +| record | [DependentSchemasDependenciesWithEscapedCharacters.FoobarBoxedVoid](#foobarboxedvoid)
boxed class to store validated null payloads | +| record | [DependentSchemasDependenciesWithEscapedCharacters.FoobarBoxedBoolean](#foobarboxedboolean)
boxed class to store validated boolean payloads | +| record | [DependentSchemasDependenciesWithEscapedCharacters.FoobarBoxedNumber](#foobarboxednumber)
boxed class to store validated Number payloads | +| record | [DependentSchemasDependenciesWithEscapedCharacters.FoobarBoxedString](#foobarboxedstring)
boxed class to store validated String payloads | +| record | [DependentSchemasDependenciesWithEscapedCharacters.FoobarBoxedList](#foobarboxedlist)
boxed class to store validated List payloads | +| record | [DependentSchemasDependenciesWithEscapedCharacters.FoobarBoxedMap](#foobarboxedmap)
boxed class to store validated Map payloads | | static class | [DependentSchemasDependenciesWithEscapedCharacters.Foobar](#foobar)
schema class | | static class | [DependentSchemasDependenciesWithEscapedCharacters.FoobarMapBuilder](#foobarmapbuilder)
builder for Map payloads | | static class | [DependentSchemasDependenciesWithEscapedCharacters.FoobarMap](#foobarmap)
output class for Map payloads | -| static class | [DependentSchemasDependenciesWithEscapedCharacters.FootbarBoxed](#footbarboxed)
abstract sealed validated payload class | -| static class | [DependentSchemasDependenciesWithEscapedCharacters.FootbarBoxedVoid](#footbarboxedvoid)
boxed class to store validated null payloads | -| static class | [DependentSchemasDependenciesWithEscapedCharacters.FootbarBoxedBoolean](#footbarboxedboolean)
boxed class to store validated boolean payloads | -| static class | [DependentSchemasDependenciesWithEscapedCharacters.FootbarBoxedNumber](#footbarboxednumber)
boxed class to store validated Number payloads | -| static class | [DependentSchemasDependenciesWithEscapedCharacters.FootbarBoxedString](#footbarboxedstring)
boxed class to store validated String payloads | -| static class | [DependentSchemasDependenciesWithEscapedCharacters.FootbarBoxedList](#footbarboxedlist)
boxed class to store validated List payloads | -| static class | [DependentSchemasDependenciesWithEscapedCharacters.FootbarBoxedMap](#footbarboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [DependentSchemasDependenciesWithEscapedCharacters.FootbarBoxed](#footbarboxed)
sealed interface for validated payloads | +| record | [DependentSchemasDependenciesWithEscapedCharacters.FootbarBoxedVoid](#footbarboxedvoid)
boxed class to store validated null payloads | +| record | [DependentSchemasDependenciesWithEscapedCharacters.FootbarBoxedBoolean](#footbarboxedboolean)
boxed class to store validated boolean payloads | +| record | [DependentSchemasDependenciesWithEscapedCharacters.FootbarBoxedNumber](#footbarboxednumber)
boxed class to store validated Number payloads | +| record | [DependentSchemasDependenciesWithEscapedCharacters.FootbarBoxedString](#footbarboxedstring)
boxed class to store validated String payloads | +| record | [DependentSchemasDependenciesWithEscapedCharacters.FootbarBoxedList](#footbarboxedlist)
boxed class to store validated List payloads | +| record | [DependentSchemasDependenciesWithEscapedCharacters.FootbarBoxedMap](#footbarboxedmap)
boxed class to store validated Map payloads | | static class | [DependentSchemasDependenciesWithEscapedCharacters.Footbar](#footbar)
schema class | ## DependentSchemasDependenciesWithEscapedCharacters1Boxed -public static abstract sealed class DependentSchemasDependenciesWithEscapedCharacters1Boxed
+public sealed interface DependentSchemasDependenciesWithEscapedCharacters1Boxed
permits
[DependentSchemasDependenciesWithEscapedCharacters1BoxedVoid](#dependentschemasdependencieswithescapedcharacters1boxedvoid), [DependentSchemasDependenciesWithEscapedCharacters1BoxedBoolean](#dependentschemasdependencieswithescapedcharacters1boxedboolean), @@ -49,103 +49,109 @@ permits
[DependentSchemasDependenciesWithEscapedCharacters1BoxedList](#dependentschemasdependencieswithescapedcharacters1boxedlist), [DependentSchemasDependenciesWithEscapedCharacters1BoxedMap](#dependentschemasdependencieswithescapedcharacters1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## DependentSchemasDependenciesWithEscapedCharacters1BoxedVoid -public static final class DependentSchemasDependenciesWithEscapedCharacters1BoxedVoid
-extends [DependentSchemasDependenciesWithEscapedCharacters1Boxed](#dependentschemasdependencieswithescapedcharacters1boxed) +public record DependentSchemasDependenciesWithEscapedCharacters1BoxedVoid
+implements [DependentSchemasDependenciesWithEscapedCharacters1Boxed](#dependentschemasdependencieswithescapedcharacters1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DependentSchemasDependenciesWithEscapedCharacters1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## DependentSchemasDependenciesWithEscapedCharacters1BoxedBoolean -public static final class DependentSchemasDependenciesWithEscapedCharacters1BoxedBoolean
-extends [DependentSchemasDependenciesWithEscapedCharacters1Boxed](#dependentschemasdependencieswithescapedcharacters1boxed) +public record DependentSchemasDependenciesWithEscapedCharacters1BoxedBoolean
+implements [DependentSchemasDependenciesWithEscapedCharacters1Boxed](#dependentschemasdependencieswithescapedcharacters1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DependentSchemasDependenciesWithEscapedCharacters1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## DependentSchemasDependenciesWithEscapedCharacters1BoxedNumber -public static final class DependentSchemasDependenciesWithEscapedCharacters1BoxedNumber
-extends [DependentSchemasDependenciesWithEscapedCharacters1Boxed](#dependentschemasdependencieswithescapedcharacters1boxed) +public record DependentSchemasDependenciesWithEscapedCharacters1BoxedNumber
+implements [DependentSchemasDependenciesWithEscapedCharacters1Boxed](#dependentschemasdependencieswithescapedcharacters1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DependentSchemasDependenciesWithEscapedCharacters1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## DependentSchemasDependenciesWithEscapedCharacters1BoxedString -public static final class DependentSchemasDependenciesWithEscapedCharacters1BoxedString
-extends [DependentSchemasDependenciesWithEscapedCharacters1Boxed](#dependentschemasdependencieswithescapedcharacters1boxed) +public record DependentSchemasDependenciesWithEscapedCharacters1BoxedString
+implements [DependentSchemasDependenciesWithEscapedCharacters1Boxed](#dependentschemasdependencieswithescapedcharacters1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DependentSchemasDependenciesWithEscapedCharacters1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## DependentSchemasDependenciesWithEscapedCharacters1BoxedList -public static final class DependentSchemasDependenciesWithEscapedCharacters1BoxedList
-extends [DependentSchemasDependenciesWithEscapedCharacters1Boxed](#dependentschemasdependencieswithescapedcharacters1boxed) +public record DependentSchemasDependenciesWithEscapedCharacters1BoxedList
+implements [DependentSchemasDependenciesWithEscapedCharacters1Boxed](#dependentschemasdependencieswithescapedcharacters1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DependentSchemasDependenciesWithEscapedCharacters1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## DependentSchemasDependenciesWithEscapedCharacters1BoxedMap -public static final class DependentSchemasDependenciesWithEscapedCharacters1BoxedMap
-extends [DependentSchemasDependenciesWithEscapedCharacters1Boxed](#dependentschemasdependencieswithescapedcharacters1boxed) +public record DependentSchemasDependenciesWithEscapedCharacters1BoxedMap
+implements [DependentSchemasDependenciesWithEscapedCharacters1Boxed](#dependentschemasdependencieswithescapedcharacters1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DependentSchemasDependenciesWithEscapedCharacters1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## DependentSchemasDependenciesWithEscapedCharacters1 public static class DependentSchemasDependenciesWithEscapedCharacters1
@@ -177,9 +183,11 @@ A schema class that validates payloads | [DependentSchemasDependenciesWithEscapedCharacters1BoxedBoolean](#dependentschemasdependencieswithescapedcharacters1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [DependentSchemasDependenciesWithEscapedCharacters1BoxedMap](#dependentschemasdependencieswithescapedcharacters1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [DependentSchemasDependenciesWithEscapedCharacters1BoxedList](#dependentschemasdependencieswithescapedcharacters1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [DependentSchemasDependenciesWithEscapedCharacters1Boxed](#dependentschemasdependencieswithescapedcharacters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## FoobarBoxed -public static abstract sealed class FoobarBoxed
+public sealed interface FoobarBoxed
permits
[FoobarBoxedVoid](#foobarboxedvoid), [FoobarBoxedBoolean](#foobarboxedboolean), @@ -188,103 +196,109 @@ permits
[FoobarBoxedList](#foobarboxedlist), [FoobarBoxedMap](#foobarboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## FoobarBoxedVoid -public static final class FoobarBoxedVoid
-extends [FoobarBoxed](#foobarboxed) +public record FoobarBoxedVoid
+implements [FoobarBoxed](#foobarboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FoobarBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FoobarBoxedBoolean -public static final class FoobarBoxedBoolean
-extends [FoobarBoxed](#foobarboxed) +public record FoobarBoxedBoolean
+implements [FoobarBoxed](#foobarboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FoobarBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FoobarBoxedNumber -public static final class FoobarBoxedNumber
-extends [FoobarBoxed](#foobarboxed) +public record FoobarBoxedNumber
+implements [FoobarBoxed](#foobarboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FoobarBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FoobarBoxedString -public static final class FoobarBoxedString
-extends [FoobarBoxed](#foobarboxed) +public record FoobarBoxedString
+implements [FoobarBoxed](#foobarboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FoobarBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FoobarBoxedList -public static final class FoobarBoxedList
-extends [FoobarBoxed](#foobarboxed) +public record FoobarBoxedList
+implements [FoobarBoxed](#foobarboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FoobarBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FoobarBoxedMap -public static final class FoobarBoxedMap
-extends [FoobarBoxed](#foobarboxed) +public record FoobarBoxedMap
+implements [FoobarBoxed](#foobarboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FoobarBoxedMap([FoobarMap](#foobarmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [FoobarMap](#foobarmap) | data
validated payload | +| [FoobarMap](#foobarmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Foobar public static class Foobar
@@ -316,7 +330,9 @@ A schema class that validates payloads | [FoobarBoxedBoolean](#foobarboxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [FoobarBoxedMap](#foobarboxedmap) | validateAndBox([Map<?, ?>](#foobarmapbuilder) arg, SchemaConfiguration configuration) | | [FoobarBoxedList](#foobarboxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [FoobarBoxed](#foobarboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## FoobarMap0Builder public class FoobarMap0Builder
builder for `Map` @@ -380,7 +396,7 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## FootbarBoxed -public static abstract sealed class FootbarBoxed
+public sealed interface FootbarBoxed
permits
[FootbarBoxedVoid](#footbarboxedvoid), [FootbarBoxedBoolean](#footbarboxedboolean), @@ -389,103 +405,109 @@ permits
[FootbarBoxedList](#footbarboxedlist), [FootbarBoxedMap](#footbarboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## FootbarBoxedVoid -public static final class FootbarBoxedVoid
-extends [FootbarBoxed](#footbarboxed) +public record FootbarBoxedVoid
+implements [FootbarBoxed](#footbarboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FootbarBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FootbarBoxedBoolean -public static final class FootbarBoxedBoolean
-extends [FootbarBoxed](#footbarboxed) +public record FootbarBoxedBoolean
+implements [FootbarBoxed](#footbarboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FootbarBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FootbarBoxedNumber -public static final class FootbarBoxedNumber
-extends [FootbarBoxed](#footbarboxed) +public record FootbarBoxedNumber
+implements [FootbarBoxed](#footbarboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FootbarBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FootbarBoxedString -public static final class FootbarBoxedString
-extends [FootbarBoxed](#footbarboxed) +public record FootbarBoxedString
+implements [FootbarBoxed](#footbarboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FootbarBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FootbarBoxedList -public static final class FootbarBoxedList
-extends [FootbarBoxed](#footbarboxed) +public record FootbarBoxedList
+implements [FootbarBoxed](#footbarboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FootbarBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FootbarBoxedMap -public static final class FootbarBoxedMap
-extends [FootbarBoxed](#footbarboxed) +public record FootbarBoxedMap
+implements [FootbarBoxed](#footbarboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FootbarBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Footbar public static class Footbar
@@ -517,5 +539,7 @@ A schema class that validates payloads | [FootbarBoxedBoolean](#footbarboxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [FootbarBoxedMap](#footbarboxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [FootbarBoxedList](#footbarboxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [FootbarBoxed](#footbarboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/DependentSchemasDependentSubschemaIncompatibleWithRoot.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/DependentSchemasDependentSubschemaIncompatibleWithRoot.md index 7679e687c06..610f9927a97 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/DependentSchemasDependentSubschemaIncompatibleWithRoot.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/DependentSchemasDependentSubschemaIncompatibleWithRoot.md @@ -4,7 +4,7 @@ public class DependentSchemasDependentSubschemaIncompatibleWithRoot
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,48 +12,48 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [DependentSchemasDependentSubschemaIncompatibleWithRoot.DependentSchemasDependentSubschemaIncompatibleWithRoot1Boxed](#dependentschemasdependentsubschemaincompatiblewithroot1boxed)
abstract sealed validated payload class | -| static class | [DependentSchemasDependentSubschemaIncompatibleWithRoot.DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedVoid](#dependentschemasdependentsubschemaincompatiblewithroot1boxedvoid)
boxed class to store validated null payloads | -| static class | [DependentSchemasDependentSubschemaIncompatibleWithRoot.DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedBoolean](#dependentschemasdependentsubschemaincompatiblewithroot1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [DependentSchemasDependentSubschemaIncompatibleWithRoot.DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedNumber](#dependentschemasdependentsubschemaincompatiblewithroot1boxednumber)
boxed class to store validated Number payloads | -| static class | [DependentSchemasDependentSubschemaIncompatibleWithRoot.DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedString](#dependentschemasdependentsubschemaincompatiblewithroot1boxedstring)
boxed class to store validated String payloads | -| static class | [DependentSchemasDependentSubschemaIncompatibleWithRoot.DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedList](#dependentschemasdependentsubschemaincompatiblewithroot1boxedlist)
boxed class to store validated List payloads | -| static class | [DependentSchemasDependentSubschemaIncompatibleWithRoot.DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedMap](#dependentschemasdependentsubschemaincompatiblewithroot1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [DependentSchemasDependentSubschemaIncompatibleWithRoot.DependentSchemasDependentSubschemaIncompatibleWithRoot1Boxed](#dependentschemasdependentsubschemaincompatiblewithroot1boxed)
sealed interface for validated payloads | +| record | [DependentSchemasDependentSubschemaIncompatibleWithRoot.DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedVoid](#dependentschemasdependentsubschemaincompatiblewithroot1boxedvoid)
boxed class to store validated null payloads | +| record | [DependentSchemasDependentSubschemaIncompatibleWithRoot.DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedBoolean](#dependentschemasdependentsubschemaincompatiblewithroot1boxedboolean)
boxed class to store validated boolean payloads | +| record | [DependentSchemasDependentSubschemaIncompatibleWithRoot.DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedNumber](#dependentschemasdependentsubschemaincompatiblewithroot1boxednumber)
boxed class to store validated Number payloads | +| record | [DependentSchemasDependentSubschemaIncompatibleWithRoot.DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedString](#dependentschemasdependentsubschemaincompatiblewithroot1boxedstring)
boxed class to store validated String payloads | +| record | [DependentSchemasDependentSubschemaIncompatibleWithRoot.DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedList](#dependentschemasdependentsubschemaincompatiblewithroot1boxedlist)
boxed class to store validated List payloads | +| record | [DependentSchemasDependentSubschemaIncompatibleWithRoot.DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedMap](#dependentschemasdependentsubschemaincompatiblewithroot1boxedmap)
boxed class to store validated Map payloads | | static class | [DependentSchemasDependentSubschemaIncompatibleWithRoot.DependentSchemasDependentSubschemaIncompatibleWithRoot1](#dependentschemasdependentsubschemaincompatiblewithroot1)
schema class | | static class | [DependentSchemasDependentSubschemaIncompatibleWithRoot.DependentSchemasDependentSubschemaIncompatibleWithRootMapBuilder](#dependentschemasdependentsubschemaincompatiblewithrootmapbuilder)
builder for Map payloads | | static class | [DependentSchemasDependentSubschemaIncompatibleWithRoot.DependentSchemasDependentSubschemaIncompatibleWithRootMap](#dependentschemasdependentsubschemaincompatiblewithrootmap)
output class for Map payloads | -| static class | [DependentSchemasDependentSubschemaIncompatibleWithRoot.FooBoxed](#fooboxed)
abstract sealed validated payload class | -| static class | [DependentSchemasDependentSubschemaIncompatibleWithRoot.FooBoxedVoid](#fooboxedvoid)
boxed class to store validated null payloads | -| static class | [DependentSchemasDependentSubschemaIncompatibleWithRoot.FooBoxedBoolean](#fooboxedboolean)
boxed class to store validated boolean payloads | -| static class | [DependentSchemasDependentSubschemaIncompatibleWithRoot.FooBoxedNumber](#fooboxednumber)
boxed class to store validated Number payloads | -| static class | [DependentSchemasDependentSubschemaIncompatibleWithRoot.FooBoxedString](#fooboxedstring)
boxed class to store validated String payloads | -| static class | [DependentSchemasDependentSubschemaIncompatibleWithRoot.FooBoxedList](#fooboxedlist)
boxed class to store validated List payloads | -| static class | [DependentSchemasDependentSubschemaIncompatibleWithRoot.FooBoxedMap](#fooboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [DependentSchemasDependentSubschemaIncompatibleWithRoot.FooBoxed](#fooboxed)
sealed interface for validated payloads | +| record | [DependentSchemasDependentSubschemaIncompatibleWithRoot.FooBoxedVoid](#fooboxedvoid)
boxed class to store validated null payloads | +| record | [DependentSchemasDependentSubschemaIncompatibleWithRoot.FooBoxedBoolean](#fooboxedboolean)
boxed class to store validated boolean payloads | +| record | [DependentSchemasDependentSubschemaIncompatibleWithRoot.FooBoxedNumber](#fooboxednumber)
boxed class to store validated Number payloads | +| record | [DependentSchemasDependentSubschemaIncompatibleWithRoot.FooBoxedString](#fooboxedstring)
boxed class to store validated String payloads | +| record | [DependentSchemasDependentSubschemaIncompatibleWithRoot.FooBoxedList](#fooboxedlist)
boxed class to store validated List payloads | +| record | [DependentSchemasDependentSubschemaIncompatibleWithRoot.FooBoxedMap](#fooboxedmap)
boxed class to store validated Map payloads | | static class | [DependentSchemasDependentSubschemaIncompatibleWithRoot.Foo](#foo)
schema class | -| static class | [DependentSchemasDependentSubschemaIncompatibleWithRoot.Foo1Boxed](#foo1boxed)
abstract sealed validated payload class | -| static class | [DependentSchemasDependentSubschemaIncompatibleWithRoot.Foo1BoxedMap](#foo1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [DependentSchemasDependentSubschemaIncompatibleWithRoot.Foo1Boxed](#foo1boxed)
sealed interface for validated payloads | +| record | [DependentSchemasDependentSubschemaIncompatibleWithRoot.Foo1BoxedMap](#foo1boxedmap)
boxed class to store validated Map payloads | | static class | [DependentSchemasDependentSubschemaIncompatibleWithRoot.Foo1](#foo1)
schema class | | static class | [DependentSchemasDependentSubschemaIncompatibleWithRoot.FooMapBuilder1](#foomapbuilder1)
builder for Map payloads | | static class | [DependentSchemasDependentSubschemaIncompatibleWithRoot.FooMap](#foomap)
output class for Map payloads | -| static class | [DependentSchemasDependentSubschemaIncompatibleWithRoot.BarBoxed](#barboxed)
abstract sealed validated payload class | -| static class | [DependentSchemasDependentSubschemaIncompatibleWithRoot.BarBoxedVoid](#barboxedvoid)
boxed class to store validated null payloads | -| static class | [DependentSchemasDependentSubschemaIncompatibleWithRoot.BarBoxedBoolean](#barboxedboolean)
boxed class to store validated boolean payloads | -| static class | [DependentSchemasDependentSubschemaIncompatibleWithRoot.BarBoxedNumber](#barboxednumber)
boxed class to store validated Number payloads | -| static class | [DependentSchemasDependentSubschemaIncompatibleWithRoot.BarBoxedString](#barboxedstring)
boxed class to store validated String payloads | -| static class | [DependentSchemasDependentSubschemaIncompatibleWithRoot.BarBoxedList](#barboxedlist)
boxed class to store validated List payloads | -| static class | [DependentSchemasDependentSubschemaIncompatibleWithRoot.BarBoxedMap](#barboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [DependentSchemasDependentSubschemaIncompatibleWithRoot.BarBoxed](#barboxed)
sealed interface for validated payloads | +| record | [DependentSchemasDependentSubschemaIncompatibleWithRoot.BarBoxedVoid](#barboxedvoid)
boxed class to store validated null payloads | +| record | [DependentSchemasDependentSubschemaIncompatibleWithRoot.BarBoxedBoolean](#barboxedboolean)
boxed class to store validated boolean payloads | +| record | [DependentSchemasDependentSubschemaIncompatibleWithRoot.BarBoxedNumber](#barboxednumber)
boxed class to store validated Number payloads | +| record | [DependentSchemasDependentSubschemaIncompatibleWithRoot.BarBoxedString](#barboxedstring)
boxed class to store validated String payloads | +| record | [DependentSchemasDependentSubschemaIncompatibleWithRoot.BarBoxedList](#barboxedlist)
boxed class to store validated List payloads | +| record | [DependentSchemasDependentSubschemaIncompatibleWithRoot.BarBoxedMap](#barboxedmap)
boxed class to store validated Map payloads | | static class | [DependentSchemasDependentSubschemaIncompatibleWithRoot.Bar](#bar)
schema class | -| static class | [DependentSchemasDependentSubschemaIncompatibleWithRoot.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
abstract sealed validated payload class | -| static class | [DependentSchemasDependentSubschemaIncompatibleWithRoot.AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid)
boxed class to store validated null payloads | -| static class | [DependentSchemasDependentSubschemaIncompatibleWithRoot.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | -| static class | [DependentSchemasDependentSubschemaIncompatibleWithRoot.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | -| static class | [DependentSchemasDependentSubschemaIncompatibleWithRoot.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | -| static class | [DependentSchemasDependentSubschemaIncompatibleWithRoot.AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist)
boxed class to store validated List payloads | -| static class | [DependentSchemasDependentSubschemaIncompatibleWithRoot.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [DependentSchemasDependentSubschemaIncompatibleWithRoot.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
sealed interface for validated payloads | +| record | [DependentSchemasDependentSubschemaIncompatibleWithRoot.AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid)
boxed class to store validated null payloads | +| record | [DependentSchemasDependentSubschemaIncompatibleWithRoot.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | +| record | [DependentSchemasDependentSubschemaIncompatibleWithRoot.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | +| record | [DependentSchemasDependentSubschemaIncompatibleWithRoot.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | +| record | [DependentSchemasDependentSubschemaIncompatibleWithRoot.AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist)
boxed class to store validated List payloads | +| record | [DependentSchemasDependentSubschemaIncompatibleWithRoot.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | | static class | [DependentSchemasDependentSubschemaIncompatibleWithRoot.AdditionalProperties](#additionalproperties)
schema class | ## DependentSchemasDependentSubschemaIncompatibleWithRoot1Boxed -public static abstract sealed class DependentSchemasDependentSubschemaIncompatibleWithRoot1Boxed
+public sealed interface DependentSchemasDependentSubschemaIncompatibleWithRoot1Boxed
permits
[DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedVoid](#dependentschemasdependentsubschemaincompatiblewithroot1boxedvoid), [DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedBoolean](#dependentschemasdependentsubschemaincompatiblewithroot1boxedboolean), @@ -62,103 +62,109 @@ permits
[DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedList](#dependentschemasdependentsubschemaincompatiblewithroot1boxedlist), [DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedMap](#dependentschemasdependentsubschemaincompatiblewithroot1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedVoid -public static final class DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedVoid
-extends [DependentSchemasDependentSubschemaIncompatibleWithRoot1Boxed](#dependentschemasdependentsubschemaincompatiblewithroot1boxed) +public record DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedVoid
+implements [DependentSchemasDependentSubschemaIncompatibleWithRoot1Boxed](#dependentschemasdependentsubschemaincompatiblewithroot1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedBoolean -public static final class DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedBoolean
-extends [DependentSchemasDependentSubschemaIncompatibleWithRoot1Boxed](#dependentschemasdependentsubschemaincompatiblewithroot1boxed) +public record DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedBoolean
+implements [DependentSchemasDependentSubschemaIncompatibleWithRoot1Boxed](#dependentschemasdependentsubschemaincompatiblewithroot1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedNumber -public static final class DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedNumber
-extends [DependentSchemasDependentSubschemaIncompatibleWithRoot1Boxed](#dependentschemasdependentsubschemaincompatiblewithroot1boxed) +public record DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedNumber
+implements [DependentSchemasDependentSubschemaIncompatibleWithRoot1Boxed](#dependentschemasdependentsubschemaincompatiblewithroot1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedString -public static final class DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedString
-extends [DependentSchemasDependentSubschemaIncompatibleWithRoot1Boxed](#dependentschemasdependentsubschemaincompatiblewithroot1boxed) +public record DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedString
+implements [DependentSchemasDependentSubschemaIncompatibleWithRoot1Boxed](#dependentschemasdependentsubschemaincompatiblewithroot1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedList -public static final class DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedList
-extends [DependentSchemasDependentSubschemaIncompatibleWithRoot1Boxed](#dependentschemasdependentsubschemaincompatiblewithroot1boxed) +public record DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedList
+implements [DependentSchemasDependentSubschemaIncompatibleWithRoot1Boxed](#dependentschemasdependentsubschemaincompatiblewithroot1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedMap -public static final class DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedMap
-extends [DependentSchemasDependentSubschemaIncompatibleWithRoot1Boxed](#dependentschemasdependentsubschemaincompatiblewithroot1boxed) +public record DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedMap
+implements [DependentSchemasDependentSubschemaIncompatibleWithRoot1Boxed](#dependentschemasdependentsubschemaincompatiblewithroot1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedMap([DependentSchemasDependentSubschemaIncompatibleWithRootMap](#dependentschemasdependentsubschemaincompatiblewithrootmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [DependentSchemasDependentSubschemaIncompatibleWithRootMap](#dependentschemasdependentsubschemaincompatiblewithrootmap) | data
validated payload | +| [DependentSchemasDependentSubschemaIncompatibleWithRootMap](#dependentschemasdependentsubschemaincompatiblewithrootmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## DependentSchemasDependentSubschemaIncompatibleWithRoot1 public static class DependentSchemasDependentSubschemaIncompatibleWithRoot1
@@ -191,7 +197,9 @@ A schema class that validates payloads | [DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedBoolean](#dependentschemasdependentsubschemaincompatiblewithroot1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedMap](#dependentschemasdependentsubschemaincompatiblewithroot1boxedmap) | validateAndBox([Map<?, ?>](#dependentschemasdependentsubschemaincompatiblewithrootmapbuilder) arg, SchemaConfiguration configuration) | | [DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedList](#dependentschemasdependentsubschemaincompatiblewithroot1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [DependentSchemasDependentSubschemaIncompatibleWithRoot1Boxed](#dependentschemasdependentsubschemaincompatiblewithroot1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## DependentSchemasDependentSubschemaIncompatibleWithRootMapBuilder public class DependentSchemasDependentSubschemaIncompatibleWithRootMapBuilder
builder for `Map` @@ -240,7 +248,7 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## FooBoxed -public static abstract sealed class FooBoxed
+public sealed interface FooBoxed
permits
[FooBoxedVoid](#fooboxedvoid), [FooBoxedBoolean](#fooboxedboolean), @@ -249,103 +257,109 @@ permits
[FooBoxedList](#fooboxedlist), [FooBoxedMap](#fooboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## FooBoxedVoid -public static final class FooBoxedVoid
-extends [FooBoxed](#fooboxed) +public record FooBoxedVoid
+implements [FooBoxed](#fooboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FooBoxedBoolean -public static final class FooBoxedBoolean
-extends [FooBoxed](#fooboxed) +public record FooBoxedBoolean
+implements [FooBoxed](#fooboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FooBoxedNumber -public static final class FooBoxedNumber
-extends [FooBoxed](#fooboxed) +public record FooBoxedNumber
+implements [FooBoxed](#fooboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FooBoxedString -public static final class FooBoxedString
-extends [FooBoxed](#fooboxed) +public record FooBoxedString
+implements [FooBoxed](#fooboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FooBoxedList -public static final class FooBoxedList
-extends [FooBoxed](#fooboxed) +public record FooBoxedList
+implements [FooBoxed](#fooboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FooBoxedMap -public static final class FooBoxedMap
-extends [FooBoxed](#fooboxed) +public record FooBoxedMap
+implements [FooBoxed](#fooboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Foo public static class Foo
@@ -359,27 +373,28 @@ A schema class that validates payloads | validateAndBox | ## Foo1Boxed -public static abstract sealed class Foo1Boxed
+public sealed interface Foo1Boxed
permits
[Foo1BoxedMap](#foo1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Foo1BoxedMap -public static final class Foo1BoxedMap
-extends [Foo1Boxed](#foo1boxed) +public record Foo1BoxedMap
+implements [Foo1Boxed](#foo1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Foo1BoxedMap([FooMap](#foomap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [FooMap](#foomap) | data
validated payload | +| [FooMap](#foomap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Foo1 public static class Foo1
@@ -423,7 +438,9 @@ DependentSchemasDependentSubschemaIncompatibleWithRoot.FooMap validatedPayload = | ----------------- | ---------------------- | | [FooMap](#foomap) | validate([Map<?, ?>](#foomapbuilder1) arg, SchemaConfiguration configuration) | | [Foo1BoxedMap](#foo1boxedmap) | validateAndBox([Map<?, ?>](#foomapbuilder1) arg, SchemaConfiguration configuration) | +| [Foo1Boxed](#foo1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## FooMapBuilder1 public class FooMapBuilder1
builder for `Map` @@ -462,7 +479,7 @@ A class to store validated Map payloads | @Nullable Object | bar()
[optional] | ## BarBoxed -public static abstract sealed class BarBoxed
+public sealed interface BarBoxed
permits
[BarBoxedVoid](#barboxedvoid), [BarBoxedBoolean](#barboxedboolean), @@ -471,103 +488,109 @@ permits
[BarBoxedList](#barboxedlist), [BarBoxedMap](#barboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## BarBoxedVoid -public static final class BarBoxedVoid
-extends [BarBoxed](#barboxed) +public record BarBoxedVoid
+implements [BarBoxed](#barboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BarBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## BarBoxedBoolean -public static final class BarBoxedBoolean
-extends [BarBoxed](#barboxed) +public record BarBoxedBoolean
+implements [BarBoxed](#barboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BarBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## BarBoxedNumber -public static final class BarBoxedNumber
-extends [BarBoxed](#barboxed) +public record BarBoxedNumber
+implements [BarBoxed](#barboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BarBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## BarBoxedString -public static final class BarBoxedString
-extends [BarBoxed](#barboxed) +public record BarBoxedString
+implements [BarBoxed](#barboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BarBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## BarBoxedList -public static final class BarBoxedList
-extends [BarBoxed](#barboxed) +public record BarBoxedList
+implements [BarBoxed](#barboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BarBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## BarBoxedMap -public static final class BarBoxedMap
-extends [BarBoxed](#barboxed) +public record BarBoxedMap
+implements [BarBoxed](#barboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BarBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Bar public static class Bar
@@ -581,7 +604,7 @@ A schema class that validates payloads | validateAndBox | ## AdditionalPropertiesBoxed -public static abstract sealed class AdditionalPropertiesBoxed
+public sealed interface AdditionalPropertiesBoxed
permits
[AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid), [AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean), @@ -590,103 +613,109 @@ permits
[AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist), [AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AdditionalPropertiesBoxedVoid -public static final class AdditionalPropertiesBoxedVoid
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedVoid
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedBoolean -public static final class AdditionalPropertiesBoxedBoolean
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedBoolean
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedNumber -public static final class AdditionalPropertiesBoxedNumber
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedNumber
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedString -public static final class AdditionalPropertiesBoxedString
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedString
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedList -public static final class AdditionalPropertiesBoxedList
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedList
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedMap -public static final class AdditionalPropertiesBoxedMap
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedMap
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalProperties public static class AdditionalProperties
diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/DependentSchemasSingleDependency.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/DependentSchemasSingleDependency.md index aec4f38e8fe..89850d5e1b3 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/DependentSchemasSingleDependency.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/DependentSchemasSingleDependency.md @@ -4,7 +4,7 @@ public class DependentSchemasSingleDependency
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,33 +12,33 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [DependentSchemasSingleDependency.DependentSchemasSingleDependency1Boxed](#dependentschemassingledependency1boxed)
abstract sealed validated payload class | -| static class | [DependentSchemasSingleDependency.DependentSchemasSingleDependency1BoxedVoid](#dependentschemassingledependency1boxedvoid)
boxed class to store validated null payloads | -| static class | [DependentSchemasSingleDependency.DependentSchemasSingleDependency1BoxedBoolean](#dependentschemassingledependency1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [DependentSchemasSingleDependency.DependentSchemasSingleDependency1BoxedNumber](#dependentschemassingledependency1boxednumber)
boxed class to store validated Number payloads | -| static class | [DependentSchemasSingleDependency.DependentSchemasSingleDependency1BoxedString](#dependentschemassingledependency1boxedstring)
boxed class to store validated String payloads | -| static class | [DependentSchemasSingleDependency.DependentSchemasSingleDependency1BoxedList](#dependentschemassingledependency1boxedlist)
boxed class to store validated List payloads | -| static class | [DependentSchemasSingleDependency.DependentSchemasSingleDependency1BoxedMap](#dependentschemassingledependency1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [DependentSchemasSingleDependency.DependentSchemasSingleDependency1Boxed](#dependentschemassingledependency1boxed)
sealed interface for validated payloads | +| record | [DependentSchemasSingleDependency.DependentSchemasSingleDependency1BoxedVoid](#dependentschemassingledependency1boxedvoid)
boxed class to store validated null payloads | +| record | [DependentSchemasSingleDependency.DependentSchemasSingleDependency1BoxedBoolean](#dependentschemassingledependency1boxedboolean)
boxed class to store validated boolean payloads | +| record | [DependentSchemasSingleDependency.DependentSchemasSingleDependency1BoxedNumber](#dependentschemassingledependency1boxednumber)
boxed class to store validated Number payloads | +| record | [DependentSchemasSingleDependency.DependentSchemasSingleDependency1BoxedString](#dependentschemassingledependency1boxedstring)
boxed class to store validated String payloads | +| record | [DependentSchemasSingleDependency.DependentSchemasSingleDependency1BoxedList](#dependentschemassingledependency1boxedlist)
boxed class to store validated List payloads | +| record | [DependentSchemasSingleDependency.DependentSchemasSingleDependency1BoxedMap](#dependentschemassingledependency1boxedmap)
boxed class to store validated Map payloads | | static class | [DependentSchemasSingleDependency.DependentSchemasSingleDependency1](#dependentschemassingledependency1)
schema class | -| static class | [DependentSchemasSingleDependency.BarBoxed](#barboxed)
abstract sealed validated payload class | -| static class | [DependentSchemasSingleDependency.BarBoxedVoid](#barboxedvoid)
boxed class to store validated null payloads | -| static class | [DependentSchemasSingleDependency.BarBoxedBoolean](#barboxedboolean)
boxed class to store validated boolean payloads | -| static class | [DependentSchemasSingleDependency.BarBoxedNumber](#barboxednumber)
boxed class to store validated Number payloads | -| static class | [DependentSchemasSingleDependency.BarBoxedString](#barboxedstring)
boxed class to store validated String payloads | -| static class | [DependentSchemasSingleDependency.BarBoxedList](#barboxedlist)
boxed class to store validated List payloads | -| static class | [DependentSchemasSingleDependency.BarBoxedMap](#barboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [DependentSchemasSingleDependency.BarBoxed](#barboxed)
sealed interface for validated payloads | +| record | [DependentSchemasSingleDependency.BarBoxedVoid](#barboxedvoid)
boxed class to store validated null payloads | +| record | [DependentSchemasSingleDependency.BarBoxedBoolean](#barboxedboolean)
boxed class to store validated boolean payloads | +| record | [DependentSchemasSingleDependency.BarBoxedNumber](#barboxednumber)
boxed class to store validated Number payloads | +| record | [DependentSchemasSingleDependency.BarBoxedString](#barboxedstring)
boxed class to store validated String payloads | +| record | [DependentSchemasSingleDependency.BarBoxedList](#barboxedlist)
boxed class to store validated List payloads | +| record | [DependentSchemasSingleDependency.BarBoxedMap](#barboxedmap)
boxed class to store validated Map payloads | | static class | [DependentSchemasSingleDependency.Bar](#bar)
schema class | | static class | [DependentSchemasSingleDependency.BarMapBuilder1](#barmapbuilder1)
builder for Map payloads | | static class | [DependentSchemasSingleDependency.BarMap](#barmap)
output class for Map payloads | -| static class | [DependentSchemasSingleDependency.Bar1Boxed](#bar1boxed)
abstract sealed validated payload class | -| static class | [DependentSchemasSingleDependency.Bar1BoxedNumber](#bar1boxednumber)
boxed class to store validated Number payloads | +| sealed interface | [DependentSchemasSingleDependency.Bar1Boxed](#bar1boxed)
sealed interface for validated payloads | +| record | [DependentSchemasSingleDependency.Bar1BoxedNumber](#bar1boxednumber)
boxed class to store validated Number payloads | | static class | [DependentSchemasSingleDependency.Bar1](#bar1)
schema class | -| static class | [DependentSchemasSingleDependency.FooBoxed](#fooboxed)
abstract sealed validated payload class | -| static class | [DependentSchemasSingleDependency.FooBoxedNumber](#fooboxednumber)
boxed class to store validated Number payloads | +| sealed interface | [DependentSchemasSingleDependency.FooBoxed](#fooboxed)
sealed interface for validated payloads | +| record | [DependentSchemasSingleDependency.FooBoxedNumber](#fooboxednumber)
boxed class to store validated Number payloads | | static class | [DependentSchemasSingleDependency.Foo](#foo)
schema class | ## DependentSchemasSingleDependency1Boxed -public static abstract sealed class DependentSchemasSingleDependency1Boxed
+public sealed interface DependentSchemasSingleDependency1Boxed
permits
[DependentSchemasSingleDependency1BoxedVoid](#dependentschemassingledependency1boxedvoid), [DependentSchemasSingleDependency1BoxedBoolean](#dependentschemassingledependency1boxedboolean), @@ -47,103 +47,109 @@ permits
[DependentSchemasSingleDependency1BoxedList](#dependentschemassingledependency1boxedlist), [DependentSchemasSingleDependency1BoxedMap](#dependentschemassingledependency1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## DependentSchemasSingleDependency1BoxedVoid -public static final class DependentSchemasSingleDependency1BoxedVoid
-extends [DependentSchemasSingleDependency1Boxed](#dependentschemassingledependency1boxed) +public record DependentSchemasSingleDependency1BoxedVoid
+implements [DependentSchemasSingleDependency1Boxed](#dependentschemassingledependency1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DependentSchemasSingleDependency1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## DependentSchemasSingleDependency1BoxedBoolean -public static final class DependentSchemasSingleDependency1BoxedBoolean
-extends [DependentSchemasSingleDependency1Boxed](#dependentschemassingledependency1boxed) +public record DependentSchemasSingleDependency1BoxedBoolean
+implements [DependentSchemasSingleDependency1Boxed](#dependentschemassingledependency1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DependentSchemasSingleDependency1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## DependentSchemasSingleDependency1BoxedNumber -public static final class DependentSchemasSingleDependency1BoxedNumber
-extends [DependentSchemasSingleDependency1Boxed](#dependentschemassingledependency1boxed) +public record DependentSchemasSingleDependency1BoxedNumber
+implements [DependentSchemasSingleDependency1Boxed](#dependentschemassingledependency1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DependentSchemasSingleDependency1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## DependentSchemasSingleDependency1BoxedString -public static final class DependentSchemasSingleDependency1BoxedString
-extends [DependentSchemasSingleDependency1Boxed](#dependentschemassingledependency1boxed) +public record DependentSchemasSingleDependency1BoxedString
+implements [DependentSchemasSingleDependency1Boxed](#dependentschemassingledependency1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DependentSchemasSingleDependency1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## DependentSchemasSingleDependency1BoxedList -public static final class DependentSchemasSingleDependency1BoxedList
-extends [DependentSchemasSingleDependency1Boxed](#dependentschemassingledependency1boxed) +public record DependentSchemasSingleDependency1BoxedList
+implements [DependentSchemasSingleDependency1Boxed](#dependentschemassingledependency1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DependentSchemasSingleDependency1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## DependentSchemasSingleDependency1BoxedMap -public static final class DependentSchemasSingleDependency1BoxedMap
-extends [DependentSchemasSingleDependency1Boxed](#dependentschemassingledependency1boxed) +public record DependentSchemasSingleDependency1BoxedMap
+implements [DependentSchemasSingleDependency1Boxed](#dependentschemassingledependency1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DependentSchemasSingleDependency1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## DependentSchemasSingleDependency1 public static class DependentSchemasSingleDependency1
@@ -175,9 +181,11 @@ A schema class that validates payloads | [DependentSchemasSingleDependency1BoxedBoolean](#dependentschemassingledependency1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [DependentSchemasSingleDependency1BoxedMap](#dependentschemassingledependency1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [DependentSchemasSingleDependency1BoxedList](#dependentschemassingledependency1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [DependentSchemasSingleDependency1Boxed](#dependentschemassingledependency1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## BarBoxed -public static abstract sealed class BarBoxed
+public sealed interface BarBoxed
permits
[BarBoxedVoid](#barboxedvoid), [BarBoxedBoolean](#barboxedboolean), @@ -186,103 +194,109 @@ permits
[BarBoxedList](#barboxedlist), [BarBoxedMap](#barboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## BarBoxedVoid -public static final class BarBoxedVoid
-extends [BarBoxed](#barboxed) +public record BarBoxedVoid
+implements [BarBoxed](#barboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BarBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## BarBoxedBoolean -public static final class BarBoxedBoolean
-extends [BarBoxed](#barboxed) +public record BarBoxedBoolean
+implements [BarBoxed](#barboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BarBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## BarBoxedNumber -public static final class BarBoxedNumber
-extends [BarBoxed](#barboxed) +public record BarBoxedNumber
+implements [BarBoxed](#barboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BarBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## BarBoxedString -public static final class BarBoxedString
-extends [BarBoxed](#barboxed) +public record BarBoxedString
+implements [BarBoxed](#barboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BarBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## BarBoxedList -public static final class BarBoxedList
-extends [BarBoxed](#barboxed) +public record BarBoxedList
+implements [BarBoxed](#barboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BarBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## BarBoxedMap -public static final class BarBoxedMap
-extends [BarBoxed](#barboxed) +public record BarBoxedMap
+implements [BarBoxed](#barboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BarBoxedMap([BarMap](#barmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [BarMap](#barmap) | data
validated payload | +| [BarMap](#barmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Bar public static class Bar
@@ -314,7 +328,9 @@ A schema class that validates payloads | [BarBoxedBoolean](#barboxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [BarBoxedMap](#barboxedmap) | validateAndBox([Map<?, ?>](#barmapbuilder1) arg, SchemaConfiguration configuration) | | [BarBoxedList](#barboxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [BarBoxed](#barboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## BarMapBuilder1 public class BarMapBuilder1
builder for `Map` @@ -363,27 +379,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## Bar1Boxed -public static abstract sealed class Bar1Boxed
+public sealed interface Bar1Boxed
permits
[Bar1BoxedNumber](#bar1boxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Bar1BoxedNumber -public static final class Bar1BoxedNumber
-extends [Bar1Boxed](#bar1boxed) +public record Bar1BoxedNumber
+implements [Bar1Boxed](#bar1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Bar1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Bar1 public static class Bar1
@@ -397,27 +414,28 @@ A schema class that validates payloads | validateAndBox | ## FooBoxed -public static abstract sealed class FooBoxed
+public sealed interface FooBoxed
permits
[FooBoxedNumber](#fooboxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## FooBoxedNumber -public static final class FooBoxedNumber
-extends [FooBoxed](#fooboxed) +public record FooBoxedNumber
+implements [FooBoxed](#fooboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Foo public static class Foo
diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/DurationFormat.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/DurationFormat.md index 187901b55a2..9c74f82ceda 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/DurationFormat.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/DurationFormat.md @@ -4,23 +4,23 @@ public class DurationFormat
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [DurationFormat.DurationFormat1Boxed](#durationformat1boxed)
abstract sealed validated payload class | -| static class | [DurationFormat.DurationFormat1BoxedVoid](#durationformat1boxedvoid)
boxed class to store validated null payloads | -| static class | [DurationFormat.DurationFormat1BoxedBoolean](#durationformat1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [DurationFormat.DurationFormat1BoxedNumber](#durationformat1boxednumber)
boxed class to store validated Number payloads | -| static class | [DurationFormat.DurationFormat1BoxedString](#durationformat1boxedstring)
boxed class to store validated String payloads | -| static class | [DurationFormat.DurationFormat1BoxedList](#durationformat1boxedlist)
boxed class to store validated List payloads | -| static class | [DurationFormat.DurationFormat1BoxedMap](#durationformat1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [DurationFormat.DurationFormat1Boxed](#durationformat1boxed)
sealed interface for validated payloads | +| record | [DurationFormat.DurationFormat1BoxedVoid](#durationformat1boxedvoid)
boxed class to store validated null payloads | +| record | [DurationFormat.DurationFormat1BoxedBoolean](#durationformat1boxedboolean)
boxed class to store validated boolean payloads | +| record | [DurationFormat.DurationFormat1BoxedNumber](#durationformat1boxednumber)
boxed class to store validated Number payloads | +| record | [DurationFormat.DurationFormat1BoxedString](#durationformat1boxedstring)
boxed class to store validated String payloads | +| record | [DurationFormat.DurationFormat1BoxedList](#durationformat1boxedlist)
boxed class to store validated List payloads | +| record | [DurationFormat.DurationFormat1BoxedMap](#durationformat1boxedmap)
boxed class to store validated Map payloads | | static class | [DurationFormat.DurationFormat1](#durationformat1)
schema class | ## DurationFormat1Boxed -public static abstract sealed class DurationFormat1Boxed
+public sealed interface DurationFormat1Boxed
permits
[DurationFormat1BoxedVoid](#durationformat1boxedvoid), [DurationFormat1BoxedBoolean](#durationformat1boxedboolean), @@ -29,103 +29,109 @@ permits
[DurationFormat1BoxedList](#durationformat1boxedlist), [DurationFormat1BoxedMap](#durationformat1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## DurationFormat1BoxedVoid -public static final class DurationFormat1BoxedVoid
-extends [DurationFormat1Boxed](#durationformat1boxed) +public record DurationFormat1BoxedVoid
+implements [DurationFormat1Boxed](#durationformat1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DurationFormat1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## DurationFormat1BoxedBoolean -public static final class DurationFormat1BoxedBoolean
-extends [DurationFormat1Boxed](#durationformat1boxed) +public record DurationFormat1BoxedBoolean
+implements [DurationFormat1Boxed](#durationformat1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DurationFormat1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## DurationFormat1BoxedNumber -public static final class DurationFormat1BoxedNumber
-extends [DurationFormat1Boxed](#durationformat1boxed) +public record DurationFormat1BoxedNumber
+implements [DurationFormat1Boxed](#durationformat1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DurationFormat1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## DurationFormat1BoxedString -public static final class DurationFormat1BoxedString
-extends [DurationFormat1Boxed](#durationformat1boxed) +public record DurationFormat1BoxedString
+implements [DurationFormat1Boxed](#durationformat1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DurationFormat1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## DurationFormat1BoxedList -public static final class DurationFormat1BoxedList
-extends [DurationFormat1Boxed](#durationformat1boxed) +public record DurationFormat1BoxedList
+implements [DurationFormat1Boxed](#durationformat1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DurationFormat1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## DurationFormat1BoxedMap -public static final class DurationFormat1BoxedMap
-extends [DurationFormat1Boxed](#durationformat1boxed) +public record DurationFormat1BoxedMap
+implements [DurationFormat1Boxed](#durationformat1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DurationFormat1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## DurationFormat1 public static class DurationFormat1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [DurationFormat1BoxedBoolean](#durationformat1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [DurationFormat1BoxedMap](#durationformat1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [DurationFormat1BoxedList](#durationformat1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [DurationFormat1Boxed](#durationformat1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/EmailFormat.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/EmailFormat.md index 46f78d993c6..b3448fb331a 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/EmailFormat.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/EmailFormat.md @@ -4,23 +4,23 @@ public class EmailFormat
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [EmailFormat.EmailFormat1Boxed](#emailformat1boxed)
abstract sealed validated payload class | -| static class | [EmailFormat.EmailFormat1BoxedVoid](#emailformat1boxedvoid)
boxed class to store validated null payloads | -| static class | [EmailFormat.EmailFormat1BoxedBoolean](#emailformat1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [EmailFormat.EmailFormat1BoxedNumber](#emailformat1boxednumber)
boxed class to store validated Number payloads | -| static class | [EmailFormat.EmailFormat1BoxedString](#emailformat1boxedstring)
boxed class to store validated String payloads | -| static class | [EmailFormat.EmailFormat1BoxedList](#emailformat1boxedlist)
boxed class to store validated List payloads | -| static class | [EmailFormat.EmailFormat1BoxedMap](#emailformat1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [EmailFormat.EmailFormat1Boxed](#emailformat1boxed)
sealed interface for validated payloads | +| record | [EmailFormat.EmailFormat1BoxedVoid](#emailformat1boxedvoid)
boxed class to store validated null payloads | +| record | [EmailFormat.EmailFormat1BoxedBoolean](#emailformat1boxedboolean)
boxed class to store validated boolean payloads | +| record | [EmailFormat.EmailFormat1BoxedNumber](#emailformat1boxednumber)
boxed class to store validated Number payloads | +| record | [EmailFormat.EmailFormat1BoxedString](#emailformat1boxedstring)
boxed class to store validated String payloads | +| record | [EmailFormat.EmailFormat1BoxedList](#emailformat1boxedlist)
boxed class to store validated List payloads | +| record | [EmailFormat.EmailFormat1BoxedMap](#emailformat1boxedmap)
boxed class to store validated Map payloads | | static class | [EmailFormat.EmailFormat1](#emailformat1)
schema class | ## EmailFormat1Boxed -public static abstract sealed class EmailFormat1Boxed
+public sealed interface EmailFormat1Boxed
permits
[EmailFormat1BoxedVoid](#emailformat1boxedvoid), [EmailFormat1BoxedBoolean](#emailformat1boxedboolean), @@ -29,103 +29,109 @@ permits
[EmailFormat1BoxedList](#emailformat1boxedlist), [EmailFormat1BoxedMap](#emailformat1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## EmailFormat1BoxedVoid -public static final class EmailFormat1BoxedVoid
-extends [EmailFormat1Boxed](#emailformat1boxed) +public record EmailFormat1BoxedVoid
+implements [EmailFormat1Boxed](#emailformat1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | EmailFormat1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## EmailFormat1BoxedBoolean -public static final class EmailFormat1BoxedBoolean
-extends [EmailFormat1Boxed](#emailformat1boxed) +public record EmailFormat1BoxedBoolean
+implements [EmailFormat1Boxed](#emailformat1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | EmailFormat1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## EmailFormat1BoxedNumber -public static final class EmailFormat1BoxedNumber
-extends [EmailFormat1Boxed](#emailformat1boxed) +public record EmailFormat1BoxedNumber
+implements [EmailFormat1Boxed](#emailformat1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | EmailFormat1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## EmailFormat1BoxedString -public static final class EmailFormat1BoxedString
-extends [EmailFormat1Boxed](#emailformat1boxed) +public record EmailFormat1BoxedString
+implements [EmailFormat1Boxed](#emailformat1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | EmailFormat1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## EmailFormat1BoxedList -public static final class EmailFormat1BoxedList
-extends [EmailFormat1Boxed](#emailformat1boxed) +public record EmailFormat1BoxedList
+implements [EmailFormat1Boxed](#emailformat1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | EmailFormat1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## EmailFormat1BoxedMap -public static final class EmailFormat1BoxedMap
-extends [EmailFormat1Boxed](#emailformat1boxed) +public record EmailFormat1BoxedMap
+implements [EmailFormat1Boxed](#emailformat1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | EmailFormat1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## EmailFormat1 public static class EmailFormat1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [EmailFormat1BoxedBoolean](#emailformat1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [EmailFormat1BoxedMap](#emailformat1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [EmailFormat1BoxedList](#emailformat1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [EmailFormat1Boxed](#emailformat1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/EmptyDependents.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/EmptyDependents.md index a0e54bf6e8c..61fd3611c08 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/EmptyDependents.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/EmptyDependents.md @@ -4,23 +4,23 @@ public class EmptyDependents
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [EmptyDependents.EmptyDependents1Boxed](#emptydependents1boxed)
abstract sealed validated payload class | -| static class | [EmptyDependents.EmptyDependents1BoxedVoid](#emptydependents1boxedvoid)
boxed class to store validated null payloads | -| static class | [EmptyDependents.EmptyDependents1BoxedBoolean](#emptydependents1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [EmptyDependents.EmptyDependents1BoxedNumber](#emptydependents1boxednumber)
boxed class to store validated Number payloads | -| static class | [EmptyDependents.EmptyDependents1BoxedString](#emptydependents1boxedstring)
boxed class to store validated String payloads | -| static class | [EmptyDependents.EmptyDependents1BoxedList](#emptydependents1boxedlist)
boxed class to store validated List payloads | -| static class | [EmptyDependents.EmptyDependents1BoxedMap](#emptydependents1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [EmptyDependents.EmptyDependents1Boxed](#emptydependents1boxed)
sealed interface for validated payloads | +| record | [EmptyDependents.EmptyDependents1BoxedVoid](#emptydependents1boxedvoid)
boxed class to store validated null payloads | +| record | [EmptyDependents.EmptyDependents1BoxedBoolean](#emptydependents1boxedboolean)
boxed class to store validated boolean payloads | +| record | [EmptyDependents.EmptyDependents1BoxedNumber](#emptydependents1boxednumber)
boxed class to store validated Number payloads | +| record | [EmptyDependents.EmptyDependents1BoxedString](#emptydependents1boxedstring)
boxed class to store validated String payloads | +| record | [EmptyDependents.EmptyDependents1BoxedList](#emptydependents1boxedlist)
boxed class to store validated List payloads | +| record | [EmptyDependents.EmptyDependents1BoxedMap](#emptydependents1boxedmap)
boxed class to store validated Map payloads | | static class | [EmptyDependents.EmptyDependents1](#emptydependents1)
schema class | ## EmptyDependents1Boxed -public static abstract sealed class EmptyDependents1Boxed
+public sealed interface EmptyDependents1Boxed
permits
[EmptyDependents1BoxedVoid](#emptydependents1boxedvoid), [EmptyDependents1BoxedBoolean](#emptydependents1boxedboolean), @@ -29,103 +29,109 @@ permits
[EmptyDependents1BoxedList](#emptydependents1boxedlist), [EmptyDependents1BoxedMap](#emptydependents1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## EmptyDependents1BoxedVoid -public static final class EmptyDependents1BoxedVoid
-extends [EmptyDependents1Boxed](#emptydependents1boxed) +public record EmptyDependents1BoxedVoid
+implements [EmptyDependents1Boxed](#emptydependents1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | EmptyDependents1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## EmptyDependents1BoxedBoolean -public static final class EmptyDependents1BoxedBoolean
-extends [EmptyDependents1Boxed](#emptydependents1boxed) +public record EmptyDependents1BoxedBoolean
+implements [EmptyDependents1Boxed](#emptydependents1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | EmptyDependents1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## EmptyDependents1BoxedNumber -public static final class EmptyDependents1BoxedNumber
-extends [EmptyDependents1Boxed](#emptydependents1boxed) +public record EmptyDependents1BoxedNumber
+implements [EmptyDependents1Boxed](#emptydependents1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | EmptyDependents1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## EmptyDependents1BoxedString -public static final class EmptyDependents1BoxedString
-extends [EmptyDependents1Boxed](#emptydependents1boxed) +public record EmptyDependents1BoxedString
+implements [EmptyDependents1Boxed](#emptydependents1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | EmptyDependents1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## EmptyDependents1BoxedList -public static final class EmptyDependents1BoxedList
-extends [EmptyDependents1Boxed](#emptydependents1boxed) +public record EmptyDependents1BoxedList
+implements [EmptyDependents1Boxed](#emptydependents1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | EmptyDependents1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## EmptyDependents1BoxedMap -public static final class EmptyDependents1BoxedMap
-extends [EmptyDependents1Boxed](#emptydependents1boxed) +public record EmptyDependents1BoxedMap
+implements [EmptyDependents1Boxed](#emptydependents1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | EmptyDependents1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## EmptyDependents1 public static class EmptyDependents1
@@ -164,5 +170,7 @@ A schema class that validates payloads | [EmptyDependents1BoxedBoolean](#emptydependents1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [EmptyDependents1BoxedMap](#emptydependents1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [EmptyDependents1BoxedList](#emptydependents1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [EmptyDependents1Boxed](#emptydependents1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/EnumWith0DoesNotMatchFalse.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/EnumWith0DoesNotMatchFalse.md index 1ca98c55bac..e3082672184 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/EnumWith0DoesNotMatchFalse.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/EnumWith0DoesNotMatchFalse.md @@ -4,15 +4,15 @@ public class EnumWith0DoesNotMatchFalse
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - enum classes ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [EnumWith0DoesNotMatchFalse.EnumWith0DoesNotMatchFalse1Boxed](#enumwith0doesnotmatchfalse1boxed)
abstract sealed validated payload class | -| static class | [EnumWith0DoesNotMatchFalse.EnumWith0DoesNotMatchFalse1BoxedNumber](#enumwith0doesnotmatchfalse1boxednumber)
boxed class to store validated Number payloads | +| sealed interface | [EnumWith0DoesNotMatchFalse.EnumWith0DoesNotMatchFalse1Boxed](#enumwith0doesnotmatchfalse1boxed)
sealed interface for validated payloads | +| record | [EnumWith0DoesNotMatchFalse.EnumWith0DoesNotMatchFalse1BoxedNumber](#enumwith0doesnotmatchfalse1boxednumber)
boxed class to store validated Number payloads | | static class | [EnumWith0DoesNotMatchFalse.EnumWith0DoesNotMatchFalse1](#enumwith0doesnotmatchfalse1)
schema class | | enum | [EnumWith0DoesNotMatchFalse.IntegerEnumWith0DoesNotMatchFalseEnums](#integerenumwith0doesnotmatchfalseenums)
Integer enum | | enum | [EnumWith0DoesNotMatchFalse.LongEnumWith0DoesNotMatchFalseEnums](#longenumwith0doesnotmatchfalseenums)
Long enum | @@ -20,27 +20,28 @@ A class that contains necessary nested | enum | [EnumWith0DoesNotMatchFalse.DoubleEnumWith0DoesNotMatchFalseEnums](#doubleenumwith0doesnotmatchfalseenums)
Double enum | ## EnumWith0DoesNotMatchFalse1Boxed -public static abstract sealed class EnumWith0DoesNotMatchFalse1Boxed
+public sealed interface EnumWith0DoesNotMatchFalse1Boxed
permits
[EnumWith0DoesNotMatchFalse1BoxedNumber](#enumwith0doesnotmatchfalse1boxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## EnumWith0DoesNotMatchFalse1BoxedNumber -public static final class EnumWith0DoesNotMatchFalse1BoxedNumber
-extends [EnumWith0DoesNotMatchFalse1Boxed](#enumwith0doesnotmatchfalse1boxed) +public record EnumWith0DoesNotMatchFalse1BoxedNumber
+implements [EnumWith0DoesNotMatchFalse1Boxed](#enumwith0doesnotmatchfalse1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | EnumWith0DoesNotMatchFalse1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## EnumWith0DoesNotMatchFalse1 public static class EnumWith0DoesNotMatchFalse1
@@ -81,7 +82,9 @@ int validatedPayload = EnumWith0DoesNotMatchFalse.EnumWith0DoesNotMatchFalse1.va | ----------------- | ---------------------- | | Number | validate(Number arg, SchemaConfiguration configuration) | | [EnumWith0DoesNotMatchFalse1BoxedNumber](#enumwith0doesnotmatchfalse1boxednumber) | validateAndBox(Number arg, SchemaConfiguration configuration) | +| [EnumWith0DoesNotMatchFalse1Boxed](#enumwith0doesnotmatchfalse1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## IntegerEnumWith0DoesNotMatchFalseEnums public enum IntegerEnumWith0DoesNotMatchFalseEnums
extends `Enum` diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/EnumWith1DoesNotMatchTrue.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/EnumWith1DoesNotMatchTrue.md index a19cbe95ca5..f3a46b77a0f 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/EnumWith1DoesNotMatchTrue.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/EnumWith1DoesNotMatchTrue.md @@ -4,15 +4,15 @@ public class EnumWith1DoesNotMatchTrue
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - enum classes ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [EnumWith1DoesNotMatchTrue.EnumWith1DoesNotMatchTrue1Boxed](#enumwith1doesnotmatchtrue1boxed)
abstract sealed validated payload class | -| static class | [EnumWith1DoesNotMatchTrue.EnumWith1DoesNotMatchTrue1BoxedNumber](#enumwith1doesnotmatchtrue1boxednumber)
boxed class to store validated Number payloads | +| sealed interface | [EnumWith1DoesNotMatchTrue.EnumWith1DoesNotMatchTrue1Boxed](#enumwith1doesnotmatchtrue1boxed)
sealed interface for validated payloads | +| record | [EnumWith1DoesNotMatchTrue.EnumWith1DoesNotMatchTrue1BoxedNumber](#enumwith1doesnotmatchtrue1boxednumber)
boxed class to store validated Number payloads | | static class | [EnumWith1DoesNotMatchTrue.EnumWith1DoesNotMatchTrue1](#enumwith1doesnotmatchtrue1)
schema class | | enum | [EnumWith1DoesNotMatchTrue.IntegerEnumWith1DoesNotMatchTrueEnums](#integerenumwith1doesnotmatchtrueenums)
Integer enum | | enum | [EnumWith1DoesNotMatchTrue.LongEnumWith1DoesNotMatchTrueEnums](#longenumwith1doesnotmatchtrueenums)
Long enum | @@ -20,27 +20,28 @@ A class that contains necessary nested | enum | [EnumWith1DoesNotMatchTrue.DoubleEnumWith1DoesNotMatchTrueEnums](#doubleenumwith1doesnotmatchtrueenums)
Double enum | ## EnumWith1DoesNotMatchTrue1Boxed -public static abstract sealed class EnumWith1DoesNotMatchTrue1Boxed
+public sealed interface EnumWith1DoesNotMatchTrue1Boxed
permits
[EnumWith1DoesNotMatchTrue1BoxedNumber](#enumwith1doesnotmatchtrue1boxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## EnumWith1DoesNotMatchTrue1BoxedNumber -public static final class EnumWith1DoesNotMatchTrue1BoxedNumber
-extends [EnumWith1DoesNotMatchTrue1Boxed](#enumwith1doesnotmatchtrue1boxed) +public record EnumWith1DoesNotMatchTrue1BoxedNumber
+implements [EnumWith1DoesNotMatchTrue1Boxed](#enumwith1doesnotmatchtrue1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | EnumWith1DoesNotMatchTrue1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## EnumWith1DoesNotMatchTrue1 public static class EnumWith1DoesNotMatchTrue1
@@ -81,7 +82,9 @@ int validatedPayload = EnumWith1DoesNotMatchTrue.EnumWith1DoesNotMatchTrue1.vali | ----------------- | ---------------------- | | Number | validate(Number arg, SchemaConfiguration configuration) | | [EnumWith1DoesNotMatchTrue1BoxedNumber](#enumwith1doesnotmatchtrue1boxednumber) | validateAndBox(Number arg, SchemaConfiguration configuration) | +| [EnumWith1DoesNotMatchTrue1Boxed](#enumwith1doesnotmatchtrue1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## IntegerEnumWith1DoesNotMatchTrueEnums public enum IntegerEnumWith1DoesNotMatchTrueEnums
extends `Enum` diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/EnumWithEscapedCharacters.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/EnumWithEscapedCharacters.md index e526d2e529e..8c281b72e92 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/EnumWithEscapedCharacters.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/EnumWithEscapedCharacters.md @@ -4,40 +4,41 @@ public class EnumWithEscapedCharacters
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - enum classes ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [EnumWithEscapedCharacters.EnumWithEscapedCharacters1Boxed](#enumwithescapedcharacters1boxed)
abstract sealed validated payload class | -| static class | [EnumWithEscapedCharacters.EnumWithEscapedCharacters1BoxedString](#enumwithescapedcharacters1boxedstring)
boxed class to store validated String payloads | +| sealed interface | [EnumWithEscapedCharacters.EnumWithEscapedCharacters1Boxed](#enumwithescapedcharacters1boxed)
sealed interface for validated payloads | +| record | [EnumWithEscapedCharacters.EnumWithEscapedCharacters1BoxedString](#enumwithescapedcharacters1boxedstring)
boxed class to store validated String payloads | | static class | [EnumWithEscapedCharacters.EnumWithEscapedCharacters1](#enumwithescapedcharacters1)
schema class | | enum | [EnumWithEscapedCharacters.StringEnumWithEscapedCharactersEnums](#stringenumwithescapedcharactersenums)
String enum | ## EnumWithEscapedCharacters1Boxed -public static abstract sealed class EnumWithEscapedCharacters1Boxed
+public sealed interface EnumWithEscapedCharacters1Boxed
permits
[EnumWithEscapedCharacters1BoxedString](#enumwithescapedcharacters1boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## EnumWithEscapedCharacters1BoxedString -public static final class EnumWithEscapedCharacters1BoxedString
-extends [EnumWithEscapedCharacters1Boxed](#enumwithescapedcharacters1boxed) +public record EnumWithEscapedCharacters1BoxedString
+implements [EnumWithEscapedCharacters1Boxed](#enumwithescapedcharacters1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | EnumWithEscapedCharacters1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## EnumWithEscapedCharacters1 public static class EnumWithEscapedCharacters1
@@ -79,7 +80,9 @@ String validatedPayload = EnumWithEscapedCharacters.EnumWithEscapedCharacters1.v | String | validate(String arg, SchemaConfiguration configuration) | | String | validate([StringEnumWithEscapedCharactersEnums](#stringenumwithescapedcharactersenums) arg, SchemaConfiguration configuration) | | [EnumWithEscapedCharacters1BoxedString](#enumwithescapedcharacters1boxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [EnumWithEscapedCharacters1Boxed](#enumwithescapedcharacters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## StringEnumWithEscapedCharactersEnums public enum StringEnumWithEscapedCharactersEnums
extends `Enum` diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/EnumWithFalseDoesNotMatch0.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/EnumWithFalseDoesNotMatch0.md index 49ada19b41f..6e8b2582e42 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/EnumWithFalseDoesNotMatch0.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/EnumWithFalseDoesNotMatch0.md @@ -4,40 +4,41 @@ public class EnumWithFalseDoesNotMatch0
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - enum classes ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [EnumWithFalseDoesNotMatch0.EnumWithFalseDoesNotMatch01Boxed](#enumwithfalsedoesnotmatch01boxed)
abstract sealed validated payload class | -| static class | [EnumWithFalseDoesNotMatch0.EnumWithFalseDoesNotMatch01BoxedBoolean](#enumwithfalsedoesnotmatch01boxedboolean)
boxed class to store validated boolean payloads | +| sealed interface | [EnumWithFalseDoesNotMatch0.EnumWithFalseDoesNotMatch01Boxed](#enumwithfalsedoesnotmatch01boxed)
sealed interface for validated payloads | +| record | [EnumWithFalseDoesNotMatch0.EnumWithFalseDoesNotMatch01BoxedBoolean](#enumwithfalsedoesnotmatch01boxedboolean)
boxed class to store validated boolean payloads | | static class | [EnumWithFalseDoesNotMatch0.EnumWithFalseDoesNotMatch01](#enumwithfalsedoesnotmatch01)
schema class | | enum | [EnumWithFalseDoesNotMatch0.BooleanEnumWithFalseDoesNotMatch0Enums](#booleanenumwithfalsedoesnotmatch0enums)
boolean enum | ## EnumWithFalseDoesNotMatch01Boxed -public static abstract sealed class EnumWithFalseDoesNotMatch01Boxed
+public sealed interface EnumWithFalseDoesNotMatch01Boxed
permits
[EnumWithFalseDoesNotMatch01BoxedBoolean](#enumwithfalsedoesnotmatch01boxedboolean) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## EnumWithFalseDoesNotMatch01BoxedBoolean -public static final class EnumWithFalseDoesNotMatch01BoxedBoolean
-extends [EnumWithFalseDoesNotMatch01Boxed](#enumwithfalsedoesnotmatch01boxed) +public record EnumWithFalseDoesNotMatch01BoxedBoolean
+implements [EnumWithFalseDoesNotMatch01Boxed](#enumwithfalsedoesnotmatch01boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | EnumWithFalseDoesNotMatch01BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## EnumWithFalseDoesNotMatch01 public static class EnumWithFalseDoesNotMatch01
@@ -79,7 +80,9 @@ boolean validatedPayload = EnumWithFalseDoesNotMatch0.EnumWithFalseDoesNotMatch0 | boolean | validate(boolean arg, SchemaConfiguration configuration) | | boolean | validate([BooleanEnumWithFalseDoesNotMatch0Enums](#booleanenumwithfalsedoesnotmatch0enums) arg, SchemaConfiguration configuration) | | [EnumWithFalseDoesNotMatch01BoxedBoolean](#enumwithfalsedoesnotmatch01boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | +| [EnumWithFalseDoesNotMatch01Boxed](#enumwithfalsedoesnotmatch01boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## BooleanEnumWithFalseDoesNotMatch0Enums public enum BooleanEnumWithFalseDoesNotMatch0Enums
extends `Enum` diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/EnumWithTrueDoesNotMatch1.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/EnumWithTrueDoesNotMatch1.md index 2a6d6f9c88d..5902c3f2697 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/EnumWithTrueDoesNotMatch1.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/EnumWithTrueDoesNotMatch1.md @@ -4,40 +4,41 @@ public class EnumWithTrueDoesNotMatch1
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - enum classes ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [EnumWithTrueDoesNotMatch1.EnumWithTrueDoesNotMatch11Boxed](#enumwithtruedoesnotmatch11boxed)
abstract sealed validated payload class | -| static class | [EnumWithTrueDoesNotMatch1.EnumWithTrueDoesNotMatch11BoxedBoolean](#enumwithtruedoesnotmatch11boxedboolean)
boxed class to store validated boolean payloads | +| sealed interface | [EnumWithTrueDoesNotMatch1.EnumWithTrueDoesNotMatch11Boxed](#enumwithtruedoesnotmatch11boxed)
sealed interface for validated payloads | +| record | [EnumWithTrueDoesNotMatch1.EnumWithTrueDoesNotMatch11BoxedBoolean](#enumwithtruedoesnotmatch11boxedboolean)
boxed class to store validated boolean payloads | | static class | [EnumWithTrueDoesNotMatch1.EnumWithTrueDoesNotMatch11](#enumwithtruedoesnotmatch11)
schema class | | enum | [EnumWithTrueDoesNotMatch1.BooleanEnumWithTrueDoesNotMatch1Enums](#booleanenumwithtruedoesnotmatch1enums)
boolean enum | ## EnumWithTrueDoesNotMatch11Boxed -public static abstract sealed class EnumWithTrueDoesNotMatch11Boxed
+public sealed interface EnumWithTrueDoesNotMatch11Boxed
permits
[EnumWithTrueDoesNotMatch11BoxedBoolean](#enumwithtruedoesnotmatch11boxedboolean) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## EnumWithTrueDoesNotMatch11BoxedBoolean -public static final class EnumWithTrueDoesNotMatch11BoxedBoolean
-extends [EnumWithTrueDoesNotMatch11Boxed](#enumwithtruedoesnotmatch11boxed) +public record EnumWithTrueDoesNotMatch11BoxedBoolean
+implements [EnumWithTrueDoesNotMatch11Boxed](#enumwithtruedoesnotmatch11boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | EnumWithTrueDoesNotMatch11BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## EnumWithTrueDoesNotMatch11 public static class EnumWithTrueDoesNotMatch11
@@ -79,7 +80,9 @@ boolean validatedPayload = EnumWithTrueDoesNotMatch1.EnumWithTrueDoesNotMatch11. | boolean | validate(boolean arg, SchemaConfiguration configuration) | | boolean | validate([BooleanEnumWithTrueDoesNotMatch1Enums](#booleanenumwithtruedoesnotmatch1enums) arg, SchemaConfiguration configuration) | | [EnumWithTrueDoesNotMatch11BoxedBoolean](#enumwithtruedoesnotmatch11boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | +| [EnumWithTrueDoesNotMatch11Boxed](#enumwithtruedoesnotmatch11boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## BooleanEnumWithTrueDoesNotMatch1Enums public enum BooleanEnumWithTrueDoesNotMatch1Enums
extends `Enum` diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/EnumsInProperties.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/EnumsInProperties.md index 6b1dbcf30dd..a518254b410 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/EnumsInProperties.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/EnumsInProperties.md @@ -4,7 +4,7 @@ public class EnumsInProperties
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -13,42 +13,43 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [EnumsInProperties.EnumsInProperties1Boxed](#enumsinproperties1boxed)
abstract sealed validated payload class | -| static class | [EnumsInProperties.EnumsInProperties1BoxedMap](#enumsinproperties1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [EnumsInProperties.EnumsInProperties1Boxed](#enumsinproperties1boxed)
sealed interface for validated payloads | +| record | [EnumsInProperties.EnumsInProperties1BoxedMap](#enumsinproperties1boxedmap)
boxed class to store validated Map payloads | | static class | [EnumsInProperties.EnumsInProperties1](#enumsinproperties1)
schema class | | static class | [EnumsInProperties.EnumsInPropertiesMapBuilder](#enumsinpropertiesmapbuilder)
builder for Map payloads | | static class | [EnumsInProperties.EnumsInPropertiesMap](#enumsinpropertiesmap)
output class for Map payloads | -| static class | [EnumsInProperties.BarBoxed](#barboxed)
abstract sealed validated payload class | -| static class | [EnumsInProperties.BarBoxedString](#barboxedstring)
boxed class to store validated String payloads | +| sealed interface | [EnumsInProperties.BarBoxed](#barboxed)
sealed interface for validated payloads | +| record | [EnumsInProperties.BarBoxedString](#barboxedstring)
boxed class to store validated String payloads | | static class | [EnumsInProperties.Bar](#bar)
schema class | | enum | [EnumsInProperties.StringBarEnums](#stringbarenums)
String enum | -| static class | [EnumsInProperties.FooBoxed](#fooboxed)
abstract sealed validated payload class | -| static class | [EnumsInProperties.FooBoxedString](#fooboxedstring)
boxed class to store validated String payloads | +| sealed interface | [EnumsInProperties.FooBoxed](#fooboxed)
sealed interface for validated payloads | +| record | [EnumsInProperties.FooBoxedString](#fooboxedstring)
boxed class to store validated String payloads | | static class | [EnumsInProperties.Foo](#foo)
schema class | | enum | [EnumsInProperties.StringFooEnums](#stringfooenums)
String enum | ## EnumsInProperties1Boxed -public static abstract sealed class EnumsInProperties1Boxed
+public sealed interface EnumsInProperties1Boxed
permits
[EnumsInProperties1BoxedMap](#enumsinproperties1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## EnumsInProperties1BoxedMap -public static final class EnumsInProperties1BoxedMap
-extends [EnumsInProperties1Boxed](#enumsinproperties1boxed) +public record EnumsInProperties1BoxedMap
+implements [EnumsInProperties1Boxed](#enumsinproperties1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | EnumsInProperties1BoxedMap([EnumsInPropertiesMap](#enumsinpropertiesmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [EnumsInPropertiesMap](#enumsinpropertiesmap) | data
validated payload | +| [EnumsInPropertiesMap](#enumsinpropertiesmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## EnumsInProperties1 public static class EnumsInProperties1
@@ -96,7 +97,9 @@ EnumsInProperties.EnumsInPropertiesMap validatedPayload = | ----------------- | ---------------------- | | [EnumsInPropertiesMap](#enumsinpropertiesmap) | validate([Map<?, ?>](#enumsinpropertiesmapbuilder) arg, SchemaConfiguration configuration) | | [EnumsInProperties1BoxedMap](#enumsinproperties1boxedmap) | validateAndBox([Map<?, ?>](#enumsinpropertiesmapbuilder) arg, SchemaConfiguration configuration) | +| [EnumsInProperties1Boxed](#enumsinproperties1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## EnumsInPropertiesMap0Builder public class EnumsInPropertiesMap0Builder
builder for `Map` @@ -156,27 +159,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## BarBoxed -public static abstract sealed class BarBoxed
+public sealed interface BarBoxed
permits
[BarBoxedString](#barboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## BarBoxedString -public static final class BarBoxedString
-extends [BarBoxed](#barboxed) +public record BarBoxedString
+implements [BarBoxed](#barboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BarBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Bar public static class Bar
@@ -218,7 +222,9 @@ String validatedPayload = EnumsInProperties.Bar.validate( | String | validate(String arg, SchemaConfiguration configuration) | | String | validate([StringBarEnums](#stringbarenums) arg, SchemaConfiguration configuration) | | [BarBoxedString](#barboxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [BarBoxed](#barboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## StringBarEnums public enum StringBarEnums
extends `Enum` @@ -231,27 +237,28 @@ A class that stores String enum values | BAR | value = "bar" | ## FooBoxed -public static abstract sealed class FooBoxed
+public sealed interface FooBoxed
permits
[FooBoxedString](#fooboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## FooBoxedString -public static final class FooBoxedString
-extends [FooBoxed](#fooboxed) +public record FooBoxedString
+implements [FooBoxed](#fooboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Foo public static class Foo
@@ -293,7 +300,9 @@ String validatedPayload = EnumsInProperties.Foo.validate( | String | validate(String arg, SchemaConfiguration configuration) | | String | validate([StringFooEnums](#stringfooenums) arg, SchemaConfiguration configuration) | | [FooBoxedString](#fooboxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [FooBoxed](#fooboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## StringFooEnums public enum StringFooEnums
extends `Enum` diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/ExclusivemaximumValidation.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/ExclusivemaximumValidation.md index 1e29e0b3d3d..ca6f30db8cb 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/ExclusivemaximumValidation.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/ExclusivemaximumValidation.md @@ -4,23 +4,23 @@ public class ExclusivemaximumValidation
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ExclusivemaximumValidation.ExclusivemaximumValidation1Boxed](#exclusivemaximumvalidation1boxed)
abstract sealed validated payload class | -| static class | [ExclusivemaximumValidation.ExclusivemaximumValidation1BoxedVoid](#exclusivemaximumvalidation1boxedvoid)
boxed class to store validated null payloads | -| static class | [ExclusivemaximumValidation.ExclusivemaximumValidation1BoxedBoolean](#exclusivemaximumvalidation1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [ExclusivemaximumValidation.ExclusivemaximumValidation1BoxedNumber](#exclusivemaximumvalidation1boxednumber)
boxed class to store validated Number payloads | -| static class | [ExclusivemaximumValidation.ExclusivemaximumValidation1BoxedString](#exclusivemaximumvalidation1boxedstring)
boxed class to store validated String payloads | -| static class | [ExclusivemaximumValidation.ExclusivemaximumValidation1BoxedList](#exclusivemaximumvalidation1boxedlist)
boxed class to store validated List payloads | -| static class | [ExclusivemaximumValidation.ExclusivemaximumValidation1BoxedMap](#exclusivemaximumvalidation1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ExclusivemaximumValidation.ExclusivemaximumValidation1Boxed](#exclusivemaximumvalidation1boxed)
sealed interface for validated payloads | +| record | [ExclusivemaximumValidation.ExclusivemaximumValidation1BoxedVoid](#exclusivemaximumvalidation1boxedvoid)
boxed class to store validated null payloads | +| record | [ExclusivemaximumValidation.ExclusivemaximumValidation1BoxedBoolean](#exclusivemaximumvalidation1boxedboolean)
boxed class to store validated boolean payloads | +| record | [ExclusivemaximumValidation.ExclusivemaximumValidation1BoxedNumber](#exclusivemaximumvalidation1boxednumber)
boxed class to store validated Number payloads | +| record | [ExclusivemaximumValidation.ExclusivemaximumValidation1BoxedString](#exclusivemaximumvalidation1boxedstring)
boxed class to store validated String payloads | +| record | [ExclusivemaximumValidation.ExclusivemaximumValidation1BoxedList](#exclusivemaximumvalidation1boxedlist)
boxed class to store validated List payloads | +| record | [ExclusivemaximumValidation.ExclusivemaximumValidation1BoxedMap](#exclusivemaximumvalidation1boxedmap)
boxed class to store validated Map payloads | | static class | [ExclusivemaximumValidation.ExclusivemaximumValidation1](#exclusivemaximumvalidation1)
schema class | ## ExclusivemaximumValidation1Boxed -public static abstract sealed class ExclusivemaximumValidation1Boxed
+public sealed interface ExclusivemaximumValidation1Boxed
permits
[ExclusivemaximumValidation1BoxedVoid](#exclusivemaximumvalidation1boxedvoid), [ExclusivemaximumValidation1BoxedBoolean](#exclusivemaximumvalidation1boxedboolean), @@ -29,103 +29,109 @@ permits
[ExclusivemaximumValidation1BoxedList](#exclusivemaximumvalidation1boxedlist), [ExclusivemaximumValidation1BoxedMap](#exclusivemaximumvalidation1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ExclusivemaximumValidation1BoxedVoid -public static final class ExclusivemaximumValidation1BoxedVoid
-extends [ExclusivemaximumValidation1Boxed](#exclusivemaximumvalidation1boxed) +public record ExclusivemaximumValidation1BoxedVoid
+implements [ExclusivemaximumValidation1Boxed](#exclusivemaximumvalidation1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ExclusivemaximumValidation1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ExclusivemaximumValidation1BoxedBoolean -public static final class ExclusivemaximumValidation1BoxedBoolean
-extends [ExclusivemaximumValidation1Boxed](#exclusivemaximumvalidation1boxed) +public record ExclusivemaximumValidation1BoxedBoolean
+implements [ExclusivemaximumValidation1Boxed](#exclusivemaximumvalidation1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ExclusivemaximumValidation1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ExclusivemaximumValidation1BoxedNumber -public static final class ExclusivemaximumValidation1BoxedNumber
-extends [ExclusivemaximumValidation1Boxed](#exclusivemaximumvalidation1boxed) +public record ExclusivemaximumValidation1BoxedNumber
+implements [ExclusivemaximumValidation1Boxed](#exclusivemaximumvalidation1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ExclusivemaximumValidation1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ExclusivemaximumValidation1BoxedString -public static final class ExclusivemaximumValidation1BoxedString
-extends [ExclusivemaximumValidation1Boxed](#exclusivemaximumvalidation1boxed) +public record ExclusivemaximumValidation1BoxedString
+implements [ExclusivemaximumValidation1Boxed](#exclusivemaximumvalidation1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ExclusivemaximumValidation1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ExclusivemaximumValidation1BoxedList -public static final class ExclusivemaximumValidation1BoxedList
-extends [ExclusivemaximumValidation1Boxed](#exclusivemaximumvalidation1boxed) +public record ExclusivemaximumValidation1BoxedList
+implements [ExclusivemaximumValidation1Boxed](#exclusivemaximumvalidation1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ExclusivemaximumValidation1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ExclusivemaximumValidation1BoxedMap -public static final class ExclusivemaximumValidation1BoxedMap
-extends [ExclusivemaximumValidation1Boxed](#exclusivemaximumvalidation1boxed) +public record ExclusivemaximumValidation1BoxedMap
+implements [ExclusivemaximumValidation1Boxed](#exclusivemaximumvalidation1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ExclusivemaximumValidation1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ExclusivemaximumValidation1 public static class ExclusivemaximumValidation1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [ExclusivemaximumValidation1BoxedBoolean](#exclusivemaximumvalidation1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [ExclusivemaximumValidation1BoxedMap](#exclusivemaximumvalidation1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [ExclusivemaximumValidation1BoxedList](#exclusivemaximumvalidation1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [ExclusivemaximumValidation1Boxed](#exclusivemaximumvalidation1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/ExclusiveminimumValidation.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/ExclusiveminimumValidation.md index f953fabb28e..e9c2e63c0af 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/ExclusiveminimumValidation.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/ExclusiveminimumValidation.md @@ -4,23 +4,23 @@ public class ExclusiveminimumValidation
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ExclusiveminimumValidation.ExclusiveminimumValidation1Boxed](#exclusiveminimumvalidation1boxed)
abstract sealed validated payload class | -| static class | [ExclusiveminimumValidation.ExclusiveminimumValidation1BoxedVoid](#exclusiveminimumvalidation1boxedvoid)
boxed class to store validated null payloads | -| static class | [ExclusiveminimumValidation.ExclusiveminimumValidation1BoxedBoolean](#exclusiveminimumvalidation1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [ExclusiveminimumValidation.ExclusiveminimumValidation1BoxedNumber](#exclusiveminimumvalidation1boxednumber)
boxed class to store validated Number payloads | -| static class | [ExclusiveminimumValidation.ExclusiveminimumValidation1BoxedString](#exclusiveminimumvalidation1boxedstring)
boxed class to store validated String payloads | -| static class | [ExclusiveminimumValidation.ExclusiveminimumValidation1BoxedList](#exclusiveminimumvalidation1boxedlist)
boxed class to store validated List payloads | -| static class | [ExclusiveminimumValidation.ExclusiveminimumValidation1BoxedMap](#exclusiveminimumvalidation1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ExclusiveminimumValidation.ExclusiveminimumValidation1Boxed](#exclusiveminimumvalidation1boxed)
sealed interface for validated payloads | +| record | [ExclusiveminimumValidation.ExclusiveminimumValidation1BoxedVoid](#exclusiveminimumvalidation1boxedvoid)
boxed class to store validated null payloads | +| record | [ExclusiveminimumValidation.ExclusiveminimumValidation1BoxedBoolean](#exclusiveminimumvalidation1boxedboolean)
boxed class to store validated boolean payloads | +| record | [ExclusiveminimumValidation.ExclusiveminimumValidation1BoxedNumber](#exclusiveminimumvalidation1boxednumber)
boxed class to store validated Number payloads | +| record | [ExclusiveminimumValidation.ExclusiveminimumValidation1BoxedString](#exclusiveminimumvalidation1boxedstring)
boxed class to store validated String payloads | +| record | [ExclusiveminimumValidation.ExclusiveminimumValidation1BoxedList](#exclusiveminimumvalidation1boxedlist)
boxed class to store validated List payloads | +| record | [ExclusiveminimumValidation.ExclusiveminimumValidation1BoxedMap](#exclusiveminimumvalidation1boxedmap)
boxed class to store validated Map payloads | | static class | [ExclusiveminimumValidation.ExclusiveminimumValidation1](#exclusiveminimumvalidation1)
schema class | ## ExclusiveminimumValidation1Boxed -public static abstract sealed class ExclusiveminimumValidation1Boxed
+public sealed interface ExclusiveminimumValidation1Boxed
permits
[ExclusiveminimumValidation1BoxedVoid](#exclusiveminimumvalidation1boxedvoid), [ExclusiveminimumValidation1BoxedBoolean](#exclusiveminimumvalidation1boxedboolean), @@ -29,103 +29,109 @@ permits
[ExclusiveminimumValidation1BoxedList](#exclusiveminimumvalidation1boxedlist), [ExclusiveminimumValidation1BoxedMap](#exclusiveminimumvalidation1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ExclusiveminimumValidation1BoxedVoid -public static final class ExclusiveminimumValidation1BoxedVoid
-extends [ExclusiveminimumValidation1Boxed](#exclusiveminimumvalidation1boxed) +public record ExclusiveminimumValidation1BoxedVoid
+implements [ExclusiveminimumValidation1Boxed](#exclusiveminimumvalidation1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ExclusiveminimumValidation1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ExclusiveminimumValidation1BoxedBoolean -public static final class ExclusiveminimumValidation1BoxedBoolean
-extends [ExclusiveminimumValidation1Boxed](#exclusiveminimumvalidation1boxed) +public record ExclusiveminimumValidation1BoxedBoolean
+implements [ExclusiveminimumValidation1Boxed](#exclusiveminimumvalidation1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ExclusiveminimumValidation1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ExclusiveminimumValidation1BoxedNumber -public static final class ExclusiveminimumValidation1BoxedNumber
-extends [ExclusiveminimumValidation1Boxed](#exclusiveminimumvalidation1boxed) +public record ExclusiveminimumValidation1BoxedNumber
+implements [ExclusiveminimumValidation1Boxed](#exclusiveminimumvalidation1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ExclusiveminimumValidation1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ExclusiveminimumValidation1BoxedString -public static final class ExclusiveminimumValidation1BoxedString
-extends [ExclusiveminimumValidation1Boxed](#exclusiveminimumvalidation1boxed) +public record ExclusiveminimumValidation1BoxedString
+implements [ExclusiveminimumValidation1Boxed](#exclusiveminimumvalidation1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ExclusiveminimumValidation1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ExclusiveminimumValidation1BoxedList -public static final class ExclusiveminimumValidation1BoxedList
-extends [ExclusiveminimumValidation1Boxed](#exclusiveminimumvalidation1boxed) +public record ExclusiveminimumValidation1BoxedList
+implements [ExclusiveminimumValidation1Boxed](#exclusiveminimumvalidation1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ExclusiveminimumValidation1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ExclusiveminimumValidation1BoxedMap -public static final class ExclusiveminimumValidation1BoxedMap
-extends [ExclusiveminimumValidation1Boxed](#exclusiveminimumvalidation1boxed) +public record ExclusiveminimumValidation1BoxedMap
+implements [ExclusiveminimumValidation1Boxed](#exclusiveminimumvalidation1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ExclusiveminimumValidation1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ExclusiveminimumValidation1 public static class ExclusiveminimumValidation1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [ExclusiveminimumValidation1BoxedBoolean](#exclusiveminimumvalidation1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [ExclusiveminimumValidation1BoxedMap](#exclusiveminimumvalidation1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [ExclusiveminimumValidation1BoxedList](#exclusiveminimumvalidation1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [ExclusiveminimumValidation1Boxed](#exclusiveminimumvalidation1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/FloatDivisionInf.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/FloatDivisionInf.md index ef8a8d5dae5..d6338e6126f 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/FloatDivisionInf.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/FloatDivisionInf.md @@ -4,38 +4,39 @@ public class FloatDivisionInf
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [FloatDivisionInf.FloatDivisionInf1Boxed](#floatdivisioninf1boxed)
abstract sealed validated payload class | -| static class | [FloatDivisionInf.FloatDivisionInf1BoxedNumber](#floatdivisioninf1boxednumber)
boxed class to store validated Number payloads | +| sealed interface | [FloatDivisionInf.FloatDivisionInf1Boxed](#floatdivisioninf1boxed)
sealed interface for validated payloads | +| record | [FloatDivisionInf.FloatDivisionInf1BoxedNumber](#floatdivisioninf1boxednumber)
boxed class to store validated Number payloads | | static class | [FloatDivisionInf.FloatDivisionInf1](#floatdivisioninf1)
schema class | ## FloatDivisionInf1Boxed -public static abstract sealed class FloatDivisionInf1Boxed
+public sealed interface FloatDivisionInf1Boxed
permits
[FloatDivisionInf1BoxedNumber](#floatdivisioninf1boxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## FloatDivisionInf1BoxedNumber -public static final class FloatDivisionInf1BoxedNumber
-extends [FloatDivisionInf1Boxed](#floatdivisioninf1boxed) +public record FloatDivisionInf1BoxedNumber
+implements [FloatDivisionInf1Boxed](#floatdivisioninf1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FloatDivisionInf1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FloatDivisionInf1 public static class FloatDivisionInf1
@@ -77,5 +78,7 @@ int validatedPayload = FloatDivisionInf.FloatDivisionInf1.validate( | ----------------- | ---------------------- | | long | validate(long arg, SchemaConfiguration configuration) | | [FloatDivisionInf1BoxedNumber](#floatdivisioninf1boxednumber) | validateAndBox(Number arg, SchemaConfiguration configuration) | +| [FloatDivisionInf1Boxed](#floatdivisioninf1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/ForbiddenProperty.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/ForbiddenProperty.md index f83f8e2d402..a0b819b97ca 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/ForbiddenProperty.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/ForbiddenProperty.md @@ -4,7 +4,7 @@ public class ForbiddenProperty
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,35 +12,35 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ForbiddenProperty.ForbiddenProperty1Boxed](#forbiddenproperty1boxed)
abstract sealed validated payload class | -| static class | [ForbiddenProperty.ForbiddenProperty1BoxedVoid](#forbiddenproperty1boxedvoid)
boxed class to store validated null payloads | -| static class | [ForbiddenProperty.ForbiddenProperty1BoxedBoolean](#forbiddenproperty1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [ForbiddenProperty.ForbiddenProperty1BoxedNumber](#forbiddenproperty1boxednumber)
boxed class to store validated Number payloads | -| static class | [ForbiddenProperty.ForbiddenProperty1BoxedString](#forbiddenproperty1boxedstring)
boxed class to store validated String payloads | -| static class | [ForbiddenProperty.ForbiddenProperty1BoxedList](#forbiddenproperty1boxedlist)
boxed class to store validated List payloads | -| static class | [ForbiddenProperty.ForbiddenProperty1BoxedMap](#forbiddenproperty1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ForbiddenProperty.ForbiddenProperty1Boxed](#forbiddenproperty1boxed)
sealed interface for validated payloads | +| record | [ForbiddenProperty.ForbiddenProperty1BoxedVoid](#forbiddenproperty1boxedvoid)
boxed class to store validated null payloads | +| record | [ForbiddenProperty.ForbiddenProperty1BoxedBoolean](#forbiddenproperty1boxedboolean)
boxed class to store validated boolean payloads | +| record | [ForbiddenProperty.ForbiddenProperty1BoxedNumber](#forbiddenproperty1boxednumber)
boxed class to store validated Number payloads | +| record | [ForbiddenProperty.ForbiddenProperty1BoxedString](#forbiddenproperty1boxedstring)
boxed class to store validated String payloads | +| record | [ForbiddenProperty.ForbiddenProperty1BoxedList](#forbiddenproperty1boxedlist)
boxed class to store validated List payloads | +| record | [ForbiddenProperty.ForbiddenProperty1BoxedMap](#forbiddenproperty1boxedmap)
boxed class to store validated Map payloads | | static class | [ForbiddenProperty.ForbiddenProperty1](#forbiddenproperty1)
schema class | | static class | [ForbiddenProperty.ForbiddenPropertyMapBuilder](#forbiddenpropertymapbuilder)
builder for Map payloads | | static class | [ForbiddenProperty.ForbiddenPropertyMap](#forbiddenpropertymap)
output class for Map payloads | -| static class | [ForbiddenProperty.FooBoxed](#fooboxed)
abstract sealed validated payload class | -| static class | [ForbiddenProperty.FooBoxedVoid](#fooboxedvoid)
boxed class to store validated null payloads | -| static class | [ForbiddenProperty.FooBoxedBoolean](#fooboxedboolean)
boxed class to store validated boolean payloads | -| static class | [ForbiddenProperty.FooBoxedNumber](#fooboxednumber)
boxed class to store validated Number payloads | -| static class | [ForbiddenProperty.FooBoxedString](#fooboxedstring)
boxed class to store validated String payloads | -| static class | [ForbiddenProperty.FooBoxedList](#fooboxedlist)
boxed class to store validated List payloads | -| static class | [ForbiddenProperty.FooBoxedMap](#fooboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ForbiddenProperty.FooBoxed](#fooboxed)
sealed interface for validated payloads | +| record | [ForbiddenProperty.FooBoxedVoid](#fooboxedvoid)
boxed class to store validated null payloads | +| record | [ForbiddenProperty.FooBoxedBoolean](#fooboxedboolean)
boxed class to store validated boolean payloads | +| record | [ForbiddenProperty.FooBoxedNumber](#fooboxednumber)
boxed class to store validated Number payloads | +| record | [ForbiddenProperty.FooBoxedString](#fooboxedstring)
boxed class to store validated String payloads | +| record | [ForbiddenProperty.FooBoxedList](#fooboxedlist)
boxed class to store validated List payloads | +| record | [ForbiddenProperty.FooBoxedMap](#fooboxedmap)
boxed class to store validated Map payloads | | static class | [ForbiddenProperty.Foo](#foo)
schema class | -| static class | [ForbiddenProperty.NotBoxed](#notboxed)
abstract sealed validated payload class | -| static class | [ForbiddenProperty.NotBoxedVoid](#notboxedvoid)
boxed class to store validated null payloads | -| static class | [ForbiddenProperty.NotBoxedBoolean](#notboxedboolean)
boxed class to store validated boolean payloads | -| static class | [ForbiddenProperty.NotBoxedNumber](#notboxednumber)
boxed class to store validated Number payloads | -| static class | [ForbiddenProperty.NotBoxedString](#notboxedstring)
boxed class to store validated String payloads | -| static class | [ForbiddenProperty.NotBoxedList](#notboxedlist)
boxed class to store validated List payloads | -| static class | [ForbiddenProperty.NotBoxedMap](#notboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ForbiddenProperty.NotBoxed](#notboxed)
sealed interface for validated payloads | +| record | [ForbiddenProperty.NotBoxedVoid](#notboxedvoid)
boxed class to store validated null payloads | +| record | [ForbiddenProperty.NotBoxedBoolean](#notboxedboolean)
boxed class to store validated boolean payloads | +| record | [ForbiddenProperty.NotBoxedNumber](#notboxednumber)
boxed class to store validated Number payloads | +| record | [ForbiddenProperty.NotBoxedString](#notboxedstring)
boxed class to store validated String payloads | +| record | [ForbiddenProperty.NotBoxedList](#notboxedlist)
boxed class to store validated List payloads | +| record | [ForbiddenProperty.NotBoxedMap](#notboxedmap)
boxed class to store validated Map payloads | | static class | [ForbiddenProperty.Not](#not)
schema class | ## ForbiddenProperty1Boxed -public static abstract sealed class ForbiddenProperty1Boxed
+public sealed interface ForbiddenProperty1Boxed
permits
[ForbiddenProperty1BoxedVoid](#forbiddenproperty1boxedvoid), [ForbiddenProperty1BoxedBoolean](#forbiddenproperty1boxedboolean), @@ -49,103 +49,109 @@ permits
[ForbiddenProperty1BoxedList](#forbiddenproperty1boxedlist), [ForbiddenProperty1BoxedMap](#forbiddenproperty1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ForbiddenProperty1BoxedVoid -public static final class ForbiddenProperty1BoxedVoid
-extends [ForbiddenProperty1Boxed](#forbiddenproperty1boxed) +public record ForbiddenProperty1BoxedVoid
+implements [ForbiddenProperty1Boxed](#forbiddenproperty1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ForbiddenProperty1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ForbiddenProperty1BoxedBoolean -public static final class ForbiddenProperty1BoxedBoolean
-extends [ForbiddenProperty1Boxed](#forbiddenproperty1boxed) +public record ForbiddenProperty1BoxedBoolean
+implements [ForbiddenProperty1Boxed](#forbiddenproperty1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ForbiddenProperty1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ForbiddenProperty1BoxedNumber -public static final class ForbiddenProperty1BoxedNumber
-extends [ForbiddenProperty1Boxed](#forbiddenproperty1boxed) +public record ForbiddenProperty1BoxedNumber
+implements [ForbiddenProperty1Boxed](#forbiddenproperty1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ForbiddenProperty1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ForbiddenProperty1BoxedString -public static final class ForbiddenProperty1BoxedString
-extends [ForbiddenProperty1Boxed](#forbiddenproperty1boxed) +public record ForbiddenProperty1BoxedString
+implements [ForbiddenProperty1Boxed](#forbiddenproperty1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ForbiddenProperty1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ForbiddenProperty1BoxedList -public static final class ForbiddenProperty1BoxedList
-extends [ForbiddenProperty1Boxed](#forbiddenproperty1boxed) +public record ForbiddenProperty1BoxedList
+implements [ForbiddenProperty1Boxed](#forbiddenproperty1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ForbiddenProperty1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ForbiddenProperty1BoxedMap -public static final class ForbiddenProperty1BoxedMap
-extends [ForbiddenProperty1Boxed](#forbiddenproperty1boxed) +public record ForbiddenProperty1BoxedMap
+implements [ForbiddenProperty1Boxed](#forbiddenproperty1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ForbiddenProperty1BoxedMap([ForbiddenPropertyMap](#forbiddenpropertymap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [ForbiddenPropertyMap](#forbiddenpropertymap) | data
validated payload | +| [ForbiddenPropertyMap](#forbiddenpropertymap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ForbiddenProperty1 public static class ForbiddenProperty1
@@ -177,7 +183,9 @@ A schema class that validates payloads | [ForbiddenProperty1BoxedBoolean](#forbiddenproperty1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [ForbiddenProperty1BoxedMap](#forbiddenproperty1boxedmap) | validateAndBox([Map<?, ?>](#forbiddenpropertymapbuilder) arg, SchemaConfiguration configuration) | | [ForbiddenProperty1BoxedList](#forbiddenproperty1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [ForbiddenProperty1Boxed](#forbiddenproperty1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ForbiddenPropertyMapBuilder public class ForbiddenPropertyMapBuilder
builder for `Map` @@ -226,7 +234,7 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## FooBoxed -public static abstract sealed class FooBoxed
+public sealed interface FooBoxed
permits
[FooBoxedVoid](#fooboxedvoid), [FooBoxedBoolean](#fooboxedboolean), @@ -235,103 +243,109 @@ permits
[FooBoxedList](#fooboxedlist), [FooBoxedMap](#fooboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## FooBoxedVoid -public static final class FooBoxedVoid
-extends [FooBoxed](#fooboxed) +public record FooBoxedVoid
+implements [FooBoxed](#fooboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FooBoxedBoolean -public static final class FooBoxedBoolean
-extends [FooBoxed](#fooboxed) +public record FooBoxedBoolean
+implements [FooBoxed](#fooboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FooBoxedNumber -public static final class FooBoxedNumber
-extends [FooBoxed](#fooboxed) +public record FooBoxedNumber
+implements [FooBoxed](#fooboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FooBoxedString -public static final class FooBoxedString
-extends [FooBoxed](#fooboxed) +public record FooBoxedString
+implements [FooBoxed](#fooboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FooBoxedList -public static final class FooBoxedList
-extends [FooBoxed](#fooboxed) +public record FooBoxedList
+implements [FooBoxed](#fooboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FooBoxedMap -public static final class FooBoxedMap
-extends [FooBoxed](#fooboxed) +public record FooBoxedMap
+implements [FooBoxed](#fooboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Foo public static class Foo
@@ -363,9 +377,11 @@ A schema class that validates payloads | [FooBoxedBoolean](#fooboxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [FooBoxedMap](#fooboxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [FooBoxedList](#fooboxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [FooBoxed](#fooboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## NotBoxed -public static abstract sealed class NotBoxed
+public sealed interface NotBoxed
permits
[NotBoxedVoid](#notboxedvoid), [NotBoxedBoolean](#notboxedboolean), @@ -374,103 +390,109 @@ permits
[NotBoxedList](#notboxedlist), [NotBoxedMap](#notboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## NotBoxedVoid -public static final class NotBoxedVoid
-extends [NotBoxed](#notboxed) +public record NotBoxedVoid
+implements [NotBoxed](#notboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NotBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NotBoxedBoolean -public static final class NotBoxedBoolean
-extends [NotBoxed](#notboxed) +public record NotBoxedBoolean
+implements [NotBoxed](#notboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NotBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NotBoxedNumber -public static final class NotBoxedNumber
-extends [NotBoxed](#notboxed) +public record NotBoxedNumber
+implements [NotBoxed](#notboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NotBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NotBoxedString -public static final class NotBoxedString
-extends [NotBoxed](#notboxed) +public record NotBoxedString
+implements [NotBoxed](#notboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NotBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NotBoxedList -public static final class NotBoxedList
-extends [NotBoxed](#notboxed) +public record NotBoxedList
+implements [NotBoxed](#notboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NotBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NotBoxedMap -public static final class NotBoxedMap
-extends [NotBoxed](#notboxed) +public record NotBoxedMap
+implements [NotBoxed](#notboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NotBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Not public static class Not
diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/HostnameFormat.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/HostnameFormat.md index 8630d7ab683..085ff0c08a1 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/HostnameFormat.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/HostnameFormat.md @@ -4,23 +4,23 @@ public class HostnameFormat
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [HostnameFormat.HostnameFormat1Boxed](#hostnameformat1boxed)
abstract sealed validated payload class | -| static class | [HostnameFormat.HostnameFormat1BoxedVoid](#hostnameformat1boxedvoid)
boxed class to store validated null payloads | -| static class | [HostnameFormat.HostnameFormat1BoxedBoolean](#hostnameformat1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [HostnameFormat.HostnameFormat1BoxedNumber](#hostnameformat1boxednumber)
boxed class to store validated Number payloads | -| static class | [HostnameFormat.HostnameFormat1BoxedString](#hostnameformat1boxedstring)
boxed class to store validated String payloads | -| static class | [HostnameFormat.HostnameFormat1BoxedList](#hostnameformat1boxedlist)
boxed class to store validated List payloads | -| static class | [HostnameFormat.HostnameFormat1BoxedMap](#hostnameformat1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [HostnameFormat.HostnameFormat1Boxed](#hostnameformat1boxed)
sealed interface for validated payloads | +| record | [HostnameFormat.HostnameFormat1BoxedVoid](#hostnameformat1boxedvoid)
boxed class to store validated null payloads | +| record | [HostnameFormat.HostnameFormat1BoxedBoolean](#hostnameformat1boxedboolean)
boxed class to store validated boolean payloads | +| record | [HostnameFormat.HostnameFormat1BoxedNumber](#hostnameformat1boxednumber)
boxed class to store validated Number payloads | +| record | [HostnameFormat.HostnameFormat1BoxedString](#hostnameformat1boxedstring)
boxed class to store validated String payloads | +| record | [HostnameFormat.HostnameFormat1BoxedList](#hostnameformat1boxedlist)
boxed class to store validated List payloads | +| record | [HostnameFormat.HostnameFormat1BoxedMap](#hostnameformat1boxedmap)
boxed class to store validated Map payloads | | static class | [HostnameFormat.HostnameFormat1](#hostnameformat1)
schema class | ## HostnameFormat1Boxed -public static abstract sealed class HostnameFormat1Boxed
+public sealed interface HostnameFormat1Boxed
permits
[HostnameFormat1BoxedVoid](#hostnameformat1boxedvoid), [HostnameFormat1BoxedBoolean](#hostnameformat1boxedboolean), @@ -29,103 +29,109 @@ permits
[HostnameFormat1BoxedList](#hostnameformat1boxedlist), [HostnameFormat1BoxedMap](#hostnameformat1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## HostnameFormat1BoxedVoid -public static final class HostnameFormat1BoxedVoid
-extends [HostnameFormat1Boxed](#hostnameformat1boxed) +public record HostnameFormat1BoxedVoid
+implements [HostnameFormat1Boxed](#hostnameformat1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | HostnameFormat1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## HostnameFormat1BoxedBoolean -public static final class HostnameFormat1BoxedBoolean
-extends [HostnameFormat1Boxed](#hostnameformat1boxed) +public record HostnameFormat1BoxedBoolean
+implements [HostnameFormat1Boxed](#hostnameformat1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | HostnameFormat1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## HostnameFormat1BoxedNumber -public static final class HostnameFormat1BoxedNumber
-extends [HostnameFormat1Boxed](#hostnameformat1boxed) +public record HostnameFormat1BoxedNumber
+implements [HostnameFormat1Boxed](#hostnameformat1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | HostnameFormat1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## HostnameFormat1BoxedString -public static final class HostnameFormat1BoxedString
-extends [HostnameFormat1Boxed](#hostnameformat1boxed) +public record HostnameFormat1BoxedString
+implements [HostnameFormat1Boxed](#hostnameformat1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | HostnameFormat1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## HostnameFormat1BoxedList -public static final class HostnameFormat1BoxedList
-extends [HostnameFormat1Boxed](#hostnameformat1boxed) +public record HostnameFormat1BoxedList
+implements [HostnameFormat1Boxed](#hostnameformat1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | HostnameFormat1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## HostnameFormat1BoxedMap -public static final class HostnameFormat1BoxedMap
-extends [HostnameFormat1Boxed](#hostnameformat1boxed) +public record HostnameFormat1BoxedMap
+implements [HostnameFormat1Boxed](#hostnameformat1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | HostnameFormat1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## HostnameFormat1 public static class HostnameFormat1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [HostnameFormat1BoxedBoolean](#hostnameformat1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [HostnameFormat1BoxedMap](#hostnameformat1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [HostnameFormat1BoxedList](#hostnameformat1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [HostnameFormat1Boxed](#hostnameformat1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/IdnEmailFormat.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/IdnEmailFormat.md index 1c48df9456b..0b756db3627 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/IdnEmailFormat.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/IdnEmailFormat.md @@ -4,23 +4,23 @@ public class IdnEmailFormat
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [IdnEmailFormat.IdnEmailFormat1Boxed](#idnemailformat1boxed)
abstract sealed validated payload class | -| static class | [IdnEmailFormat.IdnEmailFormat1BoxedVoid](#idnemailformat1boxedvoid)
boxed class to store validated null payloads | -| static class | [IdnEmailFormat.IdnEmailFormat1BoxedBoolean](#idnemailformat1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [IdnEmailFormat.IdnEmailFormat1BoxedNumber](#idnemailformat1boxednumber)
boxed class to store validated Number payloads | -| static class | [IdnEmailFormat.IdnEmailFormat1BoxedString](#idnemailformat1boxedstring)
boxed class to store validated String payloads | -| static class | [IdnEmailFormat.IdnEmailFormat1BoxedList](#idnemailformat1boxedlist)
boxed class to store validated List payloads | -| static class | [IdnEmailFormat.IdnEmailFormat1BoxedMap](#idnemailformat1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [IdnEmailFormat.IdnEmailFormat1Boxed](#idnemailformat1boxed)
sealed interface for validated payloads | +| record | [IdnEmailFormat.IdnEmailFormat1BoxedVoid](#idnemailformat1boxedvoid)
boxed class to store validated null payloads | +| record | [IdnEmailFormat.IdnEmailFormat1BoxedBoolean](#idnemailformat1boxedboolean)
boxed class to store validated boolean payloads | +| record | [IdnEmailFormat.IdnEmailFormat1BoxedNumber](#idnemailformat1boxednumber)
boxed class to store validated Number payloads | +| record | [IdnEmailFormat.IdnEmailFormat1BoxedString](#idnemailformat1boxedstring)
boxed class to store validated String payloads | +| record | [IdnEmailFormat.IdnEmailFormat1BoxedList](#idnemailformat1boxedlist)
boxed class to store validated List payloads | +| record | [IdnEmailFormat.IdnEmailFormat1BoxedMap](#idnemailformat1boxedmap)
boxed class to store validated Map payloads | | static class | [IdnEmailFormat.IdnEmailFormat1](#idnemailformat1)
schema class | ## IdnEmailFormat1Boxed -public static abstract sealed class IdnEmailFormat1Boxed
+public sealed interface IdnEmailFormat1Boxed
permits
[IdnEmailFormat1BoxedVoid](#idnemailformat1boxedvoid), [IdnEmailFormat1BoxedBoolean](#idnemailformat1boxedboolean), @@ -29,103 +29,109 @@ permits
[IdnEmailFormat1BoxedList](#idnemailformat1boxedlist), [IdnEmailFormat1BoxedMap](#idnemailformat1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## IdnEmailFormat1BoxedVoid -public static final class IdnEmailFormat1BoxedVoid
-extends [IdnEmailFormat1Boxed](#idnemailformat1boxed) +public record IdnEmailFormat1BoxedVoid
+implements [IdnEmailFormat1Boxed](#idnemailformat1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IdnEmailFormat1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IdnEmailFormat1BoxedBoolean -public static final class IdnEmailFormat1BoxedBoolean
-extends [IdnEmailFormat1Boxed](#idnemailformat1boxed) +public record IdnEmailFormat1BoxedBoolean
+implements [IdnEmailFormat1Boxed](#idnemailformat1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IdnEmailFormat1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IdnEmailFormat1BoxedNumber -public static final class IdnEmailFormat1BoxedNumber
-extends [IdnEmailFormat1Boxed](#idnemailformat1boxed) +public record IdnEmailFormat1BoxedNumber
+implements [IdnEmailFormat1Boxed](#idnemailformat1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IdnEmailFormat1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IdnEmailFormat1BoxedString -public static final class IdnEmailFormat1BoxedString
-extends [IdnEmailFormat1Boxed](#idnemailformat1boxed) +public record IdnEmailFormat1BoxedString
+implements [IdnEmailFormat1Boxed](#idnemailformat1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IdnEmailFormat1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IdnEmailFormat1BoxedList -public static final class IdnEmailFormat1BoxedList
-extends [IdnEmailFormat1Boxed](#idnemailformat1boxed) +public record IdnEmailFormat1BoxedList
+implements [IdnEmailFormat1Boxed](#idnemailformat1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IdnEmailFormat1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IdnEmailFormat1BoxedMap -public static final class IdnEmailFormat1BoxedMap
-extends [IdnEmailFormat1Boxed](#idnemailformat1boxed) +public record IdnEmailFormat1BoxedMap
+implements [IdnEmailFormat1Boxed](#idnemailformat1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IdnEmailFormat1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IdnEmailFormat1 public static class IdnEmailFormat1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [IdnEmailFormat1BoxedBoolean](#idnemailformat1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [IdnEmailFormat1BoxedMap](#idnemailformat1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [IdnEmailFormat1BoxedList](#idnemailformat1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [IdnEmailFormat1Boxed](#idnemailformat1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/IdnHostnameFormat.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/IdnHostnameFormat.md index fb37369c260..046d158dc78 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/IdnHostnameFormat.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/IdnHostnameFormat.md @@ -4,23 +4,23 @@ public class IdnHostnameFormat
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [IdnHostnameFormat.IdnHostnameFormat1Boxed](#idnhostnameformat1boxed)
abstract sealed validated payload class | -| static class | [IdnHostnameFormat.IdnHostnameFormat1BoxedVoid](#idnhostnameformat1boxedvoid)
boxed class to store validated null payloads | -| static class | [IdnHostnameFormat.IdnHostnameFormat1BoxedBoolean](#idnhostnameformat1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [IdnHostnameFormat.IdnHostnameFormat1BoxedNumber](#idnhostnameformat1boxednumber)
boxed class to store validated Number payloads | -| static class | [IdnHostnameFormat.IdnHostnameFormat1BoxedString](#idnhostnameformat1boxedstring)
boxed class to store validated String payloads | -| static class | [IdnHostnameFormat.IdnHostnameFormat1BoxedList](#idnhostnameformat1boxedlist)
boxed class to store validated List payloads | -| static class | [IdnHostnameFormat.IdnHostnameFormat1BoxedMap](#idnhostnameformat1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [IdnHostnameFormat.IdnHostnameFormat1Boxed](#idnhostnameformat1boxed)
sealed interface for validated payloads | +| record | [IdnHostnameFormat.IdnHostnameFormat1BoxedVoid](#idnhostnameformat1boxedvoid)
boxed class to store validated null payloads | +| record | [IdnHostnameFormat.IdnHostnameFormat1BoxedBoolean](#idnhostnameformat1boxedboolean)
boxed class to store validated boolean payloads | +| record | [IdnHostnameFormat.IdnHostnameFormat1BoxedNumber](#idnhostnameformat1boxednumber)
boxed class to store validated Number payloads | +| record | [IdnHostnameFormat.IdnHostnameFormat1BoxedString](#idnhostnameformat1boxedstring)
boxed class to store validated String payloads | +| record | [IdnHostnameFormat.IdnHostnameFormat1BoxedList](#idnhostnameformat1boxedlist)
boxed class to store validated List payloads | +| record | [IdnHostnameFormat.IdnHostnameFormat1BoxedMap](#idnhostnameformat1boxedmap)
boxed class to store validated Map payloads | | static class | [IdnHostnameFormat.IdnHostnameFormat1](#idnhostnameformat1)
schema class | ## IdnHostnameFormat1Boxed -public static abstract sealed class IdnHostnameFormat1Boxed
+public sealed interface IdnHostnameFormat1Boxed
permits
[IdnHostnameFormat1BoxedVoid](#idnhostnameformat1boxedvoid), [IdnHostnameFormat1BoxedBoolean](#idnhostnameformat1boxedboolean), @@ -29,103 +29,109 @@ permits
[IdnHostnameFormat1BoxedList](#idnhostnameformat1boxedlist), [IdnHostnameFormat1BoxedMap](#idnhostnameformat1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## IdnHostnameFormat1BoxedVoid -public static final class IdnHostnameFormat1BoxedVoid
-extends [IdnHostnameFormat1Boxed](#idnhostnameformat1boxed) +public record IdnHostnameFormat1BoxedVoid
+implements [IdnHostnameFormat1Boxed](#idnhostnameformat1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IdnHostnameFormat1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IdnHostnameFormat1BoxedBoolean -public static final class IdnHostnameFormat1BoxedBoolean
-extends [IdnHostnameFormat1Boxed](#idnhostnameformat1boxed) +public record IdnHostnameFormat1BoxedBoolean
+implements [IdnHostnameFormat1Boxed](#idnhostnameformat1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IdnHostnameFormat1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IdnHostnameFormat1BoxedNumber -public static final class IdnHostnameFormat1BoxedNumber
-extends [IdnHostnameFormat1Boxed](#idnhostnameformat1boxed) +public record IdnHostnameFormat1BoxedNumber
+implements [IdnHostnameFormat1Boxed](#idnhostnameformat1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IdnHostnameFormat1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IdnHostnameFormat1BoxedString -public static final class IdnHostnameFormat1BoxedString
-extends [IdnHostnameFormat1Boxed](#idnhostnameformat1boxed) +public record IdnHostnameFormat1BoxedString
+implements [IdnHostnameFormat1Boxed](#idnhostnameformat1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IdnHostnameFormat1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IdnHostnameFormat1BoxedList -public static final class IdnHostnameFormat1BoxedList
-extends [IdnHostnameFormat1Boxed](#idnhostnameformat1boxed) +public record IdnHostnameFormat1BoxedList
+implements [IdnHostnameFormat1Boxed](#idnhostnameformat1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IdnHostnameFormat1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IdnHostnameFormat1BoxedMap -public static final class IdnHostnameFormat1BoxedMap
-extends [IdnHostnameFormat1Boxed](#idnhostnameformat1boxed) +public record IdnHostnameFormat1BoxedMap
+implements [IdnHostnameFormat1Boxed](#idnhostnameformat1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IdnHostnameFormat1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IdnHostnameFormat1 public static class IdnHostnameFormat1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [IdnHostnameFormat1BoxedBoolean](#idnhostnameformat1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [IdnHostnameFormat1BoxedMap](#idnhostnameformat1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [IdnHostnameFormat1BoxedList](#idnhostnameformat1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [IdnHostnameFormat1Boxed](#idnhostnameformat1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/IfAndElseWithoutThen.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/IfAndElseWithoutThen.md index 3d2a6cb8972..66ec8e109bf 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/IfAndElseWithoutThen.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/IfAndElseWithoutThen.md @@ -4,39 +4,39 @@ public class IfAndElseWithoutThen
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [IfAndElseWithoutThen.IfAndElseWithoutThen1Boxed](#ifandelsewithoutthen1boxed)
abstract sealed validated payload class | -| static class | [IfAndElseWithoutThen.IfAndElseWithoutThen1BoxedVoid](#ifandelsewithoutthen1boxedvoid)
boxed class to store validated null payloads | -| static class | [IfAndElseWithoutThen.IfAndElseWithoutThen1BoxedBoolean](#ifandelsewithoutthen1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [IfAndElseWithoutThen.IfAndElseWithoutThen1BoxedNumber](#ifandelsewithoutthen1boxednumber)
boxed class to store validated Number payloads | -| static class | [IfAndElseWithoutThen.IfAndElseWithoutThen1BoxedString](#ifandelsewithoutthen1boxedstring)
boxed class to store validated String payloads | -| static class | [IfAndElseWithoutThen.IfAndElseWithoutThen1BoxedList](#ifandelsewithoutthen1boxedlist)
boxed class to store validated List payloads | -| static class | [IfAndElseWithoutThen.IfAndElseWithoutThen1BoxedMap](#ifandelsewithoutthen1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [IfAndElseWithoutThen.IfAndElseWithoutThen1Boxed](#ifandelsewithoutthen1boxed)
sealed interface for validated payloads | +| record | [IfAndElseWithoutThen.IfAndElseWithoutThen1BoxedVoid](#ifandelsewithoutthen1boxedvoid)
boxed class to store validated null payloads | +| record | [IfAndElseWithoutThen.IfAndElseWithoutThen1BoxedBoolean](#ifandelsewithoutthen1boxedboolean)
boxed class to store validated boolean payloads | +| record | [IfAndElseWithoutThen.IfAndElseWithoutThen1BoxedNumber](#ifandelsewithoutthen1boxednumber)
boxed class to store validated Number payloads | +| record | [IfAndElseWithoutThen.IfAndElseWithoutThen1BoxedString](#ifandelsewithoutthen1boxedstring)
boxed class to store validated String payloads | +| record | [IfAndElseWithoutThen.IfAndElseWithoutThen1BoxedList](#ifandelsewithoutthen1boxedlist)
boxed class to store validated List payloads | +| record | [IfAndElseWithoutThen.IfAndElseWithoutThen1BoxedMap](#ifandelsewithoutthen1boxedmap)
boxed class to store validated Map payloads | | static class | [IfAndElseWithoutThen.IfAndElseWithoutThen1](#ifandelsewithoutthen1)
schema class | -| static class | [IfAndElseWithoutThen.IfSchemaBoxed](#ifschemaboxed)
abstract sealed validated payload class | -| static class | [IfAndElseWithoutThen.IfSchemaBoxedVoid](#ifschemaboxedvoid)
boxed class to store validated null payloads | -| static class | [IfAndElseWithoutThen.IfSchemaBoxedBoolean](#ifschemaboxedboolean)
boxed class to store validated boolean payloads | -| static class | [IfAndElseWithoutThen.IfSchemaBoxedNumber](#ifschemaboxednumber)
boxed class to store validated Number payloads | -| static class | [IfAndElseWithoutThen.IfSchemaBoxedString](#ifschemaboxedstring)
boxed class to store validated String payloads | -| static class | [IfAndElseWithoutThen.IfSchemaBoxedList](#ifschemaboxedlist)
boxed class to store validated List payloads | -| static class | [IfAndElseWithoutThen.IfSchemaBoxedMap](#ifschemaboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [IfAndElseWithoutThen.IfSchemaBoxed](#ifschemaboxed)
sealed interface for validated payloads | +| record | [IfAndElseWithoutThen.IfSchemaBoxedVoid](#ifschemaboxedvoid)
boxed class to store validated null payloads | +| record | [IfAndElseWithoutThen.IfSchemaBoxedBoolean](#ifschemaboxedboolean)
boxed class to store validated boolean payloads | +| record | [IfAndElseWithoutThen.IfSchemaBoxedNumber](#ifschemaboxednumber)
boxed class to store validated Number payloads | +| record | [IfAndElseWithoutThen.IfSchemaBoxedString](#ifschemaboxedstring)
boxed class to store validated String payloads | +| record | [IfAndElseWithoutThen.IfSchemaBoxedList](#ifschemaboxedlist)
boxed class to store validated List payloads | +| record | [IfAndElseWithoutThen.IfSchemaBoxedMap](#ifschemaboxedmap)
boxed class to store validated Map payloads | | static class | [IfAndElseWithoutThen.IfSchema](#ifschema)
schema class | -| static class | [IfAndElseWithoutThen.ElseSchemaBoxed](#elseschemaboxed)
abstract sealed validated payload class | -| static class | [IfAndElseWithoutThen.ElseSchemaBoxedVoid](#elseschemaboxedvoid)
boxed class to store validated null payloads | -| static class | [IfAndElseWithoutThen.ElseSchemaBoxedBoolean](#elseschemaboxedboolean)
boxed class to store validated boolean payloads | -| static class | [IfAndElseWithoutThen.ElseSchemaBoxedNumber](#elseschemaboxednumber)
boxed class to store validated Number payloads | -| static class | [IfAndElseWithoutThen.ElseSchemaBoxedString](#elseschemaboxedstring)
boxed class to store validated String payloads | -| static class | [IfAndElseWithoutThen.ElseSchemaBoxedList](#elseschemaboxedlist)
boxed class to store validated List payloads | -| static class | [IfAndElseWithoutThen.ElseSchemaBoxedMap](#elseschemaboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [IfAndElseWithoutThen.ElseSchemaBoxed](#elseschemaboxed)
sealed interface for validated payloads | +| record | [IfAndElseWithoutThen.ElseSchemaBoxedVoid](#elseschemaboxedvoid)
boxed class to store validated null payloads | +| record | [IfAndElseWithoutThen.ElseSchemaBoxedBoolean](#elseschemaboxedboolean)
boxed class to store validated boolean payloads | +| record | [IfAndElseWithoutThen.ElseSchemaBoxedNumber](#elseschemaboxednumber)
boxed class to store validated Number payloads | +| record | [IfAndElseWithoutThen.ElseSchemaBoxedString](#elseschemaboxedstring)
boxed class to store validated String payloads | +| record | [IfAndElseWithoutThen.ElseSchemaBoxedList](#elseschemaboxedlist)
boxed class to store validated List payloads | +| record | [IfAndElseWithoutThen.ElseSchemaBoxedMap](#elseschemaboxedmap)
boxed class to store validated Map payloads | | static class | [IfAndElseWithoutThen.ElseSchema](#elseschema)
schema class | ## IfAndElseWithoutThen1Boxed -public static abstract sealed class IfAndElseWithoutThen1Boxed
+public sealed interface IfAndElseWithoutThen1Boxed
permits
[IfAndElseWithoutThen1BoxedVoid](#ifandelsewithoutthen1boxedvoid), [IfAndElseWithoutThen1BoxedBoolean](#ifandelsewithoutthen1boxedboolean), @@ -45,103 +45,109 @@ permits
[IfAndElseWithoutThen1BoxedList](#ifandelsewithoutthen1boxedlist), [IfAndElseWithoutThen1BoxedMap](#ifandelsewithoutthen1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## IfAndElseWithoutThen1BoxedVoid -public static final class IfAndElseWithoutThen1BoxedVoid
-extends [IfAndElseWithoutThen1Boxed](#ifandelsewithoutthen1boxed) +public record IfAndElseWithoutThen1BoxedVoid
+implements [IfAndElseWithoutThen1Boxed](#ifandelsewithoutthen1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IfAndElseWithoutThen1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IfAndElseWithoutThen1BoxedBoolean -public static final class IfAndElseWithoutThen1BoxedBoolean
-extends [IfAndElseWithoutThen1Boxed](#ifandelsewithoutthen1boxed) +public record IfAndElseWithoutThen1BoxedBoolean
+implements [IfAndElseWithoutThen1Boxed](#ifandelsewithoutthen1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IfAndElseWithoutThen1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IfAndElseWithoutThen1BoxedNumber -public static final class IfAndElseWithoutThen1BoxedNumber
-extends [IfAndElseWithoutThen1Boxed](#ifandelsewithoutthen1boxed) +public record IfAndElseWithoutThen1BoxedNumber
+implements [IfAndElseWithoutThen1Boxed](#ifandelsewithoutthen1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IfAndElseWithoutThen1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IfAndElseWithoutThen1BoxedString -public static final class IfAndElseWithoutThen1BoxedString
-extends [IfAndElseWithoutThen1Boxed](#ifandelsewithoutthen1boxed) +public record IfAndElseWithoutThen1BoxedString
+implements [IfAndElseWithoutThen1Boxed](#ifandelsewithoutthen1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IfAndElseWithoutThen1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IfAndElseWithoutThen1BoxedList -public static final class IfAndElseWithoutThen1BoxedList
-extends [IfAndElseWithoutThen1Boxed](#ifandelsewithoutthen1boxed) +public record IfAndElseWithoutThen1BoxedList
+implements [IfAndElseWithoutThen1Boxed](#ifandelsewithoutthen1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IfAndElseWithoutThen1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IfAndElseWithoutThen1BoxedMap -public static final class IfAndElseWithoutThen1BoxedMap
-extends [IfAndElseWithoutThen1Boxed](#ifandelsewithoutthen1boxed) +public record IfAndElseWithoutThen1BoxedMap
+implements [IfAndElseWithoutThen1Boxed](#ifandelsewithoutthen1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IfAndElseWithoutThen1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IfAndElseWithoutThen1 public static class IfAndElseWithoutThen1
@@ -174,9 +180,11 @@ A schema class that validates payloads | [IfAndElseWithoutThen1BoxedBoolean](#ifandelsewithoutthen1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [IfAndElseWithoutThen1BoxedMap](#ifandelsewithoutthen1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [IfAndElseWithoutThen1BoxedList](#ifandelsewithoutthen1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [IfAndElseWithoutThen1Boxed](#ifandelsewithoutthen1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## IfSchemaBoxed -public static abstract sealed class IfSchemaBoxed
+public sealed interface IfSchemaBoxed
permits
[IfSchemaBoxedVoid](#ifschemaboxedvoid), [IfSchemaBoxedBoolean](#ifschemaboxedboolean), @@ -185,103 +193,109 @@ permits
[IfSchemaBoxedList](#ifschemaboxedlist), [IfSchemaBoxedMap](#ifschemaboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## IfSchemaBoxedVoid -public static final class IfSchemaBoxedVoid
-extends [IfSchemaBoxed](#ifschemaboxed) +public record IfSchemaBoxedVoid
+implements [IfSchemaBoxed](#ifschemaboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IfSchemaBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IfSchemaBoxedBoolean -public static final class IfSchemaBoxedBoolean
-extends [IfSchemaBoxed](#ifschemaboxed) +public record IfSchemaBoxedBoolean
+implements [IfSchemaBoxed](#ifschemaboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IfSchemaBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IfSchemaBoxedNumber -public static final class IfSchemaBoxedNumber
-extends [IfSchemaBoxed](#ifschemaboxed) +public record IfSchemaBoxedNumber
+implements [IfSchemaBoxed](#ifschemaboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IfSchemaBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IfSchemaBoxedString -public static final class IfSchemaBoxedString
-extends [IfSchemaBoxed](#ifschemaboxed) +public record IfSchemaBoxedString
+implements [IfSchemaBoxed](#ifschemaboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IfSchemaBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IfSchemaBoxedList -public static final class IfSchemaBoxedList
-extends [IfSchemaBoxed](#ifschemaboxed) +public record IfSchemaBoxedList
+implements [IfSchemaBoxed](#ifschemaboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IfSchemaBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IfSchemaBoxedMap -public static final class IfSchemaBoxedMap
-extends [IfSchemaBoxed](#ifschemaboxed) +public record IfSchemaBoxedMap
+implements [IfSchemaBoxed](#ifschemaboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IfSchemaBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IfSchema public static class IfSchema
@@ -313,9 +327,11 @@ A schema class that validates payloads | [IfSchemaBoxedBoolean](#ifschemaboxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [IfSchemaBoxedMap](#ifschemaboxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [IfSchemaBoxedList](#ifschemaboxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [IfSchemaBoxed](#ifschemaboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ElseSchemaBoxed -public static abstract sealed class ElseSchemaBoxed
+public sealed interface ElseSchemaBoxed
permits
[ElseSchemaBoxedVoid](#elseschemaboxedvoid), [ElseSchemaBoxedBoolean](#elseschemaboxedboolean), @@ -324,103 +340,109 @@ permits
[ElseSchemaBoxedList](#elseschemaboxedlist), [ElseSchemaBoxedMap](#elseschemaboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ElseSchemaBoxedVoid -public static final class ElseSchemaBoxedVoid
-extends [ElseSchemaBoxed](#elseschemaboxed) +public record ElseSchemaBoxedVoid
+implements [ElseSchemaBoxed](#elseschemaboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ElseSchemaBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ElseSchemaBoxedBoolean -public static final class ElseSchemaBoxedBoolean
-extends [ElseSchemaBoxed](#elseschemaboxed) +public record ElseSchemaBoxedBoolean
+implements [ElseSchemaBoxed](#elseschemaboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ElseSchemaBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ElseSchemaBoxedNumber -public static final class ElseSchemaBoxedNumber
-extends [ElseSchemaBoxed](#elseschemaboxed) +public record ElseSchemaBoxedNumber
+implements [ElseSchemaBoxed](#elseschemaboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ElseSchemaBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ElseSchemaBoxedString -public static final class ElseSchemaBoxedString
-extends [ElseSchemaBoxed](#elseschemaboxed) +public record ElseSchemaBoxedString
+implements [ElseSchemaBoxed](#elseschemaboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ElseSchemaBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ElseSchemaBoxedList -public static final class ElseSchemaBoxedList
-extends [ElseSchemaBoxed](#elseschemaboxed) +public record ElseSchemaBoxedList
+implements [ElseSchemaBoxed](#elseschemaboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ElseSchemaBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ElseSchemaBoxedMap -public static final class ElseSchemaBoxedMap
-extends [ElseSchemaBoxed](#elseschemaboxed) +public record ElseSchemaBoxedMap
+implements [ElseSchemaBoxed](#elseschemaboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ElseSchemaBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ElseSchema public static class ElseSchema
@@ -452,5 +474,7 @@ A schema class that validates payloads | [ElseSchemaBoxedBoolean](#elseschemaboxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [ElseSchemaBoxedMap](#elseschemaboxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [ElseSchemaBoxedList](#elseschemaboxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [ElseSchemaBoxed](#elseschemaboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/IfAndThenWithoutElse.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/IfAndThenWithoutElse.md index 8479d4b1691..7f611633c05 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/IfAndThenWithoutElse.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/IfAndThenWithoutElse.md @@ -4,39 +4,39 @@ public class IfAndThenWithoutElse
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [IfAndThenWithoutElse.IfAndThenWithoutElse1Boxed](#ifandthenwithoutelse1boxed)
abstract sealed validated payload class | -| static class | [IfAndThenWithoutElse.IfAndThenWithoutElse1BoxedVoid](#ifandthenwithoutelse1boxedvoid)
boxed class to store validated null payloads | -| static class | [IfAndThenWithoutElse.IfAndThenWithoutElse1BoxedBoolean](#ifandthenwithoutelse1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [IfAndThenWithoutElse.IfAndThenWithoutElse1BoxedNumber](#ifandthenwithoutelse1boxednumber)
boxed class to store validated Number payloads | -| static class | [IfAndThenWithoutElse.IfAndThenWithoutElse1BoxedString](#ifandthenwithoutelse1boxedstring)
boxed class to store validated String payloads | -| static class | [IfAndThenWithoutElse.IfAndThenWithoutElse1BoxedList](#ifandthenwithoutelse1boxedlist)
boxed class to store validated List payloads | -| static class | [IfAndThenWithoutElse.IfAndThenWithoutElse1BoxedMap](#ifandthenwithoutelse1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [IfAndThenWithoutElse.IfAndThenWithoutElse1Boxed](#ifandthenwithoutelse1boxed)
sealed interface for validated payloads | +| record | [IfAndThenWithoutElse.IfAndThenWithoutElse1BoxedVoid](#ifandthenwithoutelse1boxedvoid)
boxed class to store validated null payloads | +| record | [IfAndThenWithoutElse.IfAndThenWithoutElse1BoxedBoolean](#ifandthenwithoutelse1boxedboolean)
boxed class to store validated boolean payloads | +| record | [IfAndThenWithoutElse.IfAndThenWithoutElse1BoxedNumber](#ifandthenwithoutelse1boxednumber)
boxed class to store validated Number payloads | +| record | [IfAndThenWithoutElse.IfAndThenWithoutElse1BoxedString](#ifandthenwithoutelse1boxedstring)
boxed class to store validated String payloads | +| record | [IfAndThenWithoutElse.IfAndThenWithoutElse1BoxedList](#ifandthenwithoutelse1boxedlist)
boxed class to store validated List payloads | +| record | [IfAndThenWithoutElse.IfAndThenWithoutElse1BoxedMap](#ifandthenwithoutelse1boxedmap)
boxed class to store validated Map payloads | | static class | [IfAndThenWithoutElse.IfAndThenWithoutElse1](#ifandthenwithoutelse1)
schema class | -| static class | [IfAndThenWithoutElse.ThenBoxed](#thenboxed)
abstract sealed validated payload class | -| static class | [IfAndThenWithoutElse.ThenBoxedVoid](#thenboxedvoid)
boxed class to store validated null payloads | -| static class | [IfAndThenWithoutElse.ThenBoxedBoolean](#thenboxedboolean)
boxed class to store validated boolean payloads | -| static class | [IfAndThenWithoutElse.ThenBoxedNumber](#thenboxednumber)
boxed class to store validated Number payloads | -| static class | [IfAndThenWithoutElse.ThenBoxedString](#thenboxedstring)
boxed class to store validated String payloads | -| static class | [IfAndThenWithoutElse.ThenBoxedList](#thenboxedlist)
boxed class to store validated List payloads | -| static class | [IfAndThenWithoutElse.ThenBoxedMap](#thenboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [IfAndThenWithoutElse.ThenBoxed](#thenboxed)
sealed interface for validated payloads | +| record | [IfAndThenWithoutElse.ThenBoxedVoid](#thenboxedvoid)
boxed class to store validated null payloads | +| record | [IfAndThenWithoutElse.ThenBoxedBoolean](#thenboxedboolean)
boxed class to store validated boolean payloads | +| record | [IfAndThenWithoutElse.ThenBoxedNumber](#thenboxednumber)
boxed class to store validated Number payloads | +| record | [IfAndThenWithoutElse.ThenBoxedString](#thenboxedstring)
boxed class to store validated String payloads | +| record | [IfAndThenWithoutElse.ThenBoxedList](#thenboxedlist)
boxed class to store validated List payloads | +| record | [IfAndThenWithoutElse.ThenBoxedMap](#thenboxedmap)
boxed class to store validated Map payloads | | static class | [IfAndThenWithoutElse.Then](#then)
schema class | -| static class | [IfAndThenWithoutElse.IfSchemaBoxed](#ifschemaboxed)
abstract sealed validated payload class | -| static class | [IfAndThenWithoutElse.IfSchemaBoxedVoid](#ifschemaboxedvoid)
boxed class to store validated null payloads | -| static class | [IfAndThenWithoutElse.IfSchemaBoxedBoolean](#ifschemaboxedboolean)
boxed class to store validated boolean payloads | -| static class | [IfAndThenWithoutElse.IfSchemaBoxedNumber](#ifschemaboxednumber)
boxed class to store validated Number payloads | -| static class | [IfAndThenWithoutElse.IfSchemaBoxedString](#ifschemaboxedstring)
boxed class to store validated String payloads | -| static class | [IfAndThenWithoutElse.IfSchemaBoxedList](#ifschemaboxedlist)
boxed class to store validated List payloads | -| static class | [IfAndThenWithoutElse.IfSchemaBoxedMap](#ifschemaboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [IfAndThenWithoutElse.IfSchemaBoxed](#ifschemaboxed)
sealed interface for validated payloads | +| record | [IfAndThenWithoutElse.IfSchemaBoxedVoid](#ifschemaboxedvoid)
boxed class to store validated null payloads | +| record | [IfAndThenWithoutElse.IfSchemaBoxedBoolean](#ifschemaboxedboolean)
boxed class to store validated boolean payloads | +| record | [IfAndThenWithoutElse.IfSchemaBoxedNumber](#ifschemaboxednumber)
boxed class to store validated Number payloads | +| record | [IfAndThenWithoutElse.IfSchemaBoxedString](#ifschemaboxedstring)
boxed class to store validated String payloads | +| record | [IfAndThenWithoutElse.IfSchemaBoxedList](#ifschemaboxedlist)
boxed class to store validated List payloads | +| record | [IfAndThenWithoutElse.IfSchemaBoxedMap](#ifschemaboxedmap)
boxed class to store validated Map payloads | | static class | [IfAndThenWithoutElse.IfSchema](#ifschema)
schema class | ## IfAndThenWithoutElse1Boxed -public static abstract sealed class IfAndThenWithoutElse1Boxed
+public sealed interface IfAndThenWithoutElse1Boxed
permits
[IfAndThenWithoutElse1BoxedVoid](#ifandthenwithoutelse1boxedvoid), [IfAndThenWithoutElse1BoxedBoolean](#ifandthenwithoutelse1boxedboolean), @@ -45,103 +45,109 @@ permits
[IfAndThenWithoutElse1BoxedList](#ifandthenwithoutelse1boxedlist), [IfAndThenWithoutElse1BoxedMap](#ifandthenwithoutelse1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## IfAndThenWithoutElse1BoxedVoid -public static final class IfAndThenWithoutElse1BoxedVoid
-extends [IfAndThenWithoutElse1Boxed](#ifandthenwithoutelse1boxed) +public record IfAndThenWithoutElse1BoxedVoid
+implements [IfAndThenWithoutElse1Boxed](#ifandthenwithoutelse1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IfAndThenWithoutElse1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IfAndThenWithoutElse1BoxedBoolean -public static final class IfAndThenWithoutElse1BoxedBoolean
-extends [IfAndThenWithoutElse1Boxed](#ifandthenwithoutelse1boxed) +public record IfAndThenWithoutElse1BoxedBoolean
+implements [IfAndThenWithoutElse1Boxed](#ifandthenwithoutelse1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IfAndThenWithoutElse1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IfAndThenWithoutElse1BoxedNumber -public static final class IfAndThenWithoutElse1BoxedNumber
-extends [IfAndThenWithoutElse1Boxed](#ifandthenwithoutelse1boxed) +public record IfAndThenWithoutElse1BoxedNumber
+implements [IfAndThenWithoutElse1Boxed](#ifandthenwithoutelse1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IfAndThenWithoutElse1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IfAndThenWithoutElse1BoxedString -public static final class IfAndThenWithoutElse1BoxedString
-extends [IfAndThenWithoutElse1Boxed](#ifandthenwithoutelse1boxed) +public record IfAndThenWithoutElse1BoxedString
+implements [IfAndThenWithoutElse1Boxed](#ifandthenwithoutelse1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IfAndThenWithoutElse1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IfAndThenWithoutElse1BoxedList -public static final class IfAndThenWithoutElse1BoxedList
-extends [IfAndThenWithoutElse1Boxed](#ifandthenwithoutelse1boxed) +public record IfAndThenWithoutElse1BoxedList
+implements [IfAndThenWithoutElse1Boxed](#ifandthenwithoutelse1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IfAndThenWithoutElse1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IfAndThenWithoutElse1BoxedMap -public static final class IfAndThenWithoutElse1BoxedMap
-extends [IfAndThenWithoutElse1Boxed](#ifandthenwithoutelse1boxed) +public record IfAndThenWithoutElse1BoxedMap
+implements [IfAndThenWithoutElse1Boxed](#ifandthenwithoutelse1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IfAndThenWithoutElse1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IfAndThenWithoutElse1 public static class IfAndThenWithoutElse1
@@ -174,9 +180,11 @@ A schema class that validates payloads | [IfAndThenWithoutElse1BoxedBoolean](#ifandthenwithoutelse1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [IfAndThenWithoutElse1BoxedMap](#ifandthenwithoutelse1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [IfAndThenWithoutElse1BoxedList](#ifandthenwithoutelse1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [IfAndThenWithoutElse1Boxed](#ifandthenwithoutelse1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ThenBoxed -public static abstract sealed class ThenBoxed
+public sealed interface ThenBoxed
permits
[ThenBoxedVoid](#thenboxedvoid), [ThenBoxedBoolean](#thenboxedboolean), @@ -185,103 +193,109 @@ permits
[ThenBoxedList](#thenboxedlist), [ThenBoxedMap](#thenboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ThenBoxedVoid -public static final class ThenBoxedVoid
-extends [ThenBoxed](#thenboxed) +public record ThenBoxedVoid
+implements [ThenBoxed](#thenboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ThenBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ThenBoxedBoolean -public static final class ThenBoxedBoolean
-extends [ThenBoxed](#thenboxed) +public record ThenBoxedBoolean
+implements [ThenBoxed](#thenboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ThenBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ThenBoxedNumber -public static final class ThenBoxedNumber
-extends [ThenBoxed](#thenboxed) +public record ThenBoxedNumber
+implements [ThenBoxed](#thenboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ThenBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ThenBoxedString -public static final class ThenBoxedString
-extends [ThenBoxed](#thenboxed) +public record ThenBoxedString
+implements [ThenBoxed](#thenboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ThenBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ThenBoxedList -public static final class ThenBoxedList
-extends [ThenBoxed](#thenboxed) +public record ThenBoxedList
+implements [ThenBoxed](#thenboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ThenBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ThenBoxedMap -public static final class ThenBoxedMap
-extends [ThenBoxed](#thenboxed) +public record ThenBoxedMap
+implements [ThenBoxed](#thenboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ThenBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Then public static class Then
@@ -313,9 +327,11 @@ A schema class that validates payloads | [ThenBoxedBoolean](#thenboxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [ThenBoxedMap](#thenboxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [ThenBoxedList](#thenboxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [ThenBoxed](#thenboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## IfSchemaBoxed -public static abstract sealed class IfSchemaBoxed
+public sealed interface IfSchemaBoxed
permits
[IfSchemaBoxedVoid](#ifschemaboxedvoid), [IfSchemaBoxedBoolean](#ifschemaboxedboolean), @@ -324,103 +340,109 @@ permits
[IfSchemaBoxedList](#ifschemaboxedlist), [IfSchemaBoxedMap](#ifschemaboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## IfSchemaBoxedVoid -public static final class IfSchemaBoxedVoid
-extends [IfSchemaBoxed](#ifschemaboxed) +public record IfSchemaBoxedVoid
+implements [IfSchemaBoxed](#ifschemaboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IfSchemaBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IfSchemaBoxedBoolean -public static final class IfSchemaBoxedBoolean
-extends [IfSchemaBoxed](#ifschemaboxed) +public record IfSchemaBoxedBoolean
+implements [IfSchemaBoxed](#ifschemaboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IfSchemaBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IfSchemaBoxedNumber -public static final class IfSchemaBoxedNumber
-extends [IfSchemaBoxed](#ifschemaboxed) +public record IfSchemaBoxedNumber
+implements [IfSchemaBoxed](#ifschemaboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IfSchemaBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IfSchemaBoxedString -public static final class IfSchemaBoxedString
-extends [IfSchemaBoxed](#ifschemaboxed) +public record IfSchemaBoxedString
+implements [IfSchemaBoxed](#ifschemaboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IfSchemaBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IfSchemaBoxedList -public static final class IfSchemaBoxedList
-extends [IfSchemaBoxed](#ifschemaboxed) +public record IfSchemaBoxedList
+implements [IfSchemaBoxed](#ifschemaboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IfSchemaBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IfSchemaBoxedMap -public static final class IfSchemaBoxedMap
-extends [IfSchemaBoxed](#ifschemaboxed) +public record IfSchemaBoxedMap
+implements [IfSchemaBoxed](#ifschemaboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IfSchemaBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IfSchema public static class IfSchema
@@ -452,5 +474,7 @@ A schema class that validates payloads | [IfSchemaBoxedBoolean](#ifschemaboxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [IfSchemaBoxedMap](#ifschemaboxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [IfSchemaBoxedList](#ifschemaboxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [IfSchemaBoxed](#ifschemaboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence.md index 02a5c4d5431..35f6c235a13 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence.md @@ -4,50 +4,50 @@ public class IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - enum classes ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence.IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1Boxed](#ifappearsattheendwhenserializedkeywordprocessingsequence1boxed)
abstract sealed validated payload class | -| static class | [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence.IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedVoid](#ifappearsattheendwhenserializedkeywordprocessingsequence1boxedvoid)
boxed class to store validated null payloads | -| static class | [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence.IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedBoolean](#ifappearsattheendwhenserializedkeywordprocessingsequence1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence.IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedNumber](#ifappearsattheendwhenserializedkeywordprocessingsequence1boxednumber)
boxed class to store validated Number payloads | -| static class | [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence.IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedString](#ifappearsattheendwhenserializedkeywordprocessingsequence1boxedstring)
boxed class to store validated String payloads | -| static class | [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence.IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedList](#ifappearsattheendwhenserializedkeywordprocessingsequence1boxedlist)
boxed class to store validated List payloads | -| static class | [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence.IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedMap](#ifappearsattheendwhenserializedkeywordprocessingsequence1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence.IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1Boxed](#ifappearsattheendwhenserializedkeywordprocessingsequence1boxed)
sealed interface for validated payloads | +| record | [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence.IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedVoid](#ifappearsattheendwhenserializedkeywordprocessingsequence1boxedvoid)
boxed class to store validated null payloads | +| record | [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence.IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedBoolean](#ifappearsattheendwhenserializedkeywordprocessingsequence1boxedboolean)
boxed class to store validated boolean payloads | +| record | [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence.IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedNumber](#ifappearsattheendwhenserializedkeywordprocessingsequence1boxednumber)
boxed class to store validated Number payloads | +| record | [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence.IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedString](#ifappearsattheendwhenserializedkeywordprocessingsequence1boxedstring)
boxed class to store validated String payloads | +| record | [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence.IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedList](#ifappearsattheendwhenserializedkeywordprocessingsequence1boxedlist)
boxed class to store validated List payloads | +| record | [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence.IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedMap](#ifappearsattheendwhenserializedkeywordprocessingsequence1boxedmap)
boxed class to store validated Map payloads | | static class | [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence.IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1](#ifappearsattheendwhenserializedkeywordprocessingsequence1)
schema class | -| static class | [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence.ThenBoxed](#thenboxed)
abstract sealed validated payload class | -| static class | [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence.ThenBoxedVoid](#thenboxedvoid)
boxed class to store validated null payloads | -| static class | [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence.ThenBoxedBoolean](#thenboxedboolean)
boxed class to store validated boolean payloads | -| static class | [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence.ThenBoxedNumber](#thenboxednumber)
boxed class to store validated Number payloads | -| static class | [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence.ThenBoxedString](#thenboxedstring)
boxed class to store validated String payloads | -| static class | [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence.ThenBoxedList](#thenboxedlist)
boxed class to store validated List payloads | -| static class | [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence.ThenBoxedMap](#thenboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence.ThenBoxed](#thenboxed)
sealed interface for validated payloads | +| record | [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence.ThenBoxedVoid](#thenboxedvoid)
boxed class to store validated null payloads | +| record | [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence.ThenBoxedBoolean](#thenboxedboolean)
boxed class to store validated boolean payloads | +| record | [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence.ThenBoxedNumber](#thenboxednumber)
boxed class to store validated Number payloads | +| record | [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence.ThenBoxedString](#thenboxedstring)
boxed class to store validated String payloads | +| record | [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence.ThenBoxedList](#thenboxedlist)
boxed class to store validated List payloads | +| record | [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence.ThenBoxedMap](#thenboxedmap)
boxed class to store validated Map payloads | | static class | [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence.Then](#then)
schema class | | enum | [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence.StringThenConst](#stringthenconst)
String enum | -| static class | [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence.IfSchemaBoxed](#ifschemaboxed)
abstract sealed validated payload class | -| static class | [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence.IfSchemaBoxedVoid](#ifschemaboxedvoid)
boxed class to store validated null payloads | -| static class | [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence.IfSchemaBoxedBoolean](#ifschemaboxedboolean)
boxed class to store validated boolean payloads | -| static class | [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence.IfSchemaBoxedNumber](#ifschemaboxednumber)
boxed class to store validated Number payloads | -| static class | [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence.IfSchemaBoxedString](#ifschemaboxedstring)
boxed class to store validated String payloads | -| static class | [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence.IfSchemaBoxedList](#ifschemaboxedlist)
boxed class to store validated List payloads | -| static class | [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence.IfSchemaBoxedMap](#ifschemaboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence.IfSchemaBoxed](#ifschemaboxed)
sealed interface for validated payloads | +| record | [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence.IfSchemaBoxedVoid](#ifschemaboxedvoid)
boxed class to store validated null payloads | +| record | [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence.IfSchemaBoxedBoolean](#ifschemaboxedboolean)
boxed class to store validated boolean payloads | +| record | [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence.IfSchemaBoxedNumber](#ifschemaboxednumber)
boxed class to store validated Number payloads | +| record | [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence.IfSchemaBoxedString](#ifschemaboxedstring)
boxed class to store validated String payloads | +| record | [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence.IfSchemaBoxedList](#ifschemaboxedlist)
boxed class to store validated List payloads | +| record | [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence.IfSchemaBoxedMap](#ifschemaboxedmap)
boxed class to store validated Map payloads | | static class | [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence.IfSchema](#ifschema)
schema class | -| static class | [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence.ElseSchemaBoxed](#elseschemaboxed)
abstract sealed validated payload class | -| static class | [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence.ElseSchemaBoxedVoid](#elseschemaboxedvoid)
boxed class to store validated null payloads | -| static class | [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence.ElseSchemaBoxedBoolean](#elseschemaboxedboolean)
boxed class to store validated boolean payloads | -| static class | [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence.ElseSchemaBoxedNumber](#elseschemaboxednumber)
boxed class to store validated Number payloads | -| static class | [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence.ElseSchemaBoxedString](#elseschemaboxedstring)
boxed class to store validated String payloads | -| static class | [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence.ElseSchemaBoxedList](#elseschemaboxedlist)
boxed class to store validated List payloads | -| static class | [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence.ElseSchemaBoxedMap](#elseschemaboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence.ElseSchemaBoxed](#elseschemaboxed)
sealed interface for validated payloads | +| record | [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence.ElseSchemaBoxedVoid](#elseschemaboxedvoid)
boxed class to store validated null payloads | +| record | [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence.ElseSchemaBoxedBoolean](#elseschemaboxedboolean)
boxed class to store validated boolean payloads | +| record | [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence.ElseSchemaBoxedNumber](#elseschemaboxednumber)
boxed class to store validated Number payloads | +| record | [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence.ElseSchemaBoxedString](#elseschemaboxedstring)
boxed class to store validated String payloads | +| record | [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence.ElseSchemaBoxedList](#elseschemaboxedlist)
boxed class to store validated List payloads | +| record | [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence.ElseSchemaBoxedMap](#elseschemaboxedmap)
boxed class to store validated Map payloads | | static class | [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence.ElseSchema](#elseschema)
schema class | | enum | [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence.StringElseConst](#stringelseconst)
String enum | ## IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1Boxed -public static abstract sealed class IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1Boxed
+public sealed interface IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1Boxed
permits
[IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedVoid](#ifappearsattheendwhenserializedkeywordprocessingsequence1boxedvoid), [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedBoolean](#ifappearsattheendwhenserializedkeywordprocessingsequence1boxedboolean), @@ -56,103 +56,109 @@ permits
[IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedList](#ifappearsattheendwhenserializedkeywordprocessingsequence1boxedlist), [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedMap](#ifappearsattheendwhenserializedkeywordprocessingsequence1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedVoid -public static final class IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedVoid
-extends [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1Boxed](#ifappearsattheendwhenserializedkeywordprocessingsequence1boxed) +public record IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedVoid
+implements [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1Boxed](#ifappearsattheendwhenserializedkeywordprocessingsequence1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedBoolean -public static final class IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedBoolean
-extends [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1Boxed](#ifappearsattheendwhenserializedkeywordprocessingsequence1boxed) +public record IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedBoolean
+implements [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1Boxed](#ifappearsattheendwhenserializedkeywordprocessingsequence1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedNumber -public static final class IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedNumber
-extends [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1Boxed](#ifappearsattheendwhenserializedkeywordprocessingsequence1boxed) +public record IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedNumber
+implements [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1Boxed](#ifappearsattheendwhenserializedkeywordprocessingsequence1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedString -public static final class IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedString
-extends [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1Boxed](#ifappearsattheendwhenserializedkeywordprocessingsequence1boxed) +public record IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedString
+implements [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1Boxed](#ifappearsattheendwhenserializedkeywordprocessingsequence1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedList -public static final class IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedList
-extends [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1Boxed](#ifappearsattheendwhenserializedkeywordprocessingsequence1boxed) +public record IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedList
+implements [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1Boxed](#ifappearsattheendwhenserializedkeywordprocessingsequence1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedMap -public static final class IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedMap
-extends [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1Boxed](#ifappearsattheendwhenserializedkeywordprocessingsequence1boxed) +public record IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedMap
+implements [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1Boxed](#ifappearsattheendwhenserializedkeywordprocessingsequence1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1 public static class IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1
@@ -186,9 +192,11 @@ A schema class that validates payloads | [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedBoolean](#ifappearsattheendwhenserializedkeywordprocessingsequence1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedMap](#ifappearsattheendwhenserializedkeywordprocessingsequence1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedList](#ifappearsattheendwhenserializedkeywordprocessingsequence1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1Boxed](#ifappearsattheendwhenserializedkeywordprocessingsequence1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ThenBoxed -public static abstract sealed class ThenBoxed
+public sealed interface ThenBoxed
permits
[ThenBoxedVoid](#thenboxedvoid), [ThenBoxedBoolean](#thenboxedboolean), @@ -197,103 +205,109 @@ permits
[ThenBoxedList](#thenboxedlist), [ThenBoxedMap](#thenboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ThenBoxedVoid -public static final class ThenBoxedVoid
-extends [ThenBoxed](#thenboxed) +public record ThenBoxedVoid
+implements [ThenBoxed](#thenboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ThenBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ThenBoxedBoolean -public static final class ThenBoxedBoolean
-extends [ThenBoxed](#thenboxed) +public record ThenBoxedBoolean
+implements [ThenBoxed](#thenboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ThenBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ThenBoxedNumber -public static final class ThenBoxedNumber
-extends [ThenBoxed](#thenboxed) +public record ThenBoxedNumber
+implements [ThenBoxed](#thenboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ThenBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ThenBoxedString -public static final class ThenBoxedString
-extends [ThenBoxed](#thenboxed) +public record ThenBoxedString
+implements [ThenBoxed](#thenboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ThenBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ThenBoxedList -public static final class ThenBoxedList
-extends [ThenBoxed](#thenboxed) +public record ThenBoxedList
+implements [ThenBoxed](#thenboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ThenBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ThenBoxedMap -public static final class ThenBoxedMap
-extends [ThenBoxed](#thenboxed) +public record ThenBoxedMap
+implements [ThenBoxed](#thenboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ThenBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Then public static class Then
@@ -325,7 +339,9 @@ A schema class that validates payloads | [ThenBoxedBoolean](#thenboxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [ThenBoxedMap](#thenboxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [ThenBoxedList](#thenboxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [ThenBoxed](#thenboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## StringThenConst public enum StringThenConst
extends `Enum` @@ -338,7 +354,7 @@ A class that stores String enum values | YES | value = "yes" | ## IfSchemaBoxed -public static abstract sealed class IfSchemaBoxed
+public sealed interface IfSchemaBoxed
permits
[IfSchemaBoxedVoid](#ifschemaboxedvoid), [IfSchemaBoxedBoolean](#ifschemaboxedboolean), @@ -347,103 +363,109 @@ permits
[IfSchemaBoxedList](#ifschemaboxedlist), [IfSchemaBoxedMap](#ifschemaboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## IfSchemaBoxedVoid -public static final class IfSchemaBoxedVoid
-extends [IfSchemaBoxed](#ifschemaboxed) +public record IfSchemaBoxedVoid
+implements [IfSchemaBoxed](#ifschemaboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IfSchemaBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IfSchemaBoxedBoolean -public static final class IfSchemaBoxedBoolean
-extends [IfSchemaBoxed](#ifschemaboxed) +public record IfSchemaBoxedBoolean
+implements [IfSchemaBoxed](#ifschemaboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IfSchemaBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IfSchemaBoxedNumber -public static final class IfSchemaBoxedNumber
-extends [IfSchemaBoxed](#ifschemaboxed) +public record IfSchemaBoxedNumber
+implements [IfSchemaBoxed](#ifschemaboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IfSchemaBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IfSchemaBoxedString -public static final class IfSchemaBoxedString
-extends [IfSchemaBoxed](#ifschemaboxed) +public record IfSchemaBoxedString
+implements [IfSchemaBoxed](#ifschemaboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IfSchemaBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IfSchemaBoxedList -public static final class IfSchemaBoxedList
-extends [IfSchemaBoxed](#ifschemaboxed) +public record IfSchemaBoxedList
+implements [IfSchemaBoxed](#ifschemaboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IfSchemaBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IfSchemaBoxedMap -public static final class IfSchemaBoxedMap
-extends [IfSchemaBoxed](#ifschemaboxed) +public record IfSchemaBoxedMap
+implements [IfSchemaBoxed](#ifschemaboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IfSchemaBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IfSchema public static class IfSchema
@@ -475,9 +497,11 @@ A schema class that validates payloads | [IfSchemaBoxedBoolean](#ifschemaboxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [IfSchemaBoxedMap](#ifschemaboxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [IfSchemaBoxedList](#ifschemaboxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [IfSchemaBoxed](#ifschemaboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ElseSchemaBoxed -public static abstract sealed class ElseSchemaBoxed
+public sealed interface ElseSchemaBoxed
permits
[ElseSchemaBoxedVoid](#elseschemaboxedvoid), [ElseSchemaBoxedBoolean](#elseschemaboxedboolean), @@ -486,103 +510,109 @@ permits
[ElseSchemaBoxedList](#elseschemaboxedlist), [ElseSchemaBoxedMap](#elseschemaboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ElseSchemaBoxedVoid -public static final class ElseSchemaBoxedVoid
-extends [ElseSchemaBoxed](#elseschemaboxed) +public record ElseSchemaBoxedVoid
+implements [ElseSchemaBoxed](#elseschemaboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ElseSchemaBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ElseSchemaBoxedBoolean -public static final class ElseSchemaBoxedBoolean
-extends [ElseSchemaBoxed](#elseschemaboxed) +public record ElseSchemaBoxedBoolean
+implements [ElseSchemaBoxed](#elseschemaboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ElseSchemaBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ElseSchemaBoxedNumber -public static final class ElseSchemaBoxedNumber
-extends [ElseSchemaBoxed](#elseschemaboxed) +public record ElseSchemaBoxedNumber
+implements [ElseSchemaBoxed](#elseschemaboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ElseSchemaBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ElseSchemaBoxedString -public static final class ElseSchemaBoxedString
-extends [ElseSchemaBoxed](#elseschemaboxed) +public record ElseSchemaBoxedString
+implements [ElseSchemaBoxed](#elseschemaboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ElseSchemaBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ElseSchemaBoxedList -public static final class ElseSchemaBoxedList
-extends [ElseSchemaBoxed](#elseschemaboxed) +public record ElseSchemaBoxedList
+implements [ElseSchemaBoxed](#elseschemaboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ElseSchemaBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ElseSchemaBoxedMap -public static final class ElseSchemaBoxedMap
-extends [ElseSchemaBoxed](#elseschemaboxed) +public record ElseSchemaBoxedMap
+implements [ElseSchemaBoxed](#elseschemaboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ElseSchemaBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ElseSchema public static class ElseSchema
@@ -614,7 +644,9 @@ A schema class that validates payloads | [ElseSchemaBoxedBoolean](#elseschemaboxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [ElseSchemaBoxedMap](#elseschemaboxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [ElseSchemaBoxedList](#elseschemaboxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [ElseSchemaBoxed](#elseschemaboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## StringElseConst public enum StringElseConst
extends `Enum` diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/IgnoreElseWithoutIf.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/IgnoreElseWithoutIf.md index 52d6031e50c..dc5da4ce435 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/IgnoreElseWithoutIf.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/IgnoreElseWithoutIf.md @@ -4,33 +4,33 @@ public class IgnoreElseWithoutIf
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - enum classes ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [IgnoreElseWithoutIf.IgnoreElseWithoutIf1Boxed](#ignoreelsewithoutif1boxed)
abstract sealed validated payload class | -| static class | [IgnoreElseWithoutIf.IgnoreElseWithoutIf1BoxedVoid](#ignoreelsewithoutif1boxedvoid)
boxed class to store validated null payloads | -| static class | [IgnoreElseWithoutIf.IgnoreElseWithoutIf1BoxedBoolean](#ignoreelsewithoutif1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [IgnoreElseWithoutIf.IgnoreElseWithoutIf1BoxedNumber](#ignoreelsewithoutif1boxednumber)
boxed class to store validated Number payloads | -| static class | [IgnoreElseWithoutIf.IgnoreElseWithoutIf1BoxedString](#ignoreelsewithoutif1boxedstring)
boxed class to store validated String payloads | -| static class | [IgnoreElseWithoutIf.IgnoreElseWithoutIf1BoxedList](#ignoreelsewithoutif1boxedlist)
boxed class to store validated List payloads | -| static class | [IgnoreElseWithoutIf.IgnoreElseWithoutIf1BoxedMap](#ignoreelsewithoutif1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [IgnoreElseWithoutIf.IgnoreElseWithoutIf1Boxed](#ignoreelsewithoutif1boxed)
sealed interface for validated payloads | +| record | [IgnoreElseWithoutIf.IgnoreElseWithoutIf1BoxedVoid](#ignoreelsewithoutif1boxedvoid)
boxed class to store validated null payloads | +| record | [IgnoreElseWithoutIf.IgnoreElseWithoutIf1BoxedBoolean](#ignoreelsewithoutif1boxedboolean)
boxed class to store validated boolean payloads | +| record | [IgnoreElseWithoutIf.IgnoreElseWithoutIf1BoxedNumber](#ignoreelsewithoutif1boxednumber)
boxed class to store validated Number payloads | +| record | [IgnoreElseWithoutIf.IgnoreElseWithoutIf1BoxedString](#ignoreelsewithoutif1boxedstring)
boxed class to store validated String payloads | +| record | [IgnoreElseWithoutIf.IgnoreElseWithoutIf1BoxedList](#ignoreelsewithoutif1boxedlist)
boxed class to store validated List payloads | +| record | [IgnoreElseWithoutIf.IgnoreElseWithoutIf1BoxedMap](#ignoreelsewithoutif1boxedmap)
boxed class to store validated Map payloads | | static class | [IgnoreElseWithoutIf.IgnoreElseWithoutIf1](#ignoreelsewithoutif1)
schema class | -| static class | [IgnoreElseWithoutIf.ElseSchemaBoxed](#elseschemaboxed)
abstract sealed validated payload class | -| static class | [IgnoreElseWithoutIf.ElseSchemaBoxedVoid](#elseschemaboxedvoid)
boxed class to store validated null payloads | -| static class | [IgnoreElseWithoutIf.ElseSchemaBoxedBoolean](#elseschemaboxedboolean)
boxed class to store validated boolean payloads | -| static class | [IgnoreElseWithoutIf.ElseSchemaBoxedNumber](#elseschemaboxednumber)
boxed class to store validated Number payloads | -| static class | [IgnoreElseWithoutIf.ElseSchemaBoxedString](#elseschemaboxedstring)
boxed class to store validated String payloads | -| static class | [IgnoreElseWithoutIf.ElseSchemaBoxedList](#elseschemaboxedlist)
boxed class to store validated List payloads | -| static class | [IgnoreElseWithoutIf.ElseSchemaBoxedMap](#elseschemaboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [IgnoreElseWithoutIf.ElseSchemaBoxed](#elseschemaboxed)
sealed interface for validated payloads | +| record | [IgnoreElseWithoutIf.ElseSchemaBoxedVoid](#elseschemaboxedvoid)
boxed class to store validated null payloads | +| record | [IgnoreElseWithoutIf.ElseSchemaBoxedBoolean](#elseschemaboxedboolean)
boxed class to store validated boolean payloads | +| record | [IgnoreElseWithoutIf.ElseSchemaBoxedNumber](#elseschemaboxednumber)
boxed class to store validated Number payloads | +| record | [IgnoreElseWithoutIf.ElseSchemaBoxedString](#elseschemaboxedstring)
boxed class to store validated String payloads | +| record | [IgnoreElseWithoutIf.ElseSchemaBoxedList](#elseschemaboxedlist)
boxed class to store validated List payloads | +| record | [IgnoreElseWithoutIf.ElseSchemaBoxedMap](#elseschemaboxedmap)
boxed class to store validated Map payloads | | static class | [IgnoreElseWithoutIf.ElseSchema](#elseschema)
schema class | | enum | [IgnoreElseWithoutIf.StringElseConst](#stringelseconst)
String enum | ## IgnoreElseWithoutIf1Boxed -public static abstract sealed class IgnoreElseWithoutIf1Boxed
+public sealed interface IgnoreElseWithoutIf1Boxed
permits
[IgnoreElseWithoutIf1BoxedVoid](#ignoreelsewithoutif1boxedvoid), [IgnoreElseWithoutIf1BoxedBoolean](#ignoreelsewithoutif1boxedboolean), @@ -39,103 +39,109 @@ permits
[IgnoreElseWithoutIf1BoxedList](#ignoreelsewithoutif1boxedlist), [IgnoreElseWithoutIf1BoxedMap](#ignoreelsewithoutif1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## IgnoreElseWithoutIf1BoxedVoid -public static final class IgnoreElseWithoutIf1BoxedVoid
-extends [IgnoreElseWithoutIf1Boxed](#ignoreelsewithoutif1boxed) +public record IgnoreElseWithoutIf1BoxedVoid
+implements [IgnoreElseWithoutIf1Boxed](#ignoreelsewithoutif1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IgnoreElseWithoutIf1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IgnoreElseWithoutIf1BoxedBoolean -public static final class IgnoreElseWithoutIf1BoxedBoolean
-extends [IgnoreElseWithoutIf1Boxed](#ignoreelsewithoutif1boxed) +public record IgnoreElseWithoutIf1BoxedBoolean
+implements [IgnoreElseWithoutIf1Boxed](#ignoreelsewithoutif1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IgnoreElseWithoutIf1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IgnoreElseWithoutIf1BoxedNumber -public static final class IgnoreElseWithoutIf1BoxedNumber
-extends [IgnoreElseWithoutIf1Boxed](#ignoreelsewithoutif1boxed) +public record IgnoreElseWithoutIf1BoxedNumber
+implements [IgnoreElseWithoutIf1Boxed](#ignoreelsewithoutif1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IgnoreElseWithoutIf1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IgnoreElseWithoutIf1BoxedString -public static final class IgnoreElseWithoutIf1BoxedString
-extends [IgnoreElseWithoutIf1Boxed](#ignoreelsewithoutif1boxed) +public record IgnoreElseWithoutIf1BoxedString
+implements [IgnoreElseWithoutIf1Boxed](#ignoreelsewithoutif1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IgnoreElseWithoutIf1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IgnoreElseWithoutIf1BoxedList -public static final class IgnoreElseWithoutIf1BoxedList
-extends [IgnoreElseWithoutIf1Boxed](#ignoreelsewithoutif1boxed) +public record IgnoreElseWithoutIf1BoxedList
+implements [IgnoreElseWithoutIf1Boxed](#ignoreelsewithoutif1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IgnoreElseWithoutIf1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IgnoreElseWithoutIf1BoxedMap -public static final class IgnoreElseWithoutIf1BoxedMap
-extends [IgnoreElseWithoutIf1Boxed](#ignoreelsewithoutif1boxed) +public record IgnoreElseWithoutIf1BoxedMap
+implements [IgnoreElseWithoutIf1Boxed](#ignoreelsewithoutif1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IgnoreElseWithoutIf1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IgnoreElseWithoutIf1 public static class IgnoreElseWithoutIf1
@@ -167,9 +173,11 @@ A schema class that validates payloads | [IgnoreElseWithoutIf1BoxedBoolean](#ignoreelsewithoutif1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [IgnoreElseWithoutIf1BoxedMap](#ignoreelsewithoutif1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [IgnoreElseWithoutIf1BoxedList](#ignoreelsewithoutif1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [IgnoreElseWithoutIf1Boxed](#ignoreelsewithoutif1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ElseSchemaBoxed -public static abstract sealed class ElseSchemaBoxed
+public sealed interface ElseSchemaBoxed
permits
[ElseSchemaBoxedVoid](#elseschemaboxedvoid), [ElseSchemaBoxedBoolean](#elseschemaboxedboolean), @@ -178,103 +186,109 @@ permits
[ElseSchemaBoxedList](#elseschemaboxedlist), [ElseSchemaBoxedMap](#elseschemaboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ElseSchemaBoxedVoid -public static final class ElseSchemaBoxedVoid
-extends [ElseSchemaBoxed](#elseschemaboxed) +public record ElseSchemaBoxedVoid
+implements [ElseSchemaBoxed](#elseschemaboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ElseSchemaBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ElseSchemaBoxedBoolean -public static final class ElseSchemaBoxedBoolean
-extends [ElseSchemaBoxed](#elseschemaboxed) +public record ElseSchemaBoxedBoolean
+implements [ElseSchemaBoxed](#elseschemaboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ElseSchemaBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ElseSchemaBoxedNumber -public static final class ElseSchemaBoxedNumber
-extends [ElseSchemaBoxed](#elseschemaboxed) +public record ElseSchemaBoxedNumber
+implements [ElseSchemaBoxed](#elseschemaboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ElseSchemaBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ElseSchemaBoxedString -public static final class ElseSchemaBoxedString
-extends [ElseSchemaBoxed](#elseschemaboxed) +public record ElseSchemaBoxedString
+implements [ElseSchemaBoxed](#elseschemaboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ElseSchemaBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ElseSchemaBoxedList -public static final class ElseSchemaBoxedList
-extends [ElseSchemaBoxed](#elseschemaboxed) +public record ElseSchemaBoxedList
+implements [ElseSchemaBoxed](#elseschemaboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ElseSchemaBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ElseSchemaBoxedMap -public static final class ElseSchemaBoxedMap
-extends [ElseSchemaBoxed](#elseschemaboxed) +public record ElseSchemaBoxedMap
+implements [ElseSchemaBoxed](#elseschemaboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ElseSchemaBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ElseSchema public static class ElseSchema
@@ -306,7 +320,9 @@ A schema class that validates payloads | [ElseSchemaBoxedBoolean](#elseschemaboxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [ElseSchemaBoxedMap](#elseschemaboxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [ElseSchemaBoxedList](#elseschemaboxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [ElseSchemaBoxed](#elseschemaboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## StringElseConst public enum StringElseConst
extends `Enum` diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/IgnoreIfWithoutThenOrElse.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/IgnoreIfWithoutThenOrElse.md index 0b5a21bcf0d..8c9062f441c 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/IgnoreIfWithoutThenOrElse.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/IgnoreIfWithoutThenOrElse.md @@ -4,33 +4,33 @@ public class IgnoreIfWithoutThenOrElse
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - enum classes ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [IgnoreIfWithoutThenOrElse.IgnoreIfWithoutThenOrElse1Boxed](#ignoreifwithoutthenorelse1boxed)
abstract sealed validated payload class | -| static class | [IgnoreIfWithoutThenOrElse.IgnoreIfWithoutThenOrElse1BoxedVoid](#ignoreifwithoutthenorelse1boxedvoid)
boxed class to store validated null payloads | -| static class | [IgnoreIfWithoutThenOrElse.IgnoreIfWithoutThenOrElse1BoxedBoolean](#ignoreifwithoutthenorelse1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [IgnoreIfWithoutThenOrElse.IgnoreIfWithoutThenOrElse1BoxedNumber](#ignoreifwithoutthenorelse1boxednumber)
boxed class to store validated Number payloads | -| static class | [IgnoreIfWithoutThenOrElse.IgnoreIfWithoutThenOrElse1BoxedString](#ignoreifwithoutthenorelse1boxedstring)
boxed class to store validated String payloads | -| static class | [IgnoreIfWithoutThenOrElse.IgnoreIfWithoutThenOrElse1BoxedList](#ignoreifwithoutthenorelse1boxedlist)
boxed class to store validated List payloads | -| static class | [IgnoreIfWithoutThenOrElse.IgnoreIfWithoutThenOrElse1BoxedMap](#ignoreifwithoutthenorelse1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [IgnoreIfWithoutThenOrElse.IgnoreIfWithoutThenOrElse1Boxed](#ignoreifwithoutthenorelse1boxed)
sealed interface for validated payloads | +| record | [IgnoreIfWithoutThenOrElse.IgnoreIfWithoutThenOrElse1BoxedVoid](#ignoreifwithoutthenorelse1boxedvoid)
boxed class to store validated null payloads | +| record | [IgnoreIfWithoutThenOrElse.IgnoreIfWithoutThenOrElse1BoxedBoolean](#ignoreifwithoutthenorelse1boxedboolean)
boxed class to store validated boolean payloads | +| record | [IgnoreIfWithoutThenOrElse.IgnoreIfWithoutThenOrElse1BoxedNumber](#ignoreifwithoutthenorelse1boxednumber)
boxed class to store validated Number payloads | +| record | [IgnoreIfWithoutThenOrElse.IgnoreIfWithoutThenOrElse1BoxedString](#ignoreifwithoutthenorelse1boxedstring)
boxed class to store validated String payloads | +| record | [IgnoreIfWithoutThenOrElse.IgnoreIfWithoutThenOrElse1BoxedList](#ignoreifwithoutthenorelse1boxedlist)
boxed class to store validated List payloads | +| record | [IgnoreIfWithoutThenOrElse.IgnoreIfWithoutThenOrElse1BoxedMap](#ignoreifwithoutthenorelse1boxedmap)
boxed class to store validated Map payloads | | static class | [IgnoreIfWithoutThenOrElse.IgnoreIfWithoutThenOrElse1](#ignoreifwithoutthenorelse1)
schema class | -| static class | [IgnoreIfWithoutThenOrElse.IfSchemaBoxed](#ifschemaboxed)
abstract sealed validated payload class | -| static class | [IgnoreIfWithoutThenOrElse.IfSchemaBoxedVoid](#ifschemaboxedvoid)
boxed class to store validated null payloads | -| static class | [IgnoreIfWithoutThenOrElse.IfSchemaBoxedBoolean](#ifschemaboxedboolean)
boxed class to store validated boolean payloads | -| static class | [IgnoreIfWithoutThenOrElse.IfSchemaBoxedNumber](#ifschemaboxednumber)
boxed class to store validated Number payloads | -| static class | [IgnoreIfWithoutThenOrElse.IfSchemaBoxedString](#ifschemaboxedstring)
boxed class to store validated String payloads | -| static class | [IgnoreIfWithoutThenOrElse.IfSchemaBoxedList](#ifschemaboxedlist)
boxed class to store validated List payloads | -| static class | [IgnoreIfWithoutThenOrElse.IfSchemaBoxedMap](#ifschemaboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [IgnoreIfWithoutThenOrElse.IfSchemaBoxed](#ifschemaboxed)
sealed interface for validated payloads | +| record | [IgnoreIfWithoutThenOrElse.IfSchemaBoxedVoid](#ifschemaboxedvoid)
boxed class to store validated null payloads | +| record | [IgnoreIfWithoutThenOrElse.IfSchemaBoxedBoolean](#ifschemaboxedboolean)
boxed class to store validated boolean payloads | +| record | [IgnoreIfWithoutThenOrElse.IfSchemaBoxedNumber](#ifschemaboxednumber)
boxed class to store validated Number payloads | +| record | [IgnoreIfWithoutThenOrElse.IfSchemaBoxedString](#ifschemaboxedstring)
boxed class to store validated String payloads | +| record | [IgnoreIfWithoutThenOrElse.IfSchemaBoxedList](#ifschemaboxedlist)
boxed class to store validated List payloads | +| record | [IgnoreIfWithoutThenOrElse.IfSchemaBoxedMap](#ifschemaboxedmap)
boxed class to store validated Map payloads | | static class | [IgnoreIfWithoutThenOrElse.IfSchema](#ifschema)
schema class | | enum | [IgnoreIfWithoutThenOrElse.StringIfConst](#stringifconst)
String enum | ## IgnoreIfWithoutThenOrElse1Boxed -public static abstract sealed class IgnoreIfWithoutThenOrElse1Boxed
+public sealed interface IgnoreIfWithoutThenOrElse1Boxed
permits
[IgnoreIfWithoutThenOrElse1BoxedVoid](#ignoreifwithoutthenorelse1boxedvoid), [IgnoreIfWithoutThenOrElse1BoxedBoolean](#ignoreifwithoutthenorelse1boxedboolean), @@ -39,103 +39,109 @@ permits
[IgnoreIfWithoutThenOrElse1BoxedList](#ignoreifwithoutthenorelse1boxedlist), [IgnoreIfWithoutThenOrElse1BoxedMap](#ignoreifwithoutthenorelse1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## IgnoreIfWithoutThenOrElse1BoxedVoid -public static final class IgnoreIfWithoutThenOrElse1BoxedVoid
-extends [IgnoreIfWithoutThenOrElse1Boxed](#ignoreifwithoutthenorelse1boxed) +public record IgnoreIfWithoutThenOrElse1BoxedVoid
+implements [IgnoreIfWithoutThenOrElse1Boxed](#ignoreifwithoutthenorelse1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IgnoreIfWithoutThenOrElse1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IgnoreIfWithoutThenOrElse1BoxedBoolean -public static final class IgnoreIfWithoutThenOrElse1BoxedBoolean
-extends [IgnoreIfWithoutThenOrElse1Boxed](#ignoreifwithoutthenorelse1boxed) +public record IgnoreIfWithoutThenOrElse1BoxedBoolean
+implements [IgnoreIfWithoutThenOrElse1Boxed](#ignoreifwithoutthenorelse1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IgnoreIfWithoutThenOrElse1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IgnoreIfWithoutThenOrElse1BoxedNumber -public static final class IgnoreIfWithoutThenOrElse1BoxedNumber
-extends [IgnoreIfWithoutThenOrElse1Boxed](#ignoreifwithoutthenorelse1boxed) +public record IgnoreIfWithoutThenOrElse1BoxedNumber
+implements [IgnoreIfWithoutThenOrElse1Boxed](#ignoreifwithoutthenorelse1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IgnoreIfWithoutThenOrElse1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IgnoreIfWithoutThenOrElse1BoxedString -public static final class IgnoreIfWithoutThenOrElse1BoxedString
-extends [IgnoreIfWithoutThenOrElse1Boxed](#ignoreifwithoutthenorelse1boxed) +public record IgnoreIfWithoutThenOrElse1BoxedString
+implements [IgnoreIfWithoutThenOrElse1Boxed](#ignoreifwithoutthenorelse1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IgnoreIfWithoutThenOrElse1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IgnoreIfWithoutThenOrElse1BoxedList -public static final class IgnoreIfWithoutThenOrElse1BoxedList
-extends [IgnoreIfWithoutThenOrElse1Boxed](#ignoreifwithoutthenorelse1boxed) +public record IgnoreIfWithoutThenOrElse1BoxedList
+implements [IgnoreIfWithoutThenOrElse1Boxed](#ignoreifwithoutthenorelse1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IgnoreIfWithoutThenOrElse1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IgnoreIfWithoutThenOrElse1BoxedMap -public static final class IgnoreIfWithoutThenOrElse1BoxedMap
-extends [IgnoreIfWithoutThenOrElse1Boxed](#ignoreifwithoutthenorelse1boxed) +public record IgnoreIfWithoutThenOrElse1BoxedMap
+implements [IgnoreIfWithoutThenOrElse1Boxed](#ignoreifwithoutthenorelse1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IgnoreIfWithoutThenOrElse1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IgnoreIfWithoutThenOrElse1 public static class IgnoreIfWithoutThenOrElse1
@@ -167,9 +173,11 @@ A schema class that validates payloads | [IgnoreIfWithoutThenOrElse1BoxedBoolean](#ignoreifwithoutthenorelse1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [IgnoreIfWithoutThenOrElse1BoxedMap](#ignoreifwithoutthenorelse1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [IgnoreIfWithoutThenOrElse1BoxedList](#ignoreifwithoutthenorelse1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [IgnoreIfWithoutThenOrElse1Boxed](#ignoreifwithoutthenorelse1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## IfSchemaBoxed -public static abstract sealed class IfSchemaBoxed
+public sealed interface IfSchemaBoxed
permits
[IfSchemaBoxedVoid](#ifschemaboxedvoid), [IfSchemaBoxedBoolean](#ifschemaboxedboolean), @@ -178,103 +186,109 @@ permits
[IfSchemaBoxedList](#ifschemaboxedlist), [IfSchemaBoxedMap](#ifschemaboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## IfSchemaBoxedVoid -public static final class IfSchemaBoxedVoid
-extends [IfSchemaBoxed](#ifschemaboxed) +public record IfSchemaBoxedVoid
+implements [IfSchemaBoxed](#ifschemaboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IfSchemaBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IfSchemaBoxedBoolean -public static final class IfSchemaBoxedBoolean
-extends [IfSchemaBoxed](#ifschemaboxed) +public record IfSchemaBoxedBoolean
+implements [IfSchemaBoxed](#ifschemaboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IfSchemaBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IfSchemaBoxedNumber -public static final class IfSchemaBoxedNumber
-extends [IfSchemaBoxed](#ifschemaboxed) +public record IfSchemaBoxedNumber
+implements [IfSchemaBoxed](#ifschemaboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IfSchemaBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IfSchemaBoxedString -public static final class IfSchemaBoxedString
-extends [IfSchemaBoxed](#ifschemaboxed) +public record IfSchemaBoxedString
+implements [IfSchemaBoxed](#ifschemaboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IfSchemaBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IfSchemaBoxedList -public static final class IfSchemaBoxedList
-extends [IfSchemaBoxed](#ifschemaboxed) +public record IfSchemaBoxedList
+implements [IfSchemaBoxed](#ifschemaboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IfSchemaBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IfSchemaBoxedMap -public static final class IfSchemaBoxedMap
-extends [IfSchemaBoxed](#ifschemaboxed) +public record IfSchemaBoxedMap
+implements [IfSchemaBoxed](#ifschemaboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IfSchemaBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IfSchema public static class IfSchema
@@ -306,7 +320,9 @@ A schema class that validates payloads | [IfSchemaBoxedBoolean](#ifschemaboxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [IfSchemaBoxedMap](#ifschemaboxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [IfSchemaBoxedList](#ifschemaboxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [IfSchemaBoxed](#ifschemaboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## StringIfConst public enum StringIfConst
extends `Enum` diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/IgnoreThenWithoutIf.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/IgnoreThenWithoutIf.md index 8a816674b49..22c93058573 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/IgnoreThenWithoutIf.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/IgnoreThenWithoutIf.md @@ -4,33 +4,33 @@ public class IgnoreThenWithoutIf
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - enum classes ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [IgnoreThenWithoutIf.IgnoreThenWithoutIf1Boxed](#ignorethenwithoutif1boxed)
abstract sealed validated payload class | -| static class | [IgnoreThenWithoutIf.IgnoreThenWithoutIf1BoxedVoid](#ignorethenwithoutif1boxedvoid)
boxed class to store validated null payloads | -| static class | [IgnoreThenWithoutIf.IgnoreThenWithoutIf1BoxedBoolean](#ignorethenwithoutif1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [IgnoreThenWithoutIf.IgnoreThenWithoutIf1BoxedNumber](#ignorethenwithoutif1boxednumber)
boxed class to store validated Number payloads | -| static class | [IgnoreThenWithoutIf.IgnoreThenWithoutIf1BoxedString](#ignorethenwithoutif1boxedstring)
boxed class to store validated String payloads | -| static class | [IgnoreThenWithoutIf.IgnoreThenWithoutIf1BoxedList](#ignorethenwithoutif1boxedlist)
boxed class to store validated List payloads | -| static class | [IgnoreThenWithoutIf.IgnoreThenWithoutIf1BoxedMap](#ignorethenwithoutif1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [IgnoreThenWithoutIf.IgnoreThenWithoutIf1Boxed](#ignorethenwithoutif1boxed)
sealed interface for validated payloads | +| record | [IgnoreThenWithoutIf.IgnoreThenWithoutIf1BoxedVoid](#ignorethenwithoutif1boxedvoid)
boxed class to store validated null payloads | +| record | [IgnoreThenWithoutIf.IgnoreThenWithoutIf1BoxedBoolean](#ignorethenwithoutif1boxedboolean)
boxed class to store validated boolean payloads | +| record | [IgnoreThenWithoutIf.IgnoreThenWithoutIf1BoxedNumber](#ignorethenwithoutif1boxednumber)
boxed class to store validated Number payloads | +| record | [IgnoreThenWithoutIf.IgnoreThenWithoutIf1BoxedString](#ignorethenwithoutif1boxedstring)
boxed class to store validated String payloads | +| record | [IgnoreThenWithoutIf.IgnoreThenWithoutIf1BoxedList](#ignorethenwithoutif1boxedlist)
boxed class to store validated List payloads | +| record | [IgnoreThenWithoutIf.IgnoreThenWithoutIf1BoxedMap](#ignorethenwithoutif1boxedmap)
boxed class to store validated Map payloads | | static class | [IgnoreThenWithoutIf.IgnoreThenWithoutIf1](#ignorethenwithoutif1)
schema class | -| static class | [IgnoreThenWithoutIf.ThenBoxed](#thenboxed)
abstract sealed validated payload class | -| static class | [IgnoreThenWithoutIf.ThenBoxedVoid](#thenboxedvoid)
boxed class to store validated null payloads | -| static class | [IgnoreThenWithoutIf.ThenBoxedBoolean](#thenboxedboolean)
boxed class to store validated boolean payloads | -| static class | [IgnoreThenWithoutIf.ThenBoxedNumber](#thenboxednumber)
boxed class to store validated Number payloads | -| static class | [IgnoreThenWithoutIf.ThenBoxedString](#thenboxedstring)
boxed class to store validated String payloads | -| static class | [IgnoreThenWithoutIf.ThenBoxedList](#thenboxedlist)
boxed class to store validated List payloads | -| static class | [IgnoreThenWithoutIf.ThenBoxedMap](#thenboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [IgnoreThenWithoutIf.ThenBoxed](#thenboxed)
sealed interface for validated payloads | +| record | [IgnoreThenWithoutIf.ThenBoxedVoid](#thenboxedvoid)
boxed class to store validated null payloads | +| record | [IgnoreThenWithoutIf.ThenBoxedBoolean](#thenboxedboolean)
boxed class to store validated boolean payloads | +| record | [IgnoreThenWithoutIf.ThenBoxedNumber](#thenboxednumber)
boxed class to store validated Number payloads | +| record | [IgnoreThenWithoutIf.ThenBoxedString](#thenboxedstring)
boxed class to store validated String payloads | +| record | [IgnoreThenWithoutIf.ThenBoxedList](#thenboxedlist)
boxed class to store validated List payloads | +| record | [IgnoreThenWithoutIf.ThenBoxedMap](#thenboxedmap)
boxed class to store validated Map payloads | | static class | [IgnoreThenWithoutIf.Then](#then)
schema class | | enum | [IgnoreThenWithoutIf.StringThenConst](#stringthenconst)
String enum | ## IgnoreThenWithoutIf1Boxed -public static abstract sealed class IgnoreThenWithoutIf1Boxed
+public sealed interface IgnoreThenWithoutIf1Boxed
permits
[IgnoreThenWithoutIf1BoxedVoid](#ignorethenwithoutif1boxedvoid), [IgnoreThenWithoutIf1BoxedBoolean](#ignorethenwithoutif1boxedboolean), @@ -39,103 +39,109 @@ permits
[IgnoreThenWithoutIf1BoxedList](#ignorethenwithoutif1boxedlist), [IgnoreThenWithoutIf1BoxedMap](#ignorethenwithoutif1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## IgnoreThenWithoutIf1BoxedVoid -public static final class IgnoreThenWithoutIf1BoxedVoid
-extends [IgnoreThenWithoutIf1Boxed](#ignorethenwithoutif1boxed) +public record IgnoreThenWithoutIf1BoxedVoid
+implements [IgnoreThenWithoutIf1Boxed](#ignorethenwithoutif1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IgnoreThenWithoutIf1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IgnoreThenWithoutIf1BoxedBoolean -public static final class IgnoreThenWithoutIf1BoxedBoolean
-extends [IgnoreThenWithoutIf1Boxed](#ignorethenwithoutif1boxed) +public record IgnoreThenWithoutIf1BoxedBoolean
+implements [IgnoreThenWithoutIf1Boxed](#ignorethenwithoutif1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IgnoreThenWithoutIf1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IgnoreThenWithoutIf1BoxedNumber -public static final class IgnoreThenWithoutIf1BoxedNumber
-extends [IgnoreThenWithoutIf1Boxed](#ignorethenwithoutif1boxed) +public record IgnoreThenWithoutIf1BoxedNumber
+implements [IgnoreThenWithoutIf1Boxed](#ignorethenwithoutif1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IgnoreThenWithoutIf1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IgnoreThenWithoutIf1BoxedString -public static final class IgnoreThenWithoutIf1BoxedString
-extends [IgnoreThenWithoutIf1Boxed](#ignorethenwithoutif1boxed) +public record IgnoreThenWithoutIf1BoxedString
+implements [IgnoreThenWithoutIf1Boxed](#ignorethenwithoutif1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IgnoreThenWithoutIf1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IgnoreThenWithoutIf1BoxedList -public static final class IgnoreThenWithoutIf1BoxedList
-extends [IgnoreThenWithoutIf1Boxed](#ignorethenwithoutif1boxed) +public record IgnoreThenWithoutIf1BoxedList
+implements [IgnoreThenWithoutIf1Boxed](#ignorethenwithoutif1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IgnoreThenWithoutIf1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IgnoreThenWithoutIf1BoxedMap -public static final class IgnoreThenWithoutIf1BoxedMap
-extends [IgnoreThenWithoutIf1Boxed](#ignorethenwithoutif1boxed) +public record IgnoreThenWithoutIf1BoxedMap
+implements [IgnoreThenWithoutIf1Boxed](#ignorethenwithoutif1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IgnoreThenWithoutIf1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IgnoreThenWithoutIf1 public static class IgnoreThenWithoutIf1
@@ -167,9 +173,11 @@ A schema class that validates payloads | [IgnoreThenWithoutIf1BoxedBoolean](#ignorethenwithoutif1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [IgnoreThenWithoutIf1BoxedMap](#ignorethenwithoutif1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [IgnoreThenWithoutIf1BoxedList](#ignorethenwithoutif1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [IgnoreThenWithoutIf1Boxed](#ignorethenwithoutif1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ThenBoxed -public static abstract sealed class ThenBoxed
+public sealed interface ThenBoxed
permits
[ThenBoxedVoid](#thenboxedvoid), [ThenBoxedBoolean](#thenboxedboolean), @@ -178,103 +186,109 @@ permits
[ThenBoxedList](#thenboxedlist), [ThenBoxedMap](#thenboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ThenBoxedVoid -public static final class ThenBoxedVoid
-extends [ThenBoxed](#thenboxed) +public record ThenBoxedVoid
+implements [ThenBoxed](#thenboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ThenBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ThenBoxedBoolean -public static final class ThenBoxedBoolean
-extends [ThenBoxed](#thenboxed) +public record ThenBoxedBoolean
+implements [ThenBoxed](#thenboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ThenBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ThenBoxedNumber -public static final class ThenBoxedNumber
-extends [ThenBoxed](#thenboxed) +public record ThenBoxedNumber
+implements [ThenBoxed](#thenboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ThenBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ThenBoxedString -public static final class ThenBoxedString
-extends [ThenBoxed](#thenboxed) +public record ThenBoxedString
+implements [ThenBoxed](#thenboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ThenBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ThenBoxedList -public static final class ThenBoxedList
-extends [ThenBoxed](#thenboxed) +public record ThenBoxedList
+implements [ThenBoxed](#thenboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ThenBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ThenBoxedMap -public static final class ThenBoxedMap
-extends [ThenBoxed](#thenboxed) +public record ThenBoxedMap
+implements [ThenBoxed](#thenboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ThenBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Then public static class Then
@@ -306,7 +320,9 @@ A schema class that validates payloads | [ThenBoxedBoolean](#thenboxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [ThenBoxedMap](#thenboxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [ThenBoxedList](#thenboxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [ThenBoxed](#thenboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## StringThenConst public enum StringThenConst
extends `Enum` diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/IntegerTypeMatchesIntegers.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/IntegerTypeMatchesIntegers.md index bcd9231a5c0..1e84368f22a 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/IntegerTypeMatchesIntegers.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/IntegerTypeMatchesIntegers.md @@ -4,38 +4,39 @@ public class IntegerTypeMatchesIntegers
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [IntegerTypeMatchesIntegers.IntegerTypeMatchesIntegers1Boxed](#integertypematchesintegers1boxed)
abstract sealed validated payload class | -| static class | [IntegerTypeMatchesIntegers.IntegerTypeMatchesIntegers1BoxedNumber](#integertypematchesintegers1boxednumber)
boxed class to store validated Number payloads | +| sealed interface | [IntegerTypeMatchesIntegers.IntegerTypeMatchesIntegers1Boxed](#integertypematchesintegers1boxed)
sealed interface for validated payloads | +| record | [IntegerTypeMatchesIntegers.IntegerTypeMatchesIntegers1BoxedNumber](#integertypematchesintegers1boxednumber)
boxed class to store validated Number payloads | | static class | [IntegerTypeMatchesIntegers.IntegerTypeMatchesIntegers1](#integertypematchesintegers1)
schema class | ## IntegerTypeMatchesIntegers1Boxed -public static abstract sealed class IntegerTypeMatchesIntegers1Boxed
+public sealed interface IntegerTypeMatchesIntegers1Boxed
permits
[IntegerTypeMatchesIntegers1BoxedNumber](#integertypematchesintegers1boxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## IntegerTypeMatchesIntegers1BoxedNumber -public static final class IntegerTypeMatchesIntegers1BoxedNumber
-extends [IntegerTypeMatchesIntegers1Boxed](#integertypematchesintegers1boxed) +public record IntegerTypeMatchesIntegers1BoxedNumber
+implements [IntegerTypeMatchesIntegers1Boxed](#integertypematchesintegers1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IntegerTypeMatchesIntegers1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IntegerTypeMatchesIntegers1 public static class IntegerTypeMatchesIntegers1
diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/Ipv4Format.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/Ipv4Format.md index 5ee841749a5..fc4821b8b70 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/Ipv4Format.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/Ipv4Format.md @@ -4,23 +4,23 @@ public class Ipv4Format
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Ipv4Format.Ipv4Format1Boxed](#ipv4format1boxed)
abstract sealed validated payload class | -| static class | [Ipv4Format.Ipv4Format1BoxedVoid](#ipv4format1boxedvoid)
boxed class to store validated null payloads | -| static class | [Ipv4Format.Ipv4Format1BoxedBoolean](#ipv4format1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [Ipv4Format.Ipv4Format1BoxedNumber](#ipv4format1boxednumber)
boxed class to store validated Number payloads | -| static class | [Ipv4Format.Ipv4Format1BoxedString](#ipv4format1boxedstring)
boxed class to store validated String payloads | -| static class | [Ipv4Format.Ipv4Format1BoxedList](#ipv4format1boxedlist)
boxed class to store validated List payloads | -| static class | [Ipv4Format.Ipv4Format1BoxedMap](#ipv4format1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [Ipv4Format.Ipv4Format1Boxed](#ipv4format1boxed)
sealed interface for validated payloads | +| record | [Ipv4Format.Ipv4Format1BoxedVoid](#ipv4format1boxedvoid)
boxed class to store validated null payloads | +| record | [Ipv4Format.Ipv4Format1BoxedBoolean](#ipv4format1boxedboolean)
boxed class to store validated boolean payloads | +| record | [Ipv4Format.Ipv4Format1BoxedNumber](#ipv4format1boxednumber)
boxed class to store validated Number payloads | +| record | [Ipv4Format.Ipv4Format1BoxedString](#ipv4format1boxedstring)
boxed class to store validated String payloads | +| record | [Ipv4Format.Ipv4Format1BoxedList](#ipv4format1boxedlist)
boxed class to store validated List payloads | +| record | [Ipv4Format.Ipv4Format1BoxedMap](#ipv4format1boxedmap)
boxed class to store validated Map payloads | | static class | [Ipv4Format.Ipv4Format1](#ipv4format1)
schema class | ## Ipv4Format1Boxed -public static abstract sealed class Ipv4Format1Boxed
+public sealed interface Ipv4Format1Boxed
permits
[Ipv4Format1BoxedVoid](#ipv4format1boxedvoid), [Ipv4Format1BoxedBoolean](#ipv4format1boxedboolean), @@ -29,103 +29,109 @@ permits
[Ipv4Format1BoxedList](#ipv4format1boxedlist), [Ipv4Format1BoxedMap](#ipv4format1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Ipv4Format1BoxedVoid -public static final class Ipv4Format1BoxedVoid
-extends [Ipv4Format1Boxed](#ipv4format1boxed) +public record Ipv4Format1BoxedVoid
+implements [Ipv4Format1Boxed](#ipv4format1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Ipv4Format1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Ipv4Format1BoxedBoolean -public static final class Ipv4Format1BoxedBoolean
-extends [Ipv4Format1Boxed](#ipv4format1boxed) +public record Ipv4Format1BoxedBoolean
+implements [Ipv4Format1Boxed](#ipv4format1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Ipv4Format1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Ipv4Format1BoxedNumber -public static final class Ipv4Format1BoxedNumber
-extends [Ipv4Format1Boxed](#ipv4format1boxed) +public record Ipv4Format1BoxedNumber
+implements [Ipv4Format1Boxed](#ipv4format1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Ipv4Format1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Ipv4Format1BoxedString -public static final class Ipv4Format1BoxedString
-extends [Ipv4Format1Boxed](#ipv4format1boxed) +public record Ipv4Format1BoxedString
+implements [Ipv4Format1Boxed](#ipv4format1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Ipv4Format1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Ipv4Format1BoxedList -public static final class Ipv4Format1BoxedList
-extends [Ipv4Format1Boxed](#ipv4format1boxed) +public record Ipv4Format1BoxedList
+implements [Ipv4Format1Boxed](#ipv4format1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Ipv4Format1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Ipv4Format1BoxedMap -public static final class Ipv4Format1BoxedMap
-extends [Ipv4Format1Boxed](#ipv4format1boxed) +public record Ipv4Format1BoxedMap
+implements [Ipv4Format1Boxed](#ipv4format1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Ipv4Format1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Ipv4Format1 public static class Ipv4Format1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [Ipv4Format1BoxedBoolean](#ipv4format1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Ipv4Format1BoxedMap](#ipv4format1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [Ipv4Format1BoxedList](#ipv4format1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Ipv4Format1Boxed](#ipv4format1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/Ipv6Format.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/Ipv6Format.md index e6d1b20816b..b7e6fa306b8 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/Ipv6Format.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/Ipv6Format.md @@ -4,23 +4,23 @@ public class Ipv6Format
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Ipv6Format.Ipv6Format1Boxed](#ipv6format1boxed)
abstract sealed validated payload class | -| static class | [Ipv6Format.Ipv6Format1BoxedVoid](#ipv6format1boxedvoid)
boxed class to store validated null payloads | -| static class | [Ipv6Format.Ipv6Format1BoxedBoolean](#ipv6format1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [Ipv6Format.Ipv6Format1BoxedNumber](#ipv6format1boxednumber)
boxed class to store validated Number payloads | -| static class | [Ipv6Format.Ipv6Format1BoxedString](#ipv6format1boxedstring)
boxed class to store validated String payloads | -| static class | [Ipv6Format.Ipv6Format1BoxedList](#ipv6format1boxedlist)
boxed class to store validated List payloads | -| static class | [Ipv6Format.Ipv6Format1BoxedMap](#ipv6format1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [Ipv6Format.Ipv6Format1Boxed](#ipv6format1boxed)
sealed interface for validated payloads | +| record | [Ipv6Format.Ipv6Format1BoxedVoid](#ipv6format1boxedvoid)
boxed class to store validated null payloads | +| record | [Ipv6Format.Ipv6Format1BoxedBoolean](#ipv6format1boxedboolean)
boxed class to store validated boolean payloads | +| record | [Ipv6Format.Ipv6Format1BoxedNumber](#ipv6format1boxednumber)
boxed class to store validated Number payloads | +| record | [Ipv6Format.Ipv6Format1BoxedString](#ipv6format1boxedstring)
boxed class to store validated String payloads | +| record | [Ipv6Format.Ipv6Format1BoxedList](#ipv6format1boxedlist)
boxed class to store validated List payloads | +| record | [Ipv6Format.Ipv6Format1BoxedMap](#ipv6format1boxedmap)
boxed class to store validated Map payloads | | static class | [Ipv6Format.Ipv6Format1](#ipv6format1)
schema class | ## Ipv6Format1Boxed -public static abstract sealed class Ipv6Format1Boxed
+public sealed interface Ipv6Format1Boxed
permits
[Ipv6Format1BoxedVoid](#ipv6format1boxedvoid), [Ipv6Format1BoxedBoolean](#ipv6format1boxedboolean), @@ -29,103 +29,109 @@ permits
[Ipv6Format1BoxedList](#ipv6format1boxedlist), [Ipv6Format1BoxedMap](#ipv6format1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Ipv6Format1BoxedVoid -public static final class Ipv6Format1BoxedVoid
-extends [Ipv6Format1Boxed](#ipv6format1boxed) +public record Ipv6Format1BoxedVoid
+implements [Ipv6Format1Boxed](#ipv6format1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Ipv6Format1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Ipv6Format1BoxedBoolean -public static final class Ipv6Format1BoxedBoolean
-extends [Ipv6Format1Boxed](#ipv6format1boxed) +public record Ipv6Format1BoxedBoolean
+implements [Ipv6Format1Boxed](#ipv6format1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Ipv6Format1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Ipv6Format1BoxedNumber -public static final class Ipv6Format1BoxedNumber
-extends [Ipv6Format1Boxed](#ipv6format1boxed) +public record Ipv6Format1BoxedNumber
+implements [Ipv6Format1Boxed](#ipv6format1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Ipv6Format1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Ipv6Format1BoxedString -public static final class Ipv6Format1BoxedString
-extends [Ipv6Format1Boxed](#ipv6format1boxed) +public record Ipv6Format1BoxedString
+implements [Ipv6Format1Boxed](#ipv6format1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Ipv6Format1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Ipv6Format1BoxedList -public static final class Ipv6Format1BoxedList
-extends [Ipv6Format1Boxed](#ipv6format1boxed) +public record Ipv6Format1BoxedList
+implements [Ipv6Format1Boxed](#ipv6format1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Ipv6Format1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Ipv6Format1BoxedMap -public static final class Ipv6Format1BoxedMap
-extends [Ipv6Format1Boxed](#ipv6format1boxed) +public record Ipv6Format1BoxedMap
+implements [Ipv6Format1Boxed](#ipv6format1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Ipv6Format1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Ipv6Format1 public static class Ipv6Format1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [Ipv6Format1BoxedBoolean](#ipv6format1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Ipv6Format1BoxedMap](#ipv6format1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [Ipv6Format1BoxedList](#ipv6format1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Ipv6Format1Boxed](#ipv6format1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/IriFormat.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/IriFormat.md index 93fa5083bc7..2a8f1ba9564 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/IriFormat.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/IriFormat.md @@ -4,23 +4,23 @@ public class IriFormat
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [IriFormat.IriFormat1Boxed](#iriformat1boxed)
abstract sealed validated payload class | -| static class | [IriFormat.IriFormat1BoxedVoid](#iriformat1boxedvoid)
boxed class to store validated null payloads | -| static class | [IriFormat.IriFormat1BoxedBoolean](#iriformat1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [IriFormat.IriFormat1BoxedNumber](#iriformat1boxednumber)
boxed class to store validated Number payloads | -| static class | [IriFormat.IriFormat1BoxedString](#iriformat1boxedstring)
boxed class to store validated String payloads | -| static class | [IriFormat.IriFormat1BoxedList](#iriformat1boxedlist)
boxed class to store validated List payloads | -| static class | [IriFormat.IriFormat1BoxedMap](#iriformat1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [IriFormat.IriFormat1Boxed](#iriformat1boxed)
sealed interface for validated payloads | +| record | [IriFormat.IriFormat1BoxedVoid](#iriformat1boxedvoid)
boxed class to store validated null payloads | +| record | [IriFormat.IriFormat1BoxedBoolean](#iriformat1boxedboolean)
boxed class to store validated boolean payloads | +| record | [IriFormat.IriFormat1BoxedNumber](#iriformat1boxednumber)
boxed class to store validated Number payloads | +| record | [IriFormat.IriFormat1BoxedString](#iriformat1boxedstring)
boxed class to store validated String payloads | +| record | [IriFormat.IriFormat1BoxedList](#iriformat1boxedlist)
boxed class to store validated List payloads | +| record | [IriFormat.IriFormat1BoxedMap](#iriformat1boxedmap)
boxed class to store validated Map payloads | | static class | [IriFormat.IriFormat1](#iriformat1)
schema class | ## IriFormat1Boxed -public static abstract sealed class IriFormat1Boxed
+public sealed interface IriFormat1Boxed
permits
[IriFormat1BoxedVoid](#iriformat1boxedvoid), [IriFormat1BoxedBoolean](#iriformat1boxedboolean), @@ -29,103 +29,109 @@ permits
[IriFormat1BoxedList](#iriformat1boxedlist), [IriFormat1BoxedMap](#iriformat1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## IriFormat1BoxedVoid -public static final class IriFormat1BoxedVoid
-extends [IriFormat1Boxed](#iriformat1boxed) +public record IriFormat1BoxedVoid
+implements [IriFormat1Boxed](#iriformat1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IriFormat1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IriFormat1BoxedBoolean -public static final class IriFormat1BoxedBoolean
-extends [IriFormat1Boxed](#iriformat1boxed) +public record IriFormat1BoxedBoolean
+implements [IriFormat1Boxed](#iriformat1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IriFormat1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IriFormat1BoxedNumber -public static final class IriFormat1BoxedNumber
-extends [IriFormat1Boxed](#iriformat1boxed) +public record IriFormat1BoxedNumber
+implements [IriFormat1Boxed](#iriformat1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IriFormat1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IriFormat1BoxedString -public static final class IriFormat1BoxedString
-extends [IriFormat1Boxed](#iriformat1boxed) +public record IriFormat1BoxedString
+implements [IriFormat1Boxed](#iriformat1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IriFormat1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IriFormat1BoxedList -public static final class IriFormat1BoxedList
-extends [IriFormat1Boxed](#iriformat1boxed) +public record IriFormat1BoxedList
+implements [IriFormat1Boxed](#iriformat1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IriFormat1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IriFormat1BoxedMap -public static final class IriFormat1BoxedMap
-extends [IriFormat1Boxed](#iriformat1boxed) +public record IriFormat1BoxedMap
+implements [IriFormat1Boxed](#iriformat1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IriFormat1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IriFormat1 public static class IriFormat1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [IriFormat1BoxedBoolean](#iriformat1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [IriFormat1BoxedMap](#iriformat1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [IriFormat1BoxedList](#iriformat1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [IriFormat1Boxed](#iriformat1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/IriReferenceFormat.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/IriReferenceFormat.md index 11acf567a61..d7d17b32f51 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/IriReferenceFormat.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/IriReferenceFormat.md @@ -4,23 +4,23 @@ public class IriReferenceFormat
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [IriReferenceFormat.IriReferenceFormat1Boxed](#irireferenceformat1boxed)
abstract sealed validated payload class | -| static class | [IriReferenceFormat.IriReferenceFormat1BoxedVoid](#irireferenceformat1boxedvoid)
boxed class to store validated null payloads | -| static class | [IriReferenceFormat.IriReferenceFormat1BoxedBoolean](#irireferenceformat1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [IriReferenceFormat.IriReferenceFormat1BoxedNumber](#irireferenceformat1boxednumber)
boxed class to store validated Number payloads | -| static class | [IriReferenceFormat.IriReferenceFormat1BoxedString](#irireferenceformat1boxedstring)
boxed class to store validated String payloads | -| static class | [IriReferenceFormat.IriReferenceFormat1BoxedList](#irireferenceformat1boxedlist)
boxed class to store validated List payloads | -| static class | [IriReferenceFormat.IriReferenceFormat1BoxedMap](#irireferenceformat1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [IriReferenceFormat.IriReferenceFormat1Boxed](#irireferenceformat1boxed)
sealed interface for validated payloads | +| record | [IriReferenceFormat.IriReferenceFormat1BoxedVoid](#irireferenceformat1boxedvoid)
boxed class to store validated null payloads | +| record | [IriReferenceFormat.IriReferenceFormat1BoxedBoolean](#irireferenceformat1boxedboolean)
boxed class to store validated boolean payloads | +| record | [IriReferenceFormat.IriReferenceFormat1BoxedNumber](#irireferenceformat1boxednumber)
boxed class to store validated Number payloads | +| record | [IriReferenceFormat.IriReferenceFormat1BoxedString](#irireferenceformat1boxedstring)
boxed class to store validated String payloads | +| record | [IriReferenceFormat.IriReferenceFormat1BoxedList](#irireferenceformat1boxedlist)
boxed class to store validated List payloads | +| record | [IriReferenceFormat.IriReferenceFormat1BoxedMap](#irireferenceformat1boxedmap)
boxed class to store validated Map payloads | | static class | [IriReferenceFormat.IriReferenceFormat1](#irireferenceformat1)
schema class | ## IriReferenceFormat1Boxed -public static abstract sealed class IriReferenceFormat1Boxed
+public sealed interface IriReferenceFormat1Boxed
permits
[IriReferenceFormat1BoxedVoid](#irireferenceformat1boxedvoid), [IriReferenceFormat1BoxedBoolean](#irireferenceformat1boxedboolean), @@ -29,103 +29,109 @@ permits
[IriReferenceFormat1BoxedList](#irireferenceformat1boxedlist), [IriReferenceFormat1BoxedMap](#irireferenceformat1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## IriReferenceFormat1BoxedVoid -public static final class IriReferenceFormat1BoxedVoid
-extends [IriReferenceFormat1Boxed](#irireferenceformat1boxed) +public record IriReferenceFormat1BoxedVoid
+implements [IriReferenceFormat1Boxed](#irireferenceformat1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IriReferenceFormat1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IriReferenceFormat1BoxedBoolean -public static final class IriReferenceFormat1BoxedBoolean
-extends [IriReferenceFormat1Boxed](#irireferenceformat1boxed) +public record IriReferenceFormat1BoxedBoolean
+implements [IriReferenceFormat1Boxed](#irireferenceformat1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IriReferenceFormat1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IriReferenceFormat1BoxedNumber -public static final class IriReferenceFormat1BoxedNumber
-extends [IriReferenceFormat1Boxed](#irireferenceformat1boxed) +public record IriReferenceFormat1BoxedNumber
+implements [IriReferenceFormat1Boxed](#irireferenceformat1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IriReferenceFormat1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IriReferenceFormat1BoxedString -public static final class IriReferenceFormat1BoxedString
-extends [IriReferenceFormat1Boxed](#irireferenceformat1boxed) +public record IriReferenceFormat1BoxedString
+implements [IriReferenceFormat1Boxed](#irireferenceformat1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IriReferenceFormat1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IriReferenceFormat1BoxedList -public static final class IriReferenceFormat1BoxedList
-extends [IriReferenceFormat1Boxed](#irireferenceformat1boxed) +public record IriReferenceFormat1BoxedList
+implements [IriReferenceFormat1Boxed](#irireferenceformat1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IriReferenceFormat1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IriReferenceFormat1BoxedMap -public static final class IriReferenceFormat1BoxedMap
-extends [IriReferenceFormat1Boxed](#irireferenceformat1boxed) +public record IriReferenceFormat1BoxedMap
+implements [IriReferenceFormat1Boxed](#irireferenceformat1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IriReferenceFormat1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IriReferenceFormat1 public static class IriReferenceFormat1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [IriReferenceFormat1BoxedBoolean](#irireferenceformat1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [IriReferenceFormat1BoxedMap](#irireferenceformat1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [IriReferenceFormat1BoxedList](#irireferenceformat1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [IriReferenceFormat1Boxed](#irireferenceformat1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/ItemsContains.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/ItemsContains.md index 667b35372a1..49d747bfa50 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/ItemsContains.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/ItemsContains.md @@ -4,7 +4,7 @@ public class ItemsContains
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated list payloads, extends FrozenList - classes to build inputs for list payloads @@ -12,50 +12,51 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ItemsContains.ItemsContains1Boxed](#itemscontains1boxed)
abstract sealed validated payload class | -| static class | [ItemsContains.ItemsContains1BoxedList](#itemscontains1boxedlist)
boxed class to store validated List payloads | +| sealed interface | [ItemsContains.ItemsContains1Boxed](#itemscontains1boxed)
sealed interface for validated payloads | +| record | [ItemsContains.ItemsContains1BoxedList](#itemscontains1boxedlist)
boxed class to store validated List payloads | | static class | [ItemsContains.ItemsContains1](#itemscontains1)
schema class | | static class | [ItemsContains.ItemsContainsListBuilder](#itemscontainslistbuilder)
builder for List payloads | | static class | [ItemsContains.ItemsContainsList](#itemscontainslist)
output class for List payloads | -| static class | [ItemsContains.ItemsBoxed](#itemsboxed)
abstract sealed validated payload class | -| static class | [ItemsContains.ItemsBoxedVoid](#itemsboxedvoid)
boxed class to store validated null payloads | -| static class | [ItemsContains.ItemsBoxedBoolean](#itemsboxedboolean)
boxed class to store validated boolean payloads | -| static class | [ItemsContains.ItemsBoxedNumber](#itemsboxednumber)
boxed class to store validated Number payloads | -| static class | [ItemsContains.ItemsBoxedString](#itemsboxedstring)
boxed class to store validated String payloads | -| static class | [ItemsContains.ItemsBoxedList](#itemsboxedlist)
boxed class to store validated List payloads | -| static class | [ItemsContains.ItemsBoxedMap](#itemsboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ItemsContains.ItemsBoxed](#itemsboxed)
sealed interface for validated payloads | +| record | [ItemsContains.ItemsBoxedVoid](#itemsboxedvoid)
boxed class to store validated null payloads | +| record | [ItemsContains.ItemsBoxedBoolean](#itemsboxedboolean)
boxed class to store validated boolean payloads | +| record | [ItemsContains.ItemsBoxedNumber](#itemsboxednumber)
boxed class to store validated Number payloads | +| record | [ItemsContains.ItemsBoxedString](#itemsboxedstring)
boxed class to store validated String payloads | +| record | [ItemsContains.ItemsBoxedList](#itemsboxedlist)
boxed class to store validated List payloads | +| record | [ItemsContains.ItemsBoxedMap](#itemsboxedmap)
boxed class to store validated Map payloads | | static class | [ItemsContains.Items](#items)
schema class | -| static class | [ItemsContains.ContainsBoxed](#containsboxed)
abstract sealed validated payload class | -| static class | [ItemsContains.ContainsBoxedVoid](#containsboxedvoid)
boxed class to store validated null payloads | -| static class | [ItemsContains.ContainsBoxedBoolean](#containsboxedboolean)
boxed class to store validated boolean payloads | -| static class | [ItemsContains.ContainsBoxedNumber](#containsboxednumber)
boxed class to store validated Number payloads | -| static class | [ItemsContains.ContainsBoxedString](#containsboxedstring)
boxed class to store validated String payloads | -| static class | [ItemsContains.ContainsBoxedList](#containsboxedlist)
boxed class to store validated List payloads | -| static class | [ItemsContains.ContainsBoxedMap](#containsboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ItemsContains.ContainsBoxed](#containsboxed)
sealed interface for validated payloads | +| record | [ItemsContains.ContainsBoxedVoid](#containsboxedvoid)
boxed class to store validated null payloads | +| record | [ItemsContains.ContainsBoxedBoolean](#containsboxedboolean)
boxed class to store validated boolean payloads | +| record | [ItemsContains.ContainsBoxedNumber](#containsboxednumber)
boxed class to store validated Number payloads | +| record | [ItemsContains.ContainsBoxedString](#containsboxedstring)
boxed class to store validated String payloads | +| record | [ItemsContains.ContainsBoxedList](#containsboxedlist)
boxed class to store validated List payloads | +| record | [ItemsContains.ContainsBoxedMap](#containsboxedmap)
boxed class to store validated Map payloads | | static class | [ItemsContains.Contains](#contains)
schema class | ## ItemsContains1Boxed -public static abstract sealed class ItemsContains1Boxed
+public sealed interface ItemsContains1Boxed
permits
[ItemsContains1BoxedList](#itemscontains1boxedlist) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ItemsContains1BoxedList -public static final class ItemsContains1BoxedList
-extends [ItemsContains1Boxed](#itemscontains1boxed) +public record ItemsContains1BoxedList
+implements [ItemsContains1Boxed](#itemscontains1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ItemsContains1BoxedList([ItemsContainsList](#itemscontainslist) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [ItemsContainsList](#itemscontainslist) | data
validated payload | +| [ItemsContainsList](#itemscontainslist) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ItemsContains1 public static class ItemsContains1
@@ -99,7 +100,9 @@ ItemsContains.ItemsContainsList validatedPayload = | ----------------- | ---------------------- | | [ItemsContainsList](#itemscontainslist) | validate([List](#itemscontainslistbuilder) arg, SchemaConfiguration configuration) | | [ItemsContains1BoxedList](#itemscontains1boxedlist) | validateAndBox([List](#itemscontainslistbuilder) arg, SchemaConfiguration configuration) | +| [ItemsContains1Boxed](#itemscontains1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ItemsContainsListBuilder public class ItemsContainsListBuilder
builder for `List<@Nullable Object>` @@ -138,7 +141,7 @@ A class to store validated List payloads | static [ItemsContainsList](#itemscontainslist) | of([List](#itemscontainslistbuilder) arg, SchemaConfiguration configuration) | ## ItemsBoxed -public static abstract sealed class ItemsBoxed
+public sealed interface ItemsBoxed
permits
[ItemsBoxedVoid](#itemsboxedvoid), [ItemsBoxedBoolean](#itemsboxedboolean), @@ -147,103 +150,109 @@ permits
[ItemsBoxedList](#itemsboxedlist), [ItemsBoxedMap](#itemsboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ItemsBoxedVoid -public static final class ItemsBoxedVoid
-extends [ItemsBoxed](#itemsboxed) +public record ItemsBoxedVoid
+implements [ItemsBoxed](#itemsboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ItemsBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ItemsBoxedBoolean -public static final class ItemsBoxedBoolean
-extends [ItemsBoxed](#itemsboxed) +public record ItemsBoxedBoolean
+implements [ItemsBoxed](#itemsboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ItemsBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ItemsBoxedNumber -public static final class ItemsBoxedNumber
-extends [ItemsBoxed](#itemsboxed) +public record ItemsBoxedNumber
+implements [ItemsBoxed](#itemsboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ItemsBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ItemsBoxedString -public static final class ItemsBoxedString
-extends [ItemsBoxed](#itemsboxed) +public record ItemsBoxedString
+implements [ItemsBoxed](#itemsboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ItemsBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ItemsBoxedList -public static final class ItemsBoxedList
-extends [ItemsBoxed](#itemsboxed) +public record ItemsBoxedList
+implements [ItemsBoxed](#itemsboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ItemsBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ItemsBoxedMap -public static final class ItemsBoxedMap
-extends [ItemsBoxed](#itemsboxed) +public record ItemsBoxedMap
+implements [ItemsBoxed](#itemsboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ItemsBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Items public static class Items
@@ -275,9 +284,11 @@ A schema class that validates payloads | [ItemsBoxedBoolean](#itemsboxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [ItemsBoxedMap](#itemsboxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [ItemsBoxedList](#itemsboxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [ItemsBoxed](#itemsboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ContainsBoxed -public static abstract sealed class ContainsBoxed
+public sealed interface ContainsBoxed
permits
[ContainsBoxedVoid](#containsboxedvoid), [ContainsBoxedBoolean](#containsboxedboolean), @@ -286,103 +297,109 @@ permits
[ContainsBoxedList](#containsboxedlist), [ContainsBoxedMap](#containsboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ContainsBoxedVoid -public static final class ContainsBoxedVoid
-extends [ContainsBoxed](#containsboxed) +public record ContainsBoxedVoid
+implements [ContainsBoxed](#containsboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ContainsBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ContainsBoxedBoolean -public static final class ContainsBoxedBoolean
-extends [ContainsBoxed](#containsboxed) +public record ContainsBoxedBoolean
+implements [ContainsBoxed](#containsboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ContainsBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ContainsBoxedNumber -public static final class ContainsBoxedNumber
-extends [ContainsBoxed](#containsboxed) +public record ContainsBoxedNumber
+implements [ContainsBoxed](#containsboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ContainsBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ContainsBoxedString -public static final class ContainsBoxedString
-extends [ContainsBoxed](#containsboxed) +public record ContainsBoxedString
+implements [ContainsBoxed](#containsboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ContainsBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ContainsBoxedList -public static final class ContainsBoxedList
-extends [ContainsBoxed](#containsboxed) +public record ContainsBoxedList
+implements [ContainsBoxed](#containsboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ContainsBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ContainsBoxedMap -public static final class ContainsBoxedMap
-extends [ContainsBoxed](#containsboxed) +public record ContainsBoxedMap
+implements [ContainsBoxed](#containsboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ContainsBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Contains public static class Contains
@@ -414,5 +431,7 @@ A schema class that validates payloads | [ContainsBoxedBoolean](#containsboxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [ContainsBoxedMap](#containsboxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [ContainsBoxedList](#containsboxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [ContainsBoxed](#containsboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/ItemsDoesNotLookInApplicatorsValidCase.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/ItemsDoesNotLookInApplicatorsValidCase.md index a4a91e145fa..c42cd35f6d0 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/ItemsDoesNotLookInApplicatorsValidCase.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/ItemsDoesNotLookInApplicatorsValidCase.md @@ -4,7 +4,7 @@ public class ItemsDoesNotLookInApplicatorsValidCase
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated list payloads, extends FrozenList - classes to build inputs for list payloads @@ -12,42 +12,43 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ItemsDoesNotLookInApplicatorsValidCase.ItemsDoesNotLookInApplicatorsValidCase1Boxed](#itemsdoesnotlookinapplicatorsvalidcase1boxed)
abstract sealed validated payload class | -| static class | [ItemsDoesNotLookInApplicatorsValidCase.ItemsDoesNotLookInApplicatorsValidCase1BoxedList](#itemsdoesnotlookinapplicatorsvalidcase1boxedlist)
boxed class to store validated List payloads | +| sealed interface | [ItemsDoesNotLookInApplicatorsValidCase.ItemsDoesNotLookInApplicatorsValidCase1Boxed](#itemsdoesnotlookinapplicatorsvalidcase1boxed)
sealed interface for validated payloads | +| record | [ItemsDoesNotLookInApplicatorsValidCase.ItemsDoesNotLookInApplicatorsValidCase1BoxedList](#itemsdoesnotlookinapplicatorsvalidcase1boxedlist)
boxed class to store validated List payloads | | static class | [ItemsDoesNotLookInApplicatorsValidCase.ItemsDoesNotLookInApplicatorsValidCase1](#itemsdoesnotlookinapplicatorsvalidcase1)
schema class | | static class | [ItemsDoesNotLookInApplicatorsValidCase.ItemsDoesNotLookInApplicatorsValidCaseListBuilder](#itemsdoesnotlookinapplicatorsvalidcaselistbuilder)
builder for List payloads | | static class | [ItemsDoesNotLookInApplicatorsValidCase.ItemsDoesNotLookInApplicatorsValidCaseList](#itemsdoesnotlookinapplicatorsvalidcaselist)
output class for List payloads | -| static class | [ItemsDoesNotLookInApplicatorsValidCase.ItemsBoxed](#itemsboxed)
abstract sealed validated payload class | -| static class | [ItemsDoesNotLookInApplicatorsValidCase.ItemsBoxedVoid](#itemsboxedvoid)
boxed class to store validated null payloads | -| static class | [ItemsDoesNotLookInApplicatorsValidCase.ItemsBoxedBoolean](#itemsboxedboolean)
boxed class to store validated boolean payloads | -| static class | [ItemsDoesNotLookInApplicatorsValidCase.ItemsBoxedNumber](#itemsboxednumber)
boxed class to store validated Number payloads | -| static class | [ItemsDoesNotLookInApplicatorsValidCase.ItemsBoxedString](#itemsboxedstring)
boxed class to store validated String payloads | -| static class | [ItemsDoesNotLookInApplicatorsValidCase.ItemsBoxedList](#itemsboxedlist)
boxed class to store validated List payloads | -| static class | [ItemsDoesNotLookInApplicatorsValidCase.ItemsBoxedMap](#itemsboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ItemsDoesNotLookInApplicatorsValidCase.ItemsBoxed](#itemsboxed)
sealed interface for validated payloads | +| record | [ItemsDoesNotLookInApplicatorsValidCase.ItemsBoxedVoid](#itemsboxedvoid)
boxed class to store validated null payloads | +| record | [ItemsDoesNotLookInApplicatorsValidCase.ItemsBoxedBoolean](#itemsboxedboolean)
boxed class to store validated boolean payloads | +| record | [ItemsDoesNotLookInApplicatorsValidCase.ItemsBoxedNumber](#itemsboxednumber)
boxed class to store validated Number payloads | +| record | [ItemsDoesNotLookInApplicatorsValidCase.ItemsBoxedString](#itemsboxedstring)
boxed class to store validated String payloads | +| record | [ItemsDoesNotLookInApplicatorsValidCase.ItemsBoxedList](#itemsboxedlist)
boxed class to store validated List payloads | +| record | [ItemsDoesNotLookInApplicatorsValidCase.ItemsBoxedMap](#itemsboxedmap)
boxed class to store validated Map payloads | | static class | [ItemsDoesNotLookInApplicatorsValidCase.Items](#items)
schema class | ## ItemsDoesNotLookInApplicatorsValidCase1Boxed -public static abstract sealed class ItemsDoesNotLookInApplicatorsValidCase1Boxed
+public sealed interface ItemsDoesNotLookInApplicatorsValidCase1Boxed
permits
[ItemsDoesNotLookInApplicatorsValidCase1BoxedList](#itemsdoesnotlookinapplicatorsvalidcase1boxedlist) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ItemsDoesNotLookInApplicatorsValidCase1BoxedList -public static final class ItemsDoesNotLookInApplicatorsValidCase1BoxedList
-extends [ItemsDoesNotLookInApplicatorsValidCase1Boxed](#itemsdoesnotlookinapplicatorsvalidcase1boxed) +public record ItemsDoesNotLookInApplicatorsValidCase1BoxedList
+implements [ItemsDoesNotLookInApplicatorsValidCase1Boxed](#itemsdoesnotlookinapplicatorsvalidcase1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ItemsDoesNotLookInApplicatorsValidCase1BoxedList([ItemsDoesNotLookInApplicatorsValidCaseList](#itemsdoesnotlookinapplicatorsvalidcaselist) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [ItemsDoesNotLookInApplicatorsValidCaseList](#itemsdoesnotlookinapplicatorsvalidcaselist) | data
validated payload | +| [ItemsDoesNotLookInApplicatorsValidCaseList](#itemsdoesnotlookinapplicatorsvalidcaselist) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ItemsDoesNotLookInApplicatorsValidCase1 public static class ItemsDoesNotLookInApplicatorsValidCase1
@@ -90,7 +91,9 @@ ItemsDoesNotLookInApplicatorsValidCase.ItemsDoesNotLookInApplicatorsValidCaseLis | ----------------- | ---------------------- | | [ItemsDoesNotLookInApplicatorsValidCaseList](#itemsdoesnotlookinapplicatorsvalidcaselist) | validate([List](#itemsdoesnotlookinapplicatorsvalidcaselistbuilder) arg, SchemaConfiguration configuration) | | [ItemsDoesNotLookInApplicatorsValidCase1BoxedList](#itemsdoesnotlookinapplicatorsvalidcase1boxedlist) | validateAndBox([List](#itemsdoesnotlookinapplicatorsvalidcaselistbuilder) arg, SchemaConfiguration configuration) | +| [ItemsDoesNotLookInApplicatorsValidCase1Boxed](#itemsdoesnotlookinapplicatorsvalidcase1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ItemsDoesNotLookInApplicatorsValidCaseListBuilder public class ItemsDoesNotLookInApplicatorsValidCaseListBuilder
builder for `List<@Nullable Object>` @@ -129,7 +132,7 @@ A class to store validated List payloads | static [ItemsDoesNotLookInApplicatorsValidCaseList](#itemsdoesnotlookinapplicatorsvalidcaselist) | of([List](#itemsdoesnotlookinapplicatorsvalidcaselistbuilder) arg, SchemaConfiguration configuration) | ## ItemsBoxed -public static abstract sealed class ItemsBoxed
+public sealed interface ItemsBoxed
permits
[ItemsBoxedVoid](#itemsboxedvoid), [ItemsBoxedBoolean](#itemsboxedboolean), @@ -138,103 +141,109 @@ permits
[ItemsBoxedList](#itemsboxedlist), [ItemsBoxedMap](#itemsboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ItemsBoxedVoid -public static final class ItemsBoxedVoid
-extends [ItemsBoxed](#itemsboxed) +public record ItemsBoxedVoid
+implements [ItemsBoxed](#itemsboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ItemsBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ItemsBoxedBoolean -public static final class ItemsBoxedBoolean
-extends [ItemsBoxed](#itemsboxed) +public record ItemsBoxedBoolean
+implements [ItemsBoxed](#itemsboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ItemsBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ItemsBoxedNumber -public static final class ItemsBoxedNumber
-extends [ItemsBoxed](#itemsboxed) +public record ItemsBoxedNumber
+implements [ItemsBoxed](#itemsboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ItemsBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ItemsBoxedString -public static final class ItemsBoxedString
-extends [ItemsBoxed](#itemsboxed) +public record ItemsBoxedString
+implements [ItemsBoxed](#itemsboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ItemsBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ItemsBoxedList -public static final class ItemsBoxedList
-extends [ItemsBoxed](#itemsboxed) +public record ItemsBoxedList
+implements [ItemsBoxed](#itemsboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ItemsBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ItemsBoxedMap -public static final class ItemsBoxedMap
-extends [ItemsBoxed](#itemsboxed) +public record ItemsBoxedMap
+implements [ItemsBoxed](#itemsboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ItemsBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Items public static class Items
@@ -266,5 +275,7 @@ A schema class that validates payloads | [ItemsBoxedBoolean](#itemsboxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [ItemsBoxedMap](#itemsboxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [ItemsBoxedList](#itemsboxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [ItemsBoxed](#itemsboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/ItemsWithNullInstanceElements.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/ItemsWithNullInstanceElements.md index b7b7c2eb784..9d40bbb4a07 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/ItemsWithNullInstanceElements.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/ItemsWithNullInstanceElements.md @@ -4,7 +4,7 @@ public class ItemsWithNullInstanceElements
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated list payloads, extends FrozenList - classes to build inputs for list payloads @@ -12,37 +12,38 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ItemsWithNullInstanceElements.ItemsWithNullInstanceElements1Boxed](#itemswithnullinstanceelements1boxed)
abstract sealed validated payload class | -| static class | [ItemsWithNullInstanceElements.ItemsWithNullInstanceElements1BoxedList](#itemswithnullinstanceelements1boxedlist)
boxed class to store validated List payloads | +| sealed interface | [ItemsWithNullInstanceElements.ItemsWithNullInstanceElements1Boxed](#itemswithnullinstanceelements1boxed)
sealed interface for validated payloads | +| record | [ItemsWithNullInstanceElements.ItemsWithNullInstanceElements1BoxedList](#itemswithnullinstanceelements1boxedlist)
boxed class to store validated List payloads | | static class | [ItemsWithNullInstanceElements.ItemsWithNullInstanceElements1](#itemswithnullinstanceelements1)
schema class | | static class | [ItemsWithNullInstanceElements.ItemsWithNullInstanceElementsListBuilder](#itemswithnullinstanceelementslistbuilder)
builder for List payloads | | static class | [ItemsWithNullInstanceElements.ItemsWithNullInstanceElementsList](#itemswithnullinstanceelementslist)
output class for List payloads | -| static class | [ItemsWithNullInstanceElements.ItemsBoxed](#itemsboxed)
abstract sealed validated payload class | -| static class | [ItemsWithNullInstanceElements.ItemsBoxedVoid](#itemsboxedvoid)
boxed class to store validated null payloads | +| sealed interface | [ItemsWithNullInstanceElements.ItemsBoxed](#itemsboxed)
sealed interface for validated payloads | +| record | [ItemsWithNullInstanceElements.ItemsBoxedVoid](#itemsboxedvoid)
boxed class to store validated null payloads | | static class | [ItemsWithNullInstanceElements.Items](#items)
schema class | ## ItemsWithNullInstanceElements1Boxed -public static abstract sealed class ItemsWithNullInstanceElements1Boxed
+public sealed interface ItemsWithNullInstanceElements1Boxed
permits
[ItemsWithNullInstanceElements1BoxedList](#itemswithnullinstanceelements1boxedlist) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ItemsWithNullInstanceElements1BoxedList -public static final class ItemsWithNullInstanceElements1BoxedList
-extends [ItemsWithNullInstanceElements1Boxed](#itemswithnullinstanceelements1boxed) +public record ItemsWithNullInstanceElements1BoxedList
+implements [ItemsWithNullInstanceElements1Boxed](#itemswithnullinstanceelements1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ItemsWithNullInstanceElements1BoxedList([ItemsWithNullInstanceElementsList](#itemswithnullinstanceelementslist) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [ItemsWithNullInstanceElementsList](#itemswithnullinstanceelementslist) | data
validated payload | +| [ItemsWithNullInstanceElementsList](#itemswithnullinstanceelementslist) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ItemsWithNullInstanceElements1 public static class ItemsWithNullInstanceElements1
@@ -87,7 +88,9 @@ ItemsWithNullInstanceElements.ItemsWithNullInstanceElementsList validatedPayload | ----------------- | ---------------------- | | [ItemsWithNullInstanceElementsList](#itemswithnullinstanceelementslist) | validate([List](#itemswithnullinstanceelementslistbuilder) arg, SchemaConfiguration configuration) | | [ItemsWithNullInstanceElements1BoxedList](#itemswithnullinstanceelements1boxedlist) | validateAndBox([List](#itemswithnullinstanceelementslistbuilder) arg, SchemaConfiguration configuration) | +| [ItemsWithNullInstanceElements1Boxed](#itemswithnullinstanceelements1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ItemsWithNullInstanceElementsListBuilder public class ItemsWithNullInstanceElementsListBuilder
builder for `List` @@ -118,27 +121,28 @@ A class to store validated List payloads | static [ItemsWithNullInstanceElementsList](#itemswithnullinstanceelementslist) | of([List](#itemswithnullinstanceelementslistbuilder) arg, SchemaConfiguration configuration) | ## ItemsBoxed -public static abstract sealed class ItemsBoxed
+public sealed interface ItemsBoxed
permits
[ItemsBoxedVoid](#itemsboxedvoid) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ItemsBoxedVoid -public static final class ItemsBoxedVoid
-extends [ItemsBoxed](#itemsboxed) +public record ItemsBoxedVoid
+implements [ItemsBoxed](#itemsboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ItemsBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Items public static class Items
diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/JsonPointerFormat.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/JsonPointerFormat.md index 0bf84047e03..65c23c09e6c 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/JsonPointerFormat.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/JsonPointerFormat.md @@ -4,23 +4,23 @@ public class JsonPointerFormat
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [JsonPointerFormat.JsonPointerFormat1Boxed](#jsonpointerformat1boxed)
abstract sealed validated payload class | -| static class | [JsonPointerFormat.JsonPointerFormat1BoxedVoid](#jsonpointerformat1boxedvoid)
boxed class to store validated null payloads | -| static class | [JsonPointerFormat.JsonPointerFormat1BoxedBoolean](#jsonpointerformat1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [JsonPointerFormat.JsonPointerFormat1BoxedNumber](#jsonpointerformat1boxednumber)
boxed class to store validated Number payloads | -| static class | [JsonPointerFormat.JsonPointerFormat1BoxedString](#jsonpointerformat1boxedstring)
boxed class to store validated String payloads | -| static class | [JsonPointerFormat.JsonPointerFormat1BoxedList](#jsonpointerformat1boxedlist)
boxed class to store validated List payloads | -| static class | [JsonPointerFormat.JsonPointerFormat1BoxedMap](#jsonpointerformat1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [JsonPointerFormat.JsonPointerFormat1Boxed](#jsonpointerformat1boxed)
sealed interface for validated payloads | +| record | [JsonPointerFormat.JsonPointerFormat1BoxedVoid](#jsonpointerformat1boxedvoid)
boxed class to store validated null payloads | +| record | [JsonPointerFormat.JsonPointerFormat1BoxedBoolean](#jsonpointerformat1boxedboolean)
boxed class to store validated boolean payloads | +| record | [JsonPointerFormat.JsonPointerFormat1BoxedNumber](#jsonpointerformat1boxednumber)
boxed class to store validated Number payloads | +| record | [JsonPointerFormat.JsonPointerFormat1BoxedString](#jsonpointerformat1boxedstring)
boxed class to store validated String payloads | +| record | [JsonPointerFormat.JsonPointerFormat1BoxedList](#jsonpointerformat1boxedlist)
boxed class to store validated List payloads | +| record | [JsonPointerFormat.JsonPointerFormat1BoxedMap](#jsonpointerformat1boxedmap)
boxed class to store validated Map payloads | | static class | [JsonPointerFormat.JsonPointerFormat1](#jsonpointerformat1)
schema class | ## JsonPointerFormat1Boxed -public static abstract sealed class JsonPointerFormat1Boxed
+public sealed interface JsonPointerFormat1Boxed
permits
[JsonPointerFormat1BoxedVoid](#jsonpointerformat1boxedvoid), [JsonPointerFormat1BoxedBoolean](#jsonpointerformat1boxedboolean), @@ -29,103 +29,109 @@ permits
[JsonPointerFormat1BoxedList](#jsonpointerformat1boxedlist), [JsonPointerFormat1BoxedMap](#jsonpointerformat1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## JsonPointerFormat1BoxedVoid -public static final class JsonPointerFormat1BoxedVoid
-extends [JsonPointerFormat1Boxed](#jsonpointerformat1boxed) +public record JsonPointerFormat1BoxedVoid
+implements [JsonPointerFormat1Boxed](#jsonpointerformat1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | JsonPointerFormat1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## JsonPointerFormat1BoxedBoolean -public static final class JsonPointerFormat1BoxedBoolean
-extends [JsonPointerFormat1Boxed](#jsonpointerformat1boxed) +public record JsonPointerFormat1BoxedBoolean
+implements [JsonPointerFormat1Boxed](#jsonpointerformat1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | JsonPointerFormat1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## JsonPointerFormat1BoxedNumber -public static final class JsonPointerFormat1BoxedNumber
-extends [JsonPointerFormat1Boxed](#jsonpointerformat1boxed) +public record JsonPointerFormat1BoxedNumber
+implements [JsonPointerFormat1Boxed](#jsonpointerformat1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | JsonPointerFormat1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## JsonPointerFormat1BoxedString -public static final class JsonPointerFormat1BoxedString
-extends [JsonPointerFormat1Boxed](#jsonpointerformat1boxed) +public record JsonPointerFormat1BoxedString
+implements [JsonPointerFormat1Boxed](#jsonpointerformat1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | JsonPointerFormat1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## JsonPointerFormat1BoxedList -public static final class JsonPointerFormat1BoxedList
-extends [JsonPointerFormat1Boxed](#jsonpointerformat1boxed) +public record JsonPointerFormat1BoxedList
+implements [JsonPointerFormat1Boxed](#jsonpointerformat1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | JsonPointerFormat1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## JsonPointerFormat1BoxedMap -public static final class JsonPointerFormat1BoxedMap
-extends [JsonPointerFormat1Boxed](#jsonpointerformat1boxed) +public record JsonPointerFormat1BoxedMap
+implements [JsonPointerFormat1Boxed](#jsonpointerformat1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | JsonPointerFormat1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## JsonPointerFormat1 public static class JsonPointerFormat1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [JsonPointerFormat1BoxedBoolean](#jsonpointerformat1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [JsonPointerFormat1BoxedMap](#jsonpointerformat1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [JsonPointerFormat1BoxedList](#jsonpointerformat1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [JsonPointerFormat1Boxed](#jsonpointerformat1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/MaxcontainsWithoutContainsIsIgnored.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/MaxcontainsWithoutContainsIsIgnored.md index 2def0d691a1..34f9ac593c7 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/MaxcontainsWithoutContainsIsIgnored.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/MaxcontainsWithoutContainsIsIgnored.md @@ -4,23 +4,23 @@ public class MaxcontainsWithoutContainsIsIgnored
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [MaxcontainsWithoutContainsIsIgnored.MaxcontainsWithoutContainsIsIgnored1Boxed](#maxcontainswithoutcontainsisignored1boxed)
abstract sealed validated payload class | -| static class | [MaxcontainsWithoutContainsIsIgnored.MaxcontainsWithoutContainsIsIgnored1BoxedVoid](#maxcontainswithoutcontainsisignored1boxedvoid)
boxed class to store validated null payloads | -| static class | [MaxcontainsWithoutContainsIsIgnored.MaxcontainsWithoutContainsIsIgnored1BoxedBoolean](#maxcontainswithoutcontainsisignored1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [MaxcontainsWithoutContainsIsIgnored.MaxcontainsWithoutContainsIsIgnored1BoxedNumber](#maxcontainswithoutcontainsisignored1boxednumber)
boxed class to store validated Number payloads | -| static class | [MaxcontainsWithoutContainsIsIgnored.MaxcontainsWithoutContainsIsIgnored1BoxedString](#maxcontainswithoutcontainsisignored1boxedstring)
boxed class to store validated String payloads | -| static class | [MaxcontainsWithoutContainsIsIgnored.MaxcontainsWithoutContainsIsIgnored1BoxedList](#maxcontainswithoutcontainsisignored1boxedlist)
boxed class to store validated List payloads | -| static class | [MaxcontainsWithoutContainsIsIgnored.MaxcontainsWithoutContainsIsIgnored1BoxedMap](#maxcontainswithoutcontainsisignored1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [MaxcontainsWithoutContainsIsIgnored.MaxcontainsWithoutContainsIsIgnored1Boxed](#maxcontainswithoutcontainsisignored1boxed)
sealed interface for validated payloads | +| record | [MaxcontainsWithoutContainsIsIgnored.MaxcontainsWithoutContainsIsIgnored1BoxedVoid](#maxcontainswithoutcontainsisignored1boxedvoid)
boxed class to store validated null payloads | +| record | [MaxcontainsWithoutContainsIsIgnored.MaxcontainsWithoutContainsIsIgnored1BoxedBoolean](#maxcontainswithoutcontainsisignored1boxedboolean)
boxed class to store validated boolean payloads | +| record | [MaxcontainsWithoutContainsIsIgnored.MaxcontainsWithoutContainsIsIgnored1BoxedNumber](#maxcontainswithoutcontainsisignored1boxednumber)
boxed class to store validated Number payloads | +| record | [MaxcontainsWithoutContainsIsIgnored.MaxcontainsWithoutContainsIsIgnored1BoxedString](#maxcontainswithoutcontainsisignored1boxedstring)
boxed class to store validated String payloads | +| record | [MaxcontainsWithoutContainsIsIgnored.MaxcontainsWithoutContainsIsIgnored1BoxedList](#maxcontainswithoutcontainsisignored1boxedlist)
boxed class to store validated List payloads | +| record | [MaxcontainsWithoutContainsIsIgnored.MaxcontainsWithoutContainsIsIgnored1BoxedMap](#maxcontainswithoutcontainsisignored1boxedmap)
boxed class to store validated Map payloads | | static class | [MaxcontainsWithoutContainsIsIgnored.MaxcontainsWithoutContainsIsIgnored1](#maxcontainswithoutcontainsisignored1)
schema class | ## MaxcontainsWithoutContainsIsIgnored1Boxed -public static abstract sealed class MaxcontainsWithoutContainsIsIgnored1Boxed
+public sealed interface MaxcontainsWithoutContainsIsIgnored1Boxed
permits
[MaxcontainsWithoutContainsIsIgnored1BoxedVoid](#maxcontainswithoutcontainsisignored1boxedvoid), [MaxcontainsWithoutContainsIsIgnored1BoxedBoolean](#maxcontainswithoutcontainsisignored1boxedboolean), @@ -29,103 +29,109 @@ permits
[MaxcontainsWithoutContainsIsIgnored1BoxedList](#maxcontainswithoutcontainsisignored1boxedlist), [MaxcontainsWithoutContainsIsIgnored1BoxedMap](#maxcontainswithoutcontainsisignored1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## MaxcontainsWithoutContainsIsIgnored1BoxedVoid -public static final class MaxcontainsWithoutContainsIsIgnored1BoxedVoid
-extends [MaxcontainsWithoutContainsIsIgnored1Boxed](#maxcontainswithoutcontainsisignored1boxed) +public record MaxcontainsWithoutContainsIsIgnored1BoxedVoid
+implements [MaxcontainsWithoutContainsIsIgnored1Boxed](#maxcontainswithoutcontainsisignored1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MaxcontainsWithoutContainsIsIgnored1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MaxcontainsWithoutContainsIsIgnored1BoxedBoolean -public static final class MaxcontainsWithoutContainsIsIgnored1BoxedBoolean
-extends [MaxcontainsWithoutContainsIsIgnored1Boxed](#maxcontainswithoutcontainsisignored1boxed) +public record MaxcontainsWithoutContainsIsIgnored1BoxedBoolean
+implements [MaxcontainsWithoutContainsIsIgnored1Boxed](#maxcontainswithoutcontainsisignored1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MaxcontainsWithoutContainsIsIgnored1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MaxcontainsWithoutContainsIsIgnored1BoxedNumber -public static final class MaxcontainsWithoutContainsIsIgnored1BoxedNumber
-extends [MaxcontainsWithoutContainsIsIgnored1Boxed](#maxcontainswithoutcontainsisignored1boxed) +public record MaxcontainsWithoutContainsIsIgnored1BoxedNumber
+implements [MaxcontainsWithoutContainsIsIgnored1Boxed](#maxcontainswithoutcontainsisignored1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MaxcontainsWithoutContainsIsIgnored1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MaxcontainsWithoutContainsIsIgnored1BoxedString -public static final class MaxcontainsWithoutContainsIsIgnored1BoxedString
-extends [MaxcontainsWithoutContainsIsIgnored1Boxed](#maxcontainswithoutcontainsisignored1boxed) +public record MaxcontainsWithoutContainsIsIgnored1BoxedString
+implements [MaxcontainsWithoutContainsIsIgnored1Boxed](#maxcontainswithoutcontainsisignored1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MaxcontainsWithoutContainsIsIgnored1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MaxcontainsWithoutContainsIsIgnored1BoxedList -public static final class MaxcontainsWithoutContainsIsIgnored1BoxedList
-extends [MaxcontainsWithoutContainsIsIgnored1Boxed](#maxcontainswithoutcontainsisignored1boxed) +public record MaxcontainsWithoutContainsIsIgnored1BoxedList
+implements [MaxcontainsWithoutContainsIsIgnored1Boxed](#maxcontainswithoutcontainsisignored1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MaxcontainsWithoutContainsIsIgnored1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MaxcontainsWithoutContainsIsIgnored1BoxedMap -public static final class MaxcontainsWithoutContainsIsIgnored1BoxedMap
-extends [MaxcontainsWithoutContainsIsIgnored1Boxed](#maxcontainswithoutcontainsisignored1boxed) +public record MaxcontainsWithoutContainsIsIgnored1BoxedMap
+implements [MaxcontainsWithoutContainsIsIgnored1Boxed](#maxcontainswithoutcontainsisignored1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MaxcontainsWithoutContainsIsIgnored1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MaxcontainsWithoutContainsIsIgnored1 public static class MaxcontainsWithoutContainsIsIgnored1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [MaxcontainsWithoutContainsIsIgnored1BoxedBoolean](#maxcontainswithoutcontainsisignored1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [MaxcontainsWithoutContainsIsIgnored1BoxedMap](#maxcontainswithoutcontainsisignored1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [MaxcontainsWithoutContainsIsIgnored1BoxedList](#maxcontainswithoutcontainsisignored1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [MaxcontainsWithoutContainsIsIgnored1Boxed](#maxcontainswithoutcontainsisignored1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/MaximumValidation.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/MaximumValidation.md index 8d3299d1f57..ea90b82fd0b 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/MaximumValidation.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/MaximumValidation.md @@ -4,23 +4,23 @@ public class MaximumValidation
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [MaximumValidation.MaximumValidation1Boxed](#maximumvalidation1boxed)
abstract sealed validated payload class | -| static class | [MaximumValidation.MaximumValidation1BoxedVoid](#maximumvalidation1boxedvoid)
boxed class to store validated null payloads | -| static class | [MaximumValidation.MaximumValidation1BoxedBoolean](#maximumvalidation1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [MaximumValidation.MaximumValidation1BoxedNumber](#maximumvalidation1boxednumber)
boxed class to store validated Number payloads | -| static class | [MaximumValidation.MaximumValidation1BoxedString](#maximumvalidation1boxedstring)
boxed class to store validated String payloads | -| static class | [MaximumValidation.MaximumValidation1BoxedList](#maximumvalidation1boxedlist)
boxed class to store validated List payloads | -| static class | [MaximumValidation.MaximumValidation1BoxedMap](#maximumvalidation1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [MaximumValidation.MaximumValidation1Boxed](#maximumvalidation1boxed)
sealed interface for validated payloads | +| record | [MaximumValidation.MaximumValidation1BoxedVoid](#maximumvalidation1boxedvoid)
boxed class to store validated null payloads | +| record | [MaximumValidation.MaximumValidation1BoxedBoolean](#maximumvalidation1boxedboolean)
boxed class to store validated boolean payloads | +| record | [MaximumValidation.MaximumValidation1BoxedNumber](#maximumvalidation1boxednumber)
boxed class to store validated Number payloads | +| record | [MaximumValidation.MaximumValidation1BoxedString](#maximumvalidation1boxedstring)
boxed class to store validated String payloads | +| record | [MaximumValidation.MaximumValidation1BoxedList](#maximumvalidation1boxedlist)
boxed class to store validated List payloads | +| record | [MaximumValidation.MaximumValidation1BoxedMap](#maximumvalidation1boxedmap)
boxed class to store validated Map payloads | | static class | [MaximumValidation.MaximumValidation1](#maximumvalidation1)
schema class | ## MaximumValidation1Boxed -public static abstract sealed class MaximumValidation1Boxed
+public sealed interface MaximumValidation1Boxed
permits
[MaximumValidation1BoxedVoid](#maximumvalidation1boxedvoid), [MaximumValidation1BoxedBoolean](#maximumvalidation1boxedboolean), @@ -29,103 +29,109 @@ permits
[MaximumValidation1BoxedList](#maximumvalidation1boxedlist), [MaximumValidation1BoxedMap](#maximumvalidation1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## MaximumValidation1BoxedVoid -public static final class MaximumValidation1BoxedVoid
-extends [MaximumValidation1Boxed](#maximumvalidation1boxed) +public record MaximumValidation1BoxedVoid
+implements [MaximumValidation1Boxed](#maximumvalidation1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MaximumValidation1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MaximumValidation1BoxedBoolean -public static final class MaximumValidation1BoxedBoolean
-extends [MaximumValidation1Boxed](#maximumvalidation1boxed) +public record MaximumValidation1BoxedBoolean
+implements [MaximumValidation1Boxed](#maximumvalidation1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MaximumValidation1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MaximumValidation1BoxedNumber -public static final class MaximumValidation1BoxedNumber
-extends [MaximumValidation1Boxed](#maximumvalidation1boxed) +public record MaximumValidation1BoxedNumber
+implements [MaximumValidation1Boxed](#maximumvalidation1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MaximumValidation1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MaximumValidation1BoxedString -public static final class MaximumValidation1BoxedString
-extends [MaximumValidation1Boxed](#maximumvalidation1boxed) +public record MaximumValidation1BoxedString
+implements [MaximumValidation1Boxed](#maximumvalidation1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MaximumValidation1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MaximumValidation1BoxedList -public static final class MaximumValidation1BoxedList
-extends [MaximumValidation1Boxed](#maximumvalidation1boxed) +public record MaximumValidation1BoxedList
+implements [MaximumValidation1Boxed](#maximumvalidation1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MaximumValidation1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MaximumValidation1BoxedMap -public static final class MaximumValidation1BoxedMap
-extends [MaximumValidation1Boxed](#maximumvalidation1boxed) +public record MaximumValidation1BoxedMap
+implements [MaximumValidation1Boxed](#maximumvalidation1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MaximumValidation1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MaximumValidation1 public static class MaximumValidation1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [MaximumValidation1BoxedBoolean](#maximumvalidation1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [MaximumValidation1BoxedMap](#maximumvalidation1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [MaximumValidation1BoxedList](#maximumvalidation1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [MaximumValidation1Boxed](#maximumvalidation1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/MaximumValidationWithUnsignedInteger.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/MaximumValidationWithUnsignedInteger.md index 98e8b63439d..319d16fd33e 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/MaximumValidationWithUnsignedInteger.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/MaximumValidationWithUnsignedInteger.md @@ -4,23 +4,23 @@ public class MaximumValidationWithUnsignedInteger
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [MaximumValidationWithUnsignedInteger.MaximumValidationWithUnsignedInteger1Boxed](#maximumvalidationwithunsignedinteger1boxed)
abstract sealed validated payload class | -| static class | [MaximumValidationWithUnsignedInteger.MaximumValidationWithUnsignedInteger1BoxedVoid](#maximumvalidationwithunsignedinteger1boxedvoid)
boxed class to store validated null payloads | -| static class | [MaximumValidationWithUnsignedInteger.MaximumValidationWithUnsignedInteger1BoxedBoolean](#maximumvalidationwithunsignedinteger1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [MaximumValidationWithUnsignedInteger.MaximumValidationWithUnsignedInteger1BoxedNumber](#maximumvalidationwithunsignedinteger1boxednumber)
boxed class to store validated Number payloads | -| static class | [MaximumValidationWithUnsignedInteger.MaximumValidationWithUnsignedInteger1BoxedString](#maximumvalidationwithunsignedinteger1boxedstring)
boxed class to store validated String payloads | -| static class | [MaximumValidationWithUnsignedInteger.MaximumValidationWithUnsignedInteger1BoxedList](#maximumvalidationwithunsignedinteger1boxedlist)
boxed class to store validated List payloads | -| static class | [MaximumValidationWithUnsignedInteger.MaximumValidationWithUnsignedInteger1BoxedMap](#maximumvalidationwithunsignedinteger1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [MaximumValidationWithUnsignedInteger.MaximumValidationWithUnsignedInteger1Boxed](#maximumvalidationwithunsignedinteger1boxed)
sealed interface for validated payloads | +| record | [MaximumValidationWithUnsignedInteger.MaximumValidationWithUnsignedInteger1BoxedVoid](#maximumvalidationwithunsignedinteger1boxedvoid)
boxed class to store validated null payloads | +| record | [MaximumValidationWithUnsignedInteger.MaximumValidationWithUnsignedInteger1BoxedBoolean](#maximumvalidationwithunsignedinteger1boxedboolean)
boxed class to store validated boolean payloads | +| record | [MaximumValidationWithUnsignedInteger.MaximumValidationWithUnsignedInteger1BoxedNumber](#maximumvalidationwithunsignedinteger1boxednumber)
boxed class to store validated Number payloads | +| record | [MaximumValidationWithUnsignedInteger.MaximumValidationWithUnsignedInteger1BoxedString](#maximumvalidationwithunsignedinteger1boxedstring)
boxed class to store validated String payloads | +| record | [MaximumValidationWithUnsignedInteger.MaximumValidationWithUnsignedInteger1BoxedList](#maximumvalidationwithunsignedinteger1boxedlist)
boxed class to store validated List payloads | +| record | [MaximumValidationWithUnsignedInteger.MaximumValidationWithUnsignedInteger1BoxedMap](#maximumvalidationwithunsignedinteger1boxedmap)
boxed class to store validated Map payloads | | static class | [MaximumValidationWithUnsignedInteger.MaximumValidationWithUnsignedInteger1](#maximumvalidationwithunsignedinteger1)
schema class | ## MaximumValidationWithUnsignedInteger1Boxed -public static abstract sealed class MaximumValidationWithUnsignedInteger1Boxed
+public sealed interface MaximumValidationWithUnsignedInteger1Boxed
permits
[MaximumValidationWithUnsignedInteger1BoxedVoid](#maximumvalidationwithunsignedinteger1boxedvoid), [MaximumValidationWithUnsignedInteger1BoxedBoolean](#maximumvalidationwithunsignedinteger1boxedboolean), @@ -29,103 +29,109 @@ permits
[MaximumValidationWithUnsignedInteger1BoxedList](#maximumvalidationwithunsignedinteger1boxedlist), [MaximumValidationWithUnsignedInteger1BoxedMap](#maximumvalidationwithunsignedinteger1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## MaximumValidationWithUnsignedInteger1BoxedVoid -public static final class MaximumValidationWithUnsignedInteger1BoxedVoid
-extends [MaximumValidationWithUnsignedInteger1Boxed](#maximumvalidationwithunsignedinteger1boxed) +public record MaximumValidationWithUnsignedInteger1BoxedVoid
+implements [MaximumValidationWithUnsignedInteger1Boxed](#maximumvalidationwithunsignedinteger1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MaximumValidationWithUnsignedInteger1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MaximumValidationWithUnsignedInteger1BoxedBoolean -public static final class MaximumValidationWithUnsignedInteger1BoxedBoolean
-extends [MaximumValidationWithUnsignedInteger1Boxed](#maximumvalidationwithunsignedinteger1boxed) +public record MaximumValidationWithUnsignedInteger1BoxedBoolean
+implements [MaximumValidationWithUnsignedInteger1Boxed](#maximumvalidationwithunsignedinteger1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MaximumValidationWithUnsignedInteger1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MaximumValidationWithUnsignedInteger1BoxedNumber -public static final class MaximumValidationWithUnsignedInteger1BoxedNumber
-extends [MaximumValidationWithUnsignedInteger1Boxed](#maximumvalidationwithunsignedinteger1boxed) +public record MaximumValidationWithUnsignedInteger1BoxedNumber
+implements [MaximumValidationWithUnsignedInteger1Boxed](#maximumvalidationwithunsignedinteger1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MaximumValidationWithUnsignedInteger1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MaximumValidationWithUnsignedInteger1BoxedString -public static final class MaximumValidationWithUnsignedInteger1BoxedString
-extends [MaximumValidationWithUnsignedInteger1Boxed](#maximumvalidationwithunsignedinteger1boxed) +public record MaximumValidationWithUnsignedInteger1BoxedString
+implements [MaximumValidationWithUnsignedInteger1Boxed](#maximumvalidationwithunsignedinteger1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MaximumValidationWithUnsignedInteger1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MaximumValidationWithUnsignedInteger1BoxedList -public static final class MaximumValidationWithUnsignedInteger1BoxedList
-extends [MaximumValidationWithUnsignedInteger1Boxed](#maximumvalidationwithunsignedinteger1boxed) +public record MaximumValidationWithUnsignedInteger1BoxedList
+implements [MaximumValidationWithUnsignedInteger1Boxed](#maximumvalidationwithunsignedinteger1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MaximumValidationWithUnsignedInteger1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MaximumValidationWithUnsignedInteger1BoxedMap -public static final class MaximumValidationWithUnsignedInteger1BoxedMap
-extends [MaximumValidationWithUnsignedInteger1Boxed](#maximumvalidationwithunsignedinteger1boxed) +public record MaximumValidationWithUnsignedInteger1BoxedMap
+implements [MaximumValidationWithUnsignedInteger1Boxed](#maximumvalidationwithunsignedinteger1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MaximumValidationWithUnsignedInteger1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MaximumValidationWithUnsignedInteger1 public static class MaximumValidationWithUnsignedInteger1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [MaximumValidationWithUnsignedInteger1BoxedBoolean](#maximumvalidationwithunsignedinteger1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [MaximumValidationWithUnsignedInteger1BoxedMap](#maximumvalidationwithunsignedinteger1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [MaximumValidationWithUnsignedInteger1BoxedList](#maximumvalidationwithunsignedinteger1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [MaximumValidationWithUnsignedInteger1Boxed](#maximumvalidationwithunsignedinteger1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/MaxitemsValidation.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/MaxitemsValidation.md index 98523745270..1fd4640fa8a 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/MaxitemsValidation.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/MaxitemsValidation.md @@ -4,23 +4,23 @@ public class MaxitemsValidation
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [MaxitemsValidation.MaxitemsValidation1Boxed](#maxitemsvalidation1boxed)
abstract sealed validated payload class | -| static class | [MaxitemsValidation.MaxitemsValidation1BoxedVoid](#maxitemsvalidation1boxedvoid)
boxed class to store validated null payloads | -| static class | [MaxitemsValidation.MaxitemsValidation1BoxedBoolean](#maxitemsvalidation1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [MaxitemsValidation.MaxitemsValidation1BoxedNumber](#maxitemsvalidation1boxednumber)
boxed class to store validated Number payloads | -| static class | [MaxitemsValidation.MaxitemsValidation1BoxedString](#maxitemsvalidation1boxedstring)
boxed class to store validated String payloads | -| static class | [MaxitemsValidation.MaxitemsValidation1BoxedList](#maxitemsvalidation1boxedlist)
boxed class to store validated List payloads | -| static class | [MaxitemsValidation.MaxitemsValidation1BoxedMap](#maxitemsvalidation1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [MaxitemsValidation.MaxitemsValidation1Boxed](#maxitemsvalidation1boxed)
sealed interface for validated payloads | +| record | [MaxitemsValidation.MaxitemsValidation1BoxedVoid](#maxitemsvalidation1boxedvoid)
boxed class to store validated null payloads | +| record | [MaxitemsValidation.MaxitemsValidation1BoxedBoolean](#maxitemsvalidation1boxedboolean)
boxed class to store validated boolean payloads | +| record | [MaxitemsValidation.MaxitemsValidation1BoxedNumber](#maxitemsvalidation1boxednumber)
boxed class to store validated Number payloads | +| record | [MaxitemsValidation.MaxitemsValidation1BoxedString](#maxitemsvalidation1boxedstring)
boxed class to store validated String payloads | +| record | [MaxitemsValidation.MaxitemsValidation1BoxedList](#maxitemsvalidation1boxedlist)
boxed class to store validated List payloads | +| record | [MaxitemsValidation.MaxitemsValidation1BoxedMap](#maxitemsvalidation1boxedmap)
boxed class to store validated Map payloads | | static class | [MaxitemsValidation.MaxitemsValidation1](#maxitemsvalidation1)
schema class | ## MaxitemsValidation1Boxed -public static abstract sealed class MaxitemsValidation1Boxed
+public sealed interface MaxitemsValidation1Boxed
permits
[MaxitemsValidation1BoxedVoid](#maxitemsvalidation1boxedvoid), [MaxitemsValidation1BoxedBoolean](#maxitemsvalidation1boxedboolean), @@ -29,103 +29,109 @@ permits
[MaxitemsValidation1BoxedList](#maxitemsvalidation1boxedlist), [MaxitemsValidation1BoxedMap](#maxitemsvalidation1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## MaxitemsValidation1BoxedVoid -public static final class MaxitemsValidation1BoxedVoid
-extends [MaxitemsValidation1Boxed](#maxitemsvalidation1boxed) +public record MaxitemsValidation1BoxedVoid
+implements [MaxitemsValidation1Boxed](#maxitemsvalidation1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MaxitemsValidation1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MaxitemsValidation1BoxedBoolean -public static final class MaxitemsValidation1BoxedBoolean
-extends [MaxitemsValidation1Boxed](#maxitemsvalidation1boxed) +public record MaxitemsValidation1BoxedBoolean
+implements [MaxitemsValidation1Boxed](#maxitemsvalidation1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MaxitemsValidation1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MaxitemsValidation1BoxedNumber -public static final class MaxitemsValidation1BoxedNumber
-extends [MaxitemsValidation1Boxed](#maxitemsvalidation1boxed) +public record MaxitemsValidation1BoxedNumber
+implements [MaxitemsValidation1Boxed](#maxitemsvalidation1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MaxitemsValidation1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MaxitemsValidation1BoxedString -public static final class MaxitemsValidation1BoxedString
-extends [MaxitemsValidation1Boxed](#maxitemsvalidation1boxed) +public record MaxitemsValidation1BoxedString
+implements [MaxitemsValidation1Boxed](#maxitemsvalidation1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MaxitemsValidation1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MaxitemsValidation1BoxedList -public static final class MaxitemsValidation1BoxedList
-extends [MaxitemsValidation1Boxed](#maxitemsvalidation1boxed) +public record MaxitemsValidation1BoxedList
+implements [MaxitemsValidation1Boxed](#maxitemsvalidation1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MaxitemsValidation1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MaxitemsValidation1BoxedMap -public static final class MaxitemsValidation1BoxedMap
-extends [MaxitemsValidation1Boxed](#maxitemsvalidation1boxed) +public record MaxitemsValidation1BoxedMap
+implements [MaxitemsValidation1Boxed](#maxitemsvalidation1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MaxitemsValidation1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MaxitemsValidation1 public static class MaxitemsValidation1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [MaxitemsValidation1BoxedBoolean](#maxitemsvalidation1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [MaxitemsValidation1BoxedMap](#maxitemsvalidation1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [MaxitemsValidation1BoxedList](#maxitemsvalidation1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [MaxitemsValidation1Boxed](#maxitemsvalidation1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/MaxlengthValidation.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/MaxlengthValidation.md index 7aa1d4b333d..e828355331e 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/MaxlengthValidation.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/MaxlengthValidation.md @@ -4,23 +4,23 @@ public class MaxlengthValidation
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [MaxlengthValidation.MaxlengthValidation1Boxed](#maxlengthvalidation1boxed)
abstract sealed validated payload class | -| static class | [MaxlengthValidation.MaxlengthValidation1BoxedVoid](#maxlengthvalidation1boxedvoid)
boxed class to store validated null payloads | -| static class | [MaxlengthValidation.MaxlengthValidation1BoxedBoolean](#maxlengthvalidation1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [MaxlengthValidation.MaxlengthValidation1BoxedNumber](#maxlengthvalidation1boxednumber)
boxed class to store validated Number payloads | -| static class | [MaxlengthValidation.MaxlengthValidation1BoxedString](#maxlengthvalidation1boxedstring)
boxed class to store validated String payloads | -| static class | [MaxlengthValidation.MaxlengthValidation1BoxedList](#maxlengthvalidation1boxedlist)
boxed class to store validated List payloads | -| static class | [MaxlengthValidation.MaxlengthValidation1BoxedMap](#maxlengthvalidation1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [MaxlengthValidation.MaxlengthValidation1Boxed](#maxlengthvalidation1boxed)
sealed interface for validated payloads | +| record | [MaxlengthValidation.MaxlengthValidation1BoxedVoid](#maxlengthvalidation1boxedvoid)
boxed class to store validated null payloads | +| record | [MaxlengthValidation.MaxlengthValidation1BoxedBoolean](#maxlengthvalidation1boxedboolean)
boxed class to store validated boolean payloads | +| record | [MaxlengthValidation.MaxlengthValidation1BoxedNumber](#maxlengthvalidation1boxednumber)
boxed class to store validated Number payloads | +| record | [MaxlengthValidation.MaxlengthValidation1BoxedString](#maxlengthvalidation1boxedstring)
boxed class to store validated String payloads | +| record | [MaxlengthValidation.MaxlengthValidation1BoxedList](#maxlengthvalidation1boxedlist)
boxed class to store validated List payloads | +| record | [MaxlengthValidation.MaxlengthValidation1BoxedMap](#maxlengthvalidation1boxedmap)
boxed class to store validated Map payloads | | static class | [MaxlengthValidation.MaxlengthValidation1](#maxlengthvalidation1)
schema class | ## MaxlengthValidation1Boxed -public static abstract sealed class MaxlengthValidation1Boxed
+public sealed interface MaxlengthValidation1Boxed
permits
[MaxlengthValidation1BoxedVoid](#maxlengthvalidation1boxedvoid), [MaxlengthValidation1BoxedBoolean](#maxlengthvalidation1boxedboolean), @@ -29,103 +29,109 @@ permits
[MaxlengthValidation1BoxedList](#maxlengthvalidation1boxedlist), [MaxlengthValidation1BoxedMap](#maxlengthvalidation1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## MaxlengthValidation1BoxedVoid -public static final class MaxlengthValidation1BoxedVoid
-extends [MaxlengthValidation1Boxed](#maxlengthvalidation1boxed) +public record MaxlengthValidation1BoxedVoid
+implements [MaxlengthValidation1Boxed](#maxlengthvalidation1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MaxlengthValidation1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MaxlengthValidation1BoxedBoolean -public static final class MaxlengthValidation1BoxedBoolean
-extends [MaxlengthValidation1Boxed](#maxlengthvalidation1boxed) +public record MaxlengthValidation1BoxedBoolean
+implements [MaxlengthValidation1Boxed](#maxlengthvalidation1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MaxlengthValidation1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MaxlengthValidation1BoxedNumber -public static final class MaxlengthValidation1BoxedNumber
-extends [MaxlengthValidation1Boxed](#maxlengthvalidation1boxed) +public record MaxlengthValidation1BoxedNumber
+implements [MaxlengthValidation1Boxed](#maxlengthvalidation1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MaxlengthValidation1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MaxlengthValidation1BoxedString -public static final class MaxlengthValidation1BoxedString
-extends [MaxlengthValidation1Boxed](#maxlengthvalidation1boxed) +public record MaxlengthValidation1BoxedString
+implements [MaxlengthValidation1Boxed](#maxlengthvalidation1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MaxlengthValidation1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MaxlengthValidation1BoxedList -public static final class MaxlengthValidation1BoxedList
-extends [MaxlengthValidation1Boxed](#maxlengthvalidation1boxed) +public record MaxlengthValidation1BoxedList
+implements [MaxlengthValidation1Boxed](#maxlengthvalidation1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MaxlengthValidation1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MaxlengthValidation1BoxedMap -public static final class MaxlengthValidation1BoxedMap
-extends [MaxlengthValidation1Boxed](#maxlengthvalidation1boxed) +public record MaxlengthValidation1BoxedMap
+implements [MaxlengthValidation1Boxed](#maxlengthvalidation1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MaxlengthValidation1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MaxlengthValidation1 public static class MaxlengthValidation1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [MaxlengthValidation1BoxedBoolean](#maxlengthvalidation1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [MaxlengthValidation1BoxedMap](#maxlengthvalidation1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [MaxlengthValidation1BoxedList](#maxlengthvalidation1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [MaxlengthValidation1Boxed](#maxlengthvalidation1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/Maxproperties0MeansTheObjectIsEmpty.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/Maxproperties0MeansTheObjectIsEmpty.md index 36d25749476..0f8c895fdcd 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/Maxproperties0MeansTheObjectIsEmpty.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/Maxproperties0MeansTheObjectIsEmpty.md @@ -4,23 +4,23 @@ public class Maxproperties0MeansTheObjectIsEmpty
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Maxproperties0MeansTheObjectIsEmpty.Maxproperties0MeansTheObjectIsEmpty1Boxed](#maxproperties0meanstheobjectisempty1boxed)
abstract sealed validated payload class | -| static class | [Maxproperties0MeansTheObjectIsEmpty.Maxproperties0MeansTheObjectIsEmpty1BoxedVoid](#maxproperties0meanstheobjectisempty1boxedvoid)
boxed class to store validated null payloads | -| static class | [Maxproperties0MeansTheObjectIsEmpty.Maxproperties0MeansTheObjectIsEmpty1BoxedBoolean](#maxproperties0meanstheobjectisempty1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [Maxproperties0MeansTheObjectIsEmpty.Maxproperties0MeansTheObjectIsEmpty1BoxedNumber](#maxproperties0meanstheobjectisempty1boxednumber)
boxed class to store validated Number payloads | -| static class | [Maxproperties0MeansTheObjectIsEmpty.Maxproperties0MeansTheObjectIsEmpty1BoxedString](#maxproperties0meanstheobjectisempty1boxedstring)
boxed class to store validated String payloads | -| static class | [Maxproperties0MeansTheObjectIsEmpty.Maxproperties0MeansTheObjectIsEmpty1BoxedList](#maxproperties0meanstheobjectisempty1boxedlist)
boxed class to store validated List payloads | -| static class | [Maxproperties0MeansTheObjectIsEmpty.Maxproperties0MeansTheObjectIsEmpty1BoxedMap](#maxproperties0meanstheobjectisempty1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [Maxproperties0MeansTheObjectIsEmpty.Maxproperties0MeansTheObjectIsEmpty1Boxed](#maxproperties0meanstheobjectisempty1boxed)
sealed interface for validated payloads | +| record | [Maxproperties0MeansTheObjectIsEmpty.Maxproperties0MeansTheObjectIsEmpty1BoxedVoid](#maxproperties0meanstheobjectisempty1boxedvoid)
boxed class to store validated null payloads | +| record | [Maxproperties0MeansTheObjectIsEmpty.Maxproperties0MeansTheObjectIsEmpty1BoxedBoolean](#maxproperties0meanstheobjectisempty1boxedboolean)
boxed class to store validated boolean payloads | +| record | [Maxproperties0MeansTheObjectIsEmpty.Maxproperties0MeansTheObjectIsEmpty1BoxedNumber](#maxproperties0meanstheobjectisempty1boxednumber)
boxed class to store validated Number payloads | +| record | [Maxproperties0MeansTheObjectIsEmpty.Maxproperties0MeansTheObjectIsEmpty1BoxedString](#maxproperties0meanstheobjectisempty1boxedstring)
boxed class to store validated String payloads | +| record | [Maxproperties0MeansTheObjectIsEmpty.Maxproperties0MeansTheObjectIsEmpty1BoxedList](#maxproperties0meanstheobjectisempty1boxedlist)
boxed class to store validated List payloads | +| record | [Maxproperties0MeansTheObjectIsEmpty.Maxproperties0MeansTheObjectIsEmpty1BoxedMap](#maxproperties0meanstheobjectisempty1boxedmap)
boxed class to store validated Map payloads | | static class | [Maxproperties0MeansTheObjectIsEmpty.Maxproperties0MeansTheObjectIsEmpty1](#maxproperties0meanstheobjectisempty1)
schema class | ## Maxproperties0MeansTheObjectIsEmpty1Boxed -public static abstract sealed class Maxproperties0MeansTheObjectIsEmpty1Boxed
+public sealed interface Maxproperties0MeansTheObjectIsEmpty1Boxed
permits
[Maxproperties0MeansTheObjectIsEmpty1BoxedVoid](#maxproperties0meanstheobjectisempty1boxedvoid), [Maxproperties0MeansTheObjectIsEmpty1BoxedBoolean](#maxproperties0meanstheobjectisempty1boxedboolean), @@ -29,103 +29,109 @@ permits
[Maxproperties0MeansTheObjectIsEmpty1BoxedList](#maxproperties0meanstheobjectisempty1boxedlist), [Maxproperties0MeansTheObjectIsEmpty1BoxedMap](#maxproperties0meanstheobjectisempty1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Maxproperties0MeansTheObjectIsEmpty1BoxedVoid -public static final class Maxproperties0MeansTheObjectIsEmpty1BoxedVoid
-extends [Maxproperties0MeansTheObjectIsEmpty1Boxed](#maxproperties0meanstheobjectisempty1boxed) +public record Maxproperties0MeansTheObjectIsEmpty1BoxedVoid
+implements [Maxproperties0MeansTheObjectIsEmpty1Boxed](#maxproperties0meanstheobjectisempty1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Maxproperties0MeansTheObjectIsEmpty1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Maxproperties0MeansTheObjectIsEmpty1BoxedBoolean -public static final class Maxproperties0MeansTheObjectIsEmpty1BoxedBoolean
-extends [Maxproperties0MeansTheObjectIsEmpty1Boxed](#maxproperties0meanstheobjectisempty1boxed) +public record Maxproperties0MeansTheObjectIsEmpty1BoxedBoolean
+implements [Maxproperties0MeansTheObjectIsEmpty1Boxed](#maxproperties0meanstheobjectisempty1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Maxproperties0MeansTheObjectIsEmpty1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Maxproperties0MeansTheObjectIsEmpty1BoxedNumber -public static final class Maxproperties0MeansTheObjectIsEmpty1BoxedNumber
-extends [Maxproperties0MeansTheObjectIsEmpty1Boxed](#maxproperties0meanstheobjectisempty1boxed) +public record Maxproperties0MeansTheObjectIsEmpty1BoxedNumber
+implements [Maxproperties0MeansTheObjectIsEmpty1Boxed](#maxproperties0meanstheobjectisempty1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Maxproperties0MeansTheObjectIsEmpty1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Maxproperties0MeansTheObjectIsEmpty1BoxedString -public static final class Maxproperties0MeansTheObjectIsEmpty1BoxedString
-extends [Maxproperties0MeansTheObjectIsEmpty1Boxed](#maxproperties0meanstheobjectisempty1boxed) +public record Maxproperties0MeansTheObjectIsEmpty1BoxedString
+implements [Maxproperties0MeansTheObjectIsEmpty1Boxed](#maxproperties0meanstheobjectisempty1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Maxproperties0MeansTheObjectIsEmpty1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Maxproperties0MeansTheObjectIsEmpty1BoxedList -public static final class Maxproperties0MeansTheObjectIsEmpty1BoxedList
-extends [Maxproperties0MeansTheObjectIsEmpty1Boxed](#maxproperties0meanstheobjectisempty1boxed) +public record Maxproperties0MeansTheObjectIsEmpty1BoxedList
+implements [Maxproperties0MeansTheObjectIsEmpty1Boxed](#maxproperties0meanstheobjectisempty1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Maxproperties0MeansTheObjectIsEmpty1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Maxproperties0MeansTheObjectIsEmpty1BoxedMap -public static final class Maxproperties0MeansTheObjectIsEmpty1BoxedMap
-extends [Maxproperties0MeansTheObjectIsEmpty1Boxed](#maxproperties0meanstheobjectisempty1boxed) +public record Maxproperties0MeansTheObjectIsEmpty1BoxedMap
+implements [Maxproperties0MeansTheObjectIsEmpty1Boxed](#maxproperties0meanstheobjectisempty1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Maxproperties0MeansTheObjectIsEmpty1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Maxproperties0MeansTheObjectIsEmpty1 public static class Maxproperties0MeansTheObjectIsEmpty1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [Maxproperties0MeansTheObjectIsEmpty1BoxedBoolean](#maxproperties0meanstheobjectisempty1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Maxproperties0MeansTheObjectIsEmpty1BoxedMap](#maxproperties0meanstheobjectisempty1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [Maxproperties0MeansTheObjectIsEmpty1BoxedList](#maxproperties0meanstheobjectisempty1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Maxproperties0MeansTheObjectIsEmpty1Boxed](#maxproperties0meanstheobjectisempty1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/MaxpropertiesValidation.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/MaxpropertiesValidation.md index 7c12d46e04b..0ee228096d5 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/MaxpropertiesValidation.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/MaxpropertiesValidation.md @@ -4,23 +4,23 @@ public class MaxpropertiesValidation
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [MaxpropertiesValidation.MaxpropertiesValidation1Boxed](#maxpropertiesvalidation1boxed)
abstract sealed validated payload class | -| static class | [MaxpropertiesValidation.MaxpropertiesValidation1BoxedVoid](#maxpropertiesvalidation1boxedvoid)
boxed class to store validated null payloads | -| static class | [MaxpropertiesValidation.MaxpropertiesValidation1BoxedBoolean](#maxpropertiesvalidation1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [MaxpropertiesValidation.MaxpropertiesValidation1BoxedNumber](#maxpropertiesvalidation1boxednumber)
boxed class to store validated Number payloads | -| static class | [MaxpropertiesValidation.MaxpropertiesValidation1BoxedString](#maxpropertiesvalidation1boxedstring)
boxed class to store validated String payloads | -| static class | [MaxpropertiesValidation.MaxpropertiesValidation1BoxedList](#maxpropertiesvalidation1boxedlist)
boxed class to store validated List payloads | -| static class | [MaxpropertiesValidation.MaxpropertiesValidation1BoxedMap](#maxpropertiesvalidation1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [MaxpropertiesValidation.MaxpropertiesValidation1Boxed](#maxpropertiesvalidation1boxed)
sealed interface for validated payloads | +| record | [MaxpropertiesValidation.MaxpropertiesValidation1BoxedVoid](#maxpropertiesvalidation1boxedvoid)
boxed class to store validated null payloads | +| record | [MaxpropertiesValidation.MaxpropertiesValidation1BoxedBoolean](#maxpropertiesvalidation1boxedboolean)
boxed class to store validated boolean payloads | +| record | [MaxpropertiesValidation.MaxpropertiesValidation1BoxedNumber](#maxpropertiesvalidation1boxednumber)
boxed class to store validated Number payloads | +| record | [MaxpropertiesValidation.MaxpropertiesValidation1BoxedString](#maxpropertiesvalidation1boxedstring)
boxed class to store validated String payloads | +| record | [MaxpropertiesValidation.MaxpropertiesValidation1BoxedList](#maxpropertiesvalidation1boxedlist)
boxed class to store validated List payloads | +| record | [MaxpropertiesValidation.MaxpropertiesValidation1BoxedMap](#maxpropertiesvalidation1boxedmap)
boxed class to store validated Map payloads | | static class | [MaxpropertiesValidation.MaxpropertiesValidation1](#maxpropertiesvalidation1)
schema class | ## MaxpropertiesValidation1Boxed -public static abstract sealed class MaxpropertiesValidation1Boxed
+public sealed interface MaxpropertiesValidation1Boxed
permits
[MaxpropertiesValidation1BoxedVoid](#maxpropertiesvalidation1boxedvoid), [MaxpropertiesValidation1BoxedBoolean](#maxpropertiesvalidation1boxedboolean), @@ -29,103 +29,109 @@ permits
[MaxpropertiesValidation1BoxedList](#maxpropertiesvalidation1boxedlist), [MaxpropertiesValidation1BoxedMap](#maxpropertiesvalidation1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## MaxpropertiesValidation1BoxedVoid -public static final class MaxpropertiesValidation1BoxedVoid
-extends [MaxpropertiesValidation1Boxed](#maxpropertiesvalidation1boxed) +public record MaxpropertiesValidation1BoxedVoid
+implements [MaxpropertiesValidation1Boxed](#maxpropertiesvalidation1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MaxpropertiesValidation1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MaxpropertiesValidation1BoxedBoolean -public static final class MaxpropertiesValidation1BoxedBoolean
-extends [MaxpropertiesValidation1Boxed](#maxpropertiesvalidation1boxed) +public record MaxpropertiesValidation1BoxedBoolean
+implements [MaxpropertiesValidation1Boxed](#maxpropertiesvalidation1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MaxpropertiesValidation1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MaxpropertiesValidation1BoxedNumber -public static final class MaxpropertiesValidation1BoxedNumber
-extends [MaxpropertiesValidation1Boxed](#maxpropertiesvalidation1boxed) +public record MaxpropertiesValidation1BoxedNumber
+implements [MaxpropertiesValidation1Boxed](#maxpropertiesvalidation1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MaxpropertiesValidation1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MaxpropertiesValidation1BoxedString -public static final class MaxpropertiesValidation1BoxedString
-extends [MaxpropertiesValidation1Boxed](#maxpropertiesvalidation1boxed) +public record MaxpropertiesValidation1BoxedString
+implements [MaxpropertiesValidation1Boxed](#maxpropertiesvalidation1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MaxpropertiesValidation1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MaxpropertiesValidation1BoxedList -public static final class MaxpropertiesValidation1BoxedList
-extends [MaxpropertiesValidation1Boxed](#maxpropertiesvalidation1boxed) +public record MaxpropertiesValidation1BoxedList
+implements [MaxpropertiesValidation1Boxed](#maxpropertiesvalidation1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MaxpropertiesValidation1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MaxpropertiesValidation1BoxedMap -public static final class MaxpropertiesValidation1BoxedMap
-extends [MaxpropertiesValidation1Boxed](#maxpropertiesvalidation1boxed) +public record MaxpropertiesValidation1BoxedMap
+implements [MaxpropertiesValidation1Boxed](#maxpropertiesvalidation1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MaxpropertiesValidation1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MaxpropertiesValidation1 public static class MaxpropertiesValidation1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [MaxpropertiesValidation1BoxedBoolean](#maxpropertiesvalidation1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [MaxpropertiesValidation1BoxedMap](#maxpropertiesvalidation1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [MaxpropertiesValidation1BoxedList](#maxpropertiesvalidation1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [MaxpropertiesValidation1Boxed](#maxpropertiesvalidation1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/MincontainsWithoutContainsIsIgnored.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/MincontainsWithoutContainsIsIgnored.md index 59c302b579d..4bfad67b17b 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/MincontainsWithoutContainsIsIgnored.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/MincontainsWithoutContainsIsIgnored.md @@ -4,23 +4,23 @@ public class MincontainsWithoutContainsIsIgnored
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [MincontainsWithoutContainsIsIgnored.MincontainsWithoutContainsIsIgnored1Boxed](#mincontainswithoutcontainsisignored1boxed)
abstract sealed validated payload class | -| static class | [MincontainsWithoutContainsIsIgnored.MincontainsWithoutContainsIsIgnored1BoxedVoid](#mincontainswithoutcontainsisignored1boxedvoid)
boxed class to store validated null payloads | -| static class | [MincontainsWithoutContainsIsIgnored.MincontainsWithoutContainsIsIgnored1BoxedBoolean](#mincontainswithoutcontainsisignored1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [MincontainsWithoutContainsIsIgnored.MincontainsWithoutContainsIsIgnored1BoxedNumber](#mincontainswithoutcontainsisignored1boxednumber)
boxed class to store validated Number payloads | -| static class | [MincontainsWithoutContainsIsIgnored.MincontainsWithoutContainsIsIgnored1BoxedString](#mincontainswithoutcontainsisignored1boxedstring)
boxed class to store validated String payloads | -| static class | [MincontainsWithoutContainsIsIgnored.MincontainsWithoutContainsIsIgnored1BoxedList](#mincontainswithoutcontainsisignored1boxedlist)
boxed class to store validated List payloads | -| static class | [MincontainsWithoutContainsIsIgnored.MincontainsWithoutContainsIsIgnored1BoxedMap](#mincontainswithoutcontainsisignored1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [MincontainsWithoutContainsIsIgnored.MincontainsWithoutContainsIsIgnored1Boxed](#mincontainswithoutcontainsisignored1boxed)
sealed interface for validated payloads | +| record | [MincontainsWithoutContainsIsIgnored.MincontainsWithoutContainsIsIgnored1BoxedVoid](#mincontainswithoutcontainsisignored1boxedvoid)
boxed class to store validated null payloads | +| record | [MincontainsWithoutContainsIsIgnored.MincontainsWithoutContainsIsIgnored1BoxedBoolean](#mincontainswithoutcontainsisignored1boxedboolean)
boxed class to store validated boolean payloads | +| record | [MincontainsWithoutContainsIsIgnored.MincontainsWithoutContainsIsIgnored1BoxedNumber](#mincontainswithoutcontainsisignored1boxednumber)
boxed class to store validated Number payloads | +| record | [MincontainsWithoutContainsIsIgnored.MincontainsWithoutContainsIsIgnored1BoxedString](#mincontainswithoutcontainsisignored1boxedstring)
boxed class to store validated String payloads | +| record | [MincontainsWithoutContainsIsIgnored.MincontainsWithoutContainsIsIgnored1BoxedList](#mincontainswithoutcontainsisignored1boxedlist)
boxed class to store validated List payloads | +| record | [MincontainsWithoutContainsIsIgnored.MincontainsWithoutContainsIsIgnored1BoxedMap](#mincontainswithoutcontainsisignored1boxedmap)
boxed class to store validated Map payloads | | static class | [MincontainsWithoutContainsIsIgnored.MincontainsWithoutContainsIsIgnored1](#mincontainswithoutcontainsisignored1)
schema class | ## MincontainsWithoutContainsIsIgnored1Boxed -public static abstract sealed class MincontainsWithoutContainsIsIgnored1Boxed
+public sealed interface MincontainsWithoutContainsIsIgnored1Boxed
permits
[MincontainsWithoutContainsIsIgnored1BoxedVoid](#mincontainswithoutcontainsisignored1boxedvoid), [MincontainsWithoutContainsIsIgnored1BoxedBoolean](#mincontainswithoutcontainsisignored1boxedboolean), @@ -29,103 +29,109 @@ permits
[MincontainsWithoutContainsIsIgnored1BoxedList](#mincontainswithoutcontainsisignored1boxedlist), [MincontainsWithoutContainsIsIgnored1BoxedMap](#mincontainswithoutcontainsisignored1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## MincontainsWithoutContainsIsIgnored1BoxedVoid -public static final class MincontainsWithoutContainsIsIgnored1BoxedVoid
-extends [MincontainsWithoutContainsIsIgnored1Boxed](#mincontainswithoutcontainsisignored1boxed) +public record MincontainsWithoutContainsIsIgnored1BoxedVoid
+implements [MincontainsWithoutContainsIsIgnored1Boxed](#mincontainswithoutcontainsisignored1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MincontainsWithoutContainsIsIgnored1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MincontainsWithoutContainsIsIgnored1BoxedBoolean -public static final class MincontainsWithoutContainsIsIgnored1BoxedBoolean
-extends [MincontainsWithoutContainsIsIgnored1Boxed](#mincontainswithoutcontainsisignored1boxed) +public record MincontainsWithoutContainsIsIgnored1BoxedBoolean
+implements [MincontainsWithoutContainsIsIgnored1Boxed](#mincontainswithoutcontainsisignored1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MincontainsWithoutContainsIsIgnored1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MincontainsWithoutContainsIsIgnored1BoxedNumber -public static final class MincontainsWithoutContainsIsIgnored1BoxedNumber
-extends [MincontainsWithoutContainsIsIgnored1Boxed](#mincontainswithoutcontainsisignored1boxed) +public record MincontainsWithoutContainsIsIgnored1BoxedNumber
+implements [MincontainsWithoutContainsIsIgnored1Boxed](#mincontainswithoutcontainsisignored1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MincontainsWithoutContainsIsIgnored1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MincontainsWithoutContainsIsIgnored1BoxedString -public static final class MincontainsWithoutContainsIsIgnored1BoxedString
-extends [MincontainsWithoutContainsIsIgnored1Boxed](#mincontainswithoutcontainsisignored1boxed) +public record MincontainsWithoutContainsIsIgnored1BoxedString
+implements [MincontainsWithoutContainsIsIgnored1Boxed](#mincontainswithoutcontainsisignored1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MincontainsWithoutContainsIsIgnored1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MincontainsWithoutContainsIsIgnored1BoxedList -public static final class MincontainsWithoutContainsIsIgnored1BoxedList
-extends [MincontainsWithoutContainsIsIgnored1Boxed](#mincontainswithoutcontainsisignored1boxed) +public record MincontainsWithoutContainsIsIgnored1BoxedList
+implements [MincontainsWithoutContainsIsIgnored1Boxed](#mincontainswithoutcontainsisignored1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MincontainsWithoutContainsIsIgnored1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MincontainsWithoutContainsIsIgnored1BoxedMap -public static final class MincontainsWithoutContainsIsIgnored1BoxedMap
-extends [MincontainsWithoutContainsIsIgnored1Boxed](#mincontainswithoutcontainsisignored1boxed) +public record MincontainsWithoutContainsIsIgnored1BoxedMap
+implements [MincontainsWithoutContainsIsIgnored1Boxed](#mincontainswithoutcontainsisignored1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MincontainsWithoutContainsIsIgnored1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MincontainsWithoutContainsIsIgnored1 public static class MincontainsWithoutContainsIsIgnored1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [MincontainsWithoutContainsIsIgnored1BoxedBoolean](#mincontainswithoutcontainsisignored1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [MincontainsWithoutContainsIsIgnored1BoxedMap](#mincontainswithoutcontainsisignored1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [MincontainsWithoutContainsIsIgnored1BoxedList](#mincontainswithoutcontainsisignored1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [MincontainsWithoutContainsIsIgnored1Boxed](#mincontainswithoutcontainsisignored1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/MinimumValidation.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/MinimumValidation.md index d08a4b87b8d..26df31b73bd 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/MinimumValidation.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/MinimumValidation.md @@ -4,23 +4,23 @@ public class MinimumValidation
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [MinimumValidation.MinimumValidation1Boxed](#minimumvalidation1boxed)
abstract sealed validated payload class | -| static class | [MinimumValidation.MinimumValidation1BoxedVoid](#minimumvalidation1boxedvoid)
boxed class to store validated null payloads | -| static class | [MinimumValidation.MinimumValidation1BoxedBoolean](#minimumvalidation1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [MinimumValidation.MinimumValidation1BoxedNumber](#minimumvalidation1boxednumber)
boxed class to store validated Number payloads | -| static class | [MinimumValidation.MinimumValidation1BoxedString](#minimumvalidation1boxedstring)
boxed class to store validated String payloads | -| static class | [MinimumValidation.MinimumValidation1BoxedList](#minimumvalidation1boxedlist)
boxed class to store validated List payloads | -| static class | [MinimumValidation.MinimumValidation1BoxedMap](#minimumvalidation1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [MinimumValidation.MinimumValidation1Boxed](#minimumvalidation1boxed)
sealed interface for validated payloads | +| record | [MinimumValidation.MinimumValidation1BoxedVoid](#minimumvalidation1boxedvoid)
boxed class to store validated null payloads | +| record | [MinimumValidation.MinimumValidation1BoxedBoolean](#minimumvalidation1boxedboolean)
boxed class to store validated boolean payloads | +| record | [MinimumValidation.MinimumValidation1BoxedNumber](#minimumvalidation1boxednumber)
boxed class to store validated Number payloads | +| record | [MinimumValidation.MinimumValidation1BoxedString](#minimumvalidation1boxedstring)
boxed class to store validated String payloads | +| record | [MinimumValidation.MinimumValidation1BoxedList](#minimumvalidation1boxedlist)
boxed class to store validated List payloads | +| record | [MinimumValidation.MinimumValidation1BoxedMap](#minimumvalidation1boxedmap)
boxed class to store validated Map payloads | | static class | [MinimumValidation.MinimumValidation1](#minimumvalidation1)
schema class | ## MinimumValidation1Boxed -public static abstract sealed class MinimumValidation1Boxed
+public sealed interface MinimumValidation1Boxed
permits
[MinimumValidation1BoxedVoid](#minimumvalidation1boxedvoid), [MinimumValidation1BoxedBoolean](#minimumvalidation1boxedboolean), @@ -29,103 +29,109 @@ permits
[MinimumValidation1BoxedList](#minimumvalidation1boxedlist), [MinimumValidation1BoxedMap](#minimumvalidation1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## MinimumValidation1BoxedVoid -public static final class MinimumValidation1BoxedVoid
-extends [MinimumValidation1Boxed](#minimumvalidation1boxed) +public record MinimumValidation1BoxedVoid
+implements [MinimumValidation1Boxed](#minimumvalidation1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MinimumValidation1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MinimumValidation1BoxedBoolean -public static final class MinimumValidation1BoxedBoolean
-extends [MinimumValidation1Boxed](#minimumvalidation1boxed) +public record MinimumValidation1BoxedBoolean
+implements [MinimumValidation1Boxed](#minimumvalidation1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MinimumValidation1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MinimumValidation1BoxedNumber -public static final class MinimumValidation1BoxedNumber
-extends [MinimumValidation1Boxed](#minimumvalidation1boxed) +public record MinimumValidation1BoxedNumber
+implements [MinimumValidation1Boxed](#minimumvalidation1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MinimumValidation1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MinimumValidation1BoxedString -public static final class MinimumValidation1BoxedString
-extends [MinimumValidation1Boxed](#minimumvalidation1boxed) +public record MinimumValidation1BoxedString
+implements [MinimumValidation1Boxed](#minimumvalidation1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MinimumValidation1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MinimumValidation1BoxedList -public static final class MinimumValidation1BoxedList
-extends [MinimumValidation1Boxed](#minimumvalidation1boxed) +public record MinimumValidation1BoxedList
+implements [MinimumValidation1Boxed](#minimumvalidation1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MinimumValidation1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MinimumValidation1BoxedMap -public static final class MinimumValidation1BoxedMap
-extends [MinimumValidation1Boxed](#minimumvalidation1boxed) +public record MinimumValidation1BoxedMap
+implements [MinimumValidation1Boxed](#minimumvalidation1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MinimumValidation1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MinimumValidation1 public static class MinimumValidation1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [MinimumValidation1BoxedBoolean](#minimumvalidation1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [MinimumValidation1BoxedMap](#minimumvalidation1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [MinimumValidation1BoxedList](#minimumvalidation1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [MinimumValidation1Boxed](#minimumvalidation1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/MinimumValidationWithSignedInteger.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/MinimumValidationWithSignedInteger.md index d0e27071bf5..8cf8b08f2a7 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/MinimumValidationWithSignedInteger.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/MinimumValidationWithSignedInteger.md @@ -4,23 +4,23 @@ public class MinimumValidationWithSignedInteger
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [MinimumValidationWithSignedInteger.MinimumValidationWithSignedInteger1Boxed](#minimumvalidationwithsignedinteger1boxed)
abstract sealed validated payload class | -| static class | [MinimumValidationWithSignedInteger.MinimumValidationWithSignedInteger1BoxedVoid](#minimumvalidationwithsignedinteger1boxedvoid)
boxed class to store validated null payloads | -| static class | [MinimumValidationWithSignedInteger.MinimumValidationWithSignedInteger1BoxedBoolean](#minimumvalidationwithsignedinteger1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [MinimumValidationWithSignedInteger.MinimumValidationWithSignedInteger1BoxedNumber](#minimumvalidationwithsignedinteger1boxednumber)
boxed class to store validated Number payloads | -| static class | [MinimumValidationWithSignedInteger.MinimumValidationWithSignedInteger1BoxedString](#minimumvalidationwithsignedinteger1boxedstring)
boxed class to store validated String payloads | -| static class | [MinimumValidationWithSignedInteger.MinimumValidationWithSignedInteger1BoxedList](#minimumvalidationwithsignedinteger1boxedlist)
boxed class to store validated List payloads | -| static class | [MinimumValidationWithSignedInteger.MinimumValidationWithSignedInteger1BoxedMap](#minimumvalidationwithsignedinteger1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [MinimumValidationWithSignedInteger.MinimumValidationWithSignedInteger1Boxed](#minimumvalidationwithsignedinteger1boxed)
sealed interface for validated payloads | +| record | [MinimumValidationWithSignedInteger.MinimumValidationWithSignedInteger1BoxedVoid](#minimumvalidationwithsignedinteger1boxedvoid)
boxed class to store validated null payloads | +| record | [MinimumValidationWithSignedInteger.MinimumValidationWithSignedInteger1BoxedBoolean](#minimumvalidationwithsignedinteger1boxedboolean)
boxed class to store validated boolean payloads | +| record | [MinimumValidationWithSignedInteger.MinimumValidationWithSignedInteger1BoxedNumber](#minimumvalidationwithsignedinteger1boxednumber)
boxed class to store validated Number payloads | +| record | [MinimumValidationWithSignedInteger.MinimumValidationWithSignedInteger1BoxedString](#minimumvalidationwithsignedinteger1boxedstring)
boxed class to store validated String payloads | +| record | [MinimumValidationWithSignedInteger.MinimumValidationWithSignedInteger1BoxedList](#minimumvalidationwithsignedinteger1boxedlist)
boxed class to store validated List payloads | +| record | [MinimumValidationWithSignedInteger.MinimumValidationWithSignedInteger1BoxedMap](#minimumvalidationwithsignedinteger1boxedmap)
boxed class to store validated Map payloads | | static class | [MinimumValidationWithSignedInteger.MinimumValidationWithSignedInteger1](#minimumvalidationwithsignedinteger1)
schema class | ## MinimumValidationWithSignedInteger1Boxed -public static abstract sealed class MinimumValidationWithSignedInteger1Boxed
+public sealed interface MinimumValidationWithSignedInteger1Boxed
permits
[MinimumValidationWithSignedInteger1BoxedVoid](#minimumvalidationwithsignedinteger1boxedvoid), [MinimumValidationWithSignedInteger1BoxedBoolean](#minimumvalidationwithsignedinteger1boxedboolean), @@ -29,103 +29,109 @@ permits
[MinimumValidationWithSignedInteger1BoxedList](#minimumvalidationwithsignedinteger1boxedlist), [MinimumValidationWithSignedInteger1BoxedMap](#minimumvalidationwithsignedinteger1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## MinimumValidationWithSignedInteger1BoxedVoid -public static final class MinimumValidationWithSignedInteger1BoxedVoid
-extends [MinimumValidationWithSignedInteger1Boxed](#minimumvalidationwithsignedinteger1boxed) +public record MinimumValidationWithSignedInteger1BoxedVoid
+implements [MinimumValidationWithSignedInteger1Boxed](#minimumvalidationwithsignedinteger1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MinimumValidationWithSignedInteger1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MinimumValidationWithSignedInteger1BoxedBoolean -public static final class MinimumValidationWithSignedInteger1BoxedBoolean
-extends [MinimumValidationWithSignedInteger1Boxed](#minimumvalidationwithsignedinteger1boxed) +public record MinimumValidationWithSignedInteger1BoxedBoolean
+implements [MinimumValidationWithSignedInteger1Boxed](#minimumvalidationwithsignedinteger1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MinimumValidationWithSignedInteger1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MinimumValidationWithSignedInteger1BoxedNumber -public static final class MinimumValidationWithSignedInteger1BoxedNumber
-extends [MinimumValidationWithSignedInteger1Boxed](#minimumvalidationwithsignedinteger1boxed) +public record MinimumValidationWithSignedInteger1BoxedNumber
+implements [MinimumValidationWithSignedInteger1Boxed](#minimumvalidationwithsignedinteger1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MinimumValidationWithSignedInteger1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MinimumValidationWithSignedInteger1BoxedString -public static final class MinimumValidationWithSignedInteger1BoxedString
-extends [MinimumValidationWithSignedInteger1Boxed](#minimumvalidationwithsignedinteger1boxed) +public record MinimumValidationWithSignedInteger1BoxedString
+implements [MinimumValidationWithSignedInteger1Boxed](#minimumvalidationwithsignedinteger1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MinimumValidationWithSignedInteger1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MinimumValidationWithSignedInteger1BoxedList -public static final class MinimumValidationWithSignedInteger1BoxedList
-extends [MinimumValidationWithSignedInteger1Boxed](#minimumvalidationwithsignedinteger1boxed) +public record MinimumValidationWithSignedInteger1BoxedList
+implements [MinimumValidationWithSignedInteger1Boxed](#minimumvalidationwithsignedinteger1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MinimumValidationWithSignedInteger1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MinimumValidationWithSignedInteger1BoxedMap -public static final class MinimumValidationWithSignedInteger1BoxedMap
-extends [MinimumValidationWithSignedInteger1Boxed](#minimumvalidationwithsignedinteger1boxed) +public record MinimumValidationWithSignedInteger1BoxedMap
+implements [MinimumValidationWithSignedInteger1Boxed](#minimumvalidationwithsignedinteger1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MinimumValidationWithSignedInteger1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MinimumValidationWithSignedInteger1 public static class MinimumValidationWithSignedInteger1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [MinimumValidationWithSignedInteger1BoxedBoolean](#minimumvalidationwithsignedinteger1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [MinimumValidationWithSignedInteger1BoxedMap](#minimumvalidationwithsignedinteger1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [MinimumValidationWithSignedInteger1BoxedList](#minimumvalidationwithsignedinteger1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [MinimumValidationWithSignedInteger1Boxed](#minimumvalidationwithsignedinteger1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/MinitemsValidation.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/MinitemsValidation.md index 64dda8d0ea0..0f8a46474b2 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/MinitemsValidation.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/MinitemsValidation.md @@ -4,23 +4,23 @@ public class MinitemsValidation
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [MinitemsValidation.MinitemsValidation1Boxed](#minitemsvalidation1boxed)
abstract sealed validated payload class | -| static class | [MinitemsValidation.MinitemsValidation1BoxedVoid](#minitemsvalidation1boxedvoid)
boxed class to store validated null payloads | -| static class | [MinitemsValidation.MinitemsValidation1BoxedBoolean](#minitemsvalidation1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [MinitemsValidation.MinitemsValidation1BoxedNumber](#minitemsvalidation1boxednumber)
boxed class to store validated Number payloads | -| static class | [MinitemsValidation.MinitemsValidation1BoxedString](#minitemsvalidation1boxedstring)
boxed class to store validated String payloads | -| static class | [MinitemsValidation.MinitemsValidation1BoxedList](#minitemsvalidation1boxedlist)
boxed class to store validated List payloads | -| static class | [MinitemsValidation.MinitemsValidation1BoxedMap](#minitemsvalidation1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [MinitemsValidation.MinitemsValidation1Boxed](#minitemsvalidation1boxed)
sealed interface for validated payloads | +| record | [MinitemsValidation.MinitemsValidation1BoxedVoid](#minitemsvalidation1boxedvoid)
boxed class to store validated null payloads | +| record | [MinitemsValidation.MinitemsValidation1BoxedBoolean](#minitemsvalidation1boxedboolean)
boxed class to store validated boolean payloads | +| record | [MinitemsValidation.MinitemsValidation1BoxedNumber](#minitemsvalidation1boxednumber)
boxed class to store validated Number payloads | +| record | [MinitemsValidation.MinitemsValidation1BoxedString](#minitemsvalidation1boxedstring)
boxed class to store validated String payloads | +| record | [MinitemsValidation.MinitemsValidation1BoxedList](#minitemsvalidation1boxedlist)
boxed class to store validated List payloads | +| record | [MinitemsValidation.MinitemsValidation1BoxedMap](#minitemsvalidation1boxedmap)
boxed class to store validated Map payloads | | static class | [MinitemsValidation.MinitemsValidation1](#minitemsvalidation1)
schema class | ## MinitemsValidation1Boxed -public static abstract sealed class MinitemsValidation1Boxed
+public sealed interface MinitemsValidation1Boxed
permits
[MinitemsValidation1BoxedVoid](#minitemsvalidation1boxedvoid), [MinitemsValidation1BoxedBoolean](#minitemsvalidation1boxedboolean), @@ -29,103 +29,109 @@ permits
[MinitemsValidation1BoxedList](#minitemsvalidation1boxedlist), [MinitemsValidation1BoxedMap](#minitemsvalidation1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## MinitemsValidation1BoxedVoid -public static final class MinitemsValidation1BoxedVoid
-extends [MinitemsValidation1Boxed](#minitemsvalidation1boxed) +public record MinitemsValidation1BoxedVoid
+implements [MinitemsValidation1Boxed](#minitemsvalidation1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MinitemsValidation1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MinitemsValidation1BoxedBoolean -public static final class MinitemsValidation1BoxedBoolean
-extends [MinitemsValidation1Boxed](#minitemsvalidation1boxed) +public record MinitemsValidation1BoxedBoolean
+implements [MinitemsValidation1Boxed](#minitemsvalidation1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MinitemsValidation1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MinitemsValidation1BoxedNumber -public static final class MinitemsValidation1BoxedNumber
-extends [MinitemsValidation1Boxed](#minitemsvalidation1boxed) +public record MinitemsValidation1BoxedNumber
+implements [MinitemsValidation1Boxed](#minitemsvalidation1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MinitemsValidation1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MinitemsValidation1BoxedString -public static final class MinitemsValidation1BoxedString
-extends [MinitemsValidation1Boxed](#minitemsvalidation1boxed) +public record MinitemsValidation1BoxedString
+implements [MinitemsValidation1Boxed](#minitemsvalidation1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MinitemsValidation1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MinitemsValidation1BoxedList -public static final class MinitemsValidation1BoxedList
-extends [MinitemsValidation1Boxed](#minitemsvalidation1boxed) +public record MinitemsValidation1BoxedList
+implements [MinitemsValidation1Boxed](#minitemsvalidation1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MinitemsValidation1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MinitemsValidation1BoxedMap -public static final class MinitemsValidation1BoxedMap
-extends [MinitemsValidation1Boxed](#minitemsvalidation1boxed) +public record MinitemsValidation1BoxedMap
+implements [MinitemsValidation1Boxed](#minitemsvalidation1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MinitemsValidation1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MinitemsValidation1 public static class MinitemsValidation1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [MinitemsValidation1BoxedBoolean](#minitemsvalidation1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [MinitemsValidation1BoxedMap](#minitemsvalidation1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [MinitemsValidation1BoxedList](#minitemsvalidation1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [MinitemsValidation1Boxed](#minitemsvalidation1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/MinlengthValidation.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/MinlengthValidation.md index 90c47d11e25..bf689a4ffa4 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/MinlengthValidation.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/MinlengthValidation.md @@ -4,23 +4,23 @@ public class MinlengthValidation
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [MinlengthValidation.MinlengthValidation1Boxed](#minlengthvalidation1boxed)
abstract sealed validated payload class | -| static class | [MinlengthValidation.MinlengthValidation1BoxedVoid](#minlengthvalidation1boxedvoid)
boxed class to store validated null payloads | -| static class | [MinlengthValidation.MinlengthValidation1BoxedBoolean](#minlengthvalidation1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [MinlengthValidation.MinlengthValidation1BoxedNumber](#minlengthvalidation1boxednumber)
boxed class to store validated Number payloads | -| static class | [MinlengthValidation.MinlengthValidation1BoxedString](#minlengthvalidation1boxedstring)
boxed class to store validated String payloads | -| static class | [MinlengthValidation.MinlengthValidation1BoxedList](#minlengthvalidation1boxedlist)
boxed class to store validated List payloads | -| static class | [MinlengthValidation.MinlengthValidation1BoxedMap](#minlengthvalidation1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [MinlengthValidation.MinlengthValidation1Boxed](#minlengthvalidation1boxed)
sealed interface for validated payloads | +| record | [MinlengthValidation.MinlengthValidation1BoxedVoid](#minlengthvalidation1boxedvoid)
boxed class to store validated null payloads | +| record | [MinlengthValidation.MinlengthValidation1BoxedBoolean](#minlengthvalidation1boxedboolean)
boxed class to store validated boolean payloads | +| record | [MinlengthValidation.MinlengthValidation1BoxedNumber](#minlengthvalidation1boxednumber)
boxed class to store validated Number payloads | +| record | [MinlengthValidation.MinlengthValidation1BoxedString](#minlengthvalidation1boxedstring)
boxed class to store validated String payloads | +| record | [MinlengthValidation.MinlengthValidation1BoxedList](#minlengthvalidation1boxedlist)
boxed class to store validated List payloads | +| record | [MinlengthValidation.MinlengthValidation1BoxedMap](#minlengthvalidation1boxedmap)
boxed class to store validated Map payloads | | static class | [MinlengthValidation.MinlengthValidation1](#minlengthvalidation1)
schema class | ## MinlengthValidation1Boxed -public static abstract sealed class MinlengthValidation1Boxed
+public sealed interface MinlengthValidation1Boxed
permits
[MinlengthValidation1BoxedVoid](#minlengthvalidation1boxedvoid), [MinlengthValidation1BoxedBoolean](#minlengthvalidation1boxedboolean), @@ -29,103 +29,109 @@ permits
[MinlengthValidation1BoxedList](#minlengthvalidation1boxedlist), [MinlengthValidation1BoxedMap](#minlengthvalidation1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## MinlengthValidation1BoxedVoid -public static final class MinlengthValidation1BoxedVoid
-extends [MinlengthValidation1Boxed](#minlengthvalidation1boxed) +public record MinlengthValidation1BoxedVoid
+implements [MinlengthValidation1Boxed](#minlengthvalidation1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MinlengthValidation1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MinlengthValidation1BoxedBoolean -public static final class MinlengthValidation1BoxedBoolean
-extends [MinlengthValidation1Boxed](#minlengthvalidation1boxed) +public record MinlengthValidation1BoxedBoolean
+implements [MinlengthValidation1Boxed](#minlengthvalidation1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MinlengthValidation1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MinlengthValidation1BoxedNumber -public static final class MinlengthValidation1BoxedNumber
-extends [MinlengthValidation1Boxed](#minlengthvalidation1boxed) +public record MinlengthValidation1BoxedNumber
+implements [MinlengthValidation1Boxed](#minlengthvalidation1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MinlengthValidation1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MinlengthValidation1BoxedString -public static final class MinlengthValidation1BoxedString
-extends [MinlengthValidation1Boxed](#minlengthvalidation1boxed) +public record MinlengthValidation1BoxedString
+implements [MinlengthValidation1Boxed](#minlengthvalidation1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MinlengthValidation1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MinlengthValidation1BoxedList -public static final class MinlengthValidation1BoxedList
-extends [MinlengthValidation1Boxed](#minlengthvalidation1boxed) +public record MinlengthValidation1BoxedList
+implements [MinlengthValidation1Boxed](#minlengthvalidation1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MinlengthValidation1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MinlengthValidation1BoxedMap -public static final class MinlengthValidation1BoxedMap
-extends [MinlengthValidation1Boxed](#minlengthvalidation1boxed) +public record MinlengthValidation1BoxedMap
+implements [MinlengthValidation1Boxed](#minlengthvalidation1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MinlengthValidation1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MinlengthValidation1 public static class MinlengthValidation1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [MinlengthValidation1BoxedBoolean](#minlengthvalidation1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [MinlengthValidation1BoxedMap](#minlengthvalidation1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [MinlengthValidation1BoxedList](#minlengthvalidation1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [MinlengthValidation1Boxed](#minlengthvalidation1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/MinpropertiesValidation.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/MinpropertiesValidation.md index a93e08d7d8f..43f7370e423 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/MinpropertiesValidation.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/MinpropertiesValidation.md @@ -4,23 +4,23 @@ public class MinpropertiesValidation
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [MinpropertiesValidation.MinpropertiesValidation1Boxed](#minpropertiesvalidation1boxed)
abstract sealed validated payload class | -| static class | [MinpropertiesValidation.MinpropertiesValidation1BoxedVoid](#minpropertiesvalidation1boxedvoid)
boxed class to store validated null payloads | -| static class | [MinpropertiesValidation.MinpropertiesValidation1BoxedBoolean](#minpropertiesvalidation1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [MinpropertiesValidation.MinpropertiesValidation1BoxedNumber](#minpropertiesvalidation1boxednumber)
boxed class to store validated Number payloads | -| static class | [MinpropertiesValidation.MinpropertiesValidation1BoxedString](#minpropertiesvalidation1boxedstring)
boxed class to store validated String payloads | -| static class | [MinpropertiesValidation.MinpropertiesValidation1BoxedList](#minpropertiesvalidation1boxedlist)
boxed class to store validated List payloads | -| static class | [MinpropertiesValidation.MinpropertiesValidation1BoxedMap](#minpropertiesvalidation1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [MinpropertiesValidation.MinpropertiesValidation1Boxed](#minpropertiesvalidation1boxed)
sealed interface for validated payloads | +| record | [MinpropertiesValidation.MinpropertiesValidation1BoxedVoid](#minpropertiesvalidation1boxedvoid)
boxed class to store validated null payloads | +| record | [MinpropertiesValidation.MinpropertiesValidation1BoxedBoolean](#minpropertiesvalidation1boxedboolean)
boxed class to store validated boolean payloads | +| record | [MinpropertiesValidation.MinpropertiesValidation1BoxedNumber](#minpropertiesvalidation1boxednumber)
boxed class to store validated Number payloads | +| record | [MinpropertiesValidation.MinpropertiesValidation1BoxedString](#minpropertiesvalidation1boxedstring)
boxed class to store validated String payloads | +| record | [MinpropertiesValidation.MinpropertiesValidation1BoxedList](#minpropertiesvalidation1boxedlist)
boxed class to store validated List payloads | +| record | [MinpropertiesValidation.MinpropertiesValidation1BoxedMap](#minpropertiesvalidation1boxedmap)
boxed class to store validated Map payloads | | static class | [MinpropertiesValidation.MinpropertiesValidation1](#minpropertiesvalidation1)
schema class | ## MinpropertiesValidation1Boxed -public static abstract sealed class MinpropertiesValidation1Boxed
+public sealed interface MinpropertiesValidation1Boxed
permits
[MinpropertiesValidation1BoxedVoid](#minpropertiesvalidation1boxedvoid), [MinpropertiesValidation1BoxedBoolean](#minpropertiesvalidation1boxedboolean), @@ -29,103 +29,109 @@ permits
[MinpropertiesValidation1BoxedList](#minpropertiesvalidation1boxedlist), [MinpropertiesValidation1BoxedMap](#minpropertiesvalidation1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## MinpropertiesValidation1BoxedVoid -public static final class MinpropertiesValidation1BoxedVoid
-extends [MinpropertiesValidation1Boxed](#minpropertiesvalidation1boxed) +public record MinpropertiesValidation1BoxedVoid
+implements [MinpropertiesValidation1Boxed](#minpropertiesvalidation1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MinpropertiesValidation1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MinpropertiesValidation1BoxedBoolean -public static final class MinpropertiesValidation1BoxedBoolean
-extends [MinpropertiesValidation1Boxed](#minpropertiesvalidation1boxed) +public record MinpropertiesValidation1BoxedBoolean
+implements [MinpropertiesValidation1Boxed](#minpropertiesvalidation1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MinpropertiesValidation1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MinpropertiesValidation1BoxedNumber -public static final class MinpropertiesValidation1BoxedNumber
-extends [MinpropertiesValidation1Boxed](#minpropertiesvalidation1boxed) +public record MinpropertiesValidation1BoxedNumber
+implements [MinpropertiesValidation1Boxed](#minpropertiesvalidation1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MinpropertiesValidation1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MinpropertiesValidation1BoxedString -public static final class MinpropertiesValidation1BoxedString
-extends [MinpropertiesValidation1Boxed](#minpropertiesvalidation1boxed) +public record MinpropertiesValidation1BoxedString
+implements [MinpropertiesValidation1Boxed](#minpropertiesvalidation1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MinpropertiesValidation1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MinpropertiesValidation1BoxedList -public static final class MinpropertiesValidation1BoxedList
-extends [MinpropertiesValidation1Boxed](#minpropertiesvalidation1boxed) +public record MinpropertiesValidation1BoxedList
+implements [MinpropertiesValidation1Boxed](#minpropertiesvalidation1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MinpropertiesValidation1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MinpropertiesValidation1BoxedMap -public static final class MinpropertiesValidation1BoxedMap
-extends [MinpropertiesValidation1Boxed](#minpropertiesvalidation1boxed) +public record MinpropertiesValidation1BoxedMap
+implements [MinpropertiesValidation1Boxed](#minpropertiesvalidation1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MinpropertiesValidation1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MinpropertiesValidation1 public static class MinpropertiesValidation1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [MinpropertiesValidation1BoxedBoolean](#minpropertiesvalidation1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [MinpropertiesValidation1BoxedMap](#minpropertiesvalidation1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [MinpropertiesValidation1BoxedList](#minpropertiesvalidation1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [MinpropertiesValidation1Boxed](#minpropertiesvalidation1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/MultipleDependentsRequired.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/MultipleDependentsRequired.md index 22c4315dc40..11eb2987149 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/MultipleDependentsRequired.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/MultipleDependentsRequired.md @@ -4,23 +4,23 @@ public class MultipleDependentsRequired
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [MultipleDependentsRequired.MultipleDependentsRequired1Boxed](#multipledependentsrequired1boxed)
abstract sealed validated payload class | -| static class | [MultipleDependentsRequired.MultipleDependentsRequired1BoxedVoid](#multipledependentsrequired1boxedvoid)
boxed class to store validated null payloads | -| static class | [MultipleDependentsRequired.MultipleDependentsRequired1BoxedBoolean](#multipledependentsrequired1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [MultipleDependentsRequired.MultipleDependentsRequired1BoxedNumber](#multipledependentsrequired1boxednumber)
boxed class to store validated Number payloads | -| static class | [MultipleDependentsRequired.MultipleDependentsRequired1BoxedString](#multipledependentsrequired1boxedstring)
boxed class to store validated String payloads | -| static class | [MultipleDependentsRequired.MultipleDependentsRequired1BoxedList](#multipledependentsrequired1boxedlist)
boxed class to store validated List payloads | -| static class | [MultipleDependentsRequired.MultipleDependentsRequired1BoxedMap](#multipledependentsrequired1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [MultipleDependentsRequired.MultipleDependentsRequired1Boxed](#multipledependentsrequired1boxed)
sealed interface for validated payloads | +| record | [MultipleDependentsRequired.MultipleDependentsRequired1BoxedVoid](#multipledependentsrequired1boxedvoid)
boxed class to store validated null payloads | +| record | [MultipleDependentsRequired.MultipleDependentsRequired1BoxedBoolean](#multipledependentsrequired1boxedboolean)
boxed class to store validated boolean payloads | +| record | [MultipleDependentsRequired.MultipleDependentsRequired1BoxedNumber](#multipledependentsrequired1boxednumber)
boxed class to store validated Number payloads | +| record | [MultipleDependentsRequired.MultipleDependentsRequired1BoxedString](#multipledependentsrequired1boxedstring)
boxed class to store validated String payloads | +| record | [MultipleDependentsRequired.MultipleDependentsRequired1BoxedList](#multipledependentsrequired1boxedlist)
boxed class to store validated List payloads | +| record | [MultipleDependentsRequired.MultipleDependentsRequired1BoxedMap](#multipledependentsrequired1boxedmap)
boxed class to store validated Map payloads | | static class | [MultipleDependentsRequired.MultipleDependentsRequired1](#multipledependentsrequired1)
schema class | ## MultipleDependentsRequired1Boxed -public static abstract sealed class MultipleDependentsRequired1Boxed
+public sealed interface MultipleDependentsRequired1Boxed
permits
[MultipleDependentsRequired1BoxedVoid](#multipledependentsrequired1boxedvoid), [MultipleDependentsRequired1BoxedBoolean](#multipledependentsrequired1boxedboolean), @@ -29,103 +29,109 @@ permits
[MultipleDependentsRequired1BoxedList](#multipledependentsrequired1boxedlist), [MultipleDependentsRequired1BoxedMap](#multipledependentsrequired1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## MultipleDependentsRequired1BoxedVoid -public static final class MultipleDependentsRequired1BoxedVoid
-extends [MultipleDependentsRequired1Boxed](#multipledependentsrequired1boxed) +public record MultipleDependentsRequired1BoxedVoid
+implements [MultipleDependentsRequired1Boxed](#multipledependentsrequired1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MultipleDependentsRequired1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MultipleDependentsRequired1BoxedBoolean -public static final class MultipleDependentsRequired1BoxedBoolean
-extends [MultipleDependentsRequired1Boxed](#multipledependentsrequired1boxed) +public record MultipleDependentsRequired1BoxedBoolean
+implements [MultipleDependentsRequired1Boxed](#multipledependentsrequired1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MultipleDependentsRequired1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MultipleDependentsRequired1BoxedNumber -public static final class MultipleDependentsRequired1BoxedNumber
-extends [MultipleDependentsRequired1Boxed](#multipledependentsrequired1boxed) +public record MultipleDependentsRequired1BoxedNumber
+implements [MultipleDependentsRequired1Boxed](#multipledependentsrequired1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MultipleDependentsRequired1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MultipleDependentsRequired1BoxedString -public static final class MultipleDependentsRequired1BoxedString
-extends [MultipleDependentsRequired1Boxed](#multipledependentsrequired1boxed) +public record MultipleDependentsRequired1BoxedString
+implements [MultipleDependentsRequired1Boxed](#multipledependentsrequired1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MultipleDependentsRequired1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MultipleDependentsRequired1BoxedList -public static final class MultipleDependentsRequired1BoxedList
-extends [MultipleDependentsRequired1Boxed](#multipledependentsrequired1boxed) +public record MultipleDependentsRequired1BoxedList
+implements [MultipleDependentsRequired1Boxed](#multipledependentsrequired1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MultipleDependentsRequired1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MultipleDependentsRequired1BoxedMap -public static final class MultipleDependentsRequired1BoxedMap
-extends [MultipleDependentsRequired1Boxed](#multipledependentsrequired1boxed) +public record MultipleDependentsRequired1BoxedMap
+implements [MultipleDependentsRequired1Boxed](#multipledependentsrequired1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MultipleDependentsRequired1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MultipleDependentsRequired1 public static class MultipleDependentsRequired1
@@ -166,5 +172,7 @@ A schema class that validates payloads | [MultipleDependentsRequired1BoxedBoolean](#multipledependentsrequired1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [MultipleDependentsRequired1BoxedMap](#multipledependentsrequired1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [MultipleDependentsRequired1BoxedList](#multipledependentsrequired1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [MultipleDependentsRequired1Boxed](#multipledependentsrequired1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/MultipleSimultaneousPatternpropertiesAreValidated.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/MultipleSimultaneousPatternpropertiesAreValidated.md index b81920ce328..618e43d1420 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/MultipleSimultaneousPatternpropertiesAreValidated.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/MultipleSimultaneousPatternpropertiesAreValidated.md @@ -4,34 +4,34 @@ public class MultipleSimultaneousPatternpropertiesAreValidated
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [MultipleSimultaneousPatternpropertiesAreValidated.MultipleSimultaneousPatternpropertiesAreValidated1Boxed](#multiplesimultaneouspatternpropertiesarevalidated1boxed)
abstract sealed validated payload class | -| static class | [MultipleSimultaneousPatternpropertiesAreValidated.MultipleSimultaneousPatternpropertiesAreValidated1BoxedVoid](#multiplesimultaneouspatternpropertiesarevalidated1boxedvoid)
boxed class to store validated null payloads | -| static class | [MultipleSimultaneousPatternpropertiesAreValidated.MultipleSimultaneousPatternpropertiesAreValidated1BoxedBoolean](#multiplesimultaneouspatternpropertiesarevalidated1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [MultipleSimultaneousPatternpropertiesAreValidated.MultipleSimultaneousPatternpropertiesAreValidated1BoxedNumber](#multiplesimultaneouspatternpropertiesarevalidated1boxednumber)
boxed class to store validated Number payloads | -| static class | [MultipleSimultaneousPatternpropertiesAreValidated.MultipleSimultaneousPatternpropertiesAreValidated1BoxedString](#multiplesimultaneouspatternpropertiesarevalidated1boxedstring)
boxed class to store validated String payloads | -| static class | [MultipleSimultaneousPatternpropertiesAreValidated.MultipleSimultaneousPatternpropertiesAreValidated1BoxedList](#multiplesimultaneouspatternpropertiesarevalidated1boxedlist)
boxed class to store validated List payloads | -| static class | [MultipleSimultaneousPatternpropertiesAreValidated.MultipleSimultaneousPatternpropertiesAreValidated1BoxedMap](#multiplesimultaneouspatternpropertiesarevalidated1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [MultipleSimultaneousPatternpropertiesAreValidated.MultipleSimultaneousPatternpropertiesAreValidated1Boxed](#multiplesimultaneouspatternpropertiesarevalidated1boxed)
sealed interface for validated payloads | +| record | [MultipleSimultaneousPatternpropertiesAreValidated.MultipleSimultaneousPatternpropertiesAreValidated1BoxedVoid](#multiplesimultaneouspatternpropertiesarevalidated1boxedvoid)
boxed class to store validated null payloads | +| record | [MultipleSimultaneousPatternpropertiesAreValidated.MultipleSimultaneousPatternpropertiesAreValidated1BoxedBoolean](#multiplesimultaneouspatternpropertiesarevalidated1boxedboolean)
boxed class to store validated boolean payloads | +| record | [MultipleSimultaneousPatternpropertiesAreValidated.MultipleSimultaneousPatternpropertiesAreValidated1BoxedNumber](#multiplesimultaneouspatternpropertiesarevalidated1boxednumber)
boxed class to store validated Number payloads | +| record | [MultipleSimultaneousPatternpropertiesAreValidated.MultipleSimultaneousPatternpropertiesAreValidated1BoxedString](#multiplesimultaneouspatternpropertiesarevalidated1boxedstring)
boxed class to store validated String payloads | +| record | [MultipleSimultaneousPatternpropertiesAreValidated.MultipleSimultaneousPatternpropertiesAreValidated1BoxedList](#multiplesimultaneouspatternpropertiesarevalidated1boxedlist)
boxed class to store validated List payloads | +| record | [MultipleSimultaneousPatternpropertiesAreValidated.MultipleSimultaneousPatternpropertiesAreValidated1BoxedMap](#multiplesimultaneouspatternpropertiesarevalidated1boxedmap)
boxed class to store validated Map payloads | | static class | [MultipleSimultaneousPatternpropertiesAreValidated.MultipleSimultaneousPatternpropertiesAreValidated1](#multiplesimultaneouspatternpropertiesarevalidated1)
schema class | -| static class | [MultipleSimultaneousPatternpropertiesAreValidated.AaaBoxed](#aaaboxed)
abstract sealed validated payload class | -| static class | [MultipleSimultaneousPatternpropertiesAreValidated.AaaBoxedVoid](#aaaboxedvoid)
boxed class to store validated null payloads | -| static class | [MultipleSimultaneousPatternpropertiesAreValidated.AaaBoxedBoolean](#aaaboxedboolean)
boxed class to store validated boolean payloads | -| static class | [MultipleSimultaneousPatternpropertiesAreValidated.AaaBoxedNumber](#aaaboxednumber)
boxed class to store validated Number payloads | -| static class | [MultipleSimultaneousPatternpropertiesAreValidated.AaaBoxedString](#aaaboxedstring)
boxed class to store validated String payloads | -| static class | [MultipleSimultaneousPatternpropertiesAreValidated.AaaBoxedList](#aaaboxedlist)
boxed class to store validated List payloads | -| static class | [MultipleSimultaneousPatternpropertiesAreValidated.AaaBoxedMap](#aaaboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [MultipleSimultaneousPatternpropertiesAreValidated.AaaBoxed](#aaaboxed)
sealed interface for validated payloads | +| record | [MultipleSimultaneousPatternpropertiesAreValidated.AaaBoxedVoid](#aaaboxedvoid)
boxed class to store validated null payloads | +| record | [MultipleSimultaneousPatternpropertiesAreValidated.AaaBoxedBoolean](#aaaboxedboolean)
boxed class to store validated boolean payloads | +| record | [MultipleSimultaneousPatternpropertiesAreValidated.AaaBoxedNumber](#aaaboxednumber)
boxed class to store validated Number payloads | +| record | [MultipleSimultaneousPatternpropertiesAreValidated.AaaBoxedString](#aaaboxedstring)
boxed class to store validated String payloads | +| record | [MultipleSimultaneousPatternpropertiesAreValidated.AaaBoxedList](#aaaboxedlist)
boxed class to store validated List payloads | +| record | [MultipleSimultaneousPatternpropertiesAreValidated.AaaBoxedMap](#aaaboxedmap)
boxed class to store validated Map payloads | | static class | [MultipleSimultaneousPatternpropertiesAreValidated.Aaa](#aaa)
schema class | -| static class | [MultipleSimultaneousPatternpropertiesAreValidated.ABoxed](#aboxed)
abstract sealed validated payload class | -| static class | [MultipleSimultaneousPatternpropertiesAreValidated.ABoxedNumber](#aboxednumber)
boxed class to store validated Number payloads | +| sealed interface | [MultipleSimultaneousPatternpropertiesAreValidated.ABoxed](#aboxed)
sealed interface for validated payloads | +| record | [MultipleSimultaneousPatternpropertiesAreValidated.ABoxedNumber](#aboxednumber)
boxed class to store validated Number payloads | | static class | [MultipleSimultaneousPatternpropertiesAreValidated.A](#a)
schema class | ## MultipleSimultaneousPatternpropertiesAreValidated1Boxed -public static abstract sealed class MultipleSimultaneousPatternpropertiesAreValidated1Boxed
+public sealed interface MultipleSimultaneousPatternpropertiesAreValidated1Boxed
permits
[MultipleSimultaneousPatternpropertiesAreValidated1BoxedVoid](#multiplesimultaneouspatternpropertiesarevalidated1boxedvoid), [MultipleSimultaneousPatternpropertiesAreValidated1BoxedBoolean](#multiplesimultaneouspatternpropertiesarevalidated1boxedboolean), @@ -40,103 +40,109 @@ permits
[MultipleSimultaneousPatternpropertiesAreValidated1BoxedList](#multiplesimultaneouspatternpropertiesarevalidated1boxedlist), [MultipleSimultaneousPatternpropertiesAreValidated1BoxedMap](#multiplesimultaneouspatternpropertiesarevalidated1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## MultipleSimultaneousPatternpropertiesAreValidated1BoxedVoid -public static final class MultipleSimultaneousPatternpropertiesAreValidated1BoxedVoid
-extends [MultipleSimultaneousPatternpropertiesAreValidated1Boxed](#multiplesimultaneouspatternpropertiesarevalidated1boxed) +public record MultipleSimultaneousPatternpropertiesAreValidated1BoxedVoid
+implements [MultipleSimultaneousPatternpropertiesAreValidated1Boxed](#multiplesimultaneouspatternpropertiesarevalidated1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MultipleSimultaneousPatternpropertiesAreValidated1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MultipleSimultaneousPatternpropertiesAreValidated1BoxedBoolean -public static final class MultipleSimultaneousPatternpropertiesAreValidated1BoxedBoolean
-extends [MultipleSimultaneousPatternpropertiesAreValidated1Boxed](#multiplesimultaneouspatternpropertiesarevalidated1boxed) +public record MultipleSimultaneousPatternpropertiesAreValidated1BoxedBoolean
+implements [MultipleSimultaneousPatternpropertiesAreValidated1Boxed](#multiplesimultaneouspatternpropertiesarevalidated1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MultipleSimultaneousPatternpropertiesAreValidated1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MultipleSimultaneousPatternpropertiesAreValidated1BoxedNumber -public static final class MultipleSimultaneousPatternpropertiesAreValidated1BoxedNumber
-extends [MultipleSimultaneousPatternpropertiesAreValidated1Boxed](#multiplesimultaneouspatternpropertiesarevalidated1boxed) +public record MultipleSimultaneousPatternpropertiesAreValidated1BoxedNumber
+implements [MultipleSimultaneousPatternpropertiesAreValidated1Boxed](#multiplesimultaneouspatternpropertiesarevalidated1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MultipleSimultaneousPatternpropertiesAreValidated1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MultipleSimultaneousPatternpropertiesAreValidated1BoxedString -public static final class MultipleSimultaneousPatternpropertiesAreValidated1BoxedString
-extends [MultipleSimultaneousPatternpropertiesAreValidated1Boxed](#multiplesimultaneouspatternpropertiesarevalidated1boxed) +public record MultipleSimultaneousPatternpropertiesAreValidated1BoxedString
+implements [MultipleSimultaneousPatternpropertiesAreValidated1Boxed](#multiplesimultaneouspatternpropertiesarevalidated1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MultipleSimultaneousPatternpropertiesAreValidated1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MultipleSimultaneousPatternpropertiesAreValidated1BoxedList -public static final class MultipleSimultaneousPatternpropertiesAreValidated1BoxedList
-extends [MultipleSimultaneousPatternpropertiesAreValidated1Boxed](#multiplesimultaneouspatternpropertiesarevalidated1boxed) +public record MultipleSimultaneousPatternpropertiesAreValidated1BoxedList
+implements [MultipleSimultaneousPatternpropertiesAreValidated1Boxed](#multiplesimultaneouspatternpropertiesarevalidated1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MultipleSimultaneousPatternpropertiesAreValidated1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MultipleSimultaneousPatternpropertiesAreValidated1BoxedMap -public static final class MultipleSimultaneousPatternpropertiesAreValidated1BoxedMap
-extends [MultipleSimultaneousPatternpropertiesAreValidated1Boxed](#multiplesimultaneouspatternpropertiesarevalidated1boxed) +public record MultipleSimultaneousPatternpropertiesAreValidated1BoxedMap
+implements [MultipleSimultaneousPatternpropertiesAreValidated1Boxed](#multiplesimultaneouspatternpropertiesarevalidated1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MultipleSimultaneousPatternpropertiesAreValidated1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MultipleSimultaneousPatternpropertiesAreValidated1 public static class MultipleSimultaneousPatternpropertiesAreValidated1
@@ -168,9 +174,11 @@ A schema class that validates payloads | [MultipleSimultaneousPatternpropertiesAreValidated1BoxedBoolean](#multiplesimultaneouspatternpropertiesarevalidated1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [MultipleSimultaneousPatternpropertiesAreValidated1BoxedMap](#multiplesimultaneouspatternpropertiesarevalidated1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [MultipleSimultaneousPatternpropertiesAreValidated1BoxedList](#multiplesimultaneouspatternpropertiesarevalidated1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [MultipleSimultaneousPatternpropertiesAreValidated1Boxed](#multiplesimultaneouspatternpropertiesarevalidated1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## AaaBoxed -public static abstract sealed class AaaBoxed
+public sealed interface AaaBoxed
permits
[AaaBoxedVoid](#aaaboxedvoid), [AaaBoxedBoolean](#aaaboxedboolean), @@ -179,103 +187,109 @@ permits
[AaaBoxedList](#aaaboxedlist), [AaaBoxedMap](#aaaboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AaaBoxedVoid -public static final class AaaBoxedVoid
-extends [AaaBoxed](#aaaboxed) +public record AaaBoxedVoid
+implements [AaaBoxed](#aaaboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AaaBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AaaBoxedBoolean -public static final class AaaBoxedBoolean
-extends [AaaBoxed](#aaaboxed) +public record AaaBoxedBoolean
+implements [AaaBoxed](#aaaboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AaaBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AaaBoxedNumber -public static final class AaaBoxedNumber
-extends [AaaBoxed](#aaaboxed) +public record AaaBoxedNumber
+implements [AaaBoxed](#aaaboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AaaBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AaaBoxedString -public static final class AaaBoxedString
-extends [AaaBoxed](#aaaboxed) +public record AaaBoxedString
+implements [AaaBoxed](#aaaboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AaaBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AaaBoxedList -public static final class AaaBoxedList
-extends [AaaBoxed](#aaaboxed) +public record AaaBoxedList
+implements [AaaBoxed](#aaaboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AaaBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AaaBoxedMap -public static final class AaaBoxedMap
-extends [AaaBoxed](#aaaboxed) +public record AaaBoxedMap
+implements [AaaBoxed](#aaaboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AaaBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Aaa public static class Aaa
@@ -307,29 +321,32 @@ A schema class that validates payloads | [AaaBoxedBoolean](#aaaboxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [AaaBoxedMap](#aaaboxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [AaaBoxedList](#aaaboxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [AaaBoxed](#aaaboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ABoxed -public static abstract sealed class ABoxed
+public sealed interface ABoxed
permits
[ABoxedNumber](#aboxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ABoxedNumber -public static final class ABoxedNumber
-extends [ABoxed](#aboxed) +public record ABoxedNumber
+implements [ABoxed](#aboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ABoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## A public static class A
diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/MultipleTypesCanBeSpecifiedInAnArray.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/MultipleTypesCanBeSpecifiedInAnArray.md index 769674fb229..ea9c6876b68 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/MultipleTypesCanBeSpecifiedInAnArray.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/MultipleTypesCanBeSpecifiedInAnArray.md @@ -4,56 +4,58 @@ public class MultipleTypesCanBeSpecifiedInAnArray
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [MultipleTypesCanBeSpecifiedInAnArray.MultipleTypesCanBeSpecifiedInAnArray1Boxed](#multipletypescanbespecifiedinanarray1boxed)
abstract sealed validated payload class | -| static class | [MultipleTypesCanBeSpecifiedInAnArray.MultipleTypesCanBeSpecifiedInAnArray1BoxedNumber](#multipletypescanbespecifiedinanarray1boxednumber)
boxed class to store validated Number payloads | -| static class | [MultipleTypesCanBeSpecifiedInAnArray.MultipleTypesCanBeSpecifiedInAnArray1BoxedString](#multipletypescanbespecifiedinanarray1boxedstring)
boxed class to store validated String payloads | +| sealed interface | [MultipleTypesCanBeSpecifiedInAnArray.MultipleTypesCanBeSpecifiedInAnArray1Boxed](#multipletypescanbespecifiedinanarray1boxed)
sealed interface for validated payloads | +| record | [MultipleTypesCanBeSpecifiedInAnArray.MultipleTypesCanBeSpecifiedInAnArray1BoxedNumber](#multipletypescanbespecifiedinanarray1boxednumber)
boxed class to store validated Number payloads | +| record | [MultipleTypesCanBeSpecifiedInAnArray.MultipleTypesCanBeSpecifiedInAnArray1BoxedString](#multipletypescanbespecifiedinanarray1boxedstring)
boxed class to store validated String payloads | | static class | [MultipleTypesCanBeSpecifiedInAnArray.MultipleTypesCanBeSpecifiedInAnArray1](#multipletypescanbespecifiedinanarray1)
schema class | ## MultipleTypesCanBeSpecifiedInAnArray1Boxed -public static abstract sealed class MultipleTypesCanBeSpecifiedInAnArray1Boxed
+public sealed interface MultipleTypesCanBeSpecifiedInAnArray1Boxed
permits
[MultipleTypesCanBeSpecifiedInAnArray1BoxedNumber](#multipletypescanbespecifiedinanarray1boxednumber), [MultipleTypesCanBeSpecifiedInAnArray1BoxedString](#multipletypescanbespecifiedinanarray1boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## MultipleTypesCanBeSpecifiedInAnArray1BoxedNumber -public static final class MultipleTypesCanBeSpecifiedInAnArray1BoxedNumber
-extends [MultipleTypesCanBeSpecifiedInAnArray1Boxed](#multipletypescanbespecifiedinanarray1boxed) +public record MultipleTypesCanBeSpecifiedInAnArray1BoxedNumber
+implements [MultipleTypesCanBeSpecifiedInAnArray1Boxed](#multipletypescanbespecifiedinanarray1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MultipleTypesCanBeSpecifiedInAnArray1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MultipleTypesCanBeSpecifiedInAnArray1BoxedString -public static final class MultipleTypesCanBeSpecifiedInAnArray1BoxedString
-extends [MultipleTypesCanBeSpecifiedInAnArray1Boxed](#multipletypescanbespecifiedinanarray1boxed) +public record MultipleTypesCanBeSpecifiedInAnArray1BoxedString
+implements [MultipleTypesCanBeSpecifiedInAnArray1Boxed](#multipletypescanbespecifiedinanarray1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MultipleTypesCanBeSpecifiedInAnArray1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MultipleTypesCanBeSpecifiedInAnArray1 public static class MultipleTypesCanBeSpecifiedInAnArray1
@@ -102,5 +104,7 @@ String validatedPayload = MultipleTypesCanBeSpecifiedInAnArray.MultipleTypesCanB | [MultipleTypesCanBeSpecifiedInAnArray1BoxedNumber](#multipletypescanbespecifiedinanarray1boxednumber) | validateAndBox(Number arg, SchemaConfiguration configuration) | | String | validate(String arg, SchemaConfiguration configuration) | | [MultipleTypesCanBeSpecifiedInAnArray1BoxedString](#multipletypescanbespecifiedinanarray1boxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [MultipleTypesCanBeSpecifiedInAnArray1Boxed](#multipletypescanbespecifiedinanarray1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/NestedAllofToCheckValidationSemantics.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/NestedAllofToCheckValidationSemantics.md index d02f03d3c8b..ebf65ca84c7 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/NestedAllofToCheckValidationSemantics.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/NestedAllofToCheckValidationSemantics.md @@ -4,34 +4,34 @@ public class NestedAllofToCheckValidationSemantics
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [NestedAllofToCheckValidationSemantics.NestedAllofToCheckValidationSemantics1Boxed](#nestedalloftocheckvalidationsemantics1boxed)
abstract sealed validated payload class | -| static class | [NestedAllofToCheckValidationSemantics.NestedAllofToCheckValidationSemantics1BoxedVoid](#nestedalloftocheckvalidationsemantics1boxedvoid)
boxed class to store validated null payloads | -| static class | [NestedAllofToCheckValidationSemantics.NestedAllofToCheckValidationSemantics1BoxedBoolean](#nestedalloftocheckvalidationsemantics1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [NestedAllofToCheckValidationSemantics.NestedAllofToCheckValidationSemantics1BoxedNumber](#nestedalloftocheckvalidationsemantics1boxednumber)
boxed class to store validated Number payloads | -| static class | [NestedAllofToCheckValidationSemantics.NestedAllofToCheckValidationSemantics1BoxedString](#nestedalloftocheckvalidationsemantics1boxedstring)
boxed class to store validated String payloads | -| static class | [NestedAllofToCheckValidationSemantics.NestedAllofToCheckValidationSemantics1BoxedList](#nestedalloftocheckvalidationsemantics1boxedlist)
boxed class to store validated List payloads | -| static class | [NestedAllofToCheckValidationSemantics.NestedAllofToCheckValidationSemantics1BoxedMap](#nestedalloftocheckvalidationsemantics1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [NestedAllofToCheckValidationSemantics.NestedAllofToCheckValidationSemantics1Boxed](#nestedalloftocheckvalidationsemantics1boxed)
sealed interface for validated payloads | +| record | [NestedAllofToCheckValidationSemantics.NestedAllofToCheckValidationSemantics1BoxedVoid](#nestedalloftocheckvalidationsemantics1boxedvoid)
boxed class to store validated null payloads | +| record | [NestedAllofToCheckValidationSemantics.NestedAllofToCheckValidationSemantics1BoxedBoolean](#nestedalloftocheckvalidationsemantics1boxedboolean)
boxed class to store validated boolean payloads | +| record | [NestedAllofToCheckValidationSemantics.NestedAllofToCheckValidationSemantics1BoxedNumber](#nestedalloftocheckvalidationsemantics1boxednumber)
boxed class to store validated Number payloads | +| record | [NestedAllofToCheckValidationSemantics.NestedAllofToCheckValidationSemantics1BoxedString](#nestedalloftocheckvalidationsemantics1boxedstring)
boxed class to store validated String payloads | +| record | [NestedAllofToCheckValidationSemantics.NestedAllofToCheckValidationSemantics1BoxedList](#nestedalloftocheckvalidationsemantics1boxedlist)
boxed class to store validated List payloads | +| record | [NestedAllofToCheckValidationSemantics.NestedAllofToCheckValidationSemantics1BoxedMap](#nestedalloftocheckvalidationsemantics1boxedmap)
boxed class to store validated Map payloads | | static class | [NestedAllofToCheckValidationSemantics.NestedAllofToCheckValidationSemantics1](#nestedalloftocheckvalidationsemantics1)
schema class | -| static class | [NestedAllofToCheckValidationSemantics.Schema0Boxed](#schema0boxed)
abstract sealed validated payload class | -| static class | [NestedAllofToCheckValidationSemantics.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | -| static class | [NestedAllofToCheckValidationSemantics.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | -| static class | [NestedAllofToCheckValidationSemantics.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | -| static class | [NestedAllofToCheckValidationSemantics.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | -| static class | [NestedAllofToCheckValidationSemantics.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | -| static class | [NestedAllofToCheckValidationSemantics.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [NestedAllofToCheckValidationSemantics.Schema0Boxed](#schema0boxed)
sealed interface for validated payloads | +| record | [NestedAllofToCheckValidationSemantics.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | +| record | [NestedAllofToCheckValidationSemantics.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | +| record | [NestedAllofToCheckValidationSemantics.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | +| record | [NestedAllofToCheckValidationSemantics.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | +| record | [NestedAllofToCheckValidationSemantics.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | +| record | [NestedAllofToCheckValidationSemantics.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | | static class | [NestedAllofToCheckValidationSemantics.Schema0](#schema0)
schema class | -| static class | [NestedAllofToCheckValidationSemantics.Schema01Boxed](#schema01boxed)
abstract sealed validated payload class | -| static class | [NestedAllofToCheckValidationSemantics.Schema01BoxedVoid](#schema01boxedvoid)
boxed class to store validated null payloads | +| sealed interface | [NestedAllofToCheckValidationSemantics.Schema01Boxed](#schema01boxed)
sealed interface for validated payloads | +| record | [NestedAllofToCheckValidationSemantics.Schema01BoxedVoid](#schema01boxedvoid)
boxed class to store validated null payloads | | static class | [NestedAllofToCheckValidationSemantics.Schema01](#schema01)
schema class | ## NestedAllofToCheckValidationSemantics1Boxed -public static abstract sealed class NestedAllofToCheckValidationSemantics1Boxed
+public sealed interface NestedAllofToCheckValidationSemantics1Boxed
permits
[NestedAllofToCheckValidationSemantics1BoxedVoid](#nestedalloftocheckvalidationsemantics1boxedvoid), [NestedAllofToCheckValidationSemantics1BoxedBoolean](#nestedalloftocheckvalidationsemantics1boxedboolean), @@ -40,103 +40,109 @@ permits
[NestedAllofToCheckValidationSemantics1BoxedList](#nestedalloftocheckvalidationsemantics1boxedlist), [NestedAllofToCheckValidationSemantics1BoxedMap](#nestedalloftocheckvalidationsemantics1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## NestedAllofToCheckValidationSemantics1BoxedVoid -public static final class NestedAllofToCheckValidationSemantics1BoxedVoid
-extends [NestedAllofToCheckValidationSemantics1Boxed](#nestedalloftocheckvalidationsemantics1boxed) +public record NestedAllofToCheckValidationSemantics1BoxedVoid
+implements [NestedAllofToCheckValidationSemantics1Boxed](#nestedalloftocheckvalidationsemantics1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NestedAllofToCheckValidationSemantics1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NestedAllofToCheckValidationSemantics1BoxedBoolean -public static final class NestedAllofToCheckValidationSemantics1BoxedBoolean
-extends [NestedAllofToCheckValidationSemantics1Boxed](#nestedalloftocheckvalidationsemantics1boxed) +public record NestedAllofToCheckValidationSemantics1BoxedBoolean
+implements [NestedAllofToCheckValidationSemantics1Boxed](#nestedalloftocheckvalidationsemantics1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NestedAllofToCheckValidationSemantics1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NestedAllofToCheckValidationSemantics1BoxedNumber -public static final class NestedAllofToCheckValidationSemantics1BoxedNumber
-extends [NestedAllofToCheckValidationSemantics1Boxed](#nestedalloftocheckvalidationsemantics1boxed) +public record NestedAllofToCheckValidationSemantics1BoxedNumber
+implements [NestedAllofToCheckValidationSemantics1Boxed](#nestedalloftocheckvalidationsemantics1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NestedAllofToCheckValidationSemantics1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NestedAllofToCheckValidationSemantics1BoxedString -public static final class NestedAllofToCheckValidationSemantics1BoxedString
-extends [NestedAllofToCheckValidationSemantics1Boxed](#nestedalloftocheckvalidationsemantics1boxed) +public record NestedAllofToCheckValidationSemantics1BoxedString
+implements [NestedAllofToCheckValidationSemantics1Boxed](#nestedalloftocheckvalidationsemantics1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NestedAllofToCheckValidationSemantics1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NestedAllofToCheckValidationSemantics1BoxedList -public static final class NestedAllofToCheckValidationSemantics1BoxedList
-extends [NestedAllofToCheckValidationSemantics1Boxed](#nestedalloftocheckvalidationsemantics1boxed) +public record NestedAllofToCheckValidationSemantics1BoxedList
+implements [NestedAllofToCheckValidationSemantics1Boxed](#nestedalloftocheckvalidationsemantics1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NestedAllofToCheckValidationSemantics1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NestedAllofToCheckValidationSemantics1BoxedMap -public static final class NestedAllofToCheckValidationSemantics1BoxedMap
-extends [NestedAllofToCheckValidationSemantics1Boxed](#nestedalloftocheckvalidationsemantics1boxed) +public record NestedAllofToCheckValidationSemantics1BoxedMap
+implements [NestedAllofToCheckValidationSemantics1Boxed](#nestedalloftocheckvalidationsemantics1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NestedAllofToCheckValidationSemantics1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NestedAllofToCheckValidationSemantics1 public static class NestedAllofToCheckValidationSemantics1
@@ -168,9 +174,11 @@ A schema class that validates payloads | [NestedAllofToCheckValidationSemantics1BoxedBoolean](#nestedalloftocheckvalidationsemantics1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [NestedAllofToCheckValidationSemantics1BoxedMap](#nestedalloftocheckvalidationsemantics1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [NestedAllofToCheckValidationSemantics1BoxedList](#nestedalloftocheckvalidationsemantics1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [NestedAllofToCheckValidationSemantics1Boxed](#nestedalloftocheckvalidationsemantics1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema0Boxed -public static abstract sealed class Schema0Boxed
+public sealed interface Schema0Boxed
permits
[Schema0BoxedVoid](#schema0boxedvoid), [Schema0BoxedBoolean](#schema0boxedboolean), @@ -179,103 +187,109 @@ permits
[Schema0BoxedList](#schema0boxedlist), [Schema0BoxedMap](#schema0boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema0BoxedVoid -public static final class Schema0BoxedVoid
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedVoid
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedBoolean -public static final class Schema0BoxedBoolean
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedBoolean
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedNumber -public static final class Schema0BoxedNumber
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedNumber
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedString -public static final class Schema0BoxedString
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedString
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedList -public static final class Schema0BoxedList
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedList
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedMap -public static final class Schema0BoxedMap
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedMap
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0 public static class Schema0
@@ -307,29 +321,32 @@ A schema class that validates payloads | [Schema0BoxedBoolean](#schema0boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Schema0BoxedMap](#schema0boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [Schema0BoxedList](#schema0boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Schema0Boxed](#schema0boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema01Boxed -public static abstract sealed class Schema01Boxed
+public sealed interface Schema01Boxed
permits
[Schema01BoxedVoid](#schema01boxedvoid) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema01BoxedVoid -public static final class Schema01BoxedVoid
-extends [Schema01Boxed](#schema01boxed) +public record Schema01BoxedVoid
+implements [Schema01Boxed](#schema01boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema01BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema01 public static class Schema01
diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/NestedAnyofToCheckValidationSemantics.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/NestedAnyofToCheckValidationSemantics.md index 61a43526623..dc2de71feb0 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/NestedAnyofToCheckValidationSemantics.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/NestedAnyofToCheckValidationSemantics.md @@ -4,34 +4,34 @@ public class NestedAnyofToCheckValidationSemantics
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [NestedAnyofToCheckValidationSemantics.NestedAnyofToCheckValidationSemantics1Boxed](#nestedanyoftocheckvalidationsemantics1boxed)
abstract sealed validated payload class | -| static class | [NestedAnyofToCheckValidationSemantics.NestedAnyofToCheckValidationSemantics1BoxedVoid](#nestedanyoftocheckvalidationsemantics1boxedvoid)
boxed class to store validated null payloads | -| static class | [NestedAnyofToCheckValidationSemantics.NestedAnyofToCheckValidationSemantics1BoxedBoolean](#nestedanyoftocheckvalidationsemantics1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [NestedAnyofToCheckValidationSemantics.NestedAnyofToCheckValidationSemantics1BoxedNumber](#nestedanyoftocheckvalidationsemantics1boxednumber)
boxed class to store validated Number payloads | -| static class | [NestedAnyofToCheckValidationSemantics.NestedAnyofToCheckValidationSemantics1BoxedString](#nestedanyoftocheckvalidationsemantics1boxedstring)
boxed class to store validated String payloads | -| static class | [NestedAnyofToCheckValidationSemantics.NestedAnyofToCheckValidationSemantics1BoxedList](#nestedanyoftocheckvalidationsemantics1boxedlist)
boxed class to store validated List payloads | -| static class | [NestedAnyofToCheckValidationSemantics.NestedAnyofToCheckValidationSemantics1BoxedMap](#nestedanyoftocheckvalidationsemantics1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [NestedAnyofToCheckValidationSemantics.NestedAnyofToCheckValidationSemantics1Boxed](#nestedanyoftocheckvalidationsemantics1boxed)
sealed interface for validated payloads | +| record | [NestedAnyofToCheckValidationSemantics.NestedAnyofToCheckValidationSemantics1BoxedVoid](#nestedanyoftocheckvalidationsemantics1boxedvoid)
boxed class to store validated null payloads | +| record | [NestedAnyofToCheckValidationSemantics.NestedAnyofToCheckValidationSemantics1BoxedBoolean](#nestedanyoftocheckvalidationsemantics1boxedboolean)
boxed class to store validated boolean payloads | +| record | [NestedAnyofToCheckValidationSemantics.NestedAnyofToCheckValidationSemantics1BoxedNumber](#nestedanyoftocheckvalidationsemantics1boxednumber)
boxed class to store validated Number payloads | +| record | [NestedAnyofToCheckValidationSemantics.NestedAnyofToCheckValidationSemantics1BoxedString](#nestedanyoftocheckvalidationsemantics1boxedstring)
boxed class to store validated String payloads | +| record | [NestedAnyofToCheckValidationSemantics.NestedAnyofToCheckValidationSemantics1BoxedList](#nestedanyoftocheckvalidationsemantics1boxedlist)
boxed class to store validated List payloads | +| record | [NestedAnyofToCheckValidationSemantics.NestedAnyofToCheckValidationSemantics1BoxedMap](#nestedanyoftocheckvalidationsemantics1boxedmap)
boxed class to store validated Map payloads | | static class | [NestedAnyofToCheckValidationSemantics.NestedAnyofToCheckValidationSemantics1](#nestedanyoftocheckvalidationsemantics1)
schema class | -| static class | [NestedAnyofToCheckValidationSemantics.Schema0Boxed](#schema0boxed)
abstract sealed validated payload class | -| static class | [NestedAnyofToCheckValidationSemantics.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | -| static class | [NestedAnyofToCheckValidationSemantics.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | -| static class | [NestedAnyofToCheckValidationSemantics.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | -| static class | [NestedAnyofToCheckValidationSemantics.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | -| static class | [NestedAnyofToCheckValidationSemantics.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | -| static class | [NestedAnyofToCheckValidationSemantics.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [NestedAnyofToCheckValidationSemantics.Schema0Boxed](#schema0boxed)
sealed interface for validated payloads | +| record | [NestedAnyofToCheckValidationSemantics.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | +| record | [NestedAnyofToCheckValidationSemantics.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | +| record | [NestedAnyofToCheckValidationSemantics.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | +| record | [NestedAnyofToCheckValidationSemantics.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | +| record | [NestedAnyofToCheckValidationSemantics.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | +| record | [NestedAnyofToCheckValidationSemantics.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | | static class | [NestedAnyofToCheckValidationSemantics.Schema0](#schema0)
schema class | -| static class | [NestedAnyofToCheckValidationSemantics.Schema01Boxed](#schema01boxed)
abstract sealed validated payload class | -| static class | [NestedAnyofToCheckValidationSemantics.Schema01BoxedVoid](#schema01boxedvoid)
boxed class to store validated null payloads | +| sealed interface | [NestedAnyofToCheckValidationSemantics.Schema01Boxed](#schema01boxed)
sealed interface for validated payloads | +| record | [NestedAnyofToCheckValidationSemantics.Schema01BoxedVoid](#schema01boxedvoid)
boxed class to store validated null payloads | | static class | [NestedAnyofToCheckValidationSemantics.Schema01](#schema01)
schema class | ## NestedAnyofToCheckValidationSemantics1Boxed -public static abstract sealed class NestedAnyofToCheckValidationSemantics1Boxed
+public sealed interface NestedAnyofToCheckValidationSemantics1Boxed
permits
[NestedAnyofToCheckValidationSemantics1BoxedVoid](#nestedanyoftocheckvalidationsemantics1boxedvoid), [NestedAnyofToCheckValidationSemantics1BoxedBoolean](#nestedanyoftocheckvalidationsemantics1boxedboolean), @@ -40,103 +40,109 @@ permits
[NestedAnyofToCheckValidationSemantics1BoxedList](#nestedanyoftocheckvalidationsemantics1boxedlist), [NestedAnyofToCheckValidationSemantics1BoxedMap](#nestedanyoftocheckvalidationsemantics1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## NestedAnyofToCheckValidationSemantics1BoxedVoid -public static final class NestedAnyofToCheckValidationSemantics1BoxedVoid
-extends [NestedAnyofToCheckValidationSemantics1Boxed](#nestedanyoftocheckvalidationsemantics1boxed) +public record NestedAnyofToCheckValidationSemantics1BoxedVoid
+implements [NestedAnyofToCheckValidationSemantics1Boxed](#nestedanyoftocheckvalidationsemantics1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NestedAnyofToCheckValidationSemantics1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NestedAnyofToCheckValidationSemantics1BoxedBoolean -public static final class NestedAnyofToCheckValidationSemantics1BoxedBoolean
-extends [NestedAnyofToCheckValidationSemantics1Boxed](#nestedanyoftocheckvalidationsemantics1boxed) +public record NestedAnyofToCheckValidationSemantics1BoxedBoolean
+implements [NestedAnyofToCheckValidationSemantics1Boxed](#nestedanyoftocheckvalidationsemantics1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NestedAnyofToCheckValidationSemantics1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NestedAnyofToCheckValidationSemantics1BoxedNumber -public static final class NestedAnyofToCheckValidationSemantics1BoxedNumber
-extends [NestedAnyofToCheckValidationSemantics1Boxed](#nestedanyoftocheckvalidationsemantics1boxed) +public record NestedAnyofToCheckValidationSemantics1BoxedNumber
+implements [NestedAnyofToCheckValidationSemantics1Boxed](#nestedanyoftocheckvalidationsemantics1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NestedAnyofToCheckValidationSemantics1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NestedAnyofToCheckValidationSemantics1BoxedString -public static final class NestedAnyofToCheckValidationSemantics1BoxedString
-extends [NestedAnyofToCheckValidationSemantics1Boxed](#nestedanyoftocheckvalidationsemantics1boxed) +public record NestedAnyofToCheckValidationSemantics1BoxedString
+implements [NestedAnyofToCheckValidationSemantics1Boxed](#nestedanyoftocheckvalidationsemantics1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NestedAnyofToCheckValidationSemantics1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NestedAnyofToCheckValidationSemantics1BoxedList -public static final class NestedAnyofToCheckValidationSemantics1BoxedList
-extends [NestedAnyofToCheckValidationSemantics1Boxed](#nestedanyoftocheckvalidationsemantics1boxed) +public record NestedAnyofToCheckValidationSemantics1BoxedList
+implements [NestedAnyofToCheckValidationSemantics1Boxed](#nestedanyoftocheckvalidationsemantics1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NestedAnyofToCheckValidationSemantics1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NestedAnyofToCheckValidationSemantics1BoxedMap -public static final class NestedAnyofToCheckValidationSemantics1BoxedMap
-extends [NestedAnyofToCheckValidationSemantics1Boxed](#nestedanyoftocheckvalidationsemantics1boxed) +public record NestedAnyofToCheckValidationSemantics1BoxedMap
+implements [NestedAnyofToCheckValidationSemantics1Boxed](#nestedanyoftocheckvalidationsemantics1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NestedAnyofToCheckValidationSemantics1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NestedAnyofToCheckValidationSemantics1 public static class NestedAnyofToCheckValidationSemantics1
@@ -168,9 +174,11 @@ A schema class that validates payloads | [NestedAnyofToCheckValidationSemantics1BoxedBoolean](#nestedanyoftocheckvalidationsemantics1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [NestedAnyofToCheckValidationSemantics1BoxedMap](#nestedanyoftocheckvalidationsemantics1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [NestedAnyofToCheckValidationSemantics1BoxedList](#nestedanyoftocheckvalidationsemantics1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [NestedAnyofToCheckValidationSemantics1Boxed](#nestedanyoftocheckvalidationsemantics1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema0Boxed -public static abstract sealed class Schema0Boxed
+public sealed interface Schema0Boxed
permits
[Schema0BoxedVoid](#schema0boxedvoid), [Schema0BoxedBoolean](#schema0boxedboolean), @@ -179,103 +187,109 @@ permits
[Schema0BoxedList](#schema0boxedlist), [Schema0BoxedMap](#schema0boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema0BoxedVoid -public static final class Schema0BoxedVoid
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedVoid
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedBoolean -public static final class Schema0BoxedBoolean
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedBoolean
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedNumber -public static final class Schema0BoxedNumber
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedNumber
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedString -public static final class Schema0BoxedString
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedString
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedList -public static final class Schema0BoxedList
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedList
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedMap -public static final class Schema0BoxedMap
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedMap
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0 public static class Schema0
@@ -307,29 +321,32 @@ A schema class that validates payloads | [Schema0BoxedBoolean](#schema0boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Schema0BoxedMap](#schema0boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [Schema0BoxedList](#schema0boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Schema0Boxed](#schema0boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema01Boxed -public static abstract sealed class Schema01Boxed
+public sealed interface Schema01Boxed
permits
[Schema01BoxedVoid](#schema01boxedvoid) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema01BoxedVoid -public static final class Schema01BoxedVoid
-extends [Schema01Boxed](#schema01boxed) +public record Schema01BoxedVoid
+implements [Schema01Boxed](#schema01boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema01BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema01 public static class Schema01
diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/NestedItems.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/NestedItems.md index 36a26e8d039..7f7efb8dd5f 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/NestedItems.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/NestedItems.md @@ -4,7 +4,7 @@ public class NestedItems
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated list payloads, extends FrozenList - classes to build inputs for list payloads @@ -12,52 +12,53 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [NestedItems.NestedItems1Boxed](#nesteditems1boxed)
abstract sealed validated payload class | -| static class | [NestedItems.NestedItems1BoxedList](#nesteditems1boxedlist)
boxed class to store validated List payloads | +| sealed interface | [NestedItems.NestedItems1Boxed](#nesteditems1boxed)
sealed interface for validated payloads | +| record | [NestedItems.NestedItems1BoxedList](#nesteditems1boxedlist)
boxed class to store validated List payloads | | static class | [NestedItems.NestedItems1](#nesteditems1)
schema class | | static class | [NestedItems.NestedItemsListBuilder](#nesteditemslistbuilder)
builder for List payloads | | static class | [NestedItems.NestedItemsList](#nesteditemslist)
output class for List payloads | -| static class | [NestedItems.ItemsBoxed](#itemsboxed)
abstract sealed validated payload class | -| static class | [NestedItems.ItemsBoxedList](#itemsboxedlist)
boxed class to store validated List payloads | +| sealed interface | [NestedItems.ItemsBoxed](#itemsboxed)
sealed interface for validated payloads | +| record | [NestedItems.ItemsBoxedList](#itemsboxedlist)
boxed class to store validated List payloads | | static class | [NestedItems.Items](#items)
schema class | | static class | [NestedItems.ItemsListBuilder2](#itemslistbuilder2)
builder for List payloads | | static class | [NestedItems.ItemsList2](#itemslist2)
output class for List payloads | -| static class | [NestedItems.Items1Boxed](#items1boxed)
abstract sealed validated payload class | -| static class | [NestedItems.Items1BoxedList](#items1boxedlist)
boxed class to store validated List payloads | +| sealed interface | [NestedItems.Items1Boxed](#items1boxed)
sealed interface for validated payloads | +| record | [NestedItems.Items1BoxedList](#items1boxedlist)
boxed class to store validated List payloads | | static class | [NestedItems.Items1](#items1)
schema class | | static class | [NestedItems.ItemsListBuilder1](#itemslistbuilder1)
builder for List payloads | | static class | [NestedItems.ItemsList1](#itemslist1)
output class for List payloads | -| static class | [NestedItems.Items2Boxed](#items2boxed)
abstract sealed validated payload class | -| static class | [NestedItems.Items2BoxedList](#items2boxedlist)
boxed class to store validated List payloads | +| sealed interface | [NestedItems.Items2Boxed](#items2boxed)
sealed interface for validated payloads | +| record | [NestedItems.Items2BoxedList](#items2boxedlist)
boxed class to store validated List payloads | | static class | [NestedItems.Items2](#items2)
schema class | | static class | [NestedItems.ItemsListBuilder](#itemslistbuilder)
builder for List payloads | | static class | [NestedItems.ItemsList](#itemslist)
output class for List payloads | -| static class | [NestedItems.Items3Boxed](#items3boxed)
abstract sealed validated payload class | -| static class | [NestedItems.Items3BoxedNumber](#items3boxednumber)
boxed class to store validated Number payloads | +| sealed interface | [NestedItems.Items3Boxed](#items3boxed)
sealed interface for validated payloads | +| record | [NestedItems.Items3BoxedNumber](#items3boxednumber)
boxed class to store validated Number payloads | | static class | [NestedItems.Items3](#items3)
schema class | ## NestedItems1Boxed -public static abstract sealed class NestedItems1Boxed
+public sealed interface NestedItems1Boxed
permits
[NestedItems1BoxedList](#nesteditems1boxedlist) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## NestedItems1BoxedList -public static final class NestedItems1BoxedList
-extends [NestedItems1Boxed](#nesteditems1boxed) +public record NestedItems1BoxedList
+implements [NestedItems1Boxed](#nesteditems1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NestedItems1BoxedList([NestedItemsList](#nesteditemslist) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [NestedItemsList](#nesteditemslist) | data
validated payload | +| [NestedItemsList](#nesteditemslist) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NestedItems1 public static class NestedItems1
@@ -109,7 +110,9 @@ NestedItems.NestedItemsList validatedPayload = | ----------------- | ---------------------- | | [NestedItemsList](#nesteditemslist) | validate([List](#nesteditemslistbuilder) arg, SchemaConfiguration configuration) | | [NestedItems1BoxedList](#nesteditems1boxedlist) | validateAndBox([List](#nesteditemslistbuilder) arg, SchemaConfiguration configuration) | +| [NestedItems1Boxed](#nesteditems1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## NestedItemsListBuilder public class NestedItemsListBuilder
builder for `List>>>` @@ -140,27 +143,28 @@ A class to store validated List payloads | static [NestedItemsList](#nesteditemslist) | of([List>>>](#nesteditemslistbuilder) arg, SchemaConfiguration configuration) | ## ItemsBoxed -public static abstract sealed class ItemsBoxed
+public sealed interface ItemsBoxed
permits
[ItemsBoxedList](#itemsboxedlist) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ItemsBoxedList -public static final class ItemsBoxedList
-extends [ItemsBoxed](#itemsboxed) +public record ItemsBoxedList
+implements [ItemsBoxed](#itemsboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ItemsBoxedList([ItemsList2](#itemslist2) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [ItemsList2](#itemslist2) | data
validated payload | +| [ItemsList2](#itemslist2) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Items public static class Items
@@ -210,7 +214,9 @@ NestedItems.ItemsList2 validatedPayload = | ----------------- | ---------------------- | | [ItemsList2](#itemslist2) | validate([List](#itemslistbuilder2) arg, SchemaConfiguration configuration) | | [ItemsBoxedList](#itemsboxedlist) | validateAndBox([List](#itemslistbuilder2) arg, SchemaConfiguration configuration) | +| [ItemsBoxed](#itemsboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ItemsListBuilder2 public class ItemsListBuilder2
builder for `List>>` @@ -241,27 +247,28 @@ A class to store validated List payloads | static [ItemsList2](#itemslist2) | of([List>>](#itemslistbuilder2) arg, SchemaConfiguration configuration) | ## Items1Boxed -public static abstract sealed class Items1Boxed
+public sealed interface Items1Boxed
permits
[Items1BoxedList](#items1boxedlist) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Items1BoxedList -public static final class Items1BoxedList
-extends [Items1Boxed](#items1boxed) +public record Items1BoxedList
+implements [Items1Boxed](#items1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Items1BoxedList([ItemsList1](#itemslist1) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [ItemsList1](#itemslist1) | data
validated payload | +| [ItemsList1](#itemslist1) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Items1 public static class Items1
@@ -309,7 +316,9 @@ NestedItems.ItemsList1 validatedPayload = | ----------------- | ---------------------- | | [ItemsList1](#itemslist1) | validate([List](#itemslistbuilder1) arg, SchemaConfiguration configuration) | | [Items1BoxedList](#items1boxedlist) | validateAndBox([List](#itemslistbuilder1) arg, SchemaConfiguration configuration) | +| [Items1Boxed](#items1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ItemsListBuilder1 public class ItemsListBuilder1
builder for `List>` @@ -340,27 +349,28 @@ A class to store validated List payloads | static [ItemsList1](#itemslist1) | of([List>](#itemslistbuilder1) arg, SchemaConfiguration configuration) | ## Items2Boxed -public static abstract sealed class Items2Boxed
+public sealed interface Items2Boxed
permits
[Items2BoxedList](#items2boxedlist) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Items2BoxedList -public static final class Items2BoxedList
-extends [Items2Boxed](#items2boxed) +public record Items2BoxedList
+implements [Items2Boxed](#items2boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Items2BoxedList([ItemsList](#itemslist) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [ItemsList](#itemslist) | data
validated payload | +| [ItemsList](#itemslist) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Items2 public static class Items2
@@ -405,7 +415,9 @@ NestedItems.ItemsList validatedPayload = | ----------------- | ---------------------- | | [ItemsList](#itemslist) | validate([List](#itemslistbuilder) arg, SchemaConfiguration configuration) | | [Items2BoxedList](#items2boxedlist) | validateAndBox([List](#itemslistbuilder) arg, SchemaConfiguration configuration) | +| [Items2Boxed](#items2boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ItemsListBuilder public class ItemsListBuilder
builder for `List` @@ -439,27 +451,28 @@ A class to store validated List payloads | static [ItemsList](#itemslist) | of([List](#itemslistbuilder) arg, SchemaConfiguration configuration) | ## Items3Boxed -public static abstract sealed class Items3Boxed
+public sealed interface Items3Boxed
permits
[Items3BoxedNumber](#items3boxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Items3BoxedNumber -public static final class Items3BoxedNumber
-extends [Items3Boxed](#items3boxed) +public record Items3BoxedNumber
+implements [Items3Boxed](#items3boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Items3BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Items3 public static class Items3
diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/NestedOneofToCheckValidationSemantics.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/NestedOneofToCheckValidationSemantics.md index 0bf18e4dad3..ee3e1712834 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/NestedOneofToCheckValidationSemantics.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/NestedOneofToCheckValidationSemantics.md @@ -4,34 +4,34 @@ public class NestedOneofToCheckValidationSemantics
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [NestedOneofToCheckValidationSemantics.NestedOneofToCheckValidationSemantics1Boxed](#nestedoneoftocheckvalidationsemantics1boxed)
abstract sealed validated payload class | -| static class | [NestedOneofToCheckValidationSemantics.NestedOneofToCheckValidationSemantics1BoxedVoid](#nestedoneoftocheckvalidationsemantics1boxedvoid)
boxed class to store validated null payloads | -| static class | [NestedOneofToCheckValidationSemantics.NestedOneofToCheckValidationSemantics1BoxedBoolean](#nestedoneoftocheckvalidationsemantics1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [NestedOneofToCheckValidationSemantics.NestedOneofToCheckValidationSemantics1BoxedNumber](#nestedoneoftocheckvalidationsemantics1boxednumber)
boxed class to store validated Number payloads | -| static class | [NestedOneofToCheckValidationSemantics.NestedOneofToCheckValidationSemantics1BoxedString](#nestedoneoftocheckvalidationsemantics1boxedstring)
boxed class to store validated String payloads | -| static class | [NestedOneofToCheckValidationSemantics.NestedOneofToCheckValidationSemantics1BoxedList](#nestedoneoftocheckvalidationsemantics1boxedlist)
boxed class to store validated List payloads | -| static class | [NestedOneofToCheckValidationSemantics.NestedOneofToCheckValidationSemantics1BoxedMap](#nestedoneoftocheckvalidationsemantics1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [NestedOneofToCheckValidationSemantics.NestedOneofToCheckValidationSemantics1Boxed](#nestedoneoftocheckvalidationsemantics1boxed)
sealed interface for validated payloads | +| record | [NestedOneofToCheckValidationSemantics.NestedOneofToCheckValidationSemantics1BoxedVoid](#nestedoneoftocheckvalidationsemantics1boxedvoid)
boxed class to store validated null payloads | +| record | [NestedOneofToCheckValidationSemantics.NestedOneofToCheckValidationSemantics1BoxedBoolean](#nestedoneoftocheckvalidationsemantics1boxedboolean)
boxed class to store validated boolean payloads | +| record | [NestedOneofToCheckValidationSemantics.NestedOneofToCheckValidationSemantics1BoxedNumber](#nestedoneoftocheckvalidationsemantics1boxednumber)
boxed class to store validated Number payloads | +| record | [NestedOneofToCheckValidationSemantics.NestedOneofToCheckValidationSemantics1BoxedString](#nestedoneoftocheckvalidationsemantics1boxedstring)
boxed class to store validated String payloads | +| record | [NestedOneofToCheckValidationSemantics.NestedOneofToCheckValidationSemantics1BoxedList](#nestedoneoftocheckvalidationsemantics1boxedlist)
boxed class to store validated List payloads | +| record | [NestedOneofToCheckValidationSemantics.NestedOneofToCheckValidationSemantics1BoxedMap](#nestedoneoftocheckvalidationsemantics1boxedmap)
boxed class to store validated Map payloads | | static class | [NestedOneofToCheckValidationSemantics.NestedOneofToCheckValidationSemantics1](#nestedoneoftocheckvalidationsemantics1)
schema class | -| static class | [NestedOneofToCheckValidationSemantics.Schema0Boxed](#schema0boxed)
abstract sealed validated payload class | -| static class | [NestedOneofToCheckValidationSemantics.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | -| static class | [NestedOneofToCheckValidationSemantics.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | -| static class | [NestedOneofToCheckValidationSemantics.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | -| static class | [NestedOneofToCheckValidationSemantics.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | -| static class | [NestedOneofToCheckValidationSemantics.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | -| static class | [NestedOneofToCheckValidationSemantics.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [NestedOneofToCheckValidationSemantics.Schema0Boxed](#schema0boxed)
sealed interface for validated payloads | +| record | [NestedOneofToCheckValidationSemantics.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | +| record | [NestedOneofToCheckValidationSemantics.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | +| record | [NestedOneofToCheckValidationSemantics.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | +| record | [NestedOneofToCheckValidationSemantics.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | +| record | [NestedOneofToCheckValidationSemantics.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | +| record | [NestedOneofToCheckValidationSemantics.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | | static class | [NestedOneofToCheckValidationSemantics.Schema0](#schema0)
schema class | -| static class | [NestedOneofToCheckValidationSemantics.Schema01Boxed](#schema01boxed)
abstract sealed validated payload class | -| static class | [NestedOneofToCheckValidationSemantics.Schema01BoxedVoid](#schema01boxedvoid)
boxed class to store validated null payloads | +| sealed interface | [NestedOneofToCheckValidationSemantics.Schema01Boxed](#schema01boxed)
sealed interface for validated payloads | +| record | [NestedOneofToCheckValidationSemantics.Schema01BoxedVoid](#schema01boxedvoid)
boxed class to store validated null payloads | | static class | [NestedOneofToCheckValidationSemantics.Schema01](#schema01)
schema class | ## NestedOneofToCheckValidationSemantics1Boxed -public static abstract sealed class NestedOneofToCheckValidationSemantics1Boxed
+public sealed interface NestedOneofToCheckValidationSemantics1Boxed
permits
[NestedOneofToCheckValidationSemantics1BoxedVoid](#nestedoneoftocheckvalidationsemantics1boxedvoid), [NestedOneofToCheckValidationSemantics1BoxedBoolean](#nestedoneoftocheckvalidationsemantics1boxedboolean), @@ -40,103 +40,109 @@ permits
[NestedOneofToCheckValidationSemantics1BoxedList](#nestedoneoftocheckvalidationsemantics1boxedlist), [NestedOneofToCheckValidationSemantics1BoxedMap](#nestedoneoftocheckvalidationsemantics1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## NestedOneofToCheckValidationSemantics1BoxedVoid -public static final class NestedOneofToCheckValidationSemantics1BoxedVoid
-extends [NestedOneofToCheckValidationSemantics1Boxed](#nestedoneoftocheckvalidationsemantics1boxed) +public record NestedOneofToCheckValidationSemantics1BoxedVoid
+implements [NestedOneofToCheckValidationSemantics1Boxed](#nestedoneoftocheckvalidationsemantics1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NestedOneofToCheckValidationSemantics1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NestedOneofToCheckValidationSemantics1BoxedBoolean -public static final class NestedOneofToCheckValidationSemantics1BoxedBoolean
-extends [NestedOneofToCheckValidationSemantics1Boxed](#nestedoneoftocheckvalidationsemantics1boxed) +public record NestedOneofToCheckValidationSemantics1BoxedBoolean
+implements [NestedOneofToCheckValidationSemantics1Boxed](#nestedoneoftocheckvalidationsemantics1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NestedOneofToCheckValidationSemantics1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NestedOneofToCheckValidationSemantics1BoxedNumber -public static final class NestedOneofToCheckValidationSemantics1BoxedNumber
-extends [NestedOneofToCheckValidationSemantics1Boxed](#nestedoneoftocheckvalidationsemantics1boxed) +public record NestedOneofToCheckValidationSemantics1BoxedNumber
+implements [NestedOneofToCheckValidationSemantics1Boxed](#nestedoneoftocheckvalidationsemantics1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NestedOneofToCheckValidationSemantics1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NestedOneofToCheckValidationSemantics1BoxedString -public static final class NestedOneofToCheckValidationSemantics1BoxedString
-extends [NestedOneofToCheckValidationSemantics1Boxed](#nestedoneoftocheckvalidationsemantics1boxed) +public record NestedOneofToCheckValidationSemantics1BoxedString
+implements [NestedOneofToCheckValidationSemantics1Boxed](#nestedoneoftocheckvalidationsemantics1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NestedOneofToCheckValidationSemantics1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NestedOneofToCheckValidationSemantics1BoxedList -public static final class NestedOneofToCheckValidationSemantics1BoxedList
-extends [NestedOneofToCheckValidationSemantics1Boxed](#nestedoneoftocheckvalidationsemantics1boxed) +public record NestedOneofToCheckValidationSemantics1BoxedList
+implements [NestedOneofToCheckValidationSemantics1Boxed](#nestedoneoftocheckvalidationsemantics1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NestedOneofToCheckValidationSemantics1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NestedOneofToCheckValidationSemantics1BoxedMap -public static final class NestedOneofToCheckValidationSemantics1BoxedMap
-extends [NestedOneofToCheckValidationSemantics1Boxed](#nestedoneoftocheckvalidationsemantics1boxed) +public record NestedOneofToCheckValidationSemantics1BoxedMap
+implements [NestedOneofToCheckValidationSemantics1Boxed](#nestedoneoftocheckvalidationsemantics1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NestedOneofToCheckValidationSemantics1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NestedOneofToCheckValidationSemantics1 public static class NestedOneofToCheckValidationSemantics1
@@ -168,9 +174,11 @@ A schema class that validates payloads | [NestedOneofToCheckValidationSemantics1BoxedBoolean](#nestedoneoftocheckvalidationsemantics1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [NestedOneofToCheckValidationSemantics1BoxedMap](#nestedoneoftocheckvalidationsemantics1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [NestedOneofToCheckValidationSemantics1BoxedList](#nestedoneoftocheckvalidationsemantics1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [NestedOneofToCheckValidationSemantics1Boxed](#nestedoneoftocheckvalidationsemantics1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema0Boxed -public static abstract sealed class Schema0Boxed
+public sealed interface Schema0Boxed
permits
[Schema0BoxedVoid](#schema0boxedvoid), [Schema0BoxedBoolean](#schema0boxedboolean), @@ -179,103 +187,109 @@ permits
[Schema0BoxedList](#schema0boxedlist), [Schema0BoxedMap](#schema0boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema0BoxedVoid -public static final class Schema0BoxedVoid
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedVoid
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedBoolean -public static final class Schema0BoxedBoolean
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedBoolean
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedNumber -public static final class Schema0BoxedNumber
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedNumber
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedString -public static final class Schema0BoxedString
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedString
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedList -public static final class Schema0BoxedList
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedList
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedMap -public static final class Schema0BoxedMap
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedMap
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0 public static class Schema0
@@ -307,29 +321,32 @@ A schema class that validates payloads | [Schema0BoxedBoolean](#schema0boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Schema0BoxedMap](#schema0boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [Schema0BoxedList](#schema0boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Schema0Boxed](#schema0boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema01Boxed -public static abstract sealed class Schema01Boxed
+public sealed interface Schema01Boxed
permits
[Schema01BoxedVoid](#schema01boxedvoid) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema01BoxedVoid -public static final class Schema01BoxedVoid
-extends [Schema01Boxed](#schema01boxed) +public record Schema01BoxedVoid
+implements [Schema01Boxed](#schema01boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema01BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema01 public static class Schema01
diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/NonAsciiPatternWithAdditionalproperties.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/NonAsciiPatternWithAdditionalproperties.md index ae12de64705..30f7135062f 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/NonAsciiPatternWithAdditionalproperties.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/NonAsciiPatternWithAdditionalproperties.md @@ -4,7 +4,7 @@ public class NonAsciiPatternWithAdditionalproperties
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,50 +12,51 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [NonAsciiPatternWithAdditionalproperties.NonAsciiPatternWithAdditionalproperties1Boxed](#nonasciipatternwithadditionalproperties1boxed)
abstract sealed validated payload class | -| static class | [NonAsciiPatternWithAdditionalproperties.NonAsciiPatternWithAdditionalproperties1BoxedMap](#nonasciipatternwithadditionalproperties1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [NonAsciiPatternWithAdditionalproperties.NonAsciiPatternWithAdditionalproperties1Boxed](#nonasciipatternwithadditionalproperties1boxed)
sealed interface for validated payloads | +| record | [NonAsciiPatternWithAdditionalproperties.NonAsciiPatternWithAdditionalproperties1BoxedMap](#nonasciipatternwithadditionalproperties1boxedmap)
boxed class to store validated Map payloads | | static class | [NonAsciiPatternWithAdditionalproperties.NonAsciiPatternWithAdditionalproperties1](#nonasciipatternwithadditionalproperties1)
schema class | | static class | [NonAsciiPatternWithAdditionalproperties.NonAsciiPatternWithAdditionalpropertiesMapBuilder](#nonasciipatternwithadditionalpropertiesmapbuilder)
builder for Map payloads | | static class | [NonAsciiPatternWithAdditionalproperties.NonAsciiPatternWithAdditionalpropertiesMap](#nonasciipatternwithadditionalpropertiesmap)
output class for Map payloads | -| static class | [NonAsciiPatternWithAdditionalproperties.CircumflexAccentLatinSmallLetterAWithAcuteBoxed](#circumflexaccentlatinsmallletterawithacuteboxed)
abstract sealed validated payload class | -| static class | [NonAsciiPatternWithAdditionalproperties.CircumflexAccentLatinSmallLetterAWithAcuteBoxedVoid](#circumflexaccentlatinsmallletterawithacuteboxedvoid)
boxed class to store validated null payloads | -| static class | [NonAsciiPatternWithAdditionalproperties.CircumflexAccentLatinSmallLetterAWithAcuteBoxedBoolean](#circumflexaccentlatinsmallletterawithacuteboxedboolean)
boxed class to store validated boolean payloads | -| static class | [NonAsciiPatternWithAdditionalproperties.CircumflexAccentLatinSmallLetterAWithAcuteBoxedNumber](#circumflexaccentlatinsmallletterawithacuteboxednumber)
boxed class to store validated Number payloads | -| static class | [NonAsciiPatternWithAdditionalproperties.CircumflexAccentLatinSmallLetterAWithAcuteBoxedString](#circumflexaccentlatinsmallletterawithacuteboxedstring)
boxed class to store validated String payloads | -| static class | [NonAsciiPatternWithAdditionalproperties.CircumflexAccentLatinSmallLetterAWithAcuteBoxedList](#circumflexaccentlatinsmallletterawithacuteboxedlist)
boxed class to store validated List payloads | -| static class | [NonAsciiPatternWithAdditionalproperties.CircumflexAccentLatinSmallLetterAWithAcuteBoxedMap](#circumflexaccentlatinsmallletterawithacuteboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [NonAsciiPatternWithAdditionalproperties.CircumflexAccentLatinSmallLetterAWithAcuteBoxed](#circumflexaccentlatinsmallletterawithacuteboxed)
sealed interface for validated payloads | +| record | [NonAsciiPatternWithAdditionalproperties.CircumflexAccentLatinSmallLetterAWithAcuteBoxedVoid](#circumflexaccentlatinsmallletterawithacuteboxedvoid)
boxed class to store validated null payloads | +| record | [NonAsciiPatternWithAdditionalproperties.CircumflexAccentLatinSmallLetterAWithAcuteBoxedBoolean](#circumflexaccentlatinsmallletterawithacuteboxedboolean)
boxed class to store validated boolean payloads | +| record | [NonAsciiPatternWithAdditionalproperties.CircumflexAccentLatinSmallLetterAWithAcuteBoxedNumber](#circumflexaccentlatinsmallletterawithacuteboxednumber)
boxed class to store validated Number payloads | +| record | [NonAsciiPatternWithAdditionalproperties.CircumflexAccentLatinSmallLetterAWithAcuteBoxedString](#circumflexaccentlatinsmallletterawithacuteboxedstring)
boxed class to store validated String payloads | +| record | [NonAsciiPatternWithAdditionalproperties.CircumflexAccentLatinSmallLetterAWithAcuteBoxedList](#circumflexaccentlatinsmallletterawithacuteboxedlist)
boxed class to store validated List payloads | +| record | [NonAsciiPatternWithAdditionalproperties.CircumflexAccentLatinSmallLetterAWithAcuteBoxedMap](#circumflexaccentlatinsmallletterawithacuteboxedmap)
boxed class to store validated Map payloads | | static class | [NonAsciiPatternWithAdditionalproperties.CircumflexAccentLatinSmallLetterAWithAcute](#circumflexaccentlatinsmallletterawithacute)
schema class | -| static class | [NonAsciiPatternWithAdditionalproperties.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
abstract sealed validated payload class | -| static class | [NonAsciiPatternWithAdditionalproperties.AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid)
boxed class to store validated null payloads | -| static class | [NonAsciiPatternWithAdditionalproperties.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | -| static class | [NonAsciiPatternWithAdditionalproperties.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | -| static class | [NonAsciiPatternWithAdditionalproperties.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | -| static class | [NonAsciiPatternWithAdditionalproperties.AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist)
boxed class to store validated List payloads | -| static class | [NonAsciiPatternWithAdditionalproperties.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [NonAsciiPatternWithAdditionalproperties.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
sealed interface for validated payloads | +| record | [NonAsciiPatternWithAdditionalproperties.AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid)
boxed class to store validated null payloads | +| record | [NonAsciiPatternWithAdditionalproperties.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | +| record | [NonAsciiPatternWithAdditionalproperties.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | +| record | [NonAsciiPatternWithAdditionalproperties.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | +| record | [NonAsciiPatternWithAdditionalproperties.AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist)
boxed class to store validated List payloads | +| record | [NonAsciiPatternWithAdditionalproperties.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | | static class | [NonAsciiPatternWithAdditionalproperties.AdditionalProperties](#additionalproperties)
schema class | ## NonAsciiPatternWithAdditionalproperties1Boxed -public static abstract sealed class NonAsciiPatternWithAdditionalproperties1Boxed
+public sealed interface NonAsciiPatternWithAdditionalproperties1Boxed
permits
[NonAsciiPatternWithAdditionalproperties1BoxedMap](#nonasciipatternwithadditionalproperties1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## NonAsciiPatternWithAdditionalproperties1BoxedMap -public static final class NonAsciiPatternWithAdditionalproperties1BoxedMap
-extends [NonAsciiPatternWithAdditionalproperties1Boxed](#nonasciipatternwithadditionalproperties1boxed) +public record NonAsciiPatternWithAdditionalproperties1BoxedMap
+implements [NonAsciiPatternWithAdditionalproperties1Boxed](#nonasciipatternwithadditionalproperties1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NonAsciiPatternWithAdditionalproperties1BoxedMap([NonAsciiPatternWithAdditionalpropertiesMap](#nonasciipatternwithadditionalpropertiesmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [NonAsciiPatternWithAdditionalpropertiesMap](#nonasciipatternwithadditionalpropertiesmap) | data
validated payload | +| [NonAsciiPatternWithAdditionalpropertiesMap](#nonasciipatternwithadditionalpropertiesmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NonAsciiPatternWithAdditionalproperties1 public static class NonAsciiPatternWithAdditionalproperties1
@@ -99,7 +100,9 @@ NonAsciiPatternWithAdditionalproperties.NonAsciiPatternWithAdditionalpropertiesM | ----------------- | ---------------------- | | [NonAsciiPatternWithAdditionalpropertiesMap](#nonasciipatternwithadditionalpropertiesmap) | validate([Map<?, ?>](#nonasciipatternwithadditionalpropertiesmapbuilder) arg, SchemaConfiguration configuration) | | [NonAsciiPatternWithAdditionalproperties1BoxedMap](#nonasciipatternwithadditionalproperties1boxedmap) | validateAndBox([Map<?, ?>](#nonasciipatternwithadditionalpropertiesmapbuilder) arg, SchemaConfiguration configuration) | +| [NonAsciiPatternWithAdditionalproperties1Boxed](#nonasciipatternwithadditionalproperties1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## NonAsciiPatternWithAdditionalpropertiesMapBuilder public class NonAsciiPatternWithAdditionalpropertiesMapBuilder
builder for `Map` @@ -128,7 +131,7 @@ A class to store validated Map payloads | static [NonAsciiPatternWithAdditionalpropertiesMap](#nonasciipatternwithadditionalpropertiesmap) | of([Map](#nonasciipatternwithadditionalpropertiesmapbuilder) arg, SchemaConfiguration configuration) | ## CircumflexAccentLatinSmallLetterAWithAcuteBoxed -public static abstract sealed class CircumflexAccentLatinSmallLetterAWithAcuteBoxed
+public sealed interface CircumflexAccentLatinSmallLetterAWithAcuteBoxed
permits
[CircumflexAccentLatinSmallLetterAWithAcuteBoxedVoid](#circumflexaccentlatinsmallletterawithacuteboxedvoid), [CircumflexAccentLatinSmallLetterAWithAcuteBoxedBoolean](#circumflexaccentlatinsmallletterawithacuteboxedboolean), @@ -137,103 +140,109 @@ permits
[CircumflexAccentLatinSmallLetterAWithAcuteBoxedList](#circumflexaccentlatinsmallletterawithacuteboxedlist), [CircumflexAccentLatinSmallLetterAWithAcuteBoxedMap](#circumflexaccentlatinsmallletterawithacuteboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## CircumflexAccentLatinSmallLetterAWithAcuteBoxedVoid -public static final class CircumflexAccentLatinSmallLetterAWithAcuteBoxedVoid
-extends [CircumflexAccentLatinSmallLetterAWithAcuteBoxed](#circumflexaccentlatinsmallletterawithacuteboxed) +public record CircumflexAccentLatinSmallLetterAWithAcuteBoxedVoid
+implements [CircumflexAccentLatinSmallLetterAWithAcuteBoxed](#circumflexaccentlatinsmallletterawithacuteboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | CircumflexAccentLatinSmallLetterAWithAcuteBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## CircumflexAccentLatinSmallLetterAWithAcuteBoxedBoolean -public static final class CircumflexAccentLatinSmallLetterAWithAcuteBoxedBoolean
-extends [CircumflexAccentLatinSmallLetterAWithAcuteBoxed](#circumflexaccentlatinsmallletterawithacuteboxed) +public record CircumflexAccentLatinSmallLetterAWithAcuteBoxedBoolean
+implements [CircumflexAccentLatinSmallLetterAWithAcuteBoxed](#circumflexaccentlatinsmallletterawithacuteboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | CircumflexAccentLatinSmallLetterAWithAcuteBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## CircumflexAccentLatinSmallLetterAWithAcuteBoxedNumber -public static final class CircumflexAccentLatinSmallLetterAWithAcuteBoxedNumber
-extends [CircumflexAccentLatinSmallLetterAWithAcuteBoxed](#circumflexaccentlatinsmallletterawithacuteboxed) +public record CircumflexAccentLatinSmallLetterAWithAcuteBoxedNumber
+implements [CircumflexAccentLatinSmallLetterAWithAcuteBoxed](#circumflexaccentlatinsmallletterawithacuteboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | CircumflexAccentLatinSmallLetterAWithAcuteBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## CircumflexAccentLatinSmallLetterAWithAcuteBoxedString -public static final class CircumflexAccentLatinSmallLetterAWithAcuteBoxedString
-extends [CircumflexAccentLatinSmallLetterAWithAcuteBoxed](#circumflexaccentlatinsmallletterawithacuteboxed) +public record CircumflexAccentLatinSmallLetterAWithAcuteBoxedString
+implements [CircumflexAccentLatinSmallLetterAWithAcuteBoxed](#circumflexaccentlatinsmallletterawithacuteboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | CircumflexAccentLatinSmallLetterAWithAcuteBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## CircumflexAccentLatinSmallLetterAWithAcuteBoxedList -public static final class CircumflexAccentLatinSmallLetterAWithAcuteBoxedList
-extends [CircumflexAccentLatinSmallLetterAWithAcuteBoxed](#circumflexaccentlatinsmallletterawithacuteboxed) +public record CircumflexAccentLatinSmallLetterAWithAcuteBoxedList
+implements [CircumflexAccentLatinSmallLetterAWithAcuteBoxed](#circumflexaccentlatinsmallletterawithacuteboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | CircumflexAccentLatinSmallLetterAWithAcuteBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## CircumflexAccentLatinSmallLetterAWithAcuteBoxedMap -public static final class CircumflexAccentLatinSmallLetterAWithAcuteBoxedMap
-extends [CircumflexAccentLatinSmallLetterAWithAcuteBoxed](#circumflexaccentlatinsmallletterawithacuteboxed) +public record CircumflexAccentLatinSmallLetterAWithAcuteBoxedMap
+implements [CircumflexAccentLatinSmallLetterAWithAcuteBoxed](#circumflexaccentlatinsmallletterawithacuteboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | CircumflexAccentLatinSmallLetterAWithAcuteBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## CircumflexAccentLatinSmallLetterAWithAcute public static class CircumflexAccentLatinSmallLetterAWithAcute
@@ -247,7 +256,7 @@ A schema class that validates payloads | validateAndBox | ## AdditionalPropertiesBoxed -public static abstract sealed class AdditionalPropertiesBoxed
+public sealed interface AdditionalPropertiesBoxed
permits
[AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid), [AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean), @@ -256,103 +265,109 @@ permits
[AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist), [AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AdditionalPropertiesBoxedVoid -public static final class AdditionalPropertiesBoxedVoid
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedVoid
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedBoolean -public static final class AdditionalPropertiesBoxedBoolean
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedBoolean
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedNumber -public static final class AdditionalPropertiesBoxedNumber
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedNumber
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedString -public static final class AdditionalPropertiesBoxedString
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedString
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedList -public static final class AdditionalPropertiesBoxedList
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedList
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedMap -public static final class AdditionalPropertiesBoxedMap
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedMap
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalProperties public static class AdditionalProperties
diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/NonInterferenceAcrossCombinedSchemas.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/NonInterferenceAcrossCombinedSchemas.md index 392ced31f44..727c527c7b2 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/NonInterferenceAcrossCombinedSchemas.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/NonInterferenceAcrossCombinedSchemas.md @@ -4,71 +4,71 @@ public class NonInterferenceAcrossCombinedSchemas
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [NonInterferenceAcrossCombinedSchemas.NonInterferenceAcrossCombinedSchemas1Boxed](#noninterferenceacrosscombinedschemas1boxed)
abstract sealed validated payload class | -| static class | [NonInterferenceAcrossCombinedSchemas.NonInterferenceAcrossCombinedSchemas1BoxedVoid](#noninterferenceacrosscombinedschemas1boxedvoid)
boxed class to store validated null payloads | -| static class | [NonInterferenceAcrossCombinedSchemas.NonInterferenceAcrossCombinedSchemas1BoxedBoolean](#noninterferenceacrosscombinedschemas1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [NonInterferenceAcrossCombinedSchemas.NonInterferenceAcrossCombinedSchemas1BoxedNumber](#noninterferenceacrosscombinedschemas1boxednumber)
boxed class to store validated Number payloads | -| static class | [NonInterferenceAcrossCombinedSchemas.NonInterferenceAcrossCombinedSchemas1BoxedString](#noninterferenceacrosscombinedschemas1boxedstring)
boxed class to store validated String payloads | -| static class | [NonInterferenceAcrossCombinedSchemas.NonInterferenceAcrossCombinedSchemas1BoxedList](#noninterferenceacrosscombinedschemas1boxedlist)
boxed class to store validated List payloads | -| static class | [NonInterferenceAcrossCombinedSchemas.NonInterferenceAcrossCombinedSchemas1BoxedMap](#noninterferenceacrosscombinedschemas1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [NonInterferenceAcrossCombinedSchemas.NonInterferenceAcrossCombinedSchemas1Boxed](#noninterferenceacrosscombinedschemas1boxed)
sealed interface for validated payloads | +| record | [NonInterferenceAcrossCombinedSchemas.NonInterferenceAcrossCombinedSchemas1BoxedVoid](#noninterferenceacrosscombinedschemas1boxedvoid)
boxed class to store validated null payloads | +| record | [NonInterferenceAcrossCombinedSchemas.NonInterferenceAcrossCombinedSchemas1BoxedBoolean](#noninterferenceacrosscombinedschemas1boxedboolean)
boxed class to store validated boolean payloads | +| record | [NonInterferenceAcrossCombinedSchemas.NonInterferenceAcrossCombinedSchemas1BoxedNumber](#noninterferenceacrosscombinedschemas1boxednumber)
boxed class to store validated Number payloads | +| record | [NonInterferenceAcrossCombinedSchemas.NonInterferenceAcrossCombinedSchemas1BoxedString](#noninterferenceacrosscombinedschemas1boxedstring)
boxed class to store validated String payloads | +| record | [NonInterferenceAcrossCombinedSchemas.NonInterferenceAcrossCombinedSchemas1BoxedList](#noninterferenceacrosscombinedschemas1boxedlist)
boxed class to store validated List payloads | +| record | [NonInterferenceAcrossCombinedSchemas.NonInterferenceAcrossCombinedSchemas1BoxedMap](#noninterferenceacrosscombinedschemas1boxedmap)
boxed class to store validated Map payloads | | static class | [NonInterferenceAcrossCombinedSchemas.NonInterferenceAcrossCombinedSchemas1](#noninterferenceacrosscombinedschemas1)
schema class | -| static class | [NonInterferenceAcrossCombinedSchemas.Schema2Boxed](#schema2boxed)
abstract sealed validated payload class | -| static class | [NonInterferenceAcrossCombinedSchemas.Schema2BoxedVoid](#schema2boxedvoid)
boxed class to store validated null payloads | -| static class | [NonInterferenceAcrossCombinedSchemas.Schema2BoxedBoolean](#schema2boxedboolean)
boxed class to store validated boolean payloads | -| static class | [NonInterferenceAcrossCombinedSchemas.Schema2BoxedNumber](#schema2boxednumber)
boxed class to store validated Number payloads | -| static class | [NonInterferenceAcrossCombinedSchemas.Schema2BoxedString](#schema2boxedstring)
boxed class to store validated String payloads | -| static class | [NonInterferenceAcrossCombinedSchemas.Schema2BoxedList](#schema2boxedlist)
boxed class to store validated List payloads | -| static class | [NonInterferenceAcrossCombinedSchemas.Schema2BoxedMap](#schema2boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [NonInterferenceAcrossCombinedSchemas.Schema2Boxed](#schema2boxed)
sealed interface for validated payloads | +| record | [NonInterferenceAcrossCombinedSchemas.Schema2BoxedVoid](#schema2boxedvoid)
boxed class to store validated null payloads | +| record | [NonInterferenceAcrossCombinedSchemas.Schema2BoxedBoolean](#schema2boxedboolean)
boxed class to store validated boolean payloads | +| record | [NonInterferenceAcrossCombinedSchemas.Schema2BoxedNumber](#schema2boxednumber)
boxed class to store validated Number payloads | +| record | [NonInterferenceAcrossCombinedSchemas.Schema2BoxedString](#schema2boxedstring)
boxed class to store validated String payloads | +| record | [NonInterferenceAcrossCombinedSchemas.Schema2BoxedList](#schema2boxedlist)
boxed class to store validated List payloads | +| record | [NonInterferenceAcrossCombinedSchemas.Schema2BoxedMap](#schema2boxedmap)
boxed class to store validated Map payloads | | static class | [NonInterferenceAcrossCombinedSchemas.Schema2](#schema2)
schema class | -| static class | [NonInterferenceAcrossCombinedSchemas.ElseSchemaBoxed](#elseschemaboxed)
abstract sealed validated payload class | -| static class | [NonInterferenceAcrossCombinedSchemas.ElseSchemaBoxedVoid](#elseschemaboxedvoid)
boxed class to store validated null payloads | -| static class | [NonInterferenceAcrossCombinedSchemas.ElseSchemaBoxedBoolean](#elseschemaboxedboolean)
boxed class to store validated boolean payloads | -| static class | [NonInterferenceAcrossCombinedSchemas.ElseSchemaBoxedNumber](#elseschemaboxednumber)
boxed class to store validated Number payloads | -| static class | [NonInterferenceAcrossCombinedSchemas.ElseSchemaBoxedString](#elseschemaboxedstring)
boxed class to store validated String payloads | -| static class | [NonInterferenceAcrossCombinedSchemas.ElseSchemaBoxedList](#elseschemaboxedlist)
boxed class to store validated List payloads | -| static class | [NonInterferenceAcrossCombinedSchemas.ElseSchemaBoxedMap](#elseschemaboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [NonInterferenceAcrossCombinedSchemas.ElseSchemaBoxed](#elseschemaboxed)
sealed interface for validated payloads | +| record | [NonInterferenceAcrossCombinedSchemas.ElseSchemaBoxedVoid](#elseschemaboxedvoid)
boxed class to store validated null payloads | +| record | [NonInterferenceAcrossCombinedSchemas.ElseSchemaBoxedBoolean](#elseschemaboxedboolean)
boxed class to store validated boolean payloads | +| record | [NonInterferenceAcrossCombinedSchemas.ElseSchemaBoxedNumber](#elseschemaboxednumber)
boxed class to store validated Number payloads | +| record | [NonInterferenceAcrossCombinedSchemas.ElseSchemaBoxedString](#elseschemaboxedstring)
boxed class to store validated String payloads | +| record | [NonInterferenceAcrossCombinedSchemas.ElseSchemaBoxedList](#elseschemaboxedlist)
boxed class to store validated List payloads | +| record | [NonInterferenceAcrossCombinedSchemas.ElseSchemaBoxedMap](#elseschemaboxedmap)
boxed class to store validated Map payloads | | static class | [NonInterferenceAcrossCombinedSchemas.ElseSchema](#elseschema)
schema class | -| static class | [NonInterferenceAcrossCombinedSchemas.Schema1Boxed](#schema1boxed)
abstract sealed validated payload class | -| static class | [NonInterferenceAcrossCombinedSchemas.Schema1BoxedVoid](#schema1boxedvoid)
boxed class to store validated null payloads | -| static class | [NonInterferenceAcrossCombinedSchemas.Schema1BoxedBoolean](#schema1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [NonInterferenceAcrossCombinedSchemas.Schema1BoxedNumber](#schema1boxednumber)
boxed class to store validated Number payloads | -| static class | [NonInterferenceAcrossCombinedSchemas.Schema1BoxedString](#schema1boxedstring)
boxed class to store validated String payloads | -| static class | [NonInterferenceAcrossCombinedSchemas.Schema1BoxedList](#schema1boxedlist)
boxed class to store validated List payloads | -| static class | [NonInterferenceAcrossCombinedSchemas.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [NonInterferenceAcrossCombinedSchemas.Schema1Boxed](#schema1boxed)
sealed interface for validated payloads | +| record | [NonInterferenceAcrossCombinedSchemas.Schema1BoxedVoid](#schema1boxedvoid)
boxed class to store validated null payloads | +| record | [NonInterferenceAcrossCombinedSchemas.Schema1BoxedBoolean](#schema1boxedboolean)
boxed class to store validated boolean payloads | +| record | [NonInterferenceAcrossCombinedSchemas.Schema1BoxedNumber](#schema1boxednumber)
boxed class to store validated Number payloads | +| record | [NonInterferenceAcrossCombinedSchemas.Schema1BoxedString](#schema1boxedstring)
boxed class to store validated String payloads | +| record | [NonInterferenceAcrossCombinedSchemas.Schema1BoxedList](#schema1boxedlist)
boxed class to store validated List payloads | +| record | [NonInterferenceAcrossCombinedSchemas.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | | static class | [NonInterferenceAcrossCombinedSchemas.Schema1](#schema1)
schema class | -| static class | [NonInterferenceAcrossCombinedSchemas.ThenBoxed](#thenboxed)
abstract sealed validated payload class | -| static class | [NonInterferenceAcrossCombinedSchemas.ThenBoxedVoid](#thenboxedvoid)
boxed class to store validated null payloads | -| static class | [NonInterferenceAcrossCombinedSchemas.ThenBoxedBoolean](#thenboxedboolean)
boxed class to store validated boolean payloads | -| static class | [NonInterferenceAcrossCombinedSchemas.ThenBoxedNumber](#thenboxednumber)
boxed class to store validated Number payloads | -| static class | [NonInterferenceAcrossCombinedSchemas.ThenBoxedString](#thenboxedstring)
boxed class to store validated String payloads | -| static class | [NonInterferenceAcrossCombinedSchemas.ThenBoxedList](#thenboxedlist)
boxed class to store validated List payloads | -| static class | [NonInterferenceAcrossCombinedSchemas.ThenBoxedMap](#thenboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [NonInterferenceAcrossCombinedSchemas.ThenBoxed](#thenboxed)
sealed interface for validated payloads | +| record | [NonInterferenceAcrossCombinedSchemas.ThenBoxedVoid](#thenboxedvoid)
boxed class to store validated null payloads | +| record | [NonInterferenceAcrossCombinedSchemas.ThenBoxedBoolean](#thenboxedboolean)
boxed class to store validated boolean payloads | +| record | [NonInterferenceAcrossCombinedSchemas.ThenBoxedNumber](#thenboxednumber)
boxed class to store validated Number payloads | +| record | [NonInterferenceAcrossCombinedSchemas.ThenBoxedString](#thenboxedstring)
boxed class to store validated String payloads | +| record | [NonInterferenceAcrossCombinedSchemas.ThenBoxedList](#thenboxedlist)
boxed class to store validated List payloads | +| record | [NonInterferenceAcrossCombinedSchemas.ThenBoxedMap](#thenboxedmap)
boxed class to store validated Map payloads | | static class | [NonInterferenceAcrossCombinedSchemas.Then](#then)
schema class | -| static class | [NonInterferenceAcrossCombinedSchemas.Schema0Boxed](#schema0boxed)
abstract sealed validated payload class | -| static class | [NonInterferenceAcrossCombinedSchemas.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | -| static class | [NonInterferenceAcrossCombinedSchemas.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | -| static class | [NonInterferenceAcrossCombinedSchemas.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | -| static class | [NonInterferenceAcrossCombinedSchemas.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | -| static class | [NonInterferenceAcrossCombinedSchemas.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | -| static class | [NonInterferenceAcrossCombinedSchemas.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [NonInterferenceAcrossCombinedSchemas.Schema0Boxed](#schema0boxed)
sealed interface for validated payloads | +| record | [NonInterferenceAcrossCombinedSchemas.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | +| record | [NonInterferenceAcrossCombinedSchemas.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | +| record | [NonInterferenceAcrossCombinedSchemas.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | +| record | [NonInterferenceAcrossCombinedSchemas.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | +| record | [NonInterferenceAcrossCombinedSchemas.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | +| record | [NonInterferenceAcrossCombinedSchemas.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | | static class | [NonInterferenceAcrossCombinedSchemas.Schema0](#schema0)
schema class | -| static class | [NonInterferenceAcrossCombinedSchemas.IfSchemaBoxed](#ifschemaboxed)
abstract sealed validated payload class | -| static class | [NonInterferenceAcrossCombinedSchemas.IfSchemaBoxedVoid](#ifschemaboxedvoid)
boxed class to store validated null payloads | -| static class | [NonInterferenceAcrossCombinedSchemas.IfSchemaBoxedBoolean](#ifschemaboxedboolean)
boxed class to store validated boolean payloads | -| static class | [NonInterferenceAcrossCombinedSchemas.IfSchemaBoxedNumber](#ifschemaboxednumber)
boxed class to store validated Number payloads | -| static class | [NonInterferenceAcrossCombinedSchemas.IfSchemaBoxedString](#ifschemaboxedstring)
boxed class to store validated String payloads | -| static class | [NonInterferenceAcrossCombinedSchemas.IfSchemaBoxedList](#ifschemaboxedlist)
boxed class to store validated List payloads | -| static class | [NonInterferenceAcrossCombinedSchemas.IfSchemaBoxedMap](#ifschemaboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [NonInterferenceAcrossCombinedSchemas.IfSchemaBoxed](#ifschemaboxed)
sealed interface for validated payloads | +| record | [NonInterferenceAcrossCombinedSchemas.IfSchemaBoxedVoid](#ifschemaboxedvoid)
boxed class to store validated null payloads | +| record | [NonInterferenceAcrossCombinedSchemas.IfSchemaBoxedBoolean](#ifschemaboxedboolean)
boxed class to store validated boolean payloads | +| record | [NonInterferenceAcrossCombinedSchemas.IfSchemaBoxedNumber](#ifschemaboxednumber)
boxed class to store validated Number payloads | +| record | [NonInterferenceAcrossCombinedSchemas.IfSchemaBoxedString](#ifschemaboxedstring)
boxed class to store validated String payloads | +| record | [NonInterferenceAcrossCombinedSchemas.IfSchemaBoxedList](#ifschemaboxedlist)
boxed class to store validated List payloads | +| record | [NonInterferenceAcrossCombinedSchemas.IfSchemaBoxedMap](#ifschemaboxedmap)
boxed class to store validated Map payloads | | static class | [NonInterferenceAcrossCombinedSchemas.IfSchema](#ifschema)
schema class | ## NonInterferenceAcrossCombinedSchemas1Boxed -public static abstract sealed class NonInterferenceAcrossCombinedSchemas1Boxed
+public sealed interface NonInterferenceAcrossCombinedSchemas1Boxed
permits
[NonInterferenceAcrossCombinedSchemas1BoxedVoid](#noninterferenceacrosscombinedschemas1boxedvoid), [NonInterferenceAcrossCombinedSchemas1BoxedBoolean](#noninterferenceacrosscombinedschemas1boxedboolean), @@ -77,103 +77,109 @@ permits
[NonInterferenceAcrossCombinedSchemas1BoxedList](#noninterferenceacrosscombinedschemas1boxedlist), [NonInterferenceAcrossCombinedSchemas1BoxedMap](#noninterferenceacrosscombinedschemas1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## NonInterferenceAcrossCombinedSchemas1BoxedVoid -public static final class NonInterferenceAcrossCombinedSchemas1BoxedVoid
-extends [NonInterferenceAcrossCombinedSchemas1Boxed](#noninterferenceacrosscombinedschemas1boxed) +public record NonInterferenceAcrossCombinedSchemas1BoxedVoid
+implements [NonInterferenceAcrossCombinedSchemas1Boxed](#noninterferenceacrosscombinedschemas1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NonInterferenceAcrossCombinedSchemas1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NonInterferenceAcrossCombinedSchemas1BoxedBoolean -public static final class NonInterferenceAcrossCombinedSchemas1BoxedBoolean
-extends [NonInterferenceAcrossCombinedSchemas1Boxed](#noninterferenceacrosscombinedschemas1boxed) +public record NonInterferenceAcrossCombinedSchemas1BoxedBoolean
+implements [NonInterferenceAcrossCombinedSchemas1Boxed](#noninterferenceacrosscombinedschemas1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NonInterferenceAcrossCombinedSchemas1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NonInterferenceAcrossCombinedSchemas1BoxedNumber -public static final class NonInterferenceAcrossCombinedSchemas1BoxedNumber
-extends [NonInterferenceAcrossCombinedSchemas1Boxed](#noninterferenceacrosscombinedschemas1boxed) +public record NonInterferenceAcrossCombinedSchemas1BoxedNumber
+implements [NonInterferenceAcrossCombinedSchemas1Boxed](#noninterferenceacrosscombinedschemas1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NonInterferenceAcrossCombinedSchemas1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NonInterferenceAcrossCombinedSchemas1BoxedString -public static final class NonInterferenceAcrossCombinedSchemas1BoxedString
-extends [NonInterferenceAcrossCombinedSchemas1Boxed](#noninterferenceacrosscombinedschemas1boxed) +public record NonInterferenceAcrossCombinedSchemas1BoxedString
+implements [NonInterferenceAcrossCombinedSchemas1Boxed](#noninterferenceacrosscombinedschemas1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NonInterferenceAcrossCombinedSchemas1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NonInterferenceAcrossCombinedSchemas1BoxedList -public static final class NonInterferenceAcrossCombinedSchemas1BoxedList
-extends [NonInterferenceAcrossCombinedSchemas1Boxed](#noninterferenceacrosscombinedschemas1boxed) +public record NonInterferenceAcrossCombinedSchemas1BoxedList
+implements [NonInterferenceAcrossCombinedSchemas1Boxed](#noninterferenceacrosscombinedschemas1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NonInterferenceAcrossCombinedSchemas1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NonInterferenceAcrossCombinedSchemas1BoxedMap -public static final class NonInterferenceAcrossCombinedSchemas1BoxedMap
-extends [NonInterferenceAcrossCombinedSchemas1Boxed](#noninterferenceacrosscombinedschemas1boxed) +public record NonInterferenceAcrossCombinedSchemas1BoxedMap
+implements [NonInterferenceAcrossCombinedSchemas1Boxed](#noninterferenceacrosscombinedschemas1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NonInterferenceAcrossCombinedSchemas1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NonInterferenceAcrossCombinedSchemas1 public static class NonInterferenceAcrossCombinedSchemas1
@@ -205,9 +211,11 @@ A schema class that validates payloads | [NonInterferenceAcrossCombinedSchemas1BoxedBoolean](#noninterferenceacrosscombinedschemas1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [NonInterferenceAcrossCombinedSchemas1BoxedMap](#noninterferenceacrosscombinedschemas1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [NonInterferenceAcrossCombinedSchemas1BoxedList](#noninterferenceacrosscombinedschemas1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [NonInterferenceAcrossCombinedSchemas1Boxed](#noninterferenceacrosscombinedschemas1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema2Boxed -public static abstract sealed class Schema2Boxed
+public sealed interface Schema2Boxed
permits
[Schema2BoxedVoid](#schema2boxedvoid), [Schema2BoxedBoolean](#schema2boxedboolean), @@ -216,103 +224,109 @@ permits
[Schema2BoxedList](#schema2boxedlist), [Schema2BoxedMap](#schema2boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema2BoxedVoid -public static final class Schema2BoxedVoid
-extends [Schema2Boxed](#schema2boxed) +public record Schema2BoxedVoid
+implements [Schema2Boxed](#schema2boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema2BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema2BoxedBoolean -public static final class Schema2BoxedBoolean
-extends [Schema2Boxed](#schema2boxed) +public record Schema2BoxedBoolean
+implements [Schema2Boxed](#schema2boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema2BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema2BoxedNumber -public static final class Schema2BoxedNumber
-extends [Schema2Boxed](#schema2boxed) +public record Schema2BoxedNumber
+implements [Schema2Boxed](#schema2boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema2BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema2BoxedString -public static final class Schema2BoxedString
-extends [Schema2Boxed](#schema2boxed) +public record Schema2BoxedString
+implements [Schema2Boxed](#schema2boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema2BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema2BoxedList -public static final class Schema2BoxedList
-extends [Schema2Boxed](#schema2boxed) +public record Schema2BoxedList
+implements [Schema2Boxed](#schema2boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema2BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema2BoxedMap -public static final class Schema2BoxedMap
-extends [Schema2Boxed](#schema2boxed) +public record Schema2BoxedMap
+implements [Schema2Boxed](#schema2boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema2BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema2 public static class Schema2
@@ -344,9 +358,11 @@ A schema class that validates payloads | [Schema2BoxedBoolean](#schema2boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Schema2BoxedMap](#schema2boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [Schema2BoxedList](#schema2boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Schema2Boxed](#schema2boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ElseSchemaBoxed -public static abstract sealed class ElseSchemaBoxed
+public sealed interface ElseSchemaBoxed
permits
[ElseSchemaBoxedVoid](#elseschemaboxedvoid), [ElseSchemaBoxedBoolean](#elseschemaboxedboolean), @@ -355,103 +371,109 @@ permits
[ElseSchemaBoxedList](#elseschemaboxedlist), [ElseSchemaBoxedMap](#elseschemaboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ElseSchemaBoxedVoid -public static final class ElseSchemaBoxedVoid
-extends [ElseSchemaBoxed](#elseschemaboxed) +public record ElseSchemaBoxedVoid
+implements [ElseSchemaBoxed](#elseschemaboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ElseSchemaBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ElseSchemaBoxedBoolean -public static final class ElseSchemaBoxedBoolean
-extends [ElseSchemaBoxed](#elseschemaboxed) +public record ElseSchemaBoxedBoolean
+implements [ElseSchemaBoxed](#elseschemaboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ElseSchemaBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ElseSchemaBoxedNumber -public static final class ElseSchemaBoxedNumber
-extends [ElseSchemaBoxed](#elseschemaboxed) +public record ElseSchemaBoxedNumber
+implements [ElseSchemaBoxed](#elseschemaboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ElseSchemaBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ElseSchemaBoxedString -public static final class ElseSchemaBoxedString
-extends [ElseSchemaBoxed](#elseschemaboxed) +public record ElseSchemaBoxedString
+implements [ElseSchemaBoxed](#elseschemaboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ElseSchemaBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ElseSchemaBoxedList -public static final class ElseSchemaBoxedList
-extends [ElseSchemaBoxed](#elseschemaboxed) +public record ElseSchemaBoxedList
+implements [ElseSchemaBoxed](#elseschemaboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ElseSchemaBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ElseSchemaBoxedMap -public static final class ElseSchemaBoxedMap
-extends [ElseSchemaBoxed](#elseschemaboxed) +public record ElseSchemaBoxedMap
+implements [ElseSchemaBoxed](#elseschemaboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ElseSchemaBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ElseSchema public static class ElseSchema
@@ -483,9 +505,11 @@ A schema class that validates payloads | [ElseSchemaBoxedBoolean](#elseschemaboxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [ElseSchemaBoxedMap](#elseschemaboxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [ElseSchemaBoxedList](#elseschemaboxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [ElseSchemaBoxed](#elseschemaboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema1Boxed -public static abstract sealed class Schema1Boxed
+public sealed interface Schema1Boxed
permits
[Schema1BoxedVoid](#schema1boxedvoid), [Schema1BoxedBoolean](#schema1boxedboolean), @@ -494,103 +518,109 @@ permits
[Schema1BoxedList](#schema1boxedlist), [Schema1BoxedMap](#schema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema1BoxedVoid -public static final class Schema1BoxedVoid
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedVoid
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedBoolean -public static final class Schema1BoxedBoolean
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedBoolean
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedNumber -public static final class Schema1BoxedNumber
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedNumber
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedString -public static final class Schema1BoxedString
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedString
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedList -public static final class Schema1BoxedList
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedList
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedMap -public static final class Schema1BoxedMap
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedMap
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1 public static class Schema1
@@ -622,9 +652,11 @@ A schema class that validates payloads | [Schema1BoxedBoolean](#schema1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Schema1BoxedMap](#schema1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [Schema1BoxedList](#schema1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Schema1Boxed](#schema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ThenBoxed -public static abstract sealed class ThenBoxed
+public sealed interface ThenBoxed
permits
[ThenBoxedVoid](#thenboxedvoid), [ThenBoxedBoolean](#thenboxedboolean), @@ -633,103 +665,109 @@ permits
[ThenBoxedList](#thenboxedlist), [ThenBoxedMap](#thenboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ThenBoxedVoid -public static final class ThenBoxedVoid
-extends [ThenBoxed](#thenboxed) +public record ThenBoxedVoid
+implements [ThenBoxed](#thenboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ThenBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ThenBoxedBoolean -public static final class ThenBoxedBoolean
-extends [ThenBoxed](#thenboxed) +public record ThenBoxedBoolean
+implements [ThenBoxed](#thenboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ThenBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ThenBoxedNumber -public static final class ThenBoxedNumber
-extends [ThenBoxed](#thenboxed) +public record ThenBoxedNumber
+implements [ThenBoxed](#thenboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ThenBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ThenBoxedString -public static final class ThenBoxedString
-extends [ThenBoxed](#thenboxed) +public record ThenBoxedString
+implements [ThenBoxed](#thenboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ThenBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ThenBoxedList -public static final class ThenBoxedList
-extends [ThenBoxed](#thenboxed) +public record ThenBoxedList
+implements [ThenBoxed](#thenboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ThenBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ThenBoxedMap -public static final class ThenBoxedMap
-extends [ThenBoxed](#thenboxed) +public record ThenBoxedMap
+implements [ThenBoxed](#thenboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ThenBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Then public static class Then
@@ -761,9 +799,11 @@ A schema class that validates payloads | [ThenBoxedBoolean](#thenboxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [ThenBoxedMap](#thenboxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [ThenBoxedList](#thenboxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [ThenBoxed](#thenboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema0Boxed -public static abstract sealed class Schema0Boxed
+public sealed interface Schema0Boxed
permits
[Schema0BoxedVoid](#schema0boxedvoid), [Schema0BoxedBoolean](#schema0boxedboolean), @@ -772,103 +812,109 @@ permits
[Schema0BoxedList](#schema0boxedlist), [Schema0BoxedMap](#schema0boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema0BoxedVoid -public static final class Schema0BoxedVoid
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedVoid
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedBoolean -public static final class Schema0BoxedBoolean
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedBoolean
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedNumber -public static final class Schema0BoxedNumber
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedNumber
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedString -public static final class Schema0BoxedString
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedString
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedList -public static final class Schema0BoxedList
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedList
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedMap -public static final class Schema0BoxedMap
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedMap
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0 public static class Schema0
@@ -900,9 +946,11 @@ A schema class that validates payloads | [Schema0BoxedBoolean](#schema0boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Schema0BoxedMap](#schema0boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [Schema0BoxedList](#schema0boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Schema0Boxed](#schema0boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## IfSchemaBoxed -public static abstract sealed class IfSchemaBoxed
+public sealed interface IfSchemaBoxed
permits
[IfSchemaBoxedVoid](#ifschemaboxedvoid), [IfSchemaBoxedBoolean](#ifschemaboxedboolean), @@ -911,103 +959,109 @@ permits
[IfSchemaBoxedList](#ifschemaboxedlist), [IfSchemaBoxedMap](#ifschemaboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## IfSchemaBoxedVoid -public static final class IfSchemaBoxedVoid
-extends [IfSchemaBoxed](#ifschemaboxed) +public record IfSchemaBoxedVoid
+implements [IfSchemaBoxed](#ifschemaboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IfSchemaBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IfSchemaBoxedBoolean -public static final class IfSchemaBoxedBoolean
-extends [IfSchemaBoxed](#ifschemaboxed) +public record IfSchemaBoxedBoolean
+implements [IfSchemaBoxed](#ifschemaboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IfSchemaBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IfSchemaBoxedNumber -public static final class IfSchemaBoxedNumber
-extends [IfSchemaBoxed](#ifschemaboxed) +public record IfSchemaBoxedNumber
+implements [IfSchemaBoxed](#ifschemaboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IfSchemaBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IfSchemaBoxedString -public static final class IfSchemaBoxedString
-extends [IfSchemaBoxed](#ifschemaboxed) +public record IfSchemaBoxedString
+implements [IfSchemaBoxed](#ifschemaboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IfSchemaBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IfSchemaBoxedList -public static final class IfSchemaBoxedList
-extends [IfSchemaBoxed](#ifschemaboxed) +public record IfSchemaBoxedList
+implements [IfSchemaBoxed](#ifschemaboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IfSchemaBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IfSchemaBoxedMap -public static final class IfSchemaBoxedMap
-extends [IfSchemaBoxed](#ifschemaboxed) +public record IfSchemaBoxedMap
+implements [IfSchemaBoxed](#ifschemaboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IfSchemaBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IfSchema public static class IfSchema
@@ -1039,5 +1093,7 @@ A schema class that validates payloads | [IfSchemaBoxedBoolean](#ifschemaboxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [IfSchemaBoxedMap](#ifschemaboxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [IfSchemaBoxedList](#ifschemaboxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [IfSchemaBoxed](#ifschemaboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/Not.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/Not.md index e5bf572f8bd..8358d5d2f6e 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/Not.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/Not.md @@ -4,26 +4,26 @@ public class Not
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Not.Not1Boxed](#not1boxed)
abstract sealed validated payload class | -| static class | [Not.Not1BoxedVoid](#not1boxedvoid)
boxed class to store validated null payloads | -| static class | [Not.Not1BoxedBoolean](#not1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [Not.Not1BoxedNumber](#not1boxednumber)
boxed class to store validated Number payloads | -| static class | [Not.Not1BoxedString](#not1boxedstring)
boxed class to store validated String payloads | -| static class | [Not.Not1BoxedList](#not1boxedlist)
boxed class to store validated List payloads | -| static class | [Not.Not1BoxedMap](#not1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [Not.Not1Boxed](#not1boxed)
sealed interface for validated payloads | +| record | [Not.Not1BoxedVoid](#not1boxedvoid)
boxed class to store validated null payloads | +| record | [Not.Not1BoxedBoolean](#not1boxedboolean)
boxed class to store validated boolean payloads | +| record | [Not.Not1BoxedNumber](#not1boxednumber)
boxed class to store validated Number payloads | +| record | [Not.Not1BoxedString](#not1boxedstring)
boxed class to store validated String payloads | +| record | [Not.Not1BoxedList](#not1boxedlist)
boxed class to store validated List payloads | +| record | [Not.Not1BoxedMap](#not1boxedmap)
boxed class to store validated Map payloads | | static class | [Not.Not1](#not1)
schema class | -| static class | [Not.Not2Boxed](#not2boxed)
abstract sealed validated payload class | -| static class | [Not.Not2BoxedNumber](#not2boxednumber)
boxed class to store validated Number payloads | +| sealed interface | [Not.Not2Boxed](#not2boxed)
sealed interface for validated payloads | +| record | [Not.Not2BoxedNumber](#not2boxednumber)
boxed class to store validated Number payloads | | static class | [Not.Not2](#not2)
schema class | ## Not1Boxed -public static abstract sealed class Not1Boxed
+public sealed interface Not1Boxed
permits
[Not1BoxedVoid](#not1boxedvoid), [Not1BoxedBoolean](#not1boxedboolean), @@ -32,103 +32,109 @@ permits
[Not1BoxedList](#not1boxedlist), [Not1BoxedMap](#not1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Not1BoxedVoid -public static final class Not1BoxedVoid
-extends [Not1Boxed](#not1boxed) +public record Not1BoxedVoid
+implements [Not1Boxed](#not1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Not1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Not1BoxedBoolean -public static final class Not1BoxedBoolean
-extends [Not1Boxed](#not1boxed) +public record Not1BoxedBoolean
+implements [Not1Boxed](#not1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Not1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Not1BoxedNumber -public static final class Not1BoxedNumber
-extends [Not1Boxed](#not1boxed) +public record Not1BoxedNumber
+implements [Not1Boxed](#not1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Not1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Not1BoxedString -public static final class Not1BoxedString
-extends [Not1Boxed](#not1boxed) +public record Not1BoxedString
+implements [Not1Boxed](#not1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Not1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Not1BoxedList -public static final class Not1BoxedList
-extends [Not1Boxed](#not1boxed) +public record Not1BoxedList
+implements [Not1Boxed](#not1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Not1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Not1BoxedMap -public static final class Not1BoxedMap
-extends [Not1Boxed](#not1boxed) +public record Not1BoxedMap
+implements [Not1Boxed](#not1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Not1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Not1 public static class Not1
@@ -160,29 +166,32 @@ A schema class that validates payloads | [Not1BoxedBoolean](#not1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Not1BoxedMap](#not1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [Not1BoxedList](#not1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Not1Boxed](#not1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Not2Boxed -public static abstract sealed class Not2Boxed
+public sealed interface Not2Boxed
permits
[Not2BoxedNumber](#not2boxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Not2BoxedNumber -public static final class Not2BoxedNumber
-extends [Not2Boxed](#not2boxed) +public record Not2BoxedNumber
+implements [Not2Boxed](#not2boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Not2BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Not2 public static class Not2
diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/NotMoreComplexSchema.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/NotMoreComplexSchema.md index 3e0871f1245..3b1f33fa85c 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/NotMoreComplexSchema.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/NotMoreComplexSchema.md @@ -4,7 +4,7 @@ public class NotMoreComplexSchema
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,25 +12,25 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [NotMoreComplexSchema.NotMoreComplexSchema1Boxed](#notmorecomplexschema1boxed)
abstract sealed validated payload class | -| static class | [NotMoreComplexSchema.NotMoreComplexSchema1BoxedVoid](#notmorecomplexschema1boxedvoid)
boxed class to store validated null payloads | -| static class | [NotMoreComplexSchema.NotMoreComplexSchema1BoxedBoolean](#notmorecomplexschema1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [NotMoreComplexSchema.NotMoreComplexSchema1BoxedNumber](#notmorecomplexschema1boxednumber)
boxed class to store validated Number payloads | -| static class | [NotMoreComplexSchema.NotMoreComplexSchema1BoxedString](#notmorecomplexschema1boxedstring)
boxed class to store validated String payloads | -| static class | [NotMoreComplexSchema.NotMoreComplexSchema1BoxedList](#notmorecomplexschema1boxedlist)
boxed class to store validated List payloads | -| static class | [NotMoreComplexSchema.NotMoreComplexSchema1BoxedMap](#notmorecomplexschema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [NotMoreComplexSchema.NotMoreComplexSchema1Boxed](#notmorecomplexschema1boxed)
sealed interface for validated payloads | +| record | [NotMoreComplexSchema.NotMoreComplexSchema1BoxedVoid](#notmorecomplexschema1boxedvoid)
boxed class to store validated null payloads | +| record | [NotMoreComplexSchema.NotMoreComplexSchema1BoxedBoolean](#notmorecomplexschema1boxedboolean)
boxed class to store validated boolean payloads | +| record | [NotMoreComplexSchema.NotMoreComplexSchema1BoxedNumber](#notmorecomplexschema1boxednumber)
boxed class to store validated Number payloads | +| record | [NotMoreComplexSchema.NotMoreComplexSchema1BoxedString](#notmorecomplexschema1boxedstring)
boxed class to store validated String payloads | +| record | [NotMoreComplexSchema.NotMoreComplexSchema1BoxedList](#notmorecomplexschema1boxedlist)
boxed class to store validated List payloads | +| record | [NotMoreComplexSchema.NotMoreComplexSchema1BoxedMap](#notmorecomplexschema1boxedmap)
boxed class to store validated Map payloads | | static class | [NotMoreComplexSchema.NotMoreComplexSchema1](#notmorecomplexschema1)
schema class | -| static class | [NotMoreComplexSchema.NotBoxed](#notboxed)
abstract sealed validated payload class | -| static class | [NotMoreComplexSchema.NotBoxedMap](#notboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [NotMoreComplexSchema.NotBoxed](#notboxed)
sealed interface for validated payloads | +| record | [NotMoreComplexSchema.NotBoxedMap](#notboxedmap)
boxed class to store validated Map payloads | | static class | [NotMoreComplexSchema.Not](#not)
schema class | | static class | [NotMoreComplexSchema.NotMapBuilder](#notmapbuilder)
builder for Map payloads | | static class | [NotMoreComplexSchema.NotMap](#notmap)
output class for Map payloads | -| static class | [NotMoreComplexSchema.FooBoxed](#fooboxed)
abstract sealed validated payload class | -| static class | [NotMoreComplexSchema.FooBoxedString](#fooboxedstring)
boxed class to store validated String payloads | +| sealed interface | [NotMoreComplexSchema.FooBoxed](#fooboxed)
sealed interface for validated payloads | +| record | [NotMoreComplexSchema.FooBoxedString](#fooboxedstring)
boxed class to store validated String payloads | | static class | [NotMoreComplexSchema.Foo](#foo)
schema class | ## NotMoreComplexSchema1Boxed -public static abstract sealed class NotMoreComplexSchema1Boxed
+public sealed interface NotMoreComplexSchema1Boxed
permits
[NotMoreComplexSchema1BoxedVoid](#notmorecomplexschema1boxedvoid), [NotMoreComplexSchema1BoxedBoolean](#notmorecomplexschema1boxedboolean), @@ -39,103 +39,109 @@ permits
[NotMoreComplexSchema1BoxedList](#notmorecomplexschema1boxedlist), [NotMoreComplexSchema1BoxedMap](#notmorecomplexschema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## NotMoreComplexSchema1BoxedVoid -public static final class NotMoreComplexSchema1BoxedVoid
-extends [NotMoreComplexSchema1Boxed](#notmorecomplexschema1boxed) +public record NotMoreComplexSchema1BoxedVoid
+implements [NotMoreComplexSchema1Boxed](#notmorecomplexschema1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NotMoreComplexSchema1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NotMoreComplexSchema1BoxedBoolean -public static final class NotMoreComplexSchema1BoxedBoolean
-extends [NotMoreComplexSchema1Boxed](#notmorecomplexschema1boxed) +public record NotMoreComplexSchema1BoxedBoolean
+implements [NotMoreComplexSchema1Boxed](#notmorecomplexschema1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NotMoreComplexSchema1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NotMoreComplexSchema1BoxedNumber -public static final class NotMoreComplexSchema1BoxedNumber
-extends [NotMoreComplexSchema1Boxed](#notmorecomplexschema1boxed) +public record NotMoreComplexSchema1BoxedNumber
+implements [NotMoreComplexSchema1Boxed](#notmorecomplexschema1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NotMoreComplexSchema1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NotMoreComplexSchema1BoxedString -public static final class NotMoreComplexSchema1BoxedString
-extends [NotMoreComplexSchema1Boxed](#notmorecomplexschema1boxed) +public record NotMoreComplexSchema1BoxedString
+implements [NotMoreComplexSchema1Boxed](#notmorecomplexschema1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NotMoreComplexSchema1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NotMoreComplexSchema1BoxedList -public static final class NotMoreComplexSchema1BoxedList
-extends [NotMoreComplexSchema1Boxed](#notmorecomplexschema1boxed) +public record NotMoreComplexSchema1BoxedList
+implements [NotMoreComplexSchema1Boxed](#notmorecomplexschema1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NotMoreComplexSchema1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NotMoreComplexSchema1BoxedMap -public static final class NotMoreComplexSchema1BoxedMap
-extends [NotMoreComplexSchema1Boxed](#notmorecomplexschema1boxed) +public record NotMoreComplexSchema1BoxedMap
+implements [NotMoreComplexSchema1Boxed](#notmorecomplexschema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NotMoreComplexSchema1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NotMoreComplexSchema1 public static class NotMoreComplexSchema1
@@ -167,29 +173,32 @@ A schema class that validates payloads | [NotMoreComplexSchema1BoxedBoolean](#notmorecomplexschema1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [NotMoreComplexSchema1BoxedMap](#notmorecomplexschema1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [NotMoreComplexSchema1BoxedList](#notmorecomplexschema1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [NotMoreComplexSchema1Boxed](#notmorecomplexschema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## NotBoxed -public static abstract sealed class NotBoxed
+public sealed interface NotBoxed
permits
[NotBoxedMap](#notboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## NotBoxedMap -public static final class NotBoxedMap
-extends [NotBoxed](#notboxed) +public record NotBoxedMap
+implements [NotBoxed](#notboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NotBoxedMap([NotMap](#notmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [NotMap](#notmap) | data
validated payload | +| [NotMap](#notmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Not public static class Not
@@ -234,7 +243,9 @@ NotMoreComplexSchema.NotMap validatedPayload = | ----------------- | ---------------------- | | [NotMap](#notmap) | validate([Map<?, ?>](#notmapbuilder) arg, SchemaConfiguration configuration) | | [NotBoxedMap](#notboxedmap) | validateAndBox([Map<?, ?>](#notmapbuilder) arg, SchemaConfiguration configuration) | +| [NotBoxed](#notboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## NotMapBuilder public class NotMapBuilder
builder for `Map` @@ -275,27 +286,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## FooBoxed -public static abstract sealed class FooBoxed
+public sealed interface FooBoxed
permits
[FooBoxedString](#fooboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## FooBoxedString -public static final class FooBoxedString
-extends [FooBoxed](#fooboxed) +public record FooBoxedString
+implements [FooBoxed](#fooboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Foo public static class Foo
diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/NotMultipleTypes.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/NotMultipleTypes.md index d0b048168c4..404817cf298 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/NotMultipleTypes.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/NotMultipleTypes.md @@ -4,27 +4,27 @@ public class NotMultipleTypes
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [NotMultipleTypes.NotMultipleTypes1Boxed](#notmultipletypes1boxed)
abstract sealed validated payload class | -| static class | [NotMultipleTypes.NotMultipleTypes1BoxedVoid](#notmultipletypes1boxedvoid)
boxed class to store validated null payloads | -| static class | [NotMultipleTypes.NotMultipleTypes1BoxedBoolean](#notmultipletypes1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [NotMultipleTypes.NotMultipleTypes1BoxedNumber](#notmultipletypes1boxednumber)
boxed class to store validated Number payloads | -| static class | [NotMultipleTypes.NotMultipleTypes1BoxedString](#notmultipletypes1boxedstring)
boxed class to store validated String payloads | -| static class | [NotMultipleTypes.NotMultipleTypes1BoxedList](#notmultipletypes1boxedlist)
boxed class to store validated List payloads | -| static class | [NotMultipleTypes.NotMultipleTypes1BoxedMap](#notmultipletypes1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [NotMultipleTypes.NotMultipleTypes1Boxed](#notmultipletypes1boxed)
sealed interface for validated payloads | +| record | [NotMultipleTypes.NotMultipleTypes1BoxedVoid](#notmultipletypes1boxedvoid)
boxed class to store validated null payloads | +| record | [NotMultipleTypes.NotMultipleTypes1BoxedBoolean](#notmultipletypes1boxedboolean)
boxed class to store validated boolean payloads | +| record | [NotMultipleTypes.NotMultipleTypes1BoxedNumber](#notmultipletypes1boxednumber)
boxed class to store validated Number payloads | +| record | [NotMultipleTypes.NotMultipleTypes1BoxedString](#notmultipletypes1boxedstring)
boxed class to store validated String payloads | +| record | [NotMultipleTypes.NotMultipleTypes1BoxedList](#notmultipletypes1boxedlist)
boxed class to store validated List payloads | +| record | [NotMultipleTypes.NotMultipleTypes1BoxedMap](#notmultipletypes1boxedmap)
boxed class to store validated Map payloads | | static class | [NotMultipleTypes.NotMultipleTypes1](#notmultipletypes1)
schema class | -| static class | [NotMultipleTypes.NotBoxed](#notboxed)
abstract sealed validated payload class | -| static class | [NotMultipleTypes.NotBoxedNumber](#notboxednumber)
boxed class to store validated Number payloads | -| static class | [NotMultipleTypes.NotBoxedBoolean](#notboxedboolean)
boxed class to store validated boolean payloads | +| sealed interface | [NotMultipleTypes.NotBoxed](#notboxed)
sealed interface for validated payloads | +| record | [NotMultipleTypes.NotBoxedNumber](#notboxednumber)
boxed class to store validated Number payloads | +| record | [NotMultipleTypes.NotBoxedBoolean](#notboxedboolean)
boxed class to store validated boolean payloads | | static class | [NotMultipleTypes.Not](#not)
schema class | ## NotMultipleTypes1Boxed -public static abstract sealed class NotMultipleTypes1Boxed
+public sealed interface NotMultipleTypes1Boxed
permits
[NotMultipleTypes1BoxedVoid](#notmultipletypes1boxedvoid), [NotMultipleTypes1BoxedBoolean](#notmultipletypes1boxedboolean), @@ -33,103 +33,109 @@ permits
[NotMultipleTypes1BoxedList](#notmultipletypes1boxedlist), [NotMultipleTypes1BoxedMap](#notmultipletypes1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## NotMultipleTypes1BoxedVoid -public static final class NotMultipleTypes1BoxedVoid
-extends [NotMultipleTypes1Boxed](#notmultipletypes1boxed) +public record NotMultipleTypes1BoxedVoid
+implements [NotMultipleTypes1Boxed](#notmultipletypes1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NotMultipleTypes1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NotMultipleTypes1BoxedBoolean -public static final class NotMultipleTypes1BoxedBoolean
-extends [NotMultipleTypes1Boxed](#notmultipletypes1boxed) +public record NotMultipleTypes1BoxedBoolean
+implements [NotMultipleTypes1Boxed](#notmultipletypes1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NotMultipleTypes1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NotMultipleTypes1BoxedNumber -public static final class NotMultipleTypes1BoxedNumber
-extends [NotMultipleTypes1Boxed](#notmultipletypes1boxed) +public record NotMultipleTypes1BoxedNumber
+implements [NotMultipleTypes1Boxed](#notmultipletypes1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NotMultipleTypes1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NotMultipleTypes1BoxedString -public static final class NotMultipleTypes1BoxedString
-extends [NotMultipleTypes1Boxed](#notmultipletypes1boxed) +public record NotMultipleTypes1BoxedString
+implements [NotMultipleTypes1Boxed](#notmultipletypes1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NotMultipleTypes1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NotMultipleTypes1BoxedList -public static final class NotMultipleTypes1BoxedList
-extends [NotMultipleTypes1Boxed](#notmultipletypes1boxed) +public record NotMultipleTypes1BoxedList
+implements [NotMultipleTypes1Boxed](#notmultipletypes1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NotMultipleTypes1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NotMultipleTypes1BoxedMap -public static final class NotMultipleTypes1BoxedMap
-extends [NotMultipleTypes1Boxed](#notmultipletypes1boxed) +public record NotMultipleTypes1BoxedMap
+implements [NotMultipleTypes1Boxed](#notmultipletypes1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NotMultipleTypes1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NotMultipleTypes1 public static class NotMultipleTypes1
@@ -161,46 +167,50 @@ A schema class that validates payloads | [NotMultipleTypes1BoxedBoolean](#notmultipletypes1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [NotMultipleTypes1BoxedMap](#notmultipletypes1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [NotMultipleTypes1BoxedList](#notmultipletypes1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [NotMultipleTypes1Boxed](#notmultipletypes1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## NotBoxed -public static abstract sealed class NotBoxed
+public sealed interface NotBoxed
permits
[NotBoxedNumber](#notboxednumber), [NotBoxedBoolean](#notboxedboolean) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## NotBoxedNumber -public static final class NotBoxedNumber
-extends [NotBoxed](#notboxed) +public record NotBoxedNumber
+implements [NotBoxed](#notboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NotBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NotBoxedBoolean -public static final class NotBoxedBoolean
-extends [NotBoxed](#notboxed) +public record NotBoxedBoolean
+implements [NotBoxed](#notboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NotBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Not public static class Not
@@ -249,5 +259,7 @@ boolean validatedPayload = NotMultipleTypes.Not.validate( | [NotBoxedNumber](#notboxednumber) | validateAndBox(Number arg, SchemaConfiguration configuration) | | boolean | validate(boolean arg, SchemaConfiguration configuration) | | [NotBoxedBoolean](#notboxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | +| [NotBoxed](#notboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/NulCharactersInStrings.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/NulCharactersInStrings.md index eb1cfff98ed..78007c6f372 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/NulCharactersInStrings.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/NulCharactersInStrings.md @@ -4,40 +4,41 @@ public class NulCharactersInStrings
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - enum classes ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [NulCharactersInStrings.NulCharactersInStrings1Boxed](#nulcharactersinstrings1boxed)
abstract sealed validated payload class | -| static class | [NulCharactersInStrings.NulCharactersInStrings1BoxedString](#nulcharactersinstrings1boxedstring)
boxed class to store validated String payloads | +| sealed interface | [NulCharactersInStrings.NulCharactersInStrings1Boxed](#nulcharactersinstrings1boxed)
sealed interface for validated payloads | +| record | [NulCharactersInStrings.NulCharactersInStrings1BoxedString](#nulcharactersinstrings1boxedstring)
boxed class to store validated String payloads | | static class | [NulCharactersInStrings.NulCharactersInStrings1](#nulcharactersinstrings1)
schema class | | enum | [NulCharactersInStrings.StringNulCharactersInStringsEnums](#stringnulcharactersinstringsenums)
String enum | ## NulCharactersInStrings1Boxed -public static abstract sealed class NulCharactersInStrings1Boxed
+public sealed interface NulCharactersInStrings1Boxed
permits
[NulCharactersInStrings1BoxedString](#nulcharactersinstrings1boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## NulCharactersInStrings1BoxedString -public static final class NulCharactersInStrings1BoxedString
-extends [NulCharactersInStrings1Boxed](#nulcharactersinstrings1boxed) +public record NulCharactersInStrings1BoxedString
+implements [NulCharactersInStrings1Boxed](#nulcharactersinstrings1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NulCharactersInStrings1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NulCharactersInStrings1 public static class NulCharactersInStrings1
@@ -79,7 +80,9 @@ String validatedPayload = NulCharactersInStrings.NulCharactersInStrings1.validat | String | validate(String arg, SchemaConfiguration configuration) | | String | validate([StringNulCharactersInStringsEnums](#stringnulcharactersinstringsenums) arg, SchemaConfiguration configuration) | | [NulCharactersInStrings1BoxedString](#nulcharactersinstrings1boxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [NulCharactersInStrings1Boxed](#nulcharactersinstrings1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## StringNulCharactersInStringsEnums public enum StringNulCharactersInStringsEnums
extends `Enum` diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/NullTypeMatchesOnlyTheNullObject.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/NullTypeMatchesOnlyTheNullObject.md index ac85cb6749c..a7bf060e212 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/NullTypeMatchesOnlyTheNullObject.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/NullTypeMatchesOnlyTheNullObject.md @@ -4,38 +4,39 @@ public class NullTypeMatchesOnlyTheNullObject
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [NullTypeMatchesOnlyTheNullObject.NullTypeMatchesOnlyTheNullObject1Boxed](#nulltypematchesonlythenullobject1boxed)
abstract sealed validated payload class | -| static class | [NullTypeMatchesOnlyTheNullObject.NullTypeMatchesOnlyTheNullObject1BoxedVoid](#nulltypematchesonlythenullobject1boxedvoid)
boxed class to store validated null payloads | +| sealed interface | [NullTypeMatchesOnlyTheNullObject.NullTypeMatchesOnlyTheNullObject1Boxed](#nulltypematchesonlythenullobject1boxed)
sealed interface for validated payloads | +| record | [NullTypeMatchesOnlyTheNullObject.NullTypeMatchesOnlyTheNullObject1BoxedVoid](#nulltypematchesonlythenullobject1boxedvoid)
boxed class to store validated null payloads | | static class | [NullTypeMatchesOnlyTheNullObject.NullTypeMatchesOnlyTheNullObject1](#nulltypematchesonlythenullobject1)
schema class | ## NullTypeMatchesOnlyTheNullObject1Boxed -public static abstract sealed class NullTypeMatchesOnlyTheNullObject1Boxed
+public sealed interface NullTypeMatchesOnlyTheNullObject1Boxed
permits
[NullTypeMatchesOnlyTheNullObject1BoxedVoid](#nulltypematchesonlythenullobject1boxedvoid) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## NullTypeMatchesOnlyTheNullObject1BoxedVoid -public static final class NullTypeMatchesOnlyTheNullObject1BoxedVoid
-extends [NullTypeMatchesOnlyTheNullObject1Boxed](#nulltypematchesonlythenullobject1boxed) +public record NullTypeMatchesOnlyTheNullObject1BoxedVoid
+implements [NullTypeMatchesOnlyTheNullObject1Boxed](#nulltypematchesonlythenullobject1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NullTypeMatchesOnlyTheNullObject1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NullTypeMatchesOnlyTheNullObject1 public static class NullTypeMatchesOnlyTheNullObject1
diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/NumberTypeMatchesNumbers.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/NumberTypeMatchesNumbers.md index d668c33c2de..76a1b65da1a 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/NumberTypeMatchesNumbers.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/NumberTypeMatchesNumbers.md @@ -4,38 +4,39 @@ public class NumberTypeMatchesNumbers
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [NumberTypeMatchesNumbers.NumberTypeMatchesNumbers1Boxed](#numbertypematchesnumbers1boxed)
abstract sealed validated payload class | -| static class | [NumberTypeMatchesNumbers.NumberTypeMatchesNumbers1BoxedNumber](#numbertypematchesnumbers1boxednumber)
boxed class to store validated Number payloads | +| sealed interface | [NumberTypeMatchesNumbers.NumberTypeMatchesNumbers1Boxed](#numbertypematchesnumbers1boxed)
sealed interface for validated payloads | +| record | [NumberTypeMatchesNumbers.NumberTypeMatchesNumbers1BoxedNumber](#numbertypematchesnumbers1boxednumber)
boxed class to store validated Number payloads | | static class | [NumberTypeMatchesNumbers.NumberTypeMatchesNumbers1](#numbertypematchesnumbers1)
schema class | ## NumberTypeMatchesNumbers1Boxed -public static abstract sealed class NumberTypeMatchesNumbers1Boxed
+public sealed interface NumberTypeMatchesNumbers1Boxed
permits
[NumberTypeMatchesNumbers1BoxedNumber](#numbertypematchesnumbers1boxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## NumberTypeMatchesNumbers1BoxedNumber -public static final class NumberTypeMatchesNumbers1BoxedNumber
-extends [NumberTypeMatchesNumbers1Boxed](#numbertypematchesnumbers1boxed) +public record NumberTypeMatchesNumbers1BoxedNumber
+implements [NumberTypeMatchesNumbers1Boxed](#numbertypematchesnumbers1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NumberTypeMatchesNumbers1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NumberTypeMatchesNumbers1 public static class NumberTypeMatchesNumbers1
diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/ObjectPropertiesValidation.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/ObjectPropertiesValidation.md index caba7bd3cae..2427b5219d5 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/ObjectPropertiesValidation.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/ObjectPropertiesValidation.md @@ -4,7 +4,7 @@ public class ObjectPropertiesValidation
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,25 +12,25 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ObjectPropertiesValidation.ObjectPropertiesValidation1Boxed](#objectpropertiesvalidation1boxed)
abstract sealed validated payload class | -| static class | [ObjectPropertiesValidation.ObjectPropertiesValidation1BoxedVoid](#objectpropertiesvalidation1boxedvoid)
boxed class to store validated null payloads | -| static class | [ObjectPropertiesValidation.ObjectPropertiesValidation1BoxedBoolean](#objectpropertiesvalidation1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [ObjectPropertiesValidation.ObjectPropertiesValidation1BoxedNumber](#objectpropertiesvalidation1boxednumber)
boxed class to store validated Number payloads | -| static class | [ObjectPropertiesValidation.ObjectPropertiesValidation1BoxedString](#objectpropertiesvalidation1boxedstring)
boxed class to store validated String payloads | -| static class | [ObjectPropertiesValidation.ObjectPropertiesValidation1BoxedList](#objectpropertiesvalidation1boxedlist)
boxed class to store validated List payloads | -| static class | [ObjectPropertiesValidation.ObjectPropertiesValidation1BoxedMap](#objectpropertiesvalidation1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ObjectPropertiesValidation.ObjectPropertiesValidation1Boxed](#objectpropertiesvalidation1boxed)
sealed interface for validated payloads | +| record | [ObjectPropertiesValidation.ObjectPropertiesValidation1BoxedVoid](#objectpropertiesvalidation1boxedvoid)
boxed class to store validated null payloads | +| record | [ObjectPropertiesValidation.ObjectPropertiesValidation1BoxedBoolean](#objectpropertiesvalidation1boxedboolean)
boxed class to store validated boolean payloads | +| record | [ObjectPropertiesValidation.ObjectPropertiesValidation1BoxedNumber](#objectpropertiesvalidation1boxednumber)
boxed class to store validated Number payloads | +| record | [ObjectPropertiesValidation.ObjectPropertiesValidation1BoxedString](#objectpropertiesvalidation1boxedstring)
boxed class to store validated String payloads | +| record | [ObjectPropertiesValidation.ObjectPropertiesValidation1BoxedList](#objectpropertiesvalidation1boxedlist)
boxed class to store validated List payloads | +| record | [ObjectPropertiesValidation.ObjectPropertiesValidation1BoxedMap](#objectpropertiesvalidation1boxedmap)
boxed class to store validated Map payloads | | static class | [ObjectPropertiesValidation.ObjectPropertiesValidation1](#objectpropertiesvalidation1)
schema class | | static class | [ObjectPropertiesValidation.ObjectPropertiesValidationMapBuilder](#objectpropertiesvalidationmapbuilder)
builder for Map payloads | | static class | [ObjectPropertiesValidation.ObjectPropertiesValidationMap](#objectpropertiesvalidationmap)
output class for Map payloads | -| static class | [ObjectPropertiesValidation.BarBoxed](#barboxed)
abstract sealed validated payload class | -| static class | [ObjectPropertiesValidation.BarBoxedString](#barboxedstring)
boxed class to store validated String payloads | +| sealed interface | [ObjectPropertiesValidation.BarBoxed](#barboxed)
sealed interface for validated payloads | +| record | [ObjectPropertiesValidation.BarBoxedString](#barboxedstring)
boxed class to store validated String payloads | | static class | [ObjectPropertiesValidation.Bar](#bar)
schema class | -| static class | [ObjectPropertiesValidation.FooBoxed](#fooboxed)
abstract sealed validated payload class | -| static class | [ObjectPropertiesValidation.FooBoxedNumber](#fooboxednumber)
boxed class to store validated Number payloads | +| sealed interface | [ObjectPropertiesValidation.FooBoxed](#fooboxed)
sealed interface for validated payloads | +| record | [ObjectPropertiesValidation.FooBoxedNumber](#fooboxednumber)
boxed class to store validated Number payloads | | static class | [ObjectPropertiesValidation.Foo](#foo)
schema class | ## ObjectPropertiesValidation1Boxed -public static abstract sealed class ObjectPropertiesValidation1Boxed
+public sealed interface ObjectPropertiesValidation1Boxed
permits
[ObjectPropertiesValidation1BoxedVoid](#objectpropertiesvalidation1boxedvoid), [ObjectPropertiesValidation1BoxedBoolean](#objectpropertiesvalidation1boxedboolean), @@ -39,103 +39,109 @@ permits
[ObjectPropertiesValidation1BoxedList](#objectpropertiesvalidation1boxedlist), [ObjectPropertiesValidation1BoxedMap](#objectpropertiesvalidation1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ObjectPropertiesValidation1BoxedVoid -public static final class ObjectPropertiesValidation1BoxedVoid
-extends [ObjectPropertiesValidation1Boxed](#objectpropertiesvalidation1boxed) +public record ObjectPropertiesValidation1BoxedVoid
+implements [ObjectPropertiesValidation1Boxed](#objectpropertiesvalidation1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ObjectPropertiesValidation1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ObjectPropertiesValidation1BoxedBoolean -public static final class ObjectPropertiesValidation1BoxedBoolean
-extends [ObjectPropertiesValidation1Boxed](#objectpropertiesvalidation1boxed) +public record ObjectPropertiesValidation1BoxedBoolean
+implements [ObjectPropertiesValidation1Boxed](#objectpropertiesvalidation1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ObjectPropertiesValidation1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ObjectPropertiesValidation1BoxedNumber -public static final class ObjectPropertiesValidation1BoxedNumber
-extends [ObjectPropertiesValidation1Boxed](#objectpropertiesvalidation1boxed) +public record ObjectPropertiesValidation1BoxedNumber
+implements [ObjectPropertiesValidation1Boxed](#objectpropertiesvalidation1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ObjectPropertiesValidation1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ObjectPropertiesValidation1BoxedString -public static final class ObjectPropertiesValidation1BoxedString
-extends [ObjectPropertiesValidation1Boxed](#objectpropertiesvalidation1boxed) +public record ObjectPropertiesValidation1BoxedString
+implements [ObjectPropertiesValidation1Boxed](#objectpropertiesvalidation1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ObjectPropertiesValidation1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ObjectPropertiesValidation1BoxedList -public static final class ObjectPropertiesValidation1BoxedList
-extends [ObjectPropertiesValidation1Boxed](#objectpropertiesvalidation1boxed) +public record ObjectPropertiesValidation1BoxedList
+implements [ObjectPropertiesValidation1Boxed](#objectpropertiesvalidation1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ObjectPropertiesValidation1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ObjectPropertiesValidation1BoxedMap -public static final class ObjectPropertiesValidation1BoxedMap
-extends [ObjectPropertiesValidation1Boxed](#objectpropertiesvalidation1boxed) +public record ObjectPropertiesValidation1BoxedMap
+implements [ObjectPropertiesValidation1Boxed](#objectpropertiesvalidation1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ObjectPropertiesValidation1BoxedMap([ObjectPropertiesValidationMap](#objectpropertiesvalidationmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [ObjectPropertiesValidationMap](#objectpropertiesvalidationmap) | data
validated payload | +| [ObjectPropertiesValidationMap](#objectpropertiesvalidationmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ObjectPropertiesValidation1 public static class ObjectPropertiesValidation1
@@ -167,7 +173,9 @@ A schema class that validates payloads | [ObjectPropertiesValidation1BoxedBoolean](#objectpropertiesvalidation1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [ObjectPropertiesValidation1BoxedMap](#objectpropertiesvalidation1boxedmap) | validateAndBox([Map<?, ?>](#objectpropertiesvalidationmapbuilder) arg, SchemaConfiguration configuration) | | [ObjectPropertiesValidation1BoxedList](#objectpropertiesvalidation1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [ObjectPropertiesValidation1Boxed](#objectpropertiesvalidation1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ObjectPropertiesValidationMapBuilder public class ObjectPropertiesValidationMapBuilder
builder for `Map` @@ -213,27 +221,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## BarBoxed -public static abstract sealed class BarBoxed
+public sealed interface BarBoxed
permits
[BarBoxedString](#barboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## BarBoxedString -public static final class BarBoxedString
-extends [BarBoxed](#barboxed) +public record BarBoxedString
+implements [BarBoxed](#barboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BarBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Bar public static class Bar
@@ -247,27 +256,28 @@ A schema class that validates payloads | validateAndBox | ## FooBoxed -public static abstract sealed class FooBoxed
+public sealed interface FooBoxed
permits
[FooBoxedNumber](#fooboxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## FooBoxedNumber -public static final class FooBoxedNumber
-extends [FooBoxed](#fooboxed) +public record FooBoxedNumber
+implements [FooBoxed](#fooboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Foo public static class Foo
diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/ObjectTypeMatchesObjects.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/ObjectTypeMatchesObjects.md index 1e9b8c9a96d..f169645577b 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/ObjectTypeMatchesObjects.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/ObjectTypeMatchesObjects.md @@ -4,38 +4,39 @@ public class ObjectTypeMatchesObjects
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ObjectTypeMatchesObjects.ObjectTypeMatchesObjects1Boxed](#objecttypematchesobjects1boxed)
abstract sealed validated payload class | -| static class | [ObjectTypeMatchesObjects.ObjectTypeMatchesObjects1BoxedMap](#objecttypematchesobjects1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ObjectTypeMatchesObjects.ObjectTypeMatchesObjects1Boxed](#objecttypematchesobjects1boxed)
sealed interface for validated payloads | +| record | [ObjectTypeMatchesObjects.ObjectTypeMatchesObjects1BoxedMap](#objecttypematchesobjects1boxedmap)
boxed class to store validated Map payloads | | static class | [ObjectTypeMatchesObjects.ObjectTypeMatchesObjects1](#objecttypematchesobjects1)
schema class | ## ObjectTypeMatchesObjects1Boxed -public static abstract sealed class ObjectTypeMatchesObjects1Boxed
+public sealed interface ObjectTypeMatchesObjects1Boxed
permits
[ObjectTypeMatchesObjects1BoxedMap](#objecttypematchesobjects1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ObjectTypeMatchesObjects1BoxedMap -public static final class ObjectTypeMatchesObjects1BoxedMap
-extends [ObjectTypeMatchesObjects1Boxed](#objecttypematchesobjects1boxed) +public record ObjectTypeMatchesObjects1BoxedMap
+implements [ObjectTypeMatchesObjects1Boxed](#objecttypematchesobjects1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ObjectTypeMatchesObjects1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ObjectTypeMatchesObjects1 public static class ObjectTypeMatchesObjects1
diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/Oneof.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/Oneof.md index 2b209414821..f4c0b682e27 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/Oneof.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/Oneof.md @@ -4,34 +4,34 @@ public class Oneof
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Oneof.Oneof1Boxed](#oneof1boxed)
abstract sealed validated payload class | -| static class | [Oneof.Oneof1BoxedVoid](#oneof1boxedvoid)
boxed class to store validated null payloads | -| static class | [Oneof.Oneof1BoxedBoolean](#oneof1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [Oneof.Oneof1BoxedNumber](#oneof1boxednumber)
boxed class to store validated Number payloads | -| static class | [Oneof.Oneof1BoxedString](#oneof1boxedstring)
boxed class to store validated String payloads | -| static class | [Oneof.Oneof1BoxedList](#oneof1boxedlist)
boxed class to store validated List payloads | -| static class | [Oneof.Oneof1BoxedMap](#oneof1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [Oneof.Oneof1Boxed](#oneof1boxed)
sealed interface for validated payloads | +| record | [Oneof.Oneof1BoxedVoid](#oneof1boxedvoid)
boxed class to store validated null payloads | +| record | [Oneof.Oneof1BoxedBoolean](#oneof1boxedboolean)
boxed class to store validated boolean payloads | +| record | [Oneof.Oneof1BoxedNumber](#oneof1boxednumber)
boxed class to store validated Number payloads | +| record | [Oneof.Oneof1BoxedString](#oneof1boxedstring)
boxed class to store validated String payloads | +| record | [Oneof.Oneof1BoxedList](#oneof1boxedlist)
boxed class to store validated List payloads | +| record | [Oneof.Oneof1BoxedMap](#oneof1boxedmap)
boxed class to store validated Map payloads | | static class | [Oneof.Oneof1](#oneof1)
schema class | -| static class | [Oneof.Schema1Boxed](#schema1boxed)
abstract sealed validated payload class | -| static class | [Oneof.Schema1BoxedVoid](#schema1boxedvoid)
boxed class to store validated null payloads | -| static class | [Oneof.Schema1BoxedBoolean](#schema1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [Oneof.Schema1BoxedNumber](#schema1boxednumber)
boxed class to store validated Number payloads | -| static class | [Oneof.Schema1BoxedString](#schema1boxedstring)
boxed class to store validated String payloads | -| static class | [Oneof.Schema1BoxedList](#schema1boxedlist)
boxed class to store validated List payloads | -| static class | [Oneof.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [Oneof.Schema1Boxed](#schema1boxed)
sealed interface for validated payloads | +| record | [Oneof.Schema1BoxedVoid](#schema1boxedvoid)
boxed class to store validated null payloads | +| record | [Oneof.Schema1BoxedBoolean](#schema1boxedboolean)
boxed class to store validated boolean payloads | +| record | [Oneof.Schema1BoxedNumber](#schema1boxednumber)
boxed class to store validated Number payloads | +| record | [Oneof.Schema1BoxedString](#schema1boxedstring)
boxed class to store validated String payloads | +| record | [Oneof.Schema1BoxedList](#schema1boxedlist)
boxed class to store validated List payloads | +| record | [Oneof.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | | static class | [Oneof.Schema1](#schema1)
schema class | -| static class | [Oneof.Schema0Boxed](#schema0boxed)
abstract sealed validated payload class | -| static class | [Oneof.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | +| sealed interface | [Oneof.Schema0Boxed](#schema0boxed)
sealed interface for validated payloads | +| record | [Oneof.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | | static class | [Oneof.Schema0](#schema0)
schema class | ## Oneof1Boxed -public static abstract sealed class Oneof1Boxed
+public sealed interface Oneof1Boxed
permits
[Oneof1BoxedVoid](#oneof1boxedvoid), [Oneof1BoxedBoolean](#oneof1boxedboolean), @@ -40,103 +40,109 @@ permits
[Oneof1BoxedList](#oneof1boxedlist), [Oneof1BoxedMap](#oneof1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Oneof1BoxedVoid -public static final class Oneof1BoxedVoid
-extends [Oneof1Boxed](#oneof1boxed) +public record Oneof1BoxedVoid
+implements [Oneof1Boxed](#oneof1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Oneof1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Oneof1BoxedBoolean -public static final class Oneof1BoxedBoolean
-extends [Oneof1Boxed](#oneof1boxed) +public record Oneof1BoxedBoolean
+implements [Oneof1Boxed](#oneof1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Oneof1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Oneof1BoxedNumber -public static final class Oneof1BoxedNumber
-extends [Oneof1Boxed](#oneof1boxed) +public record Oneof1BoxedNumber
+implements [Oneof1Boxed](#oneof1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Oneof1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Oneof1BoxedString -public static final class Oneof1BoxedString
-extends [Oneof1Boxed](#oneof1boxed) +public record Oneof1BoxedString
+implements [Oneof1Boxed](#oneof1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Oneof1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Oneof1BoxedList -public static final class Oneof1BoxedList
-extends [Oneof1Boxed](#oneof1boxed) +public record Oneof1BoxedList
+implements [Oneof1Boxed](#oneof1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Oneof1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Oneof1BoxedMap -public static final class Oneof1BoxedMap
-extends [Oneof1Boxed](#oneof1boxed) +public record Oneof1BoxedMap
+implements [Oneof1Boxed](#oneof1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Oneof1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Oneof1 public static class Oneof1
@@ -168,9 +174,11 @@ A schema class that validates payloads | [Oneof1BoxedBoolean](#oneof1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Oneof1BoxedMap](#oneof1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [Oneof1BoxedList](#oneof1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Oneof1Boxed](#oneof1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema1Boxed -public static abstract sealed class Schema1Boxed
+public sealed interface Schema1Boxed
permits
[Schema1BoxedVoid](#schema1boxedvoid), [Schema1BoxedBoolean](#schema1boxedboolean), @@ -179,103 +187,109 @@ permits
[Schema1BoxedList](#schema1boxedlist), [Schema1BoxedMap](#schema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema1BoxedVoid -public static final class Schema1BoxedVoid
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedVoid
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedBoolean -public static final class Schema1BoxedBoolean
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedBoolean
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedNumber -public static final class Schema1BoxedNumber
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedNumber
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedString -public static final class Schema1BoxedString
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedString
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedList -public static final class Schema1BoxedList
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedList
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedMap -public static final class Schema1BoxedMap
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedMap
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1 public static class Schema1
@@ -307,29 +321,32 @@ A schema class that validates payloads | [Schema1BoxedBoolean](#schema1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Schema1BoxedMap](#schema1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [Schema1BoxedList](#schema1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Schema1Boxed](#schema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema0Boxed -public static abstract sealed class Schema0Boxed
+public sealed interface Schema0Boxed
permits
[Schema0BoxedNumber](#schema0boxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema0BoxedNumber -public static final class Schema0BoxedNumber
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedNumber
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0 public static class Schema0
diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/OneofComplexTypes.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/OneofComplexTypes.md index 5c4ed6bcf33..182a53d6956 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/OneofComplexTypes.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/OneofComplexTypes.md @@ -4,7 +4,7 @@ public class OneofComplexTypes
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,43 +12,43 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [OneofComplexTypes.OneofComplexTypes1Boxed](#oneofcomplextypes1boxed)
abstract sealed validated payload class | -| static class | [OneofComplexTypes.OneofComplexTypes1BoxedVoid](#oneofcomplextypes1boxedvoid)
boxed class to store validated null payloads | -| static class | [OneofComplexTypes.OneofComplexTypes1BoxedBoolean](#oneofcomplextypes1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [OneofComplexTypes.OneofComplexTypes1BoxedNumber](#oneofcomplextypes1boxednumber)
boxed class to store validated Number payloads | -| static class | [OneofComplexTypes.OneofComplexTypes1BoxedString](#oneofcomplextypes1boxedstring)
boxed class to store validated String payloads | -| static class | [OneofComplexTypes.OneofComplexTypes1BoxedList](#oneofcomplextypes1boxedlist)
boxed class to store validated List payloads | -| static class | [OneofComplexTypes.OneofComplexTypes1BoxedMap](#oneofcomplextypes1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [OneofComplexTypes.OneofComplexTypes1Boxed](#oneofcomplextypes1boxed)
sealed interface for validated payloads | +| record | [OneofComplexTypes.OneofComplexTypes1BoxedVoid](#oneofcomplextypes1boxedvoid)
boxed class to store validated null payloads | +| record | [OneofComplexTypes.OneofComplexTypes1BoxedBoolean](#oneofcomplextypes1boxedboolean)
boxed class to store validated boolean payloads | +| record | [OneofComplexTypes.OneofComplexTypes1BoxedNumber](#oneofcomplextypes1boxednumber)
boxed class to store validated Number payloads | +| record | [OneofComplexTypes.OneofComplexTypes1BoxedString](#oneofcomplextypes1boxedstring)
boxed class to store validated String payloads | +| record | [OneofComplexTypes.OneofComplexTypes1BoxedList](#oneofcomplextypes1boxedlist)
boxed class to store validated List payloads | +| record | [OneofComplexTypes.OneofComplexTypes1BoxedMap](#oneofcomplextypes1boxedmap)
boxed class to store validated Map payloads | | static class | [OneofComplexTypes.OneofComplexTypes1](#oneofcomplextypes1)
schema class | -| static class | [OneofComplexTypes.Schema1Boxed](#schema1boxed)
abstract sealed validated payload class | -| static class | [OneofComplexTypes.Schema1BoxedVoid](#schema1boxedvoid)
boxed class to store validated null payloads | -| static class | [OneofComplexTypes.Schema1BoxedBoolean](#schema1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [OneofComplexTypes.Schema1BoxedNumber](#schema1boxednumber)
boxed class to store validated Number payloads | -| static class | [OneofComplexTypes.Schema1BoxedString](#schema1boxedstring)
boxed class to store validated String payloads | -| static class | [OneofComplexTypes.Schema1BoxedList](#schema1boxedlist)
boxed class to store validated List payloads | -| static class | [OneofComplexTypes.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [OneofComplexTypes.Schema1Boxed](#schema1boxed)
sealed interface for validated payloads | +| record | [OneofComplexTypes.Schema1BoxedVoid](#schema1boxedvoid)
boxed class to store validated null payloads | +| record | [OneofComplexTypes.Schema1BoxedBoolean](#schema1boxedboolean)
boxed class to store validated boolean payloads | +| record | [OneofComplexTypes.Schema1BoxedNumber](#schema1boxednumber)
boxed class to store validated Number payloads | +| record | [OneofComplexTypes.Schema1BoxedString](#schema1boxedstring)
boxed class to store validated String payloads | +| record | [OneofComplexTypes.Schema1BoxedList](#schema1boxedlist)
boxed class to store validated List payloads | +| record | [OneofComplexTypes.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | | static class | [OneofComplexTypes.Schema1](#schema1)
schema class | | static class | [OneofComplexTypes.Schema1MapBuilder](#schema1mapbuilder)
builder for Map payloads | | static class | [OneofComplexTypes.Schema1Map](#schema1map)
output class for Map payloads | -| static class | [OneofComplexTypes.FooBoxed](#fooboxed)
abstract sealed validated payload class | -| static class | [OneofComplexTypes.FooBoxedString](#fooboxedstring)
boxed class to store validated String payloads | +| sealed interface | [OneofComplexTypes.FooBoxed](#fooboxed)
sealed interface for validated payloads | +| record | [OneofComplexTypes.FooBoxedString](#fooboxedstring)
boxed class to store validated String payloads | | static class | [OneofComplexTypes.Foo](#foo)
schema class | -| static class | [OneofComplexTypes.Schema0Boxed](#schema0boxed)
abstract sealed validated payload class | -| static class | [OneofComplexTypes.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | -| static class | [OneofComplexTypes.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | -| static class | [OneofComplexTypes.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | -| static class | [OneofComplexTypes.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | -| static class | [OneofComplexTypes.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | -| static class | [OneofComplexTypes.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [OneofComplexTypes.Schema0Boxed](#schema0boxed)
sealed interface for validated payloads | +| record | [OneofComplexTypes.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | +| record | [OneofComplexTypes.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | +| record | [OneofComplexTypes.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | +| record | [OneofComplexTypes.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | +| record | [OneofComplexTypes.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | +| record | [OneofComplexTypes.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | | static class | [OneofComplexTypes.Schema0](#schema0)
schema class | | static class | [OneofComplexTypes.Schema0MapBuilder](#schema0mapbuilder)
builder for Map payloads | | static class | [OneofComplexTypes.Schema0Map](#schema0map)
output class for Map payloads | -| static class | [OneofComplexTypes.BarBoxed](#barboxed)
abstract sealed validated payload class | -| static class | [OneofComplexTypes.BarBoxedNumber](#barboxednumber)
boxed class to store validated Number payloads | +| sealed interface | [OneofComplexTypes.BarBoxed](#barboxed)
sealed interface for validated payloads | +| record | [OneofComplexTypes.BarBoxedNumber](#barboxednumber)
boxed class to store validated Number payloads | | static class | [OneofComplexTypes.Bar](#bar)
schema class | ## OneofComplexTypes1Boxed -public static abstract sealed class OneofComplexTypes1Boxed
+public sealed interface OneofComplexTypes1Boxed
permits
[OneofComplexTypes1BoxedVoid](#oneofcomplextypes1boxedvoid), [OneofComplexTypes1BoxedBoolean](#oneofcomplextypes1boxedboolean), @@ -57,103 +57,109 @@ permits
[OneofComplexTypes1BoxedList](#oneofcomplextypes1boxedlist), [OneofComplexTypes1BoxedMap](#oneofcomplextypes1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## OneofComplexTypes1BoxedVoid -public static final class OneofComplexTypes1BoxedVoid
-extends [OneofComplexTypes1Boxed](#oneofcomplextypes1boxed) +public record OneofComplexTypes1BoxedVoid
+implements [OneofComplexTypes1Boxed](#oneofcomplextypes1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | OneofComplexTypes1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## OneofComplexTypes1BoxedBoolean -public static final class OneofComplexTypes1BoxedBoolean
-extends [OneofComplexTypes1Boxed](#oneofcomplextypes1boxed) +public record OneofComplexTypes1BoxedBoolean
+implements [OneofComplexTypes1Boxed](#oneofcomplextypes1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | OneofComplexTypes1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## OneofComplexTypes1BoxedNumber -public static final class OneofComplexTypes1BoxedNumber
-extends [OneofComplexTypes1Boxed](#oneofcomplextypes1boxed) +public record OneofComplexTypes1BoxedNumber
+implements [OneofComplexTypes1Boxed](#oneofcomplextypes1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | OneofComplexTypes1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## OneofComplexTypes1BoxedString -public static final class OneofComplexTypes1BoxedString
-extends [OneofComplexTypes1Boxed](#oneofcomplextypes1boxed) +public record OneofComplexTypes1BoxedString
+implements [OneofComplexTypes1Boxed](#oneofcomplextypes1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | OneofComplexTypes1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## OneofComplexTypes1BoxedList -public static final class OneofComplexTypes1BoxedList
-extends [OneofComplexTypes1Boxed](#oneofcomplextypes1boxed) +public record OneofComplexTypes1BoxedList
+implements [OneofComplexTypes1Boxed](#oneofcomplextypes1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | OneofComplexTypes1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## OneofComplexTypes1BoxedMap -public static final class OneofComplexTypes1BoxedMap
-extends [OneofComplexTypes1Boxed](#oneofcomplextypes1boxed) +public record OneofComplexTypes1BoxedMap
+implements [OneofComplexTypes1Boxed](#oneofcomplextypes1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | OneofComplexTypes1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## OneofComplexTypes1 public static class OneofComplexTypes1
@@ -185,9 +191,11 @@ A schema class that validates payloads | [OneofComplexTypes1BoxedBoolean](#oneofcomplextypes1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [OneofComplexTypes1BoxedMap](#oneofcomplextypes1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [OneofComplexTypes1BoxedList](#oneofcomplextypes1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [OneofComplexTypes1Boxed](#oneofcomplextypes1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema1Boxed -public static abstract sealed class Schema1Boxed
+public sealed interface Schema1Boxed
permits
[Schema1BoxedVoid](#schema1boxedvoid), [Schema1BoxedBoolean](#schema1boxedboolean), @@ -196,103 +204,109 @@ permits
[Schema1BoxedList](#schema1boxedlist), [Schema1BoxedMap](#schema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema1BoxedVoid -public static final class Schema1BoxedVoid
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedVoid
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedBoolean -public static final class Schema1BoxedBoolean
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedBoolean
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedNumber -public static final class Schema1BoxedNumber
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedNumber
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedString -public static final class Schema1BoxedString
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedString
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedList -public static final class Schema1BoxedList
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedList
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedMap -public static final class Schema1BoxedMap
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedMap
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedMap([Schema1Map](#schema1map) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [Schema1Map](#schema1map) | data
validated payload | +| [Schema1Map](#schema1map) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1 public static class Schema1
@@ -325,7 +339,9 @@ A schema class that validates payloads | [Schema1BoxedBoolean](#schema1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Schema1BoxedMap](#schema1boxedmap) | validateAndBox([Map<?, ?>](#schema1mapbuilder) arg, SchemaConfiguration configuration) | | [Schema1BoxedList](#schema1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Schema1Boxed](#schema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema1Map0Builder public class Schema1Map0Builder
builder for `Map` @@ -381,27 +397,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## FooBoxed -public static abstract sealed class FooBoxed
+public sealed interface FooBoxed
permits
[FooBoxedString](#fooboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## FooBoxedString -public static final class FooBoxedString
-extends [FooBoxed](#fooboxed) +public record FooBoxedString
+implements [FooBoxed](#fooboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Foo public static class Foo
@@ -415,7 +432,7 @@ A schema class that validates payloads | validateAndBox | ## Schema0Boxed -public static abstract sealed class Schema0Boxed
+public sealed interface Schema0Boxed
permits
[Schema0BoxedVoid](#schema0boxedvoid), [Schema0BoxedBoolean](#schema0boxedboolean), @@ -424,103 +441,109 @@ permits
[Schema0BoxedList](#schema0boxedlist), [Schema0BoxedMap](#schema0boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema0BoxedVoid -public static final class Schema0BoxedVoid
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedVoid
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedBoolean -public static final class Schema0BoxedBoolean
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedBoolean
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedNumber -public static final class Schema0BoxedNumber
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedNumber
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedString -public static final class Schema0BoxedString
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedString
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedList -public static final class Schema0BoxedList
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedList
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedMap -public static final class Schema0BoxedMap
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedMap
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedMap([Schema0Map](#schema0map) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [Schema0Map](#schema0map) | data
validated payload | +| [Schema0Map](#schema0map) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0 public static class Schema0
@@ -553,7 +576,9 @@ A schema class that validates payloads | [Schema0BoxedBoolean](#schema0boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Schema0BoxedMap](#schema0boxedmap) | validateAndBox([Map<?, ?>](#schema0mapbuilder) arg, SchemaConfiguration configuration) | | [Schema0BoxedList](#schema0boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Schema0Boxed](#schema0boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema0Map0Builder public class Schema0Map0Builder
builder for `Map` @@ -612,27 +637,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## BarBoxed -public static abstract sealed class BarBoxed
+public sealed interface BarBoxed
permits
[BarBoxedNumber](#barboxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## BarBoxedNumber -public static final class BarBoxedNumber
-extends [BarBoxed](#barboxed) +public record BarBoxedNumber
+implements [BarBoxed](#barboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BarBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Bar public static class Bar
diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/OneofWithBaseSchema.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/OneofWithBaseSchema.md index f122b9e0462..176ea9e3a54 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/OneofWithBaseSchema.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/OneofWithBaseSchema.md @@ -4,54 +4,55 @@ public class OneofWithBaseSchema
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [OneofWithBaseSchema.OneofWithBaseSchema1Boxed](#oneofwithbaseschema1boxed)
abstract sealed validated payload class | -| static class | [OneofWithBaseSchema.OneofWithBaseSchema1BoxedString](#oneofwithbaseschema1boxedstring)
boxed class to store validated String payloads | +| sealed interface | [OneofWithBaseSchema.OneofWithBaseSchema1Boxed](#oneofwithbaseschema1boxed)
sealed interface for validated payloads | +| record | [OneofWithBaseSchema.OneofWithBaseSchema1BoxedString](#oneofwithbaseschema1boxedstring)
boxed class to store validated String payloads | | static class | [OneofWithBaseSchema.OneofWithBaseSchema1](#oneofwithbaseschema1)
schema class | -| static class | [OneofWithBaseSchema.Schema1Boxed](#schema1boxed)
abstract sealed validated payload class | -| static class | [OneofWithBaseSchema.Schema1BoxedVoid](#schema1boxedvoid)
boxed class to store validated null payloads | -| static class | [OneofWithBaseSchema.Schema1BoxedBoolean](#schema1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [OneofWithBaseSchema.Schema1BoxedNumber](#schema1boxednumber)
boxed class to store validated Number payloads | -| static class | [OneofWithBaseSchema.Schema1BoxedString](#schema1boxedstring)
boxed class to store validated String payloads | -| static class | [OneofWithBaseSchema.Schema1BoxedList](#schema1boxedlist)
boxed class to store validated List payloads | -| static class | [OneofWithBaseSchema.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [OneofWithBaseSchema.Schema1Boxed](#schema1boxed)
sealed interface for validated payloads | +| record | [OneofWithBaseSchema.Schema1BoxedVoid](#schema1boxedvoid)
boxed class to store validated null payloads | +| record | [OneofWithBaseSchema.Schema1BoxedBoolean](#schema1boxedboolean)
boxed class to store validated boolean payloads | +| record | [OneofWithBaseSchema.Schema1BoxedNumber](#schema1boxednumber)
boxed class to store validated Number payloads | +| record | [OneofWithBaseSchema.Schema1BoxedString](#schema1boxedstring)
boxed class to store validated String payloads | +| record | [OneofWithBaseSchema.Schema1BoxedList](#schema1boxedlist)
boxed class to store validated List payloads | +| record | [OneofWithBaseSchema.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | | static class | [OneofWithBaseSchema.Schema1](#schema1)
schema class | -| static class | [OneofWithBaseSchema.Schema0Boxed](#schema0boxed)
abstract sealed validated payload class | -| static class | [OneofWithBaseSchema.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | -| static class | [OneofWithBaseSchema.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | -| static class | [OneofWithBaseSchema.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | -| static class | [OneofWithBaseSchema.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | -| static class | [OneofWithBaseSchema.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | -| static class | [OneofWithBaseSchema.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [OneofWithBaseSchema.Schema0Boxed](#schema0boxed)
sealed interface for validated payloads | +| record | [OneofWithBaseSchema.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | +| record | [OneofWithBaseSchema.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | +| record | [OneofWithBaseSchema.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | +| record | [OneofWithBaseSchema.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | +| record | [OneofWithBaseSchema.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | +| record | [OneofWithBaseSchema.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | | static class | [OneofWithBaseSchema.Schema0](#schema0)
schema class | ## OneofWithBaseSchema1Boxed -public static abstract sealed class OneofWithBaseSchema1Boxed
+public sealed interface OneofWithBaseSchema1Boxed
permits
[OneofWithBaseSchema1BoxedString](#oneofwithbaseschema1boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## OneofWithBaseSchema1BoxedString -public static final class OneofWithBaseSchema1BoxedString
-extends [OneofWithBaseSchema1Boxed](#oneofwithbaseschema1boxed) +public record OneofWithBaseSchema1BoxedString
+implements [OneofWithBaseSchema1Boxed](#oneofwithbaseschema1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | OneofWithBaseSchema1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## OneofWithBaseSchema1 public static class OneofWithBaseSchema1
@@ -92,9 +93,11 @@ String validatedPayload = OneofWithBaseSchema.OneofWithBaseSchema1.validate( | ----------------- | ---------------------- | | String | validate(String arg, SchemaConfiguration configuration) | | [OneofWithBaseSchema1BoxedString](#oneofwithbaseschema1boxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [OneofWithBaseSchema1Boxed](#oneofwithbaseschema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema1Boxed -public static abstract sealed class Schema1Boxed
+public sealed interface Schema1Boxed
permits
[Schema1BoxedVoid](#schema1boxedvoid), [Schema1BoxedBoolean](#schema1boxedboolean), @@ -103,103 +106,109 @@ permits
[Schema1BoxedList](#schema1boxedlist), [Schema1BoxedMap](#schema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema1BoxedVoid -public static final class Schema1BoxedVoid
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedVoid
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedBoolean -public static final class Schema1BoxedBoolean
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedBoolean
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedNumber -public static final class Schema1BoxedNumber
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedNumber
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedString -public static final class Schema1BoxedString
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedString
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedList -public static final class Schema1BoxedList
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedList
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedMap -public static final class Schema1BoxedMap
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedMap
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1 public static class Schema1
@@ -231,9 +240,11 @@ A schema class that validates payloads | [Schema1BoxedBoolean](#schema1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Schema1BoxedMap](#schema1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [Schema1BoxedList](#schema1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Schema1Boxed](#schema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema0Boxed -public static abstract sealed class Schema0Boxed
+public sealed interface Schema0Boxed
permits
[Schema0BoxedVoid](#schema0boxedvoid), [Schema0BoxedBoolean](#schema0boxedboolean), @@ -242,103 +253,109 @@ permits
[Schema0BoxedList](#schema0boxedlist), [Schema0BoxedMap](#schema0boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema0BoxedVoid -public static final class Schema0BoxedVoid
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedVoid
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedBoolean -public static final class Schema0BoxedBoolean
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedBoolean
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedNumber -public static final class Schema0BoxedNumber
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedNumber
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedString -public static final class Schema0BoxedString
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedString
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedList -public static final class Schema0BoxedList
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedList
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedMap -public static final class Schema0BoxedMap
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedMap
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0 public static class Schema0
@@ -370,5 +387,7 @@ A schema class that validates payloads | [Schema0BoxedBoolean](#schema0boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Schema0BoxedMap](#schema0boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [Schema0BoxedList](#schema0boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Schema0Boxed](#schema0boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/OneofWithEmptySchema.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/OneofWithEmptySchema.md index 9129b14859b..a3b4f2933cb 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/OneofWithEmptySchema.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/OneofWithEmptySchema.md @@ -4,34 +4,34 @@ public class OneofWithEmptySchema
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [OneofWithEmptySchema.OneofWithEmptySchema1Boxed](#oneofwithemptyschema1boxed)
abstract sealed validated payload class | -| static class | [OneofWithEmptySchema.OneofWithEmptySchema1BoxedVoid](#oneofwithemptyschema1boxedvoid)
boxed class to store validated null payloads | -| static class | [OneofWithEmptySchema.OneofWithEmptySchema1BoxedBoolean](#oneofwithemptyschema1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [OneofWithEmptySchema.OneofWithEmptySchema1BoxedNumber](#oneofwithemptyschema1boxednumber)
boxed class to store validated Number payloads | -| static class | [OneofWithEmptySchema.OneofWithEmptySchema1BoxedString](#oneofwithemptyschema1boxedstring)
boxed class to store validated String payloads | -| static class | [OneofWithEmptySchema.OneofWithEmptySchema1BoxedList](#oneofwithemptyschema1boxedlist)
boxed class to store validated List payloads | -| static class | [OneofWithEmptySchema.OneofWithEmptySchema1BoxedMap](#oneofwithemptyschema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [OneofWithEmptySchema.OneofWithEmptySchema1Boxed](#oneofwithemptyschema1boxed)
sealed interface for validated payloads | +| record | [OneofWithEmptySchema.OneofWithEmptySchema1BoxedVoid](#oneofwithemptyschema1boxedvoid)
boxed class to store validated null payloads | +| record | [OneofWithEmptySchema.OneofWithEmptySchema1BoxedBoolean](#oneofwithemptyschema1boxedboolean)
boxed class to store validated boolean payloads | +| record | [OneofWithEmptySchema.OneofWithEmptySchema1BoxedNumber](#oneofwithemptyschema1boxednumber)
boxed class to store validated Number payloads | +| record | [OneofWithEmptySchema.OneofWithEmptySchema1BoxedString](#oneofwithemptyschema1boxedstring)
boxed class to store validated String payloads | +| record | [OneofWithEmptySchema.OneofWithEmptySchema1BoxedList](#oneofwithemptyschema1boxedlist)
boxed class to store validated List payloads | +| record | [OneofWithEmptySchema.OneofWithEmptySchema1BoxedMap](#oneofwithemptyschema1boxedmap)
boxed class to store validated Map payloads | | static class | [OneofWithEmptySchema.OneofWithEmptySchema1](#oneofwithemptyschema1)
schema class | -| static class | [OneofWithEmptySchema.Schema1Boxed](#schema1boxed)
abstract sealed validated payload class | -| static class | [OneofWithEmptySchema.Schema1BoxedVoid](#schema1boxedvoid)
boxed class to store validated null payloads | -| static class | [OneofWithEmptySchema.Schema1BoxedBoolean](#schema1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [OneofWithEmptySchema.Schema1BoxedNumber](#schema1boxednumber)
boxed class to store validated Number payloads | -| static class | [OneofWithEmptySchema.Schema1BoxedString](#schema1boxedstring)
boxed class to store validated String payloads | -| static class | [OneofWithEmptySchema.Schema1BoxedList](#schema1boxedlist)
boxed class to store validated List payloads | -| static class | [OneofWithEmptySchema.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [OneofWithEmptySchema.Schema1Boxed](#schema1boxed)
sealed interface for validated payloads | +| record | [OneofWithEmptySchema.Schema1BoxedVoid](#schema1boxedvoid)
boxed class to store validated null payloads | +| record | [OneofWithEmptySchema.Schema1BoxedBoolean](#schema1boxedboolean)
boxed class to store validated boolean payloads | +| record | [OneofWithEmptySchema.Schema1BoxedNumber](#schema1boxednumber)
boxed class to store validated Number payloads | +| record | [OneofWithEmptySchema.Schema1BoxedString](#schema1boxedstring)
boxed class to store validated String payloads | +| record | [OneofWithEmptySchema.Schema1BoxedList](#schema1boxedlist)
boxed class to store validated List payloads | +| record | [OneofWithEmptySchema.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | | static class | [OneofWithEmptySchema.Schema1](#schema1)
schema class | -| static class | [OneofWithEmptySchema.Schema0Boxed](#schema0boxed)
abstract sealed validated payload class | -| static class | [OneofWithEmptySchema.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | +| sealed interface | [OneofWithEmptySchema.Schema0Boxed](#schema0boxed)
sealed interface for validated payloads | +| record | [OneofWithEmptySchema.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | | static class | [OneofWithEmptySchema.Schema0](#schema0)
schema class | ## OneofWithEmptySchema1Boxed -public static abstract sealed class OneofWithEmptySchema1Boxed
+public sealed interface OneofWithEmptySchema1Boxed
permits
[OneofWithEmptySchema1BoxedVoid](#oneofwithemptyschema1boxedvoid), [OneofWithEmptySchema1BoxedBoolean](#oneofwithemptyschema1boxedboolean), @@ -40,103 +40,109 @@ permits
[OneofWithEmptySchema1BoxedList](#oneofwithemptyschema1boxedlist), [OneofWithEmptySchema1BoxedMap](#oneofwithemptyschema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## OneofWithEmptySchema1BoxedVoid -public static final class OneofWithEmptySchema1BoxedVoid
-extends [OneofWithEmptySchema1Boxed](#oneofwithemptyschema1boxed) +public record OneofWithEmptySchema1BoxedVoid
+implements [OneofWithEmptySchema1Boxed](#oneofwithemptyschema1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | OneofWithEmptySchema1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## OneofWithEmptySchema1BoxedBoolean -public static final class OneofWithEmptySchema1BoxedBoolean
-extends [OneofWithEmptySchema1Boxed](#oneofwithemptyschema1boxed) +public record OneofWithEmptySchema1BoxedBoolean
+implements [OneofWithEmptySchema1Boxed](#oneofwithemptyschema1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | OneofWithEmptySchema1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## OneofWithEmptySchema1BoxedNumber -public static final class OneofWithEmptySchema1BoxedNumber
-extends [OneofWithEmptySchema1Boxed](#oneofwithemptyschema1boxed) +public record OneofWithEmptySchema1BoxedNumber
+implements [OneofWithEmptySchema1Boxed](#oneofwithemptyschema1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | OneofWithEmptySchema1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## OneofWithEmptySchema1BoxedString -public static final class OneofWithEmptySchema1BoxedString
-extends [OneofWithEmptySchema1Boxed](#oneofwithemptyschema1boxed) +public record OneofWithEmptySchema1BoxedString
+implements [OneofWithEmptySchema1Boxed](#oneofwithemptyschema1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | OneofWithEmptySchema1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## OneofWithEmptySchema1BoxedList -public static final class OneofWithEmptySchema1BoxedList
-extends [OneofWithEmptySchema1Boxed](#oneofwithemptyschema1boxed) +public record OneofWithEmptySchema1BoxedList
+implements [OneofWithEmptySchema1Boxed](#oneofwithemptyschema1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | OneofWithEmptySchema1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## OneofWithEmptySchema1BoxedMap -public static final class OneofWithEmptySchema1BoxedMap
-extends [OneofWithEmptySchema1Boxed](#oneofwithemptyschema1boxed) +public record OneofWithEmptySchema1BoxedMap
+implements [OneofWithEmptySchema1Boxed](#oneofwithemptyschema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | OneofWithEmptySchema1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## OneofWithEmptySchema1 public static class OneofWithEmptySchema1
@@ -168,9 +174,11 @@ A schema class that validates payloads | [OneofWithEmptySchema1BoxedBoolean](#oneofwithemptyschema1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [OneofWithEmptySchema1BoxedMap](#oneofwithemptyschema1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [OneofWithEmptySchema1BoxedList](#oneofwithemptyschema1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [OneofWithEmptySchema1Boxed](#oneofwithemptyschema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema1Boxed -public static abstract sealed class Schema1Boxed
+public sealed interface Schema1Boxed
permits
[Schema1BoxedVoid](#schema1boxedvoid), [Schema1BoxedBoolean](#schema1boxedboolean), @@ -179,103 +187,109 @@ permits
[Schema1BoxedList](#schema1boxedlist), [Schema1BoxedMap](#schema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema1BoxedVoid -public static final class Schema1BoxedVoid
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedVoid
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedBoolean -public static final class Schema1BoxedBoolean
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedBoolean
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedNumber -public static final class Schema1BoxedNumber
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedNumber
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedString -public static final class Schema1BoxedString
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedString
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedList -public static final class Schema1BoxedList
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedList
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedMap -public static final class Schema1BoxedMap
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedMap
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1 public static class Schema1
@@ -289,27 +303,28 @@ A schema class that validates payloads | validateAndBox | ## Schema0Boxed -public static abstract sealed class Schema0Boxed
+public sealed interface Schema0Boxed
permits
[Schema0BoxedNumber](#schema0boxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema0BoxedNumber -public static final class Schema0BoxedNumber
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedNumber
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0 public static class Schema0
diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/OneofWithRequired.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/OneofWithRequired.md index 78f1deb2646..b5daaad8023 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/OneofWithRequired.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/OneofWithRequired.md @@ -4,7 +4,7 @@ public class OneofWithRequired
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,52 +12,53 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [OneofWithRequired.OneofWithRequired1Boxed](#oneofwithrequired1boxed)
abstract sealed validated payload class | -| static class | [OneofWithRequired.OneofWithRequired1BoxedMap](#oneofwithrequired1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [OneofWithRequired.OneofWithRequired1Boxed](#oneofwithrequired1boxed)
sealed interface for validated payloads | +| record | [OneofWithRequired.OneofWithRequired1BoxedMap](#oneofwithrequired1boxedmap)
boxed class to store validated Map payloads | | static class | [OneofWithRequired.OneofWithRequired1](#oneofwithrequired1)
schema class | -| static class | [OneofWithRequired.Schema1Boxed](#schema1boxed)
abstract sealed validated payload class | -| static class | [OneofWithRequired.Schema1BoxedVoid](#schema1boxedvoid)
boxed class to store validated null payloads | -| static class | [OneofWithRequired.Schema1BoxedBoolean](#schema1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [OneofWithRequired.Schema1BoxedNumber](#schema1boxednumber)
boxed class to store validated Number payloads | -| static class | [OneofWithRequired.Schema1BoxedString](#schema1boxedstring)
boxed class to store validated String payloads | -| static class | [OneofWithRequired.Schema1BoxedList](#schema1boxedlist)
boxed class to store validated List payloads | -| static class | [OneofWithRequired.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [OneofWithRequired.Schema1Boxed](#schema1boxed)
sealed interface for validated payloads | +| record | [OneofWithRequired.Schema1BoxedVoid](#schema1boxedvoid)
boxed class to store validated null payloads | +| record | [OneofWithRequired.Schema1BoxedBoolean](#schema1boxedboolean)
boxed class to store validated boolean payloads | +| record | [OneofWithRequired.Schema1BoxedNumber](#schema1boxednumber)
boxed class to store validated Number payloads | +| record | [OneofWithRequired.Schema1BoxedString](#schema1boxedstring)
boxed class to store validated String payloads | +| record | [OneofWithRequired.Schema1BoxedList](#schema1boxedlist)
boxed class to store validated List payloads | +| record | [OneofWithRequired.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | | static class | [OneofWithRequired.Schema1](#schema1)
schema class | | static class | [OneofWithRequired.Schema1MapBuilder](#schema1mapbuilder)
builder for Map payloads | | static class | [OneofWithRequired.Schema1Map](#schema1map)
output class for Map payloads | -| static class | [OneofWithRequired.Schema0Boxed](#schema0boxed)
abstract sealed validated payload class | -| static class | [OneofWithRequired.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | -| static class | [OneofWithRequired.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | -| static class | [OneofWithRequired.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | -| static class | [OneofWithRequired.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | -| static class | [OneofWithRequired.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | -| static class | [OneofWithRequired.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [OneofWithRequired.Schema0Boxed](#schema0boxed)
sealed interface for validated payloads | +| record | [OneofWithRequired.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | +| record | [OneofWithRequired.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | +| record | [OneofWithRequired.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | +| record | [OneofWithRequired.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | +| record | [OneofWithRequired.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | +| record | [OneofWithRequired.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | | static class | [OneofWithRequired.Schema0](#schema0)
schema class | | static class | [OneofWithRequired.Schema0MapBuilder](#schema0mapbuilder)
builder for Map payloads | | static class | [OneofWithRequired.Schema0Map](#schema0map)
output class for Map payloads | ## OneofWithRequired1Boxed -public static abstract sealed class OneofWithRequired1Boxed
+public sealed interface OneofWithRequired1Boxed
permits
[OneofWithRequired1BoxedMap](#oneofwithrequired1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## OneofWithRequired1BoxedMap -public static final class OneofWithRequired1BoxedMap
-extends [OneofWithRequired1Boxed](#oneofwithrequired1boxed) +public record OneofWithRequired1BoxedMap
+implements [OneofWithRequired1Boxed](#oneofwithrequired1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | OneofWithRequired1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## OneofWithRequired1 public static class OneofWithRequired1
@@ -76,9 +77,11 @@ A schema class that validates payloads | ----------------- | ---------------------- | | FrozenMap | validate(Map<?, ?> arg, SchemaConfiguration configuration) | | [OneofWithRequired1BoxedMap](#oneofwithrequired1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | +| [OneofWithRequired1Boxed](#oneofwithrequired1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema1Boxed -public static abstract sealed class Schema1Boxed
+public sealed interface Schema1Boxed
permits
[Schema1BoxedVoid](#schema1boxedvoid), [Schema1BoxedBoolean](#schema1boxedboolean), @@ -87,103 +90,109 @@ permits
[Schema1BoxedList](#schema1boxedlist), [Schema1BoxedMap](#schema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema1BoxedVoid -public static final class Schema1BoxedVoid
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedVoid
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedBoolean -public static final class Schema1BoxedBoolean
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedBoolean
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedNumber -public static final class Schema1BoxedNumber
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedNumber
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedString -public static final class Schema1BoxedString
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedString
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedList -public static final class Schema1BoxedList
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedList
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedMap -public static final class Schema1BoxedMap
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedMap
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedMap([Schema1Map](#schema1map) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [Schema1Map](#schema1map) | data
validated payload | +| [Schema1Map](#schema1map) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1 public static class Schema1
@@ -215,7 +224,9 @@ A schema class that validates payloads | [Schema1BoxedBoolean](#schema1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Schema1BoxedMap](#schema1boxedmap) | validateAndBox([Map<?, ?>](#schema1mapbuilder) arg, SchemaConfiguration configuration) | | [Schema1BoxedList](#schema1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Schema1Boxed](#schema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema1Map00Builder public class Schema1Map00Builder
builder for `Map` @@ -337,7 +348,7 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## Schema0Boxed -public static abstract sealed class Schema0Boxed
+public sealed interface Schema0Boxed
permits
[Schema0BoxedVoid](#schema0boxedvoid), [Schema0BoxedBoolean](#schema0boxedboolean), @@ -346,103 +357,109 @@ permits
[Schema0BoxedList](#schema0boxedlist), [Schema0BoxedMap](#schema0boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema0BoxedVoid -public static final class Schema0BoxedVoid
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedVoid
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedBoolean -public static final class Schema0BoxedBoolean
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedBoolean
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedNumber -public static final class Schema0BoxedNumber
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedNumber
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedString -public static final class Schema0BoxedString
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedString
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedList -public static final class Schema0BoxedList
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedList
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedMap -public static final class Schema0BoxedMap
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedMap
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedMap([Schema0Map](#schema0map) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [Schema0Map](#schema0map) | data
validated payload | +| [Schema0Map](#schema0map) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0 public static class Schema0
@@ -474,7 +491,9 @@ A schema class that validates payloads | [Schema0BoxedBoolean](#schema0boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Schema0BoxedMap](#schema0boxedmap) | validateAndBox([Map<?, ?>](#schema0mapbuilder) arg, SchemaConfiguration configuration) | | [Schema0BoxedList](#schema0boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Schema0Boxed](#schema0boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema0Map00Builder public class Schema0Map00Builder
builder for `Map` diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/PatternIsNotAnchored.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/PatternIsNotAnchored.md index 09b6b5b6cc3..15a76dd0a5d 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/PatternIsNotAnchored.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/PatternIsNotAnchored.md @@ -4,23 +4,23 @@ public class PatternIsNotAnchored
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [PatternIsNotAnchored.PatternIsNotAnchored1Boxed](#patternisnotanchored1boxed)
abstract sealed validated payload class | -| static class | [PatternIsNotAnchored.PatternIsNotAnchored1BoxedVoid](#patternisnotanchored1boxedvoid)
boxed class to store validated null payloads | -| static class | [PatternIsNotAnchored.PatternIsNotAnchored1BoxedBoolean](#patternisnotanchored1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [PatternIsNotAnchored.PatternIsNotAnchored1BoxedNumber](#patternisnotanchored1boxednumber)
boxed class to store validated Number payloads | -| static class | [PatternIsNotAnchored.PatternIsNotAnchored1BoxedString](#patternisnotanchored1boxedstring)
boxed class to store validated String payloads | -| static class | [PatternIsNotAnchored.PatternIsNotAnchored1BoxedList](#patternisnotanchored1boxedlist)
boxed class to store validated List payloads | -| static class | [PatternIsNotAnchored.PatternIsNotAnchored1BoxedMap](#patternisnotanchored1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [PatternIsNotAnchored.PatternIsNotAnchored1Boxed](#patternisnotanchored1boxed)
sealed interface for validated payloads | +| record | [PatternIsNotAnchored.PatternIsNotAnchored1BoxedVoid](#patternisnotanchored1boxedvoid)
boxed class to store validated null payloads | +| record | [PatternIsNotAnchored.PatternIsNotAnchored1BoxedBoolean](#patternisnotanchored1boxedboolean)
boxed class to store validated boolean payloads | +| record | [PatternIsNotAnchored.PatternIsNotAnchored1BoxedNumber](#patternisnotanchored1boxednumber)
boxed class to store validated Number payloads | +| record | [PatternIsNotAnchored.PatternIsNotAnchored1BoxedString](#patternisnotanchored1boxedstring)
boxed class to store validated String payloads | +| record | [PatternIsNotAnchored.PatternIsNotAnchored1BoxedList](#patternisnotanchored1boxedlist)
boxed class to store validated List payloads | +| record | [PatternIsNotAnchored.PatternIsNotAnchored1BoxedMap](#patternisnotanchored1boxedmap)
boxed class to store validated Map payloads | | static class | [PatternIsNotAnchored.PatternIsNotAnchored1](#patternisnotanchored1)
schema class | ## PatternIsNotAnchored1Boxed -public static abstract sealed class PatternIsNotAnchored1Boxed
+public sealed interface PatternIsNotAnchored1Boxed
permits
[PatternIsNotAnchored1BoxedVoid](#patternisnotanchored1boxedvoid), [PatternIsNotAnchored1BoxedBoolean](#patternisnotanchored1boxedboolean), @@ -29,103 +29,109 @@ permits
[PatternIsNotAnchored1BoxedList](#patternisnotanchored1boxedlist), [PatternIsNotAnchored1BoxedMap](#patternisnotanchored1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## PatternIsNotAnchored1BoxedVoid -public static final class PatternIsNotAnchored1BoxedVoid
-extends [PatternIsNotAnchored1Boxed](#patternisnotanchored1boxed) +public record PatternIsNotAnchored1BoxedVoid
+implements [PatternIsNotAnchored1Boxed](#patternisnotanchored1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PatternIsNotAnchored1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PatternIsNotAnchored1BoxedBoolean -public static final class PatternIsNotAnchored1BoxedBoolean
-extends [PatternIsNotAnchored1Boxed](#patternisnotanchored1boxed) +public record PatternIsNotAnchored1BoxedBoolean
+implements [PatternIsNotAnchored1Boxed](#patternisnotanchored1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PatternIsNotAnchored1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PatternIsNotAnchored1BoxedNumber -public static final class PatternIsNotAnchored1BoxedNumber
-extends [PatternIsNotAnchored1Boxed](#patternisnotanchored1boxed) +public record PatternIsNotAnchored1BoxedNumber
+implements [PatternIsNotAnchored1Boxed](#patternisnotanchored1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PatternIsNotAnchored1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PatternIsNotAnchored1BoxedString -public static final class PatternIsNotAnchored1BoxedString
-extends [PatternIsNotAnchored1Boxed](#patternisnotanchored1boxed) +public record PatternIsNotAnchored1BoxedString
+implements [PatternIsNotAnchored1Boxed](#patternisnotanchored1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PatternIsNotAnchored1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PatternIsNotAnchored1BoxedList -public static final class PatternIsNotAnchored1BoxedList
-extends [PatternIsNotAnchored1Boxed](#patternisnotanchored1boxed) +public record PatternIsNotAnchored1BoxedList
+implements [PatternIsNotAnchored1Boxed](#patternisnotanchored1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PatternIsNotAnchored1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PatternIsNotAnchored1BoxedMap -public static final class PatternIsNotAnchored1BoxedMap
-extends [PatternIsNotAnchored1Boxed](#patternisnotanchored1boxed) +public record PatternIsNotAnchored1BoxedMap
+implements [PatternIsNotAnchored1Boxed](#patternisnotanchored1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PatternIsNotAnchored1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PatternIsNotAnchored1 public static class PatternIsNotAnchored1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [PatternIsNotAnchored1BoxedBoolean](#patternisnotanchored1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [PatternIsNotAnchored1BoxedMap](#patternisnotanchored1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [PatternIsNotAnchored1BoxedList](#patternisnotanchored1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [PatternIsNotAnchored1Boxed](#patternisnotanchored1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/PatternValidation.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/PatternValidation.md index 7a47b6b1945..ddec1547b2a 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/PatternValidation.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/PatternValidation.md @@ -4,23 +4,23 @@ public class PatternValidation
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [PatternValidation.PatternValidation1Boxed](#patternvalidation1boxed)
abstract sealed validated payload class | -| static class | [PatternValidation.PatternValidation1BoxedVoid](#patternvalidation1boxedvoid)
boxed class to store validated null payloads | -| static class | [PatternValidation.PatternValidation1BoxedBoolean](#patternvalidation1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [PatternValidation.PatternValidation1BoxedNumber](#patternvalidation1boxednumber)
boxed class to store validated Number payloads | -| static class | [PatternValidation.PatternValidation1BoxedString](#patternvalidation1boxedstring)
boxed class to store validated String payloads | -| static class | [PatternValidation.PatternValidation1BoxedList](#patternvalidation1boxedlist)
boxed class to store validated List payloads | -| static class | [PatternValidation.PatternValidation1BoxedMap](#patternvalidation1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [PatternValidation.PatternValidation1Boxed](#patternvalidation1boxed)
sealed interface for validated payloads | +| record | [PatternValidation.PatternValidation1BoxedVoid](#patternvalidation1boxedvoid)
boxed class to store validated null payloads | +| record | [PatternValidation.PatternValidation1BoxedBoolean](#patternvalidation1boxedboolean)
boxed class to store validated boolean payloads | +| record | [PatternValidation.PatternValidation1BoxedNumber](#patternvalidation1boxednumber)
boxed class to store validated Number payloads | +| record | [PatternValidation.PatternValidation1BoxedString](#patternvalidation1boxedstring)
boxed class to store validated String payloads | +| record | [PatternValidation.PatternValidation1BoxedList](#patternvalidation1boxedlist)
boxed class to store validated List payloads | +| record | [PatternValidation.PatternValidation1BoxedMap](#patternvalidation1boxedmap)
boxed class to store validated Map payloads | | static class | [PatternValidation.PatternValidation1](#patternvalidation1)
schema class | ## PatternValidation1Boxed -public static abstract sealed class PatternValidation1Boxed
+public sealed interface PatternValidation1Boxed
permits
[PatternValidation1BoxedVoid](#patternvalidation1boxedvoid), [PatternValidation1BoxedBoolean](#patternvalidation1boxedboolean), @@ -29,103 +29,109 @@ permits
[PatternValidation1BoxedList](#patternvalidation1boxedlist), [PatternValidation1BoxedMap](#patternvalidation1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## PatternValidation1BoxedVoid -public static final class PatternValidation1BoxedVoid
-extends [PatternValidation1Boxed](#patternvalidation1boxed) +public record PatternValidation1BoxedVoid
+implements [PatternValidation1Boxed](#patternvalidation1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PatternValidation1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PatternValidation1BoxedBoolean -public static final class PatternValidation1BoxedBoolean
-extends [PatternValidation1Boxed](#patternvalidation1boxed) +public record PatternValidation1BoxedBoolean
+implements [PatternValidation1Boxed](#patternvalidation1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PatternValidation1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PatternValidation1BoxedNumber -public static final class PatternValidation1BoxedNumber
-extends [PatternValidation1Boxed](#patternvalidation1boxed) +public record PatternValidation1BoxedNumber
+implements [PatternValidation1Boxed](#patternvalidation1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PatternValidation1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PatternValidation1BoxedString -public static final class PatternValidation1BoxedString
-extends [PatternValidation1Boxed](#patternvalidation1boxed) +public record PatternValidation1BoxedString
+implements [PatternValidation1Boxed](#patternvalidation1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PatternValidation1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PatternValidation1BoxedList -public static final class PatternValidation1BoxedList
-extends [PatternValidation1Boxed](#patternvalidation1boxed) +public record PatternValidation1BoxedList
+implements [PatternValidation1Boxed](#patternvalidation1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PatternValidation1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PatternValidation1BoxedMap -public static final class PatternValidation1BoxedMap
-extends [PatternValidation1Boxed](#patternvalidation1boxed) +public record PatternValidation1BoxedMap
+implements [PatternValidation1Boxed](#patternvalidation1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PatternValidation1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PatternValidation1 public static class PatternValidation1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [PatternValidation1BoxedBoolean](#patternvalidation1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [PatternValidation1BoxedMap](#patternvalidation1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [PatternValidation1BoxedList](#patternvalidation1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [PatternValidation1Boxed](#patternvalidation1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/PatternpropertiesValidatesPropertiesMatchingARegex.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/PatternpropertiesValidatesPropertiesMatchingARegex.md index b41d5247f74..837555c8491 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/PatternpropertiesValidatesPropertiesMatchingARegex.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/PatternpropertiesValidatesPropertiesMatchingARegex.md @@ -4,26 +4,26 @@ public class PatternpropertiesValidatesPropertiesMatchingARegex
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [PatternpropertiesValidatesPropertiesMatchingARegex.PatternpropertiesValidatesPropertiesMatchingARegex1Boxed](#patternpropertiesvalidatespropertiesmatchingaregex1boxed)
abstract sealed validated payload class | -| static class | [PatternpropertiesValidatesPropertiesMatchingARegex.PatternpropertiesValidatesPropertiesMatchingARegex1BoxedVoid](#patternpropertiesvalidatespropertiesmatchingaregex1boxedvoid)
boxed class to store validated null payloads | -| static class | [PatternpropertiesValidatesPropertiesMatchingARegex.PatternpropertiesValidatesPropertiesMatchingARegex1BoxedBoolean](#patternpropertiesvalidatespropertiesmatchingaregex1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [PatternpropertiesValidatesPropertiesMatchingARegex.PatternpropertiesValidatesPropertiesMatchingARegex1BoxedNumber](#patternpropertiesvalidatespropertiesmatchingaregex1boxednumber)
boxed class to store validated Number payloads | -| static class | [PatternpropertiesValidatesPropertiesMatchingARegex.PatternpropertiesValidatesPropertiesMatchingARegex1BoxedString](#patternpropertiesvalidatespropertiesmatchingaregex1boxedstring)
boxed class to store validated String payloads | -| static class | [PatternpropertiesValidatesPropertiesMatchingARegex.PatternpropertiesValidatesPropertiesMatchingARegex1BoxedList](#patternpropertiesvalidatespropertiesmatchingaregex1boxedlist)
boxed class to store validated List payloads | -| static class | [PatternpropertiesValidatesPropertiesMatchingARegex.PatternpropertiesValidatesPropertiesMatchingARegex1BoxedMap](#patternpropertiesvalidatespropertiesmatchingaregex1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [PatternpropertiesValidatesPropertiesMatchingARegex.PatternpropertiesValidatesPropertiesMatchingARegex1Boxed](#patternpropertiesvalidatespropertiesmatchingaregex1boxed)
sealed interface for validated payloads | +| record | [PatternpropertiesValidatesPropertiesMatchingARegex.PatternpropertiesValidatesPropertiesMatchingARegex1BoxedVoid](#patternpropertiesvalidatespropertiesmatchingaregex1boxedvoid)
boxed class to store validated null payloads | +| record | [PatternpropertiesValidatesPropertiesMatchingARegex.PatternpropertiesValidatesPropertiesMatchingARegex1BoxedBoolean](#patternpropertiesvalidatespropertiesmatchingaregex1boxedboolean)
boxed class to store validated boolean payloads | +| record | [PatternpropertiesValidatesPropertiesMatchingARegex.PatternpropertiesValidatesPropertiesMatchingARegex1BoxedNumber](#patternpropertiesvalidatespropertiesmatchingaregex1boxednumber)
boxed class to store validated Number payloads | +| record | [PatternpropertiesValidatesPropertiesMatchingARegex.PatternpropertiesValidatesPropertiesMatchingARegex1BoxedString](#patternpropertiesvalidatespropertiesmatchingaregex1boxedstring)
boxed class to store validated String payloads | +| record | [PatternpropertiesValidatesPropertiesMatchingARegex.PatternpropertiesValidatesPropertiesMatchingARegex1BoxedList](#patternpropertiesvalidatespropertiesmatchingaregex1boxedlist)
boxed class to store validated List payloads | +| record | [PatternpropertiesValidatesPropertiesMatchingARegex.PatternpropertiesValidatesPropertiesMatchingARegex1BoxedMap](#patternpropertiesvalidatespropertiesmatchingaregex1boxedmap)
boxed class to store validated Map payloads | | static class | [PatternpropertiesValidatesPropertiesMatchingARegex.PatternpropertiesValidatesPropertiesMatchingARegex1](#patternpropertiesvalidatespropertiesmatchingaregex1)
schema class | -| static class | [PatternpropertiesValidatesPropertiesMatchingARegex.FoBoxed](#foboxed)
abstract sealed validated payload class | -| static class | [PatternpropertiesValidatesPropertiesMatchingARegex.FoBoxedNumber](#foboxednumber)
boxed class to store validated Number payloads | +| sealed interface | [PatternpropertiesValidatesPropertiesMatchingARegex.FoBoxed](#foboxed)
sealed interface for validated payloads | +| record | [PatternpropertiesValidatesPropertiesMatchingARegex.FoBoxedNumber](#foboxednumber)
boxed class to store validated Number payloads | | static class | [PatternpropertiesValidatesPropertiesMatchingARegex.Fo](#fo)
schema class | ## PatternpropertiesValidatesPropertiesMatchingARegex1Boxed -public static abstract sealed class PatternpropertiesValidatesPropertiesMatchingARegex1Boxed
+public sealed interface PatternpropertiesValidatesPropertiesMatchingARegex1Boxed
permits
[PatternpropertiesValidatesPropertiesMatchingARegex1BoxedVoid](#patternpropertiesvalidatespropertiesmatchingaregex1boxedvoid), [PatternpropertiesValidatesPropertiesMatchingARegex1BoxedBoolean](#patternpropertiesvalidatespropertiesmatchingaregex1boxedboolean), @@ -32,103 +32,109 @@ permits
[PatternpropertiesValidatesPropertiesMatchingARegex1BoxedList](#patternpropertiesvalidatespropertiesmatchingaregex1boxedlist), [PatternpropertiesValidatesPropertiesMatchingARegex1BoxedMap](#patternpropertiesvalidatespropertiesmatchingaregex1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## PatternpropertiesValidatesPropertiesMatchingARegex1BoxedVoid -public static final class PatternpropertiesValidatesPropertiesMatchingARegex1BoxedVoid
-extends [PatternpropertiesValidatesPropertiesMatchingARegex1Boxed](#patternpropertiesvalidatespropertiesmatchingaregex1boxed) +public record PatternpropertiesValidatesPropertiesMatchingARegex1BoxedVoid
+implements [PatternpropertiesValidatesPropertiesMatchingARegex1Boxed](#patternpropertiesvalidatespropertiesmatchingaregex1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PatternpropertiesValidatesPropertiesMatchingARegex1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PatternpropertiesValidatesPropertiesMatchingARegex1BoxedBoolean -public static final class PatternpropertiesValidatesPropertiesMatchingARegex1BoxedBoolean
-extends [PatternpropertiesValidatesPropertiesMatchingARegex1Boxed](#patternpropertiesvalidatespropertiesmatchingaregex1boxed) +public record PatternpropertiesValidatesPropertiesMatchingARegex1BoxedBoolean
+implements [PatternpropertiesValidatesPropertiesMatchingARegex1Boxed](#patternpropertiesvalidatespropertiesmatchingaregex1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PatternpropertiesValidatesPropertiesMatchingARegex1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PatternpropertiesValidatesPropertiesMatchingARegex1BoxedNumber -public static final class PatternpropertiesValidatesPropertiesMatchingARegex1BoxedNumber
-extends [PatternpropertiesValidatesPropertiesMatchingARegex1Boxed](#patternpropertiesvalidatespropertiesmatchingaregex1boxed) +public record PatternpropertiesValidatesPropertiesMatchingARegex1BoxedNumber
+implements [PatternpropertiesValidatesPropertiesMatchingARegex1Boxed](#patternpropertiesvalidatespropertiesmatchingaregex1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PatternpropertiesValidatesPropertiesMatchingARegex1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PatternpropertiesValidatesPropertiesMatchingARegex1BoxedString -public static final class PatternpropertiesValidatesPropertiesMatchingARegex1BoxedString
-extends [PatternpropertiesValidatesPropertiesMatchingARegex1Boxed](#patternpropertiesvalidatespropertiesmatchingaregex1boxed) +public record PatternpropertiesValidatesPropertiesMatchingARegex1BoxedString
+implements [PatternpropertiesValidatesPropertiesMatchingARegex1Boxed](#patternpropertiesvalidatespropertiesmatchingaregex1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PatternpropertiesValidatesPropertiesMatchingARegex1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PatternpropertiesValidatesPropertiesMatchingARegex1BoxedList -public static final class PatternpropertiesValidatesPropertiesMatchingARegex1BoxedList
-extends [PatternpropertiesValidatesPropertiesMatchingARegex1Boxed](#patternpropertiesvalidatespropertiesmatchingaregex1boxed) +public record PatternpropertiesValidatesPropertiesMatchingARegex1BoxedList
+implements [PatternpropertiesValidatesPropertiesMatchingARegex1Boxed](#patternpropertiesvalidatespropertiesmatchingaregex1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PatternpropertiesValidatesPropertiesMatchingARegex1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PatternpropertiesValidatesPropertiesMatchingARegex1BoxedMap -public static final class PatternpropertiesValidatesPropertiesMatchingARegex1BoxedMap
-extends [PatternpropertiesValidatesPropertiesMatchingARegex1Boxed](#patternpropertiesvalidatespropertiesmatchingaregex1boxed) +public record PatternpropertiesValidatesPropertiesMatchingARegex1BoxedMap
+implements [PatternpropertiesValidatesPropertiesMatchingARegex1Boxed](#patternpropertiesvalidatespropertiesmatchingaregex1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PatternpropertiesValidatesPropertiesMatchingARegex1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PatternpropertiesValidatesPropertiesMatchingARegex1 public static class PatternpropertiesValidatesPropertiesMatchingARegex1
@@ -160,29 +166,32 @@ A schema class that validates payloads | [PatternpropertiesValidatesPropertiesMatchingARegex1BoxedBoolean](#patternpropertiesvalidatespropertiesmatchingaregex1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [PatternpropertiesValidatesPropertiesMatchingARegex1BoxedMap](#patternpropertiesvalidatespropertiesmatchingaregex1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [PatternpropertiesValidatesPropertiesMatchingARegex1BoxedList](#patternpropertiesvalidatespropertiesmatchingaregex1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [PatternpropertiesValidatesPropertiesMatchingARegex1Boxed](#patternpropertiesvalidatespropertiesmatchingaregex1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## FoBoxed -public static abstract sealed class FoBoxed
+public sealed interface FoBoxed
permits
[FoBoxedNumber](#foboxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## FoBoxedNumber -public static final class FoBoxedNumber
-extends [FoBoxed](#foboxed) +public record FoBoxedNumber
+implements [FoBoxed](#foboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FoBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Fo public static class Fo
diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/PatternpropertiesWithNullValuedInstanceProperties.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/PatternpropertiesWithNullValuedInstanceProperties.md index 36c4b753aaf..74e030b224e 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/PatternpropertiesWithNullValuedInstanceProperties.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/PatternpropertiesWithNullValuedInstanceProperties.md @@ -4,26 +4,26 @@ public class PatternpropertiesWithNullValuedInstanceProperties
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [PatternpropertiesWithNullValuedInstanceProperties.PatternpropertiesWithNullValuedInstanceProperties1Boxed](#patternpropertieswithnullvaluedinstanceproperties1boxed)
abstract sealed validated payload class | -| static class | [PatternpropertiesWithNullValuedInstanceProperties.PatternpropertiesWithNullValuedInstanceProperties1BoxedVoid](#patternpropertieswithnullvaluedinstanceproperties1boxedvoid)
boxed class to store validated null payloads | -| static class | [PatternpropertiesWithNullValuedInstanceProperties.PatternpropertiesWithNullValuedInstanceProperties1BoxedBoolean](#patternpropertieswithnullvaluedinstanceproperties1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [PatternpropertiesWithNullValuedInstanceProperties.PatternpropertiesWithNullValuedInstanceProperties1BoxedNumber](#patternpropertieswithnullvaluedinstanceproperties1boxednumber)
boxed class to store validated Number payloads | -| static class | [PatternpropertiesWithNullValuedInstanceProperties.PatternpropertiesWithNullValuedInstanceProperties1BoxedString](#patternpropertieswithnullvaluedinstanceproperties1boxedstring)
boxed class to store validated String payloads | -| static class | [PatternpropertiesWithNullValuedInstanceProperties.PatternpropertiesWithNullValuedInstanceProperties1BoxedList](#patternpropertieswithnullvaluedinstanceproperties1boxedlist)
boxed class to store validated List payloads | -| static class | [PatternpropertiesWithNullValuedInstanceProperties.PatternpropertiesWithNullValuedInstanceProperties1BoxedMap](#patternpropertieswithnullvaluedinstanceproperties1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [PatternpropertiesWithNullValuedInstanceProperties.PatternpropertiesWithNullValuedInstanceProperties1Boxed](#patternpropertieswithnullvaluedinstanceproperties1boxed)
sealed interface for validated payloads | +| record | [PatternpropertiesWithNullValuedInstanceProperties.PatternpropertiesWithNullValuedInstanceProperties1BoxedVoid](#patternpropertieswithnullvaluedinstanceproperties1boxedvoid)
boxed class to store validated null payloads | +| record | [PatternpropertiesWithNullValuedInstanceProperties.PatternpropertiesWithNullValuedInstanceProperties1BoxedBoolean](#patternpropertieswithnullvaluedinstanceproperties1boxedboolean)
boxed class to store validated boolean payloads | +| record | [PatternpropertiesWithNullValuedInstanceProperties.PatternpropertiesWithNullValuedInstanceProperties1BoxedNumber](#patternpropertieswithnullvaluedinstanceproperties1boxednumber)
boxed class to store validated Number payloads | +| record | [PatternpropertiesWithNullValuedInstanceProperties.PatternpropertiesWithNullValuedInstanceProperties1BoxedString](#patternpropertieswithnullvaluedinstanceproperties1boxedstring)
boxed class to store validated String payloads | +| record | [PatternpropertiesWithNullValuedInstanceProperties.PatternpropertiesWithNullValuedInstanceProperties1BoxedList](#patternpropertieswithnullvaluedinstanceproperties1boxedlist)
boxed class to store validated List payloads | +| record | [PatternpropertiesWithNullValuedInstanceProperties.PatternpropertiesWithNullValuedInstanceProperties1BoxedMap](#patternpropertieswithnullvaluedinstanceproperties1boxedmap)
boxed class to store validated Map payloads | | static class | [PatternpropertiesWithNullValuedInstanceProperties.PatternpropertiesWithNullValuedInstanceProperties1](#patternpropertieswithnullvaluedinstanceproperties1)
schema class | -| static class | [PatternpropertiesWithNullValuedInstanceProperties.BarBoxed](#barboxed)
abstract sealed validated payload class | -| static class | [PatternpropertiesWithNullValuedInstanceProperties.BarBoxedVoid](#barboxedvoid)
boxed class to store validated null payloads | +| sealed interface | [PatternpropertiesWithNullValuedInstanceProperties.BarBoxed](#barboxed)
sealed interface for validated payloads | +| record | [PatternpropertiesWithNullValuedInstanceProperties.BarBoxedVoid](#barboxedvoid)
boxed class to store validated null payloads | | static class | [PatternpropertiesWithNullValuedInstanceProperties.Bar](#bar)
schema class | ## PatternpropertiesWithNullValuedInstanceProperties1Boxed -public static abstract sealed class PatternpropertiesWithNullValuedInstanceProperties1Boxed
+public sealed interface PatternpropertiesWithNullValuedInstanceProperties1Boxed
permits
[PatternpropertiesWithNullValuedInstanceProperties1BoxedVoid](#patternpropertieswithnullvaluedinstanceproperties1boxedvoid), [PatternpropertiesWithNullValuedInstanceProperties1BoxedBoolean](#patternpropertieswithnullvaluedinstanceproperties1boxedboolean), @@ -32,103 +32,109 @@ permits
[PatternpropertiesWithNullValuedInstanceProperties1BoxedList](#patternpropertieswithnullvaluedinstanceproperties1boxedlist), [PatternpropertiesWithNullValuedInstanceProperties1BoxedMap](#patternpropertieswithnullvaluedinstanceproperties1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## PatternpropertiesWithNullValuedInstanceProperties1BoxedVoid -public static final class PatternpropertiesWithNullValuedInstanceProperties1BoxedVoid
-extends [PatternpropertiesWithNullValuedInstanceProperties1Boxed](#patternpropertieswithnullvaluedinstanceproperties1boxed) +public record PatternpropertiesWithNullValuedInstanceProperties1BoxedVoid
+implements [PatternpropertiesWithNullValuedInstanceProperties1Boxed](#patternpropertieswithnullvaluedinstanceproperties1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PatternpropertiesWithNullValuedInstanceProperties1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PatternpropertiesWithNullValuedInstanceProperties1BoxedBoolean -public static final class PatternpropertiesWithNullValuedInstanceProperties1BoxedBoolean
-extends [PatternpropertiesWithNullValuedInstanceProperties1Boxed](#patternpropertieswithnullvaluedinstanceproperties1boxed) +public record PatternpropertiesWithNullValuedInstanceProperties1BoxedBoolean
+implements [PatternpropertiesWithNullValuedInstanceProperties1Boxed](#patternpropertieswithnullvaluedinstanceproperties1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PatternpropertiesWithNullValuedInstanceProperties1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PatternpropertiesWithNullValuedInstanceProperties1BoxedNumber -public static final class PatternpropertiesWithNullValuedInstanceProperties1BoxedNumber
-extends [PatternpropertiesWithNullValuedInstanceProperties1Boxed](#patternpropertieswithnullvaluedinstanceproperties1boxed) +public record PatternpropertiesWithNullValuedInstanceProperties1BoxedNumber
+implements [PatternpropertiesWithNullValuedInstanceProperties1Boxed](#patternpropertieswithnullvaluedinstanceproperties1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PatternpropertiesWithNullValuedInstanceProperties1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PatternpropertiesWithNullValuedInstanceProperties1BoxedString -public static final class PatternpropertiesWithNullValuedInstanceProperties1BoxedString
-extends [PatternpropertiesWithNullValuedInstanceProperties1Boxed](#patternpropertieswithnullvaluedinstanceproperties1boxed) +public record PatternpropertiesWithNullValuedInstanceProperties1BoxedString
+implements [PatternpropertiesWithNullValuedInstanceProperties1Boxed](#patternpropertieswithnullvaluedinstanceproperties1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PatternpropertiesWithNullValuedInstanceProperties1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PatternpropertiesWithNullValuedInstanceProperties1BoxedList -public static final class PatternpropertiesWithNullValuedInstanceProperties1BoxedList
-extends [PatternpropertiesWithNullValuedInstanceProperties1Boxed](#patternpropertieswithnullvaluedinstanceproperties1boxed) +public record PatternpropertiesWithNullValuedInstanceProperties1BoxedList
+implements [PatternpropertiesWithNullValuedInstanceProperties1Boxed](#patternpropertieswithnullvaluedinstanceproperties1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PatternpropertiesWithNullValuedInstanceProperties1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PatternpropertiesWithNullValuedInstanceProperties1BoxedMap -public static final class PatternpropertiesWithNullValuedInstanceProperties1BoxedMap
-extends [PatternpropertiesWithNullValuedInstanceProperties1Boxed](#patternpropertieswithnullvaluedinstanceproperties1boxed) +public record PatternpropertiesWithNullValuedInstanceProperties1BoxedMap
+implements [PatternpropertiesWithNullValuedInstanceProperties1Boxed](#patternpropertieswithnullvaluedinstanceproperties1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PatternpropertiesWithNullValuedInstanceProperties1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PatternpropertiesWithNullValuedInstanceProperties1 public static class PatternpropertiesWithNullValuedInstanceProperties1
@@ -160,29 +166,32 @@ A schema class that validates payloads | [PatternpropertiesWithNullValuedInstanceProperties1BoxedBoolean](#patternpropertieswithnullvaluedinstanceproperties1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [PatternpropertiesWithNullValuedInstanceProperties1BoxedMap](#patternpropertieswithnullvaluedinstanceproperties1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [PatternpropertiesWithNullValuedInstanceProperties1BoxedList](#patternpropertieswithnullvaluedinstanceproperties1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [PatternpropertiesWithNullValuedInstanceProperties1Boxed](#patternpropertieswithnullvaluedinstanceproperties1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## BarBoxed -public static abstract sealed class BarBoxed
+public sealed interface BarBoxed
permits
[BarBoxedVoid](#barboxedvoid) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## BarBoxedVoid -public static final class BarBoxedVoid
-extends [BarBoxed](#barboxed) +public record BarBoxedVoid
+implements [BarBoxed](#barboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BarBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Bar public static class Bar
diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/PrefixitemsValidationAdjustsTheStartingIndexForItems.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/PrefixitemsValidationAdjustsTheStartingIndexForItems.md index 7adfcfecbf2..1b15dd3fca0 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/PrefixitemsValidationAdjustsTheStartingIndexForItems.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/PrefixitemsValidationAdjustsTheStartingIndexForItems.md @@ -4,7 +4,7 @@ public class PrefixitemsValidationAdjustsTheStartingIndexForItems
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated list payloads, extends FrozenList - classes to build inputs for list payloads @@ -12,40 +12,41 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [PrefixitemsValidationAdjustsTheStartingIndexForItems.PrefixitemsValidationAdjustsTheStartingIndexForItems1Boxed](#prefixitemsvalidationadjuststhestartingindexforitems1boxed)
abstract sealed validated payload class | -| static class | [PrefixitemsValidationAdjustsTheStartingIndexForItems.PrefixitemsValidationAdjustsTheStartingIndexForItems1BoxedList](#prefixitemsvalidationadjuststhestartingindexforitems1boxedlist)
boxed class to store validated List payloads | +| sealed interface | [PrefixitemsValidationAdjustsTheStartingIndexForItems.PrefixitemsValidationAdjustsTheStartingIndexForItems1Boxed](#prefixitemsvalidationadjuststhestartingindexforitems1boxed)
sealed interface for validated payloads | +| record | [PrefixitemsValidationAdjustsTheStartingIndexForItems.PrefixitemsValidationAdjustsTheStartingIndexForItems1BoxedList](#prefixitemsvalidationadjuststhestartingindexforitems1boxedlist)
boxed class to store validated List payloads | | static class | [PrefixitemsValidationAdjustsTheStartingIndexForItems.PrefixitemsValidationAdjustsTheStartingIndexForItems1](#prefixitemsvalidationadjuststhestartingindexforitems1)
schema class | -| static class | [PrefixitemsValidationAdjustsTheStartingIndexForItems.Schema0Boxed](#schema0boxed)
abstract sealed validated payload class | -| static class | [PrefixitemsValidationAdjustsTheStartingIndexForItems.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | +| sealed interface | [PrefixitemsValidationAdjustsTheStartingIndexForItems.Schema0Boxed](#schema0boxed)
sealed interface for validated payloads | +| record | [PrefixitemsValidationAdjustsTheStartingIndexForItems.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | | static class | [PrefixitemsValidationAdjustsTheStartingIndexForItems.Schema0](#schema0)
schema class | | static class | [PrefixitemsValidationAdjustsTheStartingIndexForItems.PrefixitemsValidationAdjustsTheStartingIndexForItemsListBuilder](#prefixitemsvalidationadjuststhestartingindexforitemslistbuilder)
builder for List payloads | | static class | [PrefixitemsValidationAdjustsTheStartingIndexForItems.PrefixitemsValidationAdjustsTheStartingIndexForItemsList](#prefixitemsvalidationadjuststhestartingindexforitemslist)
output class for List payloads | -| static class | [PrefixitemsValidationAdjustsTheStartingIndexForItems.ItemsBoxed](#itemsboxed)
abstract sealed validated payload class | -| static class | [PrefixitemsValidationAdjustsTheStartingIndexForItems.ItemsBoxedNumber](#itemsboxednumber)
boxed class to store validated Number payloads | +| sealed interface | [PrefixitemsValidationAdjustsTheStartingIndexForItems.ItemsBoxed](#itemsboxed)
sealed interface for validated payloads | +| record | [PrefixitemsValidationAdjustsTheStartingIndexForItems.ItemsBoxedNumber](#itemsboxednumber)
boxed class to store validated Number payloads | | static class | [PrefixitemsValidationAdjustsTheStartingIndexForItems.Items](#items)
schema class | ## PrefixitemsValidationAdjustsTheStartingIndexForItems1Boxed -public static abstract sealed class PrefixitemsValidationAdjustsTheStartingIndexForItems1Boxed
+public sealed interface PrefixitemsValidationAdjustsTheStartingIndexForItems1Boxed
permits
[PrefixitemsValidationAdjustsTheStartingIndexForItems1BoxedList](#prefixitemsvalidationadjuststhestartingindexforitems1boxedlist) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## PrefixitemsValidationAdjustsTheStartingIndexForItems1BoxedList -public static final class PrefixitemsValidationAdjustsTheStartingIndexForItems1BoxedList
-extends [PrefixitemsValidationAdjustsTheStartingIndexForItems1Boxed](#prefixitemsvalidationadjuststhestartingindexforitems1boxed) +public record PrefixitemsValidationAdjustsTheStartingIndexForItems1BoxedList
+implements [PrefixitemsValidationAdjustsTheStartingIndexForItems1Boxed](#prefixitemsvalidationadjuststhestartingindexforitems1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PrefixitemsValidationAdjustsTheStartingIndexForItems1BoxedList([PrefixitemsValidationAdjustsTheStartingIndexForItemsList](#prefixitemsvalidationadjuststhestartingindexforitemslist) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [PrefixitemsValidationAdjustsTheStartingIndexForItemsList](#prefixitemsvalidationadjuststhestartingindexforitemslist) | data
validated payload | +| [PrefixitemsValidationAdjustsTheStartingIndexForItemsList](#prefixitemsvalidationadjuststhestartingindexforitemslist) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PrefixitemsValidationAdjustsTheStartingIndexForItems1 public static class PrefixitemsValidationAdjustsTheStartingIndexForItems1
@@ -91,29 +92,32 @@ PrefixitemsValidationAdjustsTheStartingIndexForItems.PrefixitemsValidationAdjust | ----------------- | ---------------------- | | [PrefixitemsValidationAdjustsTheStartingIndexForItemsList](#prefixitemsvalidationadjuststhestartingindexforitemslist) | validate([List](#prefixitemsvalidationadjuststhestartingindexforitemslistbuilder) arg, SchemaConfiguration configuration) | | [PrefixitemsValidationAdjustsTheStartingIndexForItems1BoxedList](#prefixitemsvalidationadjuststhestartingindexforitems1boxedlist) | validateAndBox([List](#prefixitemsvalidationadjuststhestartingindexforitemslistbuilder) arg, SchemaConfiguration configuration) | +| [PrefixitemsValidationAdjustsTheStartingIndexForItems1Boxed](#prefixitemsvalidationadjuststhestartingindexforitems1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema0Boxed -public static abstract sealed class Schema0Boxed
+public sealed interface Schema0Boxed
permits
[Schema0BoxedString](#schema0boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema0BoxedString -public static final class Schema0BoxedString
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedString
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0 public static class Schema0
@@ -160,27 +164,28 @@ A class to store validated List payloads | static [PrefixitemsValidationAdjustsTheStartingIndexForItemsList](#prefixitemsvalidationadjuststhestartingindexforitemslist) | of([List](#prefixitemsvalidationadjuststhestartingindexforitemslistbuilder) arg, SchemaConfiguration configuration) | ## ItemsBoxed -public static abstract sealed class ItemsBoxed
+public sealed interface ItemsBoxed
permits
[ItemsBoxedNumber](#itemsboxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ItemsBoxedNumber -public static final class ItemsBoxedNumber
-extends [ItemsBoxed](#itemsboxed) +public record ItemsBoxedNumber
+implements [ItemsBoxed](#itemsboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ItemsBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Items public static class Items
diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/PrefixitemsWithNullInstanceElements.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/PrefixitemsWithNullInstanceElements.md index 3a6239ddae7..7ca15c2ac9e 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/PrefixitemsWithNullInstanceElements.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/PrefixitemsWithNullInstanceElements.md @@ -4,7 +4,7 @@ public class PrefixitemsWithNullInstanceElements
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated list payloads, extends FrozenList - classes to build inputs for list payloads @@ -12,22 +12,22 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [PrefixitemsWithNullInstanceElements.PrefixitemsWithNullInstanceElements1Boxed](#prefixitemswithnullinstanceelements1boxed)
abstract sealed validated payload class | -| static class | [PrefixitemsWithNullInstanceElements.PrefixitemsWithNullInstanceElements1BoxedVoid](#prefixitemswithnullinstanceelements1boxedvoid)
boxed class to store validated null payloads | -| static class | [PrefixitemsWithNullInstanceElements.PrefixitemsWithNullInstanceElements1BoxedBoolean](#prefixitemswithnullinstanceelements1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [PrefixitemsWithNullInstanceElements.PrefixitemsWithNullInstanceElements1BoxedNumber](#prefixitemswithnullinstanceelements1boxednumber)
boxed class to store validated Number payloads | -| static class | [PrefixitemsWithNullInstanceElements.PrefixitemsWithNullInstanceElements1BoxedString](#prefixitemswithnullinstanceelements1boxedstring)
boxed class to store validated String payloads | -| static class | [PrefixitemsWithNullInstanceElements.PrefixitemsWithNullInstanceElements1BoxedList](#prefixitemswithnullinstanceelements1boxedlist)
boxed class to store validated List payloads | -| static class | [PrefixitemsWithNullInstanceElements.PrefixitemsWithNullInstanceElements1BoxedMap](#prefixitemswithnullinstanceelements1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [PrefixitemsWithNullInstanceElements.PrefixitemsWithNullInstanceElements1Boxed](#prefixitemswithnullinstanceelements1boxed)
sealed interface for validated payloads | +| record | [PrefixitemsWithNullInstanceElements.PrefixitemsWithNullInstanceElements1BoxedVoid](#prefixitemswithnullinstanceelements1boxedvoid)
boxed class to store validated null payloads | +| record | [PrefixitemsWithNullInstanceElements.PrefixitemsWithNullInstanceElements1BoxedBoolean](#prefixitemswithnullinstanceelements1boxedboolean)
boxed class to store validated boolean payloads | +| record | [PrefixitemsWithNullInstanceElements.PrefixitemsWithNullInstanceElements1BoxedNumber](#prefixitemswithnullinstanceelements1boxednumber)
boxed class to store validated Number payloads | +| record | [PrefixitemsWithNullInstanceElements.PrefixitemsWithNullInstanceElements1BoxedString](#prefixitemswithnullinstanceelements1boxedstring)
boxed class to store validated String payloads | +| record | [PrefixitemsWithNullInstanceElements.PrefixitemsWithNullInstanceElements1BoxedList](#prefixitemswithnullinstanceelements1boxedlist)
boxed class to store validated List payloads | +| record | [PrefixitemsWithNullInstanceElements.PrefixitemsWithNullInstanceElements1BoxedMap](#prefixitemswithnullinstanceelements1boxedmap)
boxed class to store validated Map payloads | | static class | [PrefixitemsWithNullInstanceElements.PrefixitemsWithNullInstanceElements1](#prefixitemswithnullinstanceelements1)
schema class | -| static class | [PrefixitemsWithNullInstanceElements.Schema0Boxed](#schema0boxed)
abstract sealed validated payload class | -| static class | [PrefixitemsWithNullInstanceElements.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | +| sealed interface | [PrefixitemsWithNullInstanceElements.Schema0Boxed](#schema0boxed)
sealed interface for validated payloads | +| record | [PrefixitemsWithNullInstanceElements.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | | static class | [PrefixitemsWithNullInstanceElements.Schema0](#schema0)
schema class | | static class | [PrefixitemsWithNullInstanceElements.PrefixitemsWithNullInstanceElementsListBuilder](#prefixitemswithnullinstanceelementslistbuilder)
builder for List payloads | | static class | [PrefixitemsWithNullInstanceElements.PrefixitemsWithNullInstanceElementsList](#prefixitemswithnullinstanceelementslist)
output class for List payloads | ## PrefixitemsWithNullInstanceElements1Boxed -public static abstract sealed class PrefixitemsWithNullInstanceElements1Boxed
+public sealed interface PrefixitemsWithNullInstanceElements1Boxed
permits
[PrefixitemsWithNullInstanceElements1BoxedVoid](#prefixitemswithnullinstanceelements1boxedvoid), [PrefixitemsWithNullInstanceElements1BoxedBoolean](#prefixitemswithnullinstanceelements1boxedboolean), @@ -36,103 +36,109 @@ permits
[PrefixitemsWithNullInstanceElements1BoxedList](#prefixitemswithnullinstanceelements1boxedlist), [PrefixitemsWithNullInstanceElements1BoxedMap](#prefixitemswithnullinstanceelements1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## PrefixitemsWithNullInstanceElements1BoxedVoid -public static final class PrefixitemsWithNullInstanceElements1BoxedVoid
-extends [PrefixitemsWithNullInstanceElements1Boxed](#prefixitemswithnullinstanceelements1boxed) +public record PrefixitemsWithNullInstanceElements1BoxedVoid
+implements [PrefixitemsWithNullInstanceElements1Boxed](#prefixitemswithnullinstanceelements1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PrefixitemsWithNullInstanceElements1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PrefixitemsWithNullInstanceElements1BoxedBoolean -public static final class PrefixitemsWithNullInstanceElements1BoxedBoolean
-extends [PrefixitemsWithNullInstanceElements1Boxed](#prefixitemswithnullinstanceelements1boxed) +public record PrefixitemsWithNullInstanceElements1BoxedBoolean
+implements [PrefixitemsWithNullInstanceElements1Boxed](#prefixitemswithnullinstanceelements1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PrefixitemsWithNullInstanceElements1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PrefixitemsWithNullInstanceElements1BoxedNumber -public static final class PrefixitemsWithNullInstanceElements1BoxedNumber
-extends [PrefixitemsWithNullInstanceElements1Boxed](#prefixitemswithnullinstanceelements1boxed) +public record PrefixitemsWithNullInstanceElements1BoxedNumber
+implements [PrefixitemsWithNullInstanceElements1Boxed](#prefixitemswithnullinstanceelements1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PrefixitemsWithNullInstanceElements1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PrefixitemsWithNullInstanceElements1BoxedString -public static final class PrefixitemsWithNullInstanceElements1BoxedString
-extends [PrefixitemsWithNullInstanceElements1Boxed](#prefixitemswithnullinstanceelements1boxed) +public record PrefixitemsWithNullInstanceElements1BoxedString
+implements [PrefixitemsWithNullInstanceElements1Boxed](#prefixitemswithnullinstanceelements1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PrefixitemsWithNullInstanceElements1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PrefixitemsWithNullInstanceElements1BoxedList -public static final class PrefixitemsWithNullInstanceElements1BoxedList
-extends [PrefixitemsWithNullInstanceElements1Boxed](#prefixitemswithnullinstanceelements1boxed) +public record PrefixitemsWithNullInstanceElements1BoxedList
+implements [PrefixitemsWithNullInstanceElements1Boxed](#prefixitemswithnullinstanceelements1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PrefixitemsWithNullInstanceElements1BoxedList([PrefixitemsWithNullInstanceElementsList](#prefixitemswithnullinstanceelementslist) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [PrefixitemsWithNullInstanceElementsList](#prefixitemswithnullinstanceelementslist) | data
validated payload | +| [PrefixitemsWithNullInstanceElementsList](#prefixitemswithnullinstanceelementslist) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PrefixitemsWithNullInstanceElements1BoxedMap -public static final class PrefixitemsWithNullInstanceElements1BoxedMap
-extends [PrefixitemsWithNullInstanceElements1Boxed](#prefixitemswithnullinstanceelements1boxed) +public record PrefixitemsWithNullInstanceElements1BoxedMap
+implements [PrefixitemsWithNullInstanceElements1Boxed](#prefixitemswithnullinstanceelements1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PrefixitemsWithNullInstanceElements1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PrefixitemsWithNullInstanceElements1 public static class PrefixitemsWithNullInstanceElements1
@@ -164,29 +170,32 @@ A schema class that validates payloads | [PrefixitemsWithNullInstanceElements1BoxedBoolean](#prefixitemswithnullinstanceelements1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [PrefixitemsWithNullInstanceElements1BoxedMap](#prefixitemswithnullinstanceelements1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [PrefixitemsWithNullInstanceElements1BoxedList](#prefixitemswithnullinstanceelements1boxedlist) | validateAndBox([List](#prefixitemswithnullinstanceelementslistbuilder) arg, SchemaConfiguration configuration) | +| [PrefixitemsWithNullInstanceElements1Boxed](#prefixitemswithnullinstanceelements1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema0Boxed -public static abstract sealed class Schema0Boxed
+public sealed interface Schema0Boxed
permits
[Schema0BoxedVoid](#schema0boxedvoid) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema0BoxedVoid -public static final class Schema0BoxedVoid
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedVoid
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0 public static class Schema0
diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/PropertiesPatternpropertiesAdditionalpropertiesInteraction.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/PropertiesPatternpropertiesAdditionalpropertiesInteraction.md index 1e53657af78..14f101bdedc 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/PropertiesPatternpropertiesAdditionalpropertiesInteraction.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/PropertiesPatternpropertiesAdditionalpropertiesInteraction.md @@ -4,7 +4,7 @@ public class PropertiesPatternpropertiesAdditionalpropertiesInteraction
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,51 +12,52 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [PropertiesPatternpropertiesAdditionalpropertiesInteraction.PropertiesPatternpropertiesAdditionalpropertiesInteraction1Boxed](#propertiespatternpropertiesadditionalpropertiesinteraction1boxed)
abstract sealed validated payload class | -| static class | [PropertiesPatternpropertiesAdditionalpropertiesInteraction.PropertiesPatternpropertiesAdditionalpropertiesInteraction1BoxedMap](#propertiespatternpropertiesadditionalpropertiesinteraction1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [PropertiesPatternpropertiesAdditionalpropertiesInteraction.PropertiesPatternpropertiesAdditionalpropertiesInteraction1Boxed](#propertiespatternpropertiesadditionalpropertiesinteraction1boxed)
sealed interface for validated payloads | +| record | [PropertiesPatternpropertiesAdditionalpropertiesInteraction.PropertiesPatternpropertiesAdditionalpropertiesInteraction1BoxedMap](#propertiespatternpropertiesadditionalpropertiesinteraction1boxedmap)
boxed class to store validated Map payloads | | static class | [PropertiesPatternpropertiesAdditionalpropertiesInteraction.PropertiesPatternpropertiesAdditionalpropertiesInteraction1](#propertiespatternpropertiesadditionalpropertiesinteraction1)
schema class | | static class | [PropertiesPatternpropertiesAdditionalpropertiesInteraction.PropertiesPatternpropertiesAdditionalpropertiesInteractionMapBuilder](#propertiespatternpropertiesadditionalpropertiesinteractionmapbuilder)
builder for Map payloads | | static class | [PropertiesPatternpropertiesAdditionalpropertiesInteraction.PropertiesPatternpropertiesAdditionalpropertiesInteractionMap](#propertiespatternpropertiesadditionalpropertiesinteractionmap)
output class for Map payloads | -| static class | [PropertiesPatternpropertiesAdditionalpropertiesInteraction.BarBoxed](#barboxed)
abstract sealed validated payload class | -| static class | [PropertiesPatternpropertiesAdditionalpropertiesInteraction.BarBoxedList](#barboxedlist)
boxed class to store validated List payloads | +| sealed interface | [PropertiesPatternpropertiesAdditionalpropertiesInteraction.BarBoxed](#barboxed)
sealed interface for validated payloads | +| record | [PropertiesPatternpropertiesAdditionalpropertiesInteraction.BarBoxedList](#barboxedlist)
boxed class to store validated List payloads | | static class | [PropertiesPatternpropertiesAdditionalpropertiesInteraction.Bar](#bar)
schema class | -| static class | [PropertiesPatternpropertiesAdditionalpropertiesInteraction.FooBoxed](#fooboxed)
abstract sealed validated payload class | -| static class | [PropertiesPatternpropertiesAdditionalpropertiesInteraction.FooBoxedList](#fooboxedlist)
boxed class to store validated List payloads | +| sealed interface | [PropertiesPatternpropertiesAdditionalpropertiesInteraction.FooBoxed](#fooboxed)
sealed interface for validated payloads | +| record | [PropertiesPatternpropertiesAdditionalpropertiesInteraction.FooBoxedList](#fooboxedlist)
boxed class to store validated List payloads | | static class | [PropertiesPatternpropertiesAdditionalpropertiesInteraction.Foo](#foo)
schema class | -| static class | [PropertiesPatternpropertiesAdditionalpropertiesInteraction.FoBoxed](#foboxed)
abstract sealed validated payload class | -| static class | [PropertiesPatternpropertiesAdditionalpropertiesInteraction.FoBoxedVoid](#foboxedvoid)
boxed class to store validated null payloads | -| static class | [PropertiesPatternpropertiesAdditionalpropertiesInteraction.FoBoxedBoolean](#foboxedboolean)
boxed class to store validated boolean payloads | -| static class | [PropertiesPatternpropertiesAdditionalpropertiesInteraction.FoBoxedNumber](#foboxednumber)
boxed class to store validated Number payloads | -| static class | [PropertiesPatternpropertiesAdditionalpropertiesInteraction.FoBoxedString](#foboxedstring)
boxed class to store validated String payloads | -| static class | [PropertiesPatternpropertiesAdditionalpropertiesInteraction.FoBoxedList](#foboxedlist)
boxed class to store validated List payloads | -| static class | [PropertiesPatternpropertiesAdditionalpropertiesInteraction.FoBoxedMap](#foboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [PropertiesPatternpropertiesAdditionalpropertiesInteraction.FoBoxed](#foboxed)
sealed interface for validated payloads | +| record | [PropertiesPatternpropertiesAdditionalpropertiesInteraction.FoBoxedVoid](#foboxedvoid)
boxed class to store validated null payloads | +| record | [PropertiesPatternpropertiesAdditionalpropertiesInteraction.FoBoxedBoolean](#foboxedboolean)
boxed class to store validated boolean payloads | +| record | [PropertiesPatternpropertiesAdditionalpropertiesInteraction.FoBoxedNumber](#foboxednumber)
boxed class to store validated Number payloads | +| record | [PropertiesPatternpropertiesAdditionalpropertiesInteraction.FoBoxedString](#foboxedstring)
boxed class to store validated String payloads | +| record | [PropertiesPatternpropertiesAdditionalpropertiesInteraction.FoBoxedList](#foboxedlist)
boxed class to store validated List payloads | +| record | [PropertiesPatternpropertiesAdditionalpropertiesInteraction.FoBoxedMap](#foboxedmap)
boxed class to store validated Map payloads | | static class | [PropertiesPatternpropertiesAdditionalpropertiesInteraction.Fo](#fo)
schema class | -| static class | [PropertiesPatternpropertiesAdditionalpropertiesInteraction.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
abstract sealed validated payload class | -| static class | [PropertiesPatternpropertiesAdditionalpropertiesInteraction.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | +| sealed interface | [PropertiesPatternpropertiesAdditionalpropertiesInteraction.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
sealed interface for validated payloads | +| record | [PropertiesPatternpropertiesAdditionalpropertiesInteraction.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | | static class | [PropertiesPatternpropertiesAdditionalpropertiesInteraction.AdditionalProperties](#additionalproperties)
schema class | ## PropertiesPatternpropertiesAdditionalpropertiesInteraction1Boxed -public static abstract sealed class PropertiesPatternpropertiesAdditionalpropertiesInteraction1Boxed
+public sealed interface PropertiesPatternpropertiesAdditionalpropertiesInteraction1Boxed
permits
[PropertiesPatternpropertiesAdditionalpropertiesInteraction1BoxedMap](#propertiespatternpropertiesadditionalpropertiesinteraction1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## PropertiesPatternpropertiesAdditionalpropertiesInteraction1BoxedMap -public static final class PropertiesPatternpropertiesAdditionalpropertiesInteraction1BoxedMap
-extends [PropertiesPatternpropertiesAdditionalpropertiesInteraction1Boxed](#propertiespatternpropertiesadditionalpropertiesinteraction1boxed) +public record PropertiesPatternpropertiesAdditionalpropertiesInteraction1BoxedMap
+implements [PropertiesPatternpropertiesAdditionalpropertiesInteraction1Boxed](#propertiespatternpropertiesadditionalpropertiesinteraction1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PropertiesPatternpropertiesAdditionalpropertiesInteraction1BoxedMap([PropertiesPatternpropertiesAdditionalpropertiesInteractionMap](#propertiespatternpropertiesadditionalpropertiesinteractionmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [PropertiesPatternpropertiesAdditionalpropertiesInteractionMap](#propertiespatternpropertiesadditionalpropertiesinteractionmap) | data
validated payload | +| [PropertiesPatternpropertiesAdditionalpropertiesInteractionMap](#propertiespatternpropertiesadditionalpropertiesinteractionmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PropertiesPatternpropertiesAdditionalpropertiesInteraction1 public static class PropertiesPatternpropertiesAdditionalpropertiesInteraction1
@@ -103,7 +104,9 @@ PropertiesPatternpropertiesAdditionalpropertiesInteraction.PropertiesPatternprop | ----------------- | ---------------------- | | [PropertiesPatternpropertiesAdditionalpropertiesInteractionMap](#propertiespatternpropertiesadditionalpropertiesinteractionmap) | validate([Map<?, ?>](#propertiespatternpropertiesadditionalpropertiesinteractionmapbuilder) arg, SchemaConfiguration configuration) | | [PropertiesPatternpropertiesAdditionalpropertiesInteraction1BoxedMap](#propertiespatternpropertiesadditionalpropertiesinteraction1boxedmap) | validateAndBox([Map<?, ?>](#propertiespatternpropertiesadditionalpropertiesinteractionmapbuilder) arg, SchemaConfiguration configuration) | +| [PropertiesPatternpropertiesAdditionalpropertiesInteraction1Boxed](#propertiespatternpropertiesadditionalpropertiesinteraction1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## PropertiesPatternpropertiesAdditionalpropertiesInteractionMapBuilder public class PropertiesPatternpropertiesAdditionalpropertiesInteractionMapBuilder
builder for `Map` @@ -141,27 +144,28 @@ A class to store validated Map payloads | Number | getAdditionalProperty(String name)
provides type safety for additional properties | ## BarBoxed -public static abstract sealed class BarBoxed
+public sealed interface BarBoxed
permits
[BarBoxedList](#barboxedlist) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## BarBoxedList -public static final class BarBoxedList
-extends [BarBoxed](#barboxed) +public record BarBoxedList
+implements [BarBoxed](#barboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BarBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Bar public static class Bar
@@ -175,27 +179,28 @@ A schema class that validates payloads | validateAndBox | ## FooBoxed -public static abstract sealed class FooBoxed
+public sealed interface FooBoxed
permits
[FooBoxedList](#fooboxedlist) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## FooBoxedList -public static final class FooBoxedList
-extends [FooBoxed](#fooboxed) +public record FooBoxedList
+implements [FooBoxed](#fooboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Foo public static class Foo
@@ -214,9 +219,11 @@ A schema class that validates payloads | ----------------- | ---------------------- | | FrozenList<@Nullable Object> | validate(List arg, SchemaConfiguration configuration) | | [FooBoxedList](#fooboxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [FooBoxed](#fooboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## FoBoxed -public static abstract sealed class FoBoxed
+public sealed interface FoBoxed
permits
[FoBoxedVoid](#foboxedvoid), [FoBoxedBoolean](#foboxedboolean), @@ -225,103 +232,109 @@ permits
[FoBoxedList](#foboxedlist), [FoBoxedMap](#foboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## FoBoxedVoid -public static final class FoBoxedVoid
-extends [FoBoxed](#foboxed) +public record FoBoxedVoid
+implements [FoBoxed](#foboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FoBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FoBoxedBoolean -public static final class FoBoxedBoolean
-extends [FoBoxed](#foboxed) +public record FoBoxedBoolean
+implements [FoBoxed](#foboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FoBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FoBoxedNumber -public static final class FoBoxedNumber
-extends [FoBoxed](#foboxed) +public record FoBoxedNumber
+implements [FoBoxed](#foboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FoBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FoBoxedString -public static final class FoBoxedString
-extends [FoBoxed](#foboxed) +public record FoBoxedString
+implements [FoBoxed](#foboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FoBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FoBoxedList -public static final class FoBoxedList
-extends [FoBoxed](#foboxed) +public record FoBoxedList
+implements [FoBoxed](#foboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FoBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FoBoxedMap -public static final class FoBoxedMap
-extends [FoBoxed](#foboxed) +public record FoBoxedMap
+implements [FoBoxed](#foboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FoBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Fo public static class Fo
@@ -353,29 +366,32 @@ A schema class that validates payloads | [FoBoxedBoolean](#foboxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [FoBoxedMap](#foboxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [FoBoxedList](#foboxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [FoBoxed](#foboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## AdditionalPropertiesBoxed -public static abstract sealed class AdditionalPropertiesBoxed
+public sealed interface AdditionalPropertiesBoxed
permits
[AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AdditionalPropertiesBoxedNumber -public static final class AdditionalPropertiesBoxedNumber
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedNumber
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalProperties public static class AdditionalProperties
diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/PropertiesWhoseNamesAreJavascriptObjectPropertyNames.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/PropertiesWhoseNamesAreJavascriptObjectPropertyNames.md index 70ba755e01c..12521dedf71 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/PropertiesWhoseNamesAreJavascriptObjectPropertyNames.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/PropertiesWhoseNamesAreJavascriptObjectPropertyNames.md @@ -4,7 +4,7 @@ public class PropertiesWhoseNamesAreJavascriptObjectPropertyNames
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,38 +12,38 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [PropertiesWhoseNamesAreJavascriptObjectPropertyNames.PropertiesWhoseNamesAreJavascriptObjectPropertyNames1Boxed](#propertieswhosenamesarejavascriptobjectpropertynames1boxed)
abstract sealed validated payload class | -| static class | [PropertiesWhoseNamesAreJavascriptObjectPropertyNames.PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedVoid](#propertieswhosenamesarejavascriptobjectpropertynames1boxedvoid)
boxed class to store validated null payloads | -| static class | [PropertiesWhoseNamesAreJavascriptObjectPropertyNames.PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedBoolean](#propertieswhosenamesarejavascriptobjectpropertynames1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [PropertiesWhoseNamesAreJavascriptObjectPropertyNames.PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedNumber](#propertieswhosenamesarejavascriptobjectpropertynames1boxednumber)
boxed class to store validated Number payloads | -| static class | [PropertiesWhoseNamesAreJavascriptObjectPropertyNames.PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedString](#propertieswhosenamesarejavascriptobjectpropertynames1boxedstring)
boxed class to store validated String payloads | -| static class | [PropertiesWhoseNamesAreJavascriptObjectPropertyNames.PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedList](#propertieswhosenamesarejavascriptobjectpropertynames1boxedlist)
boxed class to store validated List payloads | -| static class | [PropertiesWhoseNamesAreJavascriptObjectPropertyNames.PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedMap](#propertieswhosenamesarejavascriptobjectpropertynames1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [PropertiesWhoseNamesAreJavascriptObjectPropertyNames.PropertiesWhoseNamesAreJavascriptObjectPropertyNames1Boxed](#propertieswhosenamesarejavascriptobjectpropertynames1boxed)
sealed interface for validated payloads | +| record | [PropertiesWhoseNamesAreJavascriptObjectPropertyNames.PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedVoid](#propertieswhosenamesarejavascriptobjectpropertynames1boxedvoid)
boxed class to store validated null payloads | +| record | [PropertiesWhoseNamesAreJavascriptObjectPropertyNames.PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedBoolean](#propertieswhosenamesarejavascriptobjectpropertynames1boxedboolean)
boxed class to store validated boolean payloads | +| record | [PropertiesWhoseNamesAreJavascriptObjectPropertyNames.PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedNumber](#propertieswhosenamesarejavascriptobjectpropertynames1boxednumber)
boxed class to store validated Number payloads | +| record | [PropertiesWhoseNamesAreJavascriptObjectPropertyNames.PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedString](#propertieswhosenamesarejavascriptobjectpropertynames1boxedstring)
boxed class to store validated String payloads | +| record | [PropertiesWhoseNamesAreJavascriptObjectPropertyNames.PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedList](#propertieswhosenamesarejavascriptobjectpropertynames1boxedlist)
boxed class to store validated List payloads | +| record | [PropertiesWhoseNamesAreJavascriptObjectPropertyNames.PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedMap](#propertieswhosenamesarejavascriptobjectpropertynames1boxedmap)
boxed class to store validated Map payloads | | static class | [PropertiesWhoseNamesAreJavascriptObjectPropertyNames.PropertiesWhoseNamesAreJavascriptObjectPropertyNames1](#propertieswhosenamesarejavascriptobjectpropertynames1)
schema class | | static class | [PropertiesWhoseNamesAreJavascriptObjectPropertyNames.PropertiesWhoseNamesAreJavascriptObjectPropertyNamesMapBuilder](#propertieswhosenamesarejavascriptobjectpropertynamesmapbuilder)
builder for Map payloads | | static class | [PropertiesWhoseNamesAreJavascriptObjectPropertyNames.PropertiesWhoseNamesAreJavascriptObjectPropertyNamesMap](#propertieswhosenamesarejavascriptobjectpropertynamesmap)
output class for Map payloads | -| static class | [PropertiesWhoseNamesAreJavascriptObjectPropertyNames.ConstructorBoxed](#constructorboxed)
abstract sealed validated payload class | -| static class | [PropertiesWhoseNamesAreJavascriptObjectPropertyNames.ConstructorBoxedNumber](#constructorboxednumber)
boxed class to store validated Number payloads | +| sealed interface | [PropertiesWhoseNamesAreJavascriptObjectPropertyNames.ConstructorBoxed](#constructorboxed)
sealed interface for validated payloads | +| record | [PropertiesWhoseNamesAreJavascriptObjectPropertyNames.ConstructorBoxedNumber](#constructorboxednumber)
boxed class to store validated Number payloads | | static class | [PropertiesWhoseNamesAreJavascriptObjectPropertyNames.Constructor](#constructor)
schema class | -| static class | [PropertiesWhoseNamesAreJavascriptObjectPropertyNames.ToStringSchemaBoxed](#tostringschemaboxed)
abstract sealed validated payload class | -| static class | [PropertiesWhoseNamesAreJavascriptObjectPropertyNames.ToStringSchemaBoxedVoid](#tostringschemaboxedvoid)
boxed class to store validated null payloads | -| static class | [PropertiesWhoseNamesAreJavascriptObjectPropertyNames.ToStringSchemaBoxedBoolean](#tostringschemaboxedboolean)
boxed class to store validated boolean payloads | -| static class | [PropertiesWhoseNamesAreJavascriptObjectPropertyNames.ToStringSchemaBoxedNumber](#tostringschemaboxednumber)
boxed class to store validated Number payloads | -| static class | [PropertiesWhoseNamesAreJavascriptObjectPropertyNames.ToStringSchemaBoxedString](#tostringschemaboxedstring)
boxed class to store validated String payloads | -| static class | [PropertiesWhoseNamesAreJavascriptObjectPropertyNames.ToStringSchemaBoxedList](#tostringschemaboxedlist)
boxed class to store validated List payloads | -| static class | [PropertiesWhoseNamesAreJavascriptObjectPropertyNames.ToStringSchemaBoxedMap](#tostringschemaboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [PropertiesWhoseNamesAreJavascriptObjectPropertyNames.ToStringSchemaBoxed](#tostringschemaboxed)
sealed interface for validated payloads | +| record | [PropertiesWhoseNamesAreJavascriptObjectPropertyNames.ToStringSchemaBoxedVoid](#tostringschemaboxedvoid)
boxed class to store validated null payloads | +| record | [PropertiesWhoseNamesAreJavascriptObjectPropertyNames.ToStringSchemaBoxedBoolean](#tostringschemaboxedboolean)
boxed class to store validated boolean payloads | +| record | [PropertiesWhoseNamesAreJavascriptObjectPropertyNames.ToStringSchemaBoxedNumber](#tostringschemaboxednumber)
boxed class to store validated Number payloads | +| record | [PropertiesWhoseNamesAreJavascriptObjectPropertyNames.ToStringSchemaBoxedString](#tostringschemaboxedstring)
boxed class to store validated String payloads | +| record | [PropertiesWhoseNamesAreJavascriptObjectPropertyNames.ToStringSchemaBoxedList](#tostringschemaboxedlist)
boxed class to store validated List payloads | +| record | [PropertiesWhoseNamesAreJavascriptObjectPropertyNames.ToStringSchemaBoxedMap](#tostringschemaboxedmap)
boxed class to store validated Map payloads | | static class | [PropertiesWhoseNamesAreJavascriptObjectPropertyNames.ToStringSchema](#tostringschema)
schema class | | static class | [PropertiesWhoseNamesAreJavascriptObjectPropertyNames.ToStringMapBuilder](#tostringmapbuilder)
builder for Map payloads | | static class | [PropertiesWhoseNamesAreJavascriptObjectPropertyNames.ToStringMap](#tostringmap)
output class for Map payloads | -| static class | [PropertiesWhoseNamesAreJavascriptObjectPropertyNames.LengthBoxed](#lengthboxed)
abstract sealed validated payload class | -| static class | [PropertiesWhoseNamesAreJavascriptObjectPropertyNames.LengthBoxedString](#lengthboxedstring)
boxed class to store validated String payloads | +| sealed interface | [PropertiesWhoseNamesAreJavascriptObjectPropertyNames.LengthBoxed](#lengthboxed)
sealed interface for validated payloads | +| record | [PropertiesWhoseNamesAreJavascriptObjectPropertyNames.LengthBoxedString](#lengthboxedstring)
boxed class to store validated String payloads | | static class | [PropertiesWhoseNamesAreJavascriptObjectPropertyNames.Length](#length)
schema class | -| static class | [PropertiesWhoseNamesAreJavascriptObjectPropertyNames.ProtoBoxed](#protoboxed)
abstract sealed validated payload class | -| static class | [PropertiesWhoseNamesAreJavascriptObjectPropertyNames.ProtoBoxedNumber](#protoboxednumber)
boxed class to store validated Number payloads | +| sealed interface | [PropertiesWhoseNamesAreJavascriptObjectPropertyNames.ProtoBoxed](#protoboxed)
sealed interface for validated payloads | +| record | [PropertiesWhoseNamesAreJavascriptObjectPropertyNames.ProtoBoxedNumber](#protoboxednumber)
boxed class to store validated Number payloads | | static class | [PropertiesWhoseNamesAreJavascriptObjectPropertyNames.Proto](#proto)
schema class | ## PropertiesWhoseNamesAreJavascriptObjectPropertyNames1Boxed -public static abstract sealed class PropertiesWhoseNamesAreJavascriptObjectPropertyNames1Boxed
+public sealed interface PropertiesWhoseNamesAreJavascriptObjectPropertyNames1Boxed
permits
[PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedVoid](#propertieswhosenamesarejavascriptobjectpropertynames1boxedvoid), [PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedBoolean](#propertieswhosenamesarejavascriptobjectpropertynames1boxedboolean), @@ -52,103 +52,109 @@ permits
[PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedList](#propertieswhosenamesarejavascriptobjectpropertynames1boxedlist), [PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedMap](#propertieswhosenamesarejavascriptobjectpropertynames1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedVoid -public static final class PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedVoid
-extends [PropertiesWhoseNamesAreJavascriptObjectPropertyNames1Boxed](#propertieswhosenamesarejavascriptobjectpropertynames1boxed) +public record PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedVoid
+implements [PropertiesWhoseNamesAreJavascriptObjectPropertyNames1Boxed](#propertieswhosenamesarejavascriptobjectpropertynames1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedBoolean -public static final class PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedBoolean
-extends [PropertiesWhoseNamesAreJavascriptObjectPropertyNames1Boxed](#propertieswhosenamesarejavascriptobjectpropertynames1boxed) +public record PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedBoolean
+implements [PropertiesWhoseNamesAreJavascriptObjectPropertyNames1Boxed](#propertieswhosenamesarejavascriptobjectpropertynames1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedNumber -public static final class PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedNumber
-extends [PropertiesWhoseNamesAreJavascriptObjectPropertyNames1Boxed](#propertieswhosenamesarejavascriptobjectpropertynames1boxed) +public record PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedNumber
+implements [PropertiesWhoseNamesAreJavascriptObjectPropertyNames1Boxed](#propertieswhosenamesarejavascriptobjectpropertynames1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedString -public static final class PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedString
-extends [PropertiesWhoseNamesAreJavascriptObjectPropertyNames1Boxed](#propertieswhosenamesarejavascriptobjectpropertynames1boxed) +public record PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedString
+implements [PropertiesWhoseNamesAreJavascriptObjectPropertyNames1Boxed](#propertieswhosenamesarejavascriptobjectpropertynames1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedList -public static final class PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedList
-extends [PropertiesWhoseNamesAreJavascriptObjectPropertyNames1Boxed](#propertieswhosenamesarejavascriptobjectpropertynames1boxed) +public record PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedList
+implements [PropertiesWhoseNamesAreJavascriptObjectPropertyNames1Boxed](#propertieswhosenamesarejavascriptobjectpropertynames1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedMap -public static final class PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedMap
-extends [PropertiesWhoseNamesAreJavascriptObjectPropertyNames1Boxed](#propertieswhosenamesarejavascriptobjectpropertynames1boxed) +public record PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedMap
+implements [PropertiesWhoseNamesAreJavascriptObjectPropertyNames1Boxed](#propertieswhosenamesarejavascriptobjectpropertynames1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedMap([PropertiesWhoseNamesAreJavascriptObjectPropertyNamesMap](#propertieswhosenamesarejavascriptobjectpropertynamesmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [PropertiesWhoseNamesAreJavascriptObjectPropertyNamesMap](#propertieswhosenamesarejavascriptobjectpropertynamesmap) | data
validated payload | +| [PropertiesWhoseNamesAreJavascriptObjectPropertyNamesMap](#propertieswhosenamesarejavascriptobjectpropertynamesmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PropertiesWhoseNamesAreJavascriptObjectPropertyNames1 public static class PropertiesWhoseNamesAreJavascriptObjectPropertyNames1
@@ -180,7 +186,9 @@ A schema class that validates payloads | [PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedBoolean](#propertieswhosenamesarejavascriptobjectpropertynames1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedMap](#propertieswhosenamesarejavascriptobjectpropertynames1boxedmap) | validateAndBox([Map<?, ?>](#propertieswhosenamesarejavascriptobjectpropertynamesmapbuilder) arg, SchemaConfiguration configuration) | | [PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedList](#propertieswhosenamesarejavascriptobjectpropertynames1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [PropertiesWhoseNamesAreJavascriptObjectPropertyNames1Boxed](#propertieswhosenamesarejavascriptobjectpropertynames1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## PropertiesWhoseNamesAreJavascriptObjectPropertyNamesMapBuilder public class PropertiesWhoseNamesAreJavascriptObjectPropertyNamesMapBuilder
builder for `Map` @@ -238,27 +246,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## ConstructorBoxed -public static abstract sealed class ConstructorBoxed
+public sealed interface ConstructorBoxed
permits
[ConstructorBoxedNumber](#constructorboxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ConstructorBoxedNumber -public static final class ConstructorBoxedNumber
-extends [ConstructorBoxed](#constructorboxed) +public record ConstructorBoxedNumber
+implements [ConstructorBoxed](#constructorboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ConstructorBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Constructor public static class Constructor
@@ -272,7 +281,7 @@ A schema class that validates payloads | validateAndBox | ## ToStringSchemaBoxed -public static abstract sealed class ToStringSchemaBoxed
+public sealed interface ToStringSchemaBoxed
permits
[ToStringSchemaBoxedVoid](#tostringschemaboxedvoid), [ToStringSchemaBoxedBoolean](#tostringschemaboxedboolean), @@ -281,103 +290,109 @@ permits
[ToStringSchemaBoxedList](#tostringschemaboxedlist), [ToStringSchemaBoxedMap](#tostringschemaboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ToStringSchemaBoxedVoid -public static final class ToStringSchemaBoxedVoid
-extends [ToStringSchemaBoxed](#tostringschemaboxed) +public record ToStringSchemaBoxedVoid
+implements [ToStringSchemaBoxed](#tostringschemaboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ToStringSchemaBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ToStringSchemaBoxedBoolean -public static final class ToStringSchemaBoxedBoolean
-extends [ToStringSchemaBoxed](#tostringschemaboxed) +public record ToStringSchemaBoxedBoolean
+implements [ToStringSchemaBoxed](#tostringschemaboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ToStringSchemaBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ToStringSchemaBoxedNumber -public static final class ToStringSchemaBoxedNumber
-extends [ToStringSchemaBoxed](#tostringschemaboxed) +public record ToStringSchemaBoxedNumber
+implements [ToStringSchemaBoxed](#tostringschemaboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ToStringSchemaBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ToStringSchemaBoxedString -public static final class ToStringSchemaBoxedString
-extends [ToStringSchemaBoxed](#tostringschemaboxed) +public record ToStringSchemaBoxedString
+implements [ToStringSchemaBoxed](#tostringschemaboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ToStringSchemaBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ToStringSchemaBoxedList -public static final class ToStringSchemaBoxedList
-extends [ToStringSchemaBoxed](#tostringschemaboxed) +public record ToStringSchemaBoxedList
+implements [ToStringSchemaBoxed](#tostringschemaboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ToStringSchemaBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ToStringSchemaBoxedMap -public static final class ToStringSchemaBoxedMap
-extends [ToStringSchemaBoxed](#tostringschemaboxed) +public record ToStringSchemaBoxedMap
+implements [ToStringSchemaBoxed](#tostringschemaboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ToStringSchemaBoxedMap([ToStringMap](#tostringmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [ToStringMap](#tostringmap) | data
validated payload | +| [ToStringMap](#tostringmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ToStringSchema public static class ToStringSchema
@@ -409,7 +424,9 @@ A schema class that validates payloads | [ToStringSchemaBoxedBoolean](#tostringschemaboxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [ToStringSchemaBoxedMap](#tostringschemaboxedmap) | validateAndBox([Map<?, ?>](#tostringmapbuilder) arg, SchemaConfiguration configuration) | | [ToStringSchemaBoxedList](#tostringschemaboxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [ToStringSchemaBoxed](#tostringschemaboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ToStringMapBuilder public class ToStringMapBuilder
builder for `Map` @@ -450,27 +467,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## LengthBoxed -public static abstract sealed class LengthBoxed
+public sealed interface LengthBoxed
permits
[LengthBoxedString](#lengthboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## LengthBoxedString -public static final class LengthBoxedString
-extends [LengthBoxed](#lengthboxed) +public record LengthBoxedString
+implements [LengthBoxed](#lengthboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | LengthBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Length public static class Length
@@ -484,27 +502,28 @@ A schema class that validates payloads | validateAndBox | ## ProtoBoxed -public static abstract sealed class ProtoBoxed
+public sealed interface ProtoBoxed
permits
[ProtoBoxedNumber](#protoboxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ProtoBoxedNumber -public static final class ProtoBoxedNumber
-extends [ProtoBoxed](#protoboxed) +public record ProtoBoxedNumber
+implements [ProtoBoxed](#protoboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ProtoBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Proto public static class Proto
diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/PropertiesWithEscapedCharacters.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/PropertiesWithEscapedCharacters.md index d2af863280c..a34e94b8786 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/PropertiesWithEscapedCharacters.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/PropertiesWithEscapedCharacters.md @@ -4,7 +4,7 @@ public class PropertiesWithEscapedCharacters
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,37 +12,37 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [PropertiesWithEscapedCharacters.PropertiesWithEscapedCharacters1Boxed](#propertieswithescapedcharacters1boxed)
abstract sealed validated payload class | -| static class | [PropertiesWithEscapedCharacters.PropertiesWithEscapedCharacters1BoxedVoid](#propertieswithescapedcharacters1boxedvoid)
boxed class to store validated null payloads | -| static class | [PropertiesWithEscapedCharacters.PropertiesWithEscapedCharacters1BoxedBoolean](#propertieswithescapedcharacters1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [PropertiesWithEscapedCharacters.PropertiesWithEscapedCharacters1BoxedNumber](#propertieswithescapedcharacters1boxednumber)
boxed class to store validated Number payloads | -| static class | [PropertiesWithEscapedCharacters.PropertiesWithEscapedCharacters1BoxedString](#propertieswithescapedcharacters1boxedstring)
boxed class to store validated String payloads | -| static class | [PropertiesWithEscapedCharacters.PropertiesWithEscapedCharacters1BoxedList](#propertieswithescapedcharacters1boxedlist)
boxed class to store validated List payloads | -| static class | [PropertiesWithEscapedCharacters.PropertiesWithEscapedCharacters1BoxedMap](#propertieswithescapedcharacters1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [PropertiesWithEscapedCharacters.PropertiesWithEscapedCharacters1Boxed](#propertieswithescapedcharacters1boxed)
sealed interface for validated payloads | +| record | [PropertiesWithEscapedCharacters.PropertiesWithEscapedCharacters1BoxedVoid](#propertieswithescapedcharacters1boxedvoid)
boxed class to store validated null payloads | +| record | [PropertiesWithEscapedCharacters.PropertiesWithEscapedCharacters1BoxedBoolean](#propertieswithescapedcharacters1boxedboolean)
boxed class to store validated boolean payloads | +| record | [PropertiesWithEscapedCharacters.PropertiesWithEscapedCharacters1BoxedNumber](#propertieswithescapedcharacters1boxednumber)
boxed class to store validated Number payloads | +| record | [PropertiesWithEscapedCharacters.PropertiesWithEscapedCharacters1BoxedString](#propertieswithescapedcharacters1boxedstring)
boxed class to store validated String payloads | +| record | [PropertiesWithEscapedCharacters.PropertiesWithEscapedCharacters1BoxedList](#propertieswithescapedcharacters1boxedlist)
boxed class to store validated List payloads | +| record | [PropertiesWithEscapedCharacters.PropertiesWithEscapedCharacters1BoxedMap](#propertieswithescapedcharacters1boxedmap)
boxed class to store validated Map payloads | | static class | [PropertiesWithEscapedCharacters.PropertiesWithEscapedCharacters1](#propertieswithescapedcharacters1)
schema class | | static class | [PropertiesWithEscapedCharacters.PropertiesWithEscapedCharactersMapBuilder](#propertieswithescapedcharactersmapbuilder)
builder for Map payloads | | static class | [PropertiesWithEscapedCharacters.PropertiesWithEscapedCharactersMap](#propertieswithescapedcharactersmap)
output class for Map payloads | -| static class | [PropertiesWithEscapedCharacters.FoofbarBoxed](#foofbarboxed)
abstract sealed validated payload class | -| static class | [PropertiesWithEscapedCharacters.FoofbarBoxedNumber](#foofbarboxednumber)
boxed class to store validated Number payloads | +| sealed interface | [PropertiesWithEscapedCharacters.FoofbarBoxed](#foofbarboxed)
sealed interface for validated payloads | +| record | [PropertiesWithEscapedCharacters.FoofbarBoxedNumber](#foofbarboxednumber)
boxed class to store validated Number payloads | | static class | [PropertiesWithEscapedCharacters.Foofbar](#foofbar)
schema class | -| static class | [PropertiesWithEscapedCharacters.FootbarBoxed](#footbarboxed)
abstract sealed validated payload class | -| static class | [PropertiesWithEscapedCharacters.FootbarBoxedNumber](#footbarboxednumber)
boxed class to store validated Number payloads | +| sealed interface | [PropertiesWithEscapedCharacters.FootbarBoxed](#footbarboxed)
sealed interface for validated payloads | +| record | [PropertiesWithEscapedCharacters.FootbarBoxedNumber](#footbarboxednumber)
boxed class to store validated Number payloads | | static class | [PropertiesWithEscapedCharacters.Footbar](#footbar)
schema class | -| static class | [PropertiesWithEscapedCharacters.FoorbarBoxed](#foorbarboxed)
abstract sealed validated payload class | -| static class | [PropertiesWithEscapedCharacters.FoorbarBoxedNumber](#foorbarboxednumber)
boxed class to store validated Number payloads | +| sealed interface | [PropertiesWithEscapedCharacters.FoorbarBoxed](#foorbarboxed)
sealed interface for validated payloads | +| record | [PropertiesWithEscapedCharacters.FoorbarBoxedNumber](#foorbarboxednumber)
boxed class to store validated Number payloads | | static class | [PropertiesWithEscapedCharacters.Foorbar](#foorbar)
schema class | -| static class | [PropertiesWithEscapedCharacters.Foobar1Boxed](#foobar1boxed)
abstract sealed validated payload class | -| static class | [PropertiesWithEscapedCharacters.Foobar1BoxedNumber](#foobar1boxednumber)
boxed class to store validated Number payloads | +| sealed interface | [PropertiesWithEscapedCharacters.Foobar1Boxed](#foobar1boxed)
sealed interface for validated payloads | +| record | [PropertiesWithEscapedCharacters.Foobar1BoxedNumber](#foobar1boxednumber)
boxed class to store validated Number payloads | | static class | [PropertiesWithEscapedCharacters.Foobar1](#foobar1)
schema class | -| static class | [PropertiesWithEscapedCharacters.FoobarBoxed](#foobarboxed)
abstract sealed validated payload class | -| static class | [PropertiesWithEscapedCharacters.FoobarBoxedNumber](#foobarboxednumber)
boxed class to store validated Number payloads | +| sealed interface | [PropertiesWithEscapedCharacters.FoobarBoxed](#foobarboxed)
sealed interface for validated payloads | +| record | [PropertiesWithEscapedCharacters.FoobarBoxedNumber](#foobarboxednumber)
boxed class to store validated Number payloads | | static class | [PropertiesWithEscapedCharacters.Foobar](#foobar)
schema class | -| static class | [PropertiesWithEscapedCharacters.FoonbarBoxed](#foonbarboxed)
abstract sealed validated payload class | -| static class | [PropertiesWithEscapedCharacters.FoonbarBoxedNumber](#foonbarboxednumber)
boxed class to store validated Number payloads | +| sealed interface | [PropertiesWithEscapedCharacters.FoonbarBoxed](#foonbarboxed)
sealed interface for validated payloads | +| record | [PropertiesWithEscapedCharacters.FoonbarBoxedNumber](#foonbarboxednumber)
boxed class to store validated Number payloads | | static class | [PropertiesWithEscapedCharacters.Foonbar](#foonbar)
schema class | ## PropertiesWithEscapedCharacters1Boxed -public static abstract sealed class PropertiesWithEscapedCharacters1Boxed
+public sealed interface PropertiesWithEscapedCharacters1Boxed
permits
[PropertiesWithEscapedCharacters1BoxedVoid](#propertieswithescapedcharacters1boxedvoid), [PropertiesWithEscapedCharacters1BoxedBoolean](#propertieswithescapedcharacters1boxedboolean), @@ -51,103 +51,109 @@ permits
[PropertiesWithEscapedCharacters1BoxedList](#propertieswithescapedcharacters1boxedlist), [PropertiesWithEscapedCharacters1BoxedMap](#propertieswithescapedcharacters1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## PropertiesWithEscapedCharacters1BoxedVoid -public static final class PropertiesWithEscapedCharacters1BoxedVoid
-extends [PropertiesWithEscapedCharacters1Boxed](#propertieswithescapedcharacters1boxed) +public record PropertiesWithEscapedCharacters1BoxedVoid
+implements [PropertiesWithEscapedCharacters1Boxed](#propertieswithescapedcharacters1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PropertiesWithEscapedCharacters1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PropertiesWithEscapedCharacters1BoxedBoolean -public static final class PropertiesWithEscapedCharacters1BoxedBoolean
-extends [PropertiesWithEscapedCharacters1Boxed](#propertieswithescapedcharacters1boxed) +public record PropertiesWithEscapedCharacters1BoxedBoolean
+implements [PropertiesWithEscapedCharacters1Boxed](#propertieswithescapedcharacters1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PropertiesWithEscapedCharacters1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PropertiesWithEscapedCharacters1BoxedNumber -public static final class PropertiesWithEscapedCharacters1BoxedNumber
-extends [PropertiesWithEscapedCharacters1Boxed](#propertieswithescapedcharacters1boxed) +public record PropertiesWithEscapedCharacters1BoxedNumber
+implements [PropertiesWithEscapedCharacters1Boxed](#propertieswithescapedcharacters1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PropertiesWithEscapedCharacters1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PropertiesWithEscapedCharacters1BoxedString -public static final class PropertiesWithEscapedCharacters1BoxedString
-extends [PropertiesWithEscapedCharacters1Boxed](#propertieswithescapedcharacters1boxed) +public record PropertiesWithEscapedCharacters1BoxedString
+implements [PropertiesWithEscapedCharacters1Boxed](#propertieswithescapedcharacters1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PropertiesWithEscapedCharacters1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PropertiesWithEscapedCharacters1BoxedList -public static final class PropertiesWithEscapedCharacters1BoxedList
-extends [PropertiesWithEscapedCharacters1Boxed](#propertieswithescapedcharacters1boxed) +public record PropertiesWithEscapedCharacters1BoxedList
+implements [PropertiesWithEscapedCharacters1Boxed](#propertieswithescapedcharacters1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PropertiesWithEscapedCharacters1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PropertiesWithEscapedCharacters1BoxedMap -public static final class PropertiesWithEscapedCharacters1BoxedMap
-extends [PropertiesWithEscapedCharacters1Boxed](#propertieswithescapedcharacters1boxed) +public record PropertiesWithEscapedCharacters1BoxedMap
+implements [PropertiesWithEscapedCharacters1Boxed](#propertieswithescapedcharacters1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PropertiesWithEscapedCharacters1BoxedMap([PropertiesWithEscapedCharactersMap](#propertieswithescapedcharactersmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [PropertiesWithEscapedCharactersMap](#propertieswithescapedcharactersmap) | data
validated payload | +| [PropertiesWithEscapedCharactersMap](#propertieswithescapedcharactersmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PropertiesWithEscapedCharacters1 public static class PropertiesWithEscapedCharacters1
@@ -179,7 +185,9 @@ A schema class that validates payloads | [PropertiesWithEscapedCharacters1BoxedBoolean](#propertieswithescapedcharacters1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [PropertiesWithEscapedCharacters1BoxedMap](#propertieswithescapedcharacters1boxedmap) | validateAndBox([Map<?, ?>](#propertieswithescapedcharactersmapbuilder) arg, SchemaConfiguration configuration) | | [PropertiesWithEscapedCharacters1BoxedList](#propertieswithescapedcharacters1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [PropertiesWithEscapedCharacters1Boxed](#propertieswithescapedcharacters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## PropertiesWithEscapedCharactersMapBuilder public class PropertiesWithEscapedCharactersMapBuilder
builder for `Map` @@ -243,27 +251,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## FoofbarBoxed -public static abstract sealed class FoofbarBoxed
+public sealed interface FoofbarBoxed
permits
[FoofbarBoxedNumber](#foofbarboxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## FoofbarBoxedNumber -public static final class FoofbarBoxedNumber
-extends [FoofbarBoxed](#foofbarboxed) +public record FoofbarBoxedNumber
+implements [FoofbarBoxed](#foofbarboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FoofbarBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Foofbar public static class Foofbar
@@ -277,27 +286,28 @@ A schema class that validates payloads | validateAndBox | ## FootbarBoxed -public static abstract sealed class FootbarBoxed
+public sealed interface FootbarBoxed
permits
[FootbarBoxedNumber](#footbarboxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## FootbarBoxedNumber -public static final class FootbarBoxedNumber
-extends [FootbarBoxed](#footbarboxed) +public record FootbarBoxedNumber
+implements [FootbarBoxed](#footbarboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FootbarBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Footbar public static class Footbar
@@ -311,27 +321,28 @@ A schema class that validates payloads | validateAndBox | ## FoorbarBoxed -public static abstract sealed class FoorbarBoxed
+public sealed interface FoorbarBoxed
permits
[FoorbarBoxedNumber](#foorbarboxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## FoorbarBoxedNumber -public static final class FoorbarBoxedNumber
-extends [FoorbarBoxed](#foorbarboxed) +public record FoorbarBoxedNumber
+implements [FoorbarBoxed](#foorbarboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FoorbarBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Foorbar public static class Foorbar
@@ -345,27 +356,28 @@ A schema class that validates payloads | validateAndBox | ## Foobar1Boxed -public static abstract sealed class Foobar1Boxed
+public sealed interface Foobar1Boxed
permits
[Foobar1BoxedNumber](#foobar1boxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Foobar1BoxedNumber -public static final class Foobar1BoxedNumber
-extends [Foobar1Boxed](#foobar1boxed) +public record Foobar1BoxedNumber
+implements [Foobar1Boxed](#foobar1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Foobar1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Foobar1 public static class Foobar1
@@ -379,27 +391,28 @@ A schema class that validates payloads | validateAndBox | ## FoobarBoxed -public static abstract sealed class FoobarBoxed
+public sealed interface FoobarBoxed
permits
[FoobarBoxedNumber](#foobarboxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## FoobarBoxedNumber -public static final class FoobarBoxedNumber
-extends [FoobarBoxed](#foobarboxed) +public record FoobarBoxedNumber
+implements [FoobarBoxed](#foobarboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FoobarBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Foobar public static class Foobar
@@ -413,27 +426,28 @@ A schema class that validates payloads | validateAndBox | ## FoonbarBoxed -public static abstract sealed class FoonbarBoxed
+public sealed interface FoonbarBoxed
permits
[FoonbarBoxedNumber](#foonbarboxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## FoonbarBoxedNumber -public static final class FoonbarBoxedNumber
-extends [FoonbarBoxed](#foonbarboxed) +public record FoonbarBoxedNumber
+implements [FoonbarBoxed](#foonbarboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FoonbarBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Foonbar public static class Foonbar
diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/PropertiesWithNullValuedInstanceProperties.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/PropertiesWithNullValuedInstanceProperties.md index 84f77ba51a4..fed56234823 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/PropertiesWithNullValuedInstanceProperties.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/PropertiesWithNullValuedInstanceProperties.md @@ -4,7 +4,7 @@ public class PropertiesWithNullValuedInstanceProperties
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,22 +12,22 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [PropertiesWithNullValuedInstanceProperties.PropertiesWithNullValuedInstanceProperties1Boxed](#propertieswithnullvaluedinstanceproperties1boxed)
abstract sealed validated payload class | -| static class | [PropertiesWithNullValuedInstanceProperties.PropertiesWithNullValuedInstanceProperties1BoxedVoid](#propertieswithnullvaluedinstanceproperties1boxedvoid)
boxed class to store validated null payloads | -| static class | [PropertiesWithNullValuedInstanceProperties.PropertiesWithNullValuedInstanceProperties1BoxedBoolean](#propertieswithnullvaluedinstanceproperties1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [PropertiesWithNullValuedInstanceProperties.PropertiesWithNullValuedInstanceProperties1BoxedNumber](#propertieswithnullvaluedinstanceproperties1boxednumber)
boxed class to store validated Number payloads | -| static class | [PropertiesWithNullValuedInstanceProperties.PropertiesWithNullValuedInstanceProperties1BoxedString](#propertieswithnullvaluedinstanceproperties1boxedstring)
boxed class to store validated String payloads | -| static class | [PropertiesWithNullValuedInstanceProperties.PropertiesWithNullValuedInstanceProperties1BoxedList](#propertieswithnullvaluedinstanceproperties1boxedlist)
boxed class to store validated List payloads | -| static class | [PropertiesWithNullValuedInstanceProperties.PropertiesWithNullValuedInstanceProperties1BoxedMap](#propertieswithnullvaluedinstanceproperties1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [PropertiesWithNullValuedInstanceProperties.PropertiesWithNullValuedInstanceProperties1Boxed](#propertieswithnullvaluedinstanceproperties1boxed)
sealed interface for validated payloads | +| record | [PropertiesWithNullValuedInstanceProperties.PropertiesWithNullValuedInstanceProperties1BoxedVoid](#propertieswithnullvaluedinstanceproperties1boxedvoid)
boxed class to store validated null payloads | +| record | [PropertiesWithNullValuedInstanceProperties.PropertiesWithNullValuedInstanceProperties1BoxedBoolean](#propertieswithnullvaluedinstanceproperties1boxedboolean)
boxed class to store validated boolean payloads | +| record | [PropertiesWithNullValuedInstanceProperties.PropertiesWithNullValuedInstanceProperties1BoxedNumber](#propertieswithnullvaluedinstanceproperties1boxednumber)
boxed class to store validated Number payloads | +| record | [PropertiesWithNullValuedInstanceProperties.PropertiesWithNullValuedInstanceProperties1BoxedString](#propertieswithnullvaluedinstanceproperties1boxedstring)
boxed class to store validated String payloads | +| record | [PropertiesWithNullValuedInstanceProperties.PropertiesWithNullValuedInstanceProperties1BoxedList](#propertieswithnullvaluedinstanceproperties1boxedlist)
boxed class to store validated List payloads | +| record | [PropertiesWithNullValuedInstanceProperties.PropertiesWithNullValuedInstanceProperties1BoxedMap](#propertieswithnullvaluedinstanceproperties1boxedmap)
boxed class to store validated Map payloads | | static class | [PropertiesWithNullValuedInstanceProperties.PropertiesWithNullValuedInstanceProperties1](#propertieswithnullvaluedinstanceproperties1)
schema class | | static class | [PropertiesWithNullValuedInstanceProperties.PropertiesWithNullValuedInstancePropertiesMapBuilder](#propertieswithnullvaluedinstancepropertiesmapbuilder)
builder for Map payloads | | static class | [PropertiesWithNullValuedInstanceProperties.PropertiesWithNullValuedInstancePropertiesMap](#propertieswithnullvaluedinstancepropertiesmap)
output class for Map payloads | -| static class | [PropertiesWithNullValuedInstanceProperties.FooBoxed](#fooboxed)
abstract sealed validated payload class | -| static class | [PropertiesWithNullValuedInstanceProperties.FooBoxedVoid](#fooboxedvoid)
boxed class to store validated null payloads | +| sealed interface | [PropertiesWithNullValuedInstanceProperties.FooBoxed](#fooboxed)
sealed interface for validated payloads | +| record | [PropertiesWithNullValuedInstanceProperties.FooBoxedVoid](#fooboxedvoid)
boxed class to store validated null payloads | | static class | [PropertiesWithNullValuedInstanceProperties.Foo](#foo)
schema class | ## PropertiesWithNullValuedInstanceProperties1Boxed -public static abstract sealed class PropertiesWithNullValuedInstanceProperties1Boxed
+public sealed interface PropertiesWithNullValuedInstanceProperties1Boxed
permits
[PropertiesWithNullValuedInstanceProperties1BoxedVoid](#propertieswithnullvaluedinstanceproperties1boxedvoid), [PropertiesWithNullValuedInstanceProperties1BoxedBoolean](#propertieswithnullvaluedinstanceproperties1boxedboolean), @@ -36,103 +36,109 @@ permits
[PropertiesWithNullValuedInstanceProperties1BoxedList](#propertieswithnullvaluedinstanceproperties1boxedlist), [PropertiesWithNullValuedInstanceProperties1BoxedMap](#propertieswithnullvaluedinstanceproperties1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## PropertiesWithNullValuedInstanceProperties1BoxedVoid -public static final class PropertiesWithNullValuedInstanceProperties1BoxedVoid
-extends [PropertiesWithNullValuedInstanceProperties1Boxed](#propertieswithnullvaluedinstanceproperties1boxed) +public record PropertiesWithNullValuedInstanceProperties1BoxedVoid
+implements [PropertiesWithNullValuedInstanceProperties1Boxed](#propertieswithnullvaluedinstanceproperties1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PropertiesWithNullValuedInstanceProperties1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PropertiesWithNullValuedInstanceProperties1BoxedBoolean -public static final class PropertiesWithNullValuedInstanceProperties1BoxedBoolean
-extends [PropertiesWithNullValuedInstanceProperties1Boxed](#propertieswithnullvaluedinstanceproperties1boxed) +public record PropertiesWithNullValuedInstanceProperties1BoxedBoolean
+implements [PropertiesWithNullValuedInstanceProperties1Boxed](#propertieswithnullvaluedinstanceproperties1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PropertiesWithNullValuedInstanceProperties1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PropertiesWithNullValuedInstanceProperties1BoxedNumber -public static final class PropertiesWithNullValuedInstanceProperties1BoxedNumber
-extends [PropertiesWithNullValuedInstanceProperties1Boxed](#propertieswithnullvaluedinstanceproperties1boxed) +public record PropertiesWithNullValuedInstanceProperties1BoxedNumber
+implements [PropertiesWithNullValuedInstanceProperties1Boxed](#propertieswithnullvaluedinstanceproperties1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PropertiesWithNullValuedInstanceProperties1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PropertiesWithNullValuedInstanceProperties1BoxedString -public static final class PropertiesWithNullValuedInstanceProperties1BoxedString
-extends [PropertiesWithNullValuedInstanceProperties1Boxed](#propertieswithnullvaluedinstanceproperties1boxed) +public record PropertiesWithNullValuedInstanceProperties1BoxedString
+implements [PropertiesWithNullValuedInstanceProperties1Boxed](#propertieswithnullvaluedinstanceproperties1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PropertiesWithNullValuedInstanceProperties1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PropertiesWithNullValuedInstanceProperties1BoxedList -public static final class PropertiesWithNullValuedInstanceProperties1BoxedList
-extends [PropertiesWithNullValuedInstanceProperties1Boxed](#propertieswithnullvaluedinstanceproperties1boxed) +public record PropertiesWithNullValuedInstanceProperties1BoxedList
+implements [PropertiesWithNullValuedInstanceProperties1Boxed](#propertieswithnullvaluedinstanceproperties1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PropertiesWithNullValuedInstanceProperties1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PropertiesWithNullValuedInstanceProperties1BoxedMap -public static final class PropertiesWithNullValuedInstanceProperties1BoxedMap
-extends [PropertiesWithNullValuedInstanceProperties1Boxed](#propertieswithnullvaluedinstanceproperties1boxed) +public record PropertiesWithNullValuedInstanceProperties1BoxedMap
+implements [PropertiesWithNullValuedInstanceProperties1Boxed](#propertieswithnullvaluedinstanceproperties1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PropertiesWithNullValuedInstanceProperties1BoxedMap([PropertiesWithNullValuedInstancePropertiesMap](#propertieswithnullvaluedinstancepropertiesmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [PropertiesWithNullValuedInstancePropertiesMap](#propertieswithnullvaluedinstancepropertiesmap) | data
validated payload | +| [PropertiesWithNullValuedInstancePropertiesMap](#propertieswithnullvaluedinstancepropertiesmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PropertiesWithNullValuedInstanceProperties1 public static class PropertiesWithNullValuedInstanceProperties1
@@ -164,7 +170,9 @@ A schema class that validates payloads | [PropertiesWithNullValuedInstanceProperties1BoxedBoolean](#propertieswithnullvaluedinstanceproperties1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [PropertiesWithNullValuedInstanceProperties1BoxedMap](#propertieswithnullvaluedinstanceproperties1boxedmap) | validateAndBox([Map<?, ?>](#propertieswithnullvaluedinstancepropertiesmapbuilder) arg, SchemaConfiguration configuration) | | [PropertiesWithNullValuedInstanceProperties1BoxedList](#propertieswithnullvaluedinstanceproperties1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [PropertiesWithNullValuedInstanceProperties1Boxed](#propertieswithnullvaluedinstanceproperties1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## PropertiesWithNullValuedInstancePropertiesMapBuilder public class PropertiesWithNullValuedInstancePropertiesMapBuilder
builder for `Map` @@ -205,27 +213,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## FooBoxed -public static abstract sealed class FooBoxed
+public sealed interface FooBoxed
permits
[FooBoxedVoid](#fooboxedvoid) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## FooBoxedVoid -public static final class FooBoxedVoid
-extends [FooBoxed](#fooboxed) +public record FooBoxedVoid
+implements [FooBoxed](#fooboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Foo public static class Foo
diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/PropertyNamedRefThatIsNotAReference.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/PropertyNamedRefThatIsNotAReference.md index 45748c1d470..1d8a12ff4d3 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/PropertyNamedRefThatIsNotAReference.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/PropertyNamedRefThatIsNotAReference.md @@ -4,7 +4,7 @@ public class PropertyNamedRefThatIsNotAReference
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,22 +12,22 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [PropertyNamedRefThatIsNotAReference.PropertyNamedRefThatIsNotAReference1Boxed](#propertynamedrefthatisnotareference1boxed)
abstract sealed validated payload class | -| static class | [PropertyNamedRefThatIsNotAReference.PropertyNamedRefThatIsNotAReference1BoxedVoid](#propertynamedrefthatisnotareference1boxedvoid)
boxed class to store validated null payloads | -| static class | [PropertyNamedRefThatIsNotAReference.PropertyNamedRefThatIsNotAReference1BoxedBoolean](#propertynamedrefthatisnotareference1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [PropertyNamedRefThatIsNotAReference.PropertyNamedRefThatIsNotAReference1BoxedNumber](#propertynamedrefthatisnotareference1boxednumber)
boxed class to store validated Number payloads | -| static class | [PropertyNamedRefThatIsNotAReference.PropertyNamedRefThatIsNotAReference1BoxedString](#propertynamedrefthatisnotareference1boxedstring)
boxed class to store validated String payloads | -| static class | [PropertyNamedRefThatIsNotAReference.PropertyNamedRefThatIsNotAReference1BoxedList](#propertynamedrefthatisnotareference1boxedlist)
boxed class to store validated List payloads | -| static class | [PropertyNamedRefThatIsNotAReference.PropertyNamedRefThatIsNotAReference1BoxedMap](#propertynamedrefthatisnotareference1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [PropertyNamedRefThatIsNotAReference.PropertyNamedRefThatIsNotAReference1Boxed](#propertynamedrefthatisnotareference1boxed)
sealed interface for validated payloads | +| record | [PropertyNamedRefThatIsNotAReference.PropertyNamedRefThatIsNotAReference1BoxedVoid](#propertynamedrefthatisnotareference1boxedvoid)
boxed class to store validated null payloads | +| record | [PropertyNamedRefThatIsNotAReference.PropertyNamedRefThatIsNotAReference1BoxedBoolean](#propertynamedrefthatisnotareference1boxedboolean)
boxed class to store validated boolean payloads | +| record | [PropertyNamedRefThatIsNotAReference.PropertyNamedRefThatIsNotAReference1BoxedNumber](#propertynamedrefthatisnotareference1boxednumber)
boxed class to store validated Number payloads | +| record | [PropertyNamedRefThatIsNotAReference.PropertyNamedRefThatIsNotAReference1BoxedString](#propertynamedrefthatisnotareference1boxedstring)
boxed class to store validated String payloads | +| record | [PropertyNamedRefThatIsNotAReference.PropertyNamedRefThatIsNotAReference1BoxedList](#propertynamedrefthatisnotareference1boxedlist)
boxed class to store validated List payloads | +| record | [PropertyNamedRefThatIsNotAReference.PropertyNamedRefThatIsNotAReference1BoxedMap](#propertynamedrefthatisnotareference1boxedmap)
boxed class to store validated Map payloads | | static class | [PropertyNamedRefThatIsNotAReference.PropertyNamedRefThatIsNotAReference1](#propertynamedrefthatisnotareference1)
schema class | | static class | [PropertyNamedRefThatIsNotAReference.PropertyNamedRefThatIsNotAReferenceMapBuilder](#propertynamedrefthatisnotareferencemapbuilder)
builder for Map payloads | | static class | [PropertyNamedRefThatIsNotAReference.PropertyNamedRefThatIsNotAReferenceMap](#propertynamedrefthatisnotareferencemap)
output class for Map payloads | -| static class | [PropertyNamedRefThatIsNotAReference.RefBoxed](#refboxed)
abstract sealed validated payload class | -| static class | [PropertyNamedRefThatIsNotAReference.RefBoxedString](#refboxedstring)
boxed class to store validated String payloads | +| sealed interface | [PropertyNamedRefThatIsNotAReference.RefBoxed](#refboxed)
sealed interface for validated payloads | +| record | [PropertyNamedRefThatIsNotAReference.RefBoxedString](#refboxedstring)
boxed class to store validated String payloads | | static class | [PropertyNamedRefThatIsNotAReference.Ref](#ref)
schema class | ## PropertyNamedRefThatIsNotAReference1Boxed -public static abstract sealed class PropertyNamedRefThatIsNotAReference1Boxed
+public sealed interface PropertyNamedRefThatIsNotAReference1Boxed
permits
[PropertyNamedRefThatIsNotAReference1BoxedVoid](#propertynamedrefthatisnotareference1boxedvoid), [PropertyNamedRefThatIsNotAReference1BoxedBoolean](#propertynamedrefthatisnotareference1boxedboolean), @@ -36,103 +36,109 @@ permits
[PropertyNamedRefThatIsNotAReference1BoxedList](#propertynamedrefthatisnotareference1boxedlist), [PropertyNamedRefThatIsNotAReference1BoxedMap](#propertynamedrefthatisnotareference1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## PropertyNamedRefThatIsNotAReference1BoxedVoid -public static final class PropertyNamedRefThatIsNotAReference1BoxedVoid
-extends [PropertyNamedRefThatIsNotAReference1Boxed](#propertynamedrefthatisnotareference1boxed) +public record PropertyNamedRefThatIsNotAReference1BoxedVoid
+implements [PropertyNamedRefThatIsNotAReference1Boxed](#propertynamedrefthatisnotareference1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PropertyNamedRefThatIsNotAReference1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PropertyNamedRefThatIsNotAReference1BoxedBoolean -public static final class PropertyNamedRefThatIsNotAReference1BoxedBoolean
-extends [PropertyNamedRefThatIsNotAReference1Boxed](#propertynamedrefthatisnotareference1boxed) +public record PropertyNamedRefThatIsNotAReference1BoxedBoolean
+implements [PropertyNamedRefThatIsNotAReference1Boxed](#propertynamedrefthatisnotareference1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PropertyNamedRefThatIsNotAReference1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PropertyNamedRefThatIsNotAReference1BoxedNumber -public static final class PropertyNamedRefThatIsNotAReference1BoxedNumber
-extends [PropertyNamedRefThatIsNotAReference1Boxed](#propertynamedrefthatisnotareference1boxed) +public record PropertyNamedRefThatIsNotAReference1BoxedNumber
+implements [PropertyNamedRefThatIsNotAReference1Boxed](#propertynamedrefthatisnotareference1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PropertyNamedRefThatIsNotAReference1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PropertyNamedRefThatIsNotAReference1BoxedString -public static final class PropertyNamedRefThatIsNotAReference1BoxedString
-extends [PropertyNamedRefThatIsNotAReference1Boxed](#propertynamedrefthatisnotareference1boxed) +public record PropertyNamedRefThatIsNotAReference1BoxedString
+implements [PropertyNamedRefThatIsNotAReference1Boxed](#propertynamedrefthatisnotareference1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PropertyNamedRefThatIsNotAReference1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PropertyNamedRefThatIsNotAReference1BoxedList -public static final class PropertyNamedRefThatIsNotAReference1BoxedList
-extends [PropertyNamedRefThatIsNotAReference1Boxed](#propertynamedrefthatisnotareference1boxed) +public record PropertyNamedRefThatIsNotAReference1BoxedList
+implements [PropertyNamedRefThatIsNotAReference1Boxed](#propertynamedrefthatisnotareference1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PropertyNamedRefThatIsNotAReference1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PropertyNamedRefThatIsNotAReference1BoxedMap -public static final class PropertyNamedRefThatIsNotAReference1BoxedMap
-extends [PropertyNamedRefThatIsNotAReference1Boxed](#propertynamedrefthatisnotareference1boxed) +public record PropertyNamedRefThatIsNotAReference1BoxedMap
+implements [PropertyNamedRefThatIsNotAReference1Boxed](#propertynamedrefthatisnotareference1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PropertyNamedRefThatIsNotAReference1BoxedMap([PropertyNamedRefThatIsNotAReferenceMap](#propertynamedrefthatisnotareferencemap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [PropertyNamedRefThatIsNotAReferenceMap](#propertynamedrefthatisnotareferencemap) | data
validated payload | +| [PropertyNamedRefThatIsNotAReferenceMap](#propertynamedrefthatisnotareferencemap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PropertyNamedRefThatIsNotAReference1 public static class PropertyNamedRefThatIsNotAReference1
@@ -164,7 +170,9 @@ A schema class that validates payloads | [PropertyNamedRefThatIsNotAReference1BoxedBoolean](#propertynamedrefthatisnotareference1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [PropertyNamedRefThatIsNotAReference1BoxedMap](#propertynamedrefthatisnotareference1boxedmap) | validateAndBox([Map<?, ?>](#propertynamedrefthatisnotareferencemapbuilder) arg, SchemaConfiguration configuration) | | [PropertyNamedRefThatIsNotAReference1BoxedList](#propertynamedrefthatisnotareference1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [PropertyNamedRefThatIsNotAReference1Boxed](#propertynamedrefthatisnotareference1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## PropertyNamedRefThatIsNotAReferenceMapBuilder public class PropertyNamedRefThatIsNotAReferenceMapBuilder
builder for `Map` @@ -205,27 +213,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## RefBoxed -public static abstract sealed class RefBoxed
+public sealed interface RefBoxed
permits
[RefBoxedString](#refboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## RefBoxedString -public static final class RefBoxedString
-extends [RefBoxed](#refboxed) +public record RefBoxedString
+implements [RefBoxed](#refboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RefBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Ref public static class Ref
diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/PropertynamesValidation.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/PropertynamesValidation.md index 77f225c3fb9..e69267abd96 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/PropertynamesValidation.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/PropertynamesValidation.md @@ -4,26 +4,26 @@ public class PropertynamesValidation
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [PropertynamesValidation.PropertynamesValidation1Boxed](#propertynamesvalidation1boxed)
abstract sealed validated payload class | -| static class | [PropertynamesValidation.PropertynamesValidation1BoxedVoid](#propertynamesvalidation1boxedvoid)
boxed class to store validated null payloads | -| static class | [PropertynamesValidation.PropertynamesValidation1BoxedBoolean](#propertynamesvalidation1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [PropertynamesValidation.PropertynamesValidation1BoxedNumber](#propertynamesvalidation1boxednumber)
boxed class to store validated Number payloads | -| static class | [PropertynamesValidation.PropertynamesValidation1BoxedString](#propertynamesvalidation1boxedstring)
boxed class to store validated String payloads | -| static class | [PropertynamesValidation.PropertynamesValidation1BoxedList](#propertynamesvalidation1boxedlist)
boxed class to store validated List payloads | -| static class | [PropertynamesValidation.PropertynamesValidation1BoxedMap](#propertynamesvalidation1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [PropertynamesValidation.PropertynamesValidation1Boxed](#propertynamesvalidation1boxed)
sealed interface for validated payloads | +| record | [PropertynamesValidation.PropertynamesValidation1BoxedVoid](#propertynamesvalidation1boxedvoid)
boxed class to store validated null payloads | +| record | [PropertynamesValidation.PropertynamesValidation1BoxedBoolean](#propertynamesvalidation1boxedboolean)
boxed class to store validated boolean payloads | +| record | [PropertynamesValidation.PropertynamesValidation1BoxedNumber](#propertynamesvalidation1boxednumber)
boxed class to store validated Number payloads | +| record | [PropertynamesValidation.PropertynamesValidation1BoxedString](#propertynamesvalidation1boxedstring)
boxed class to store validated String payloads | +| record | [PropertynamesValidation.PropertynamesValidation1BoxedList](#propertynamesvalidation1boxedlist)
boxed class to store validated List payloads | +| record | [PropertynamesValidation.PropertynamesValidation1BoxedMap](#propertynamesvalidation1boxedmap)
boxed class to store validated Map payloads | | static class | [PropertynamesValidation.PropertynamesValidation1](#propertynamesvalidation1)
schema class | -| static class | [PropertynamesValidation.PropertyNamesBoxed](#propertynamesboxed)
abstract sealed validated payload class | -| static class | [PropertynamesValidation.PropertyNamesBoxedString](#propertynamesboxedstring)
boxed class to store validated String payloads | +| sealed interface | [PropertynamesValidation.PropertyNamesBoxed](#propertynamesboxed)
sealed interface for validated payloads | +| record | [PropertynamesValidation.PropertyNamesBoxedString](#propertynamesboxedstring)
boxed class to store validated String payloads | | static class | [PropertynamesValidation.PropertyNames](#propertynames)
schema class | ## PropertynamesValidation1Boxed -public static abstract sealed class PropertynamesValidation1Boxed
+public sealed interface PropertynamesValidation1Boxed
permits
[PropertynamesValidation1BoxedVoid](#propertynamesvalidation1boxedvoid), [PropertynamesValidation1BoxedBoolean](#propertynamesvalidation1boxedboolean), @@ -32,103 +32,109 @@ permits
[PropertynamesValidation1BoxedList](#propertynamesvalidation1boxedlist), [PropertynamesValidation1BoxedMap](#propertynamesvalidation1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## PropertynamesValidation1BoxedVoid -public static final class PropertynamesValidation1BoxedVoid
-extends [PropertynamesValidation1Boxed](#propertynamesvalidation1boxed) +public record PropertynamesValidation1BoxedVoid
+implements [PropertynamesValidation1Boxed](#propertynamesvalidation1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PropertynamesValidation1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PropertynamesValidation1BoxedBoolean -public static final class PropertynamesValidation1BoxedBoolean
-extends [PropertynamesValidation1Boxed](#propertynamesvalidation1boxed) +public record PropertynamesValidation1BoxedBoolean
+implements [PropertynamesValidation1Boxed](#propertynamesvalidation1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PropertynamesValidation1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PropertynamesValidation1BoxedNumber -public static final class PropertynamesValidation1BoxedNumber
-extends [PropertynamesValidation1Boxed](#propertynamesvalidation1boxed) +public record PropertynamesValidation1BoxedNumber
+implements [PropertynamesValidation1Boxed](#propertynamesvalidation1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PropertynamesValidation1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PropertynamesValidation1BoxedString -public static final class PropertynamesValidation1BoxedString
-extends [PropertynamesValidation1Boxed](#propertynamesvalidation1boxed) +public record PropertynamesValidation1BoxedString
+implements [PropertynamesValidation1Boxed](#propertynamesvalidation1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PropertynamesValidation1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PropertynamesValidation1BoxedList -public static final class PropertynamesValidation1BoxedList
-extends [PropertynamesValidation1Boxed](#propertynamesvalidation1boxed) +public record PropertynamesValidation1BoxedList
+implements [PropertynamesValidation1Boxed](#propertynamesvalidation1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PropertynamesValidation1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PropertynamesValidation1BoxedMap -public static final class PropertynamesValidation1BoxedMap
-extends [PropertynamesValidation1Boxed](#propertynamesvalidation1boxed) +public record PropertynamesValidation1BoxedMap
+implements [PropertynamesValidation1Boxed](#propertynamesvalidation1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PropertynamesValidation1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PropertynamesValidation1 public static class PropertynamesValidation1
@@ -160,29 +166,32 @@ A schema class that validates payloads | [PropertynamesValidation1BoxedBoolean](#propertynamesvalidation1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [PropertynamesValidation1BoxedMap](#propertynamesvalidation1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [PropertynamesValidation1BoxedList](#propertynamesvalidation1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [PropertynamesValidation1Boxed](#propertynamesvalidation1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## PropertyNamesBoxed -public static abstract sealed class PropertyNamesBoxed
+public sealed interface PropertyNamesBoxed
permits
[PropertyNamesBoxedString](#propertynamesboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## PropertyNamesBoxedString -public static final class PropertyNamesBoxedString
-extends [PropertyNamesBoxed](#propertynamesboxed) +public record PropertyNamesBoxedString
+implements [PropertyNamesBoxed](#propertynamesboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PropertyNamesBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PropertyNames public static class PropertyNames
@@ -223,5 +232,7 @@ String validatedPayload = PropertynamesValidation.PropertyNames.validate( | ----------------- | ---------------------- | | String | validate(String arg, SchemaConfiguration configuration) | | [PropertyNamesBoxedString](#propertynamesboxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [PropertyNamesBoxed](#propertynamesboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/RegexFormat.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/RegexFormat.md index efa47d86c32..11d63e7de13 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/RegexFormat.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/RegexFormat.md @@ -4,23 +4,23 @@ public class RegexFormat
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [RegexFormat.RegexFormat1Boxed](#regexformat1boxed)
abstract sealed validated payload class | -| static class | [RegexFormat.RegexFormat1BoxedVoid](#regexformat1boxedvoid)
boxed class to store validated null payloads | -| static class | [RegexFormat.RegexFormat1BoxedBoolean](#regexformat1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [RegexFormat.RegexFormat1BoxedNumber](#regexformat1boxednumber)
boxed class to store validated Number payloads | -| static class | [RegexFormat.RegexFormat1BoxedString](#regexformat1boxedstring)
boxed class to store validated String payloads | -| static class | [RegexFormat.RegexFormat1BoxedList](#regexformat1boxedlist)
boxed class to store validated List payloads | -| static class | [RegexFormat.RegexFormat1BoxedMap](#regexformat1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [RegexFormat.RegexFormat1Boxed](#regexformat1boxed)
sealed interface for validated payloads | +| record | [RegexFormat.RegexFormat1BoxedVoid](#regexformat1boxedvoid)
boxed class to store validated null payloads | +| record | [RegexFormat.RegexFormat1BoxedBoolean](#regexformat1boxedboolean)
boxed class to store validated boolean payloads | +| record | [RegexFormat.RegexFormat1BoxedNumber](#regexformat1boxednumber)
boxed class to store validated Number payloads | +| record | [RegexFormat.RegexFormat1BoxedString](#regexformat1boxedstring)
boxed class to store validated String payloads | +| record | [RegexFormat.RegexFormat1BoxedList](#regexformat1boxedlist)
boxed class to store validated List payloads | +| record | [RegexFormat.RegexFormat1BoxedMap](#regexformat1boxedmap)
boxed class to store validated Map payloads | | static class | [RegexFormat.RegexFormat1](#regexformat1)
schema class | ## RegexFormat1Boxed -public static abstract sealed class RegexFormat1Boxed
+public sealed interface RegexFormat1Boxed
permits
[RegexFormat1BoxedVoid](#regexformat1boxedvoid), [RegexFormat1BoxedBoolean](#regexformat1boxedboolean), @@ -29,103 +29,109 @@ permits
[RegexFormat1BoxedList](#regexformat1boxedlist), [RegexFormat1BoxedMap](#regexformat1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## RegexFormat1BoxedVoid -public static final class RegexFormat1BoxedVoid
-extends [RegexFormat1Boxed](#regexformat1boxed) +public record RegexFormat1BoxedVoid
+implements [RegexFormat1Boxed](#regexformat1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RegexFormat1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RegexFormat1BoxedBoolean -public static final class RegexFormat1BoxedBoolean
-extends [RegexFormat1Boxed](#regexformat1boxed) +public record RegexFormat1BoxedBoolean
+implements [RegexFormat1Boxed](#regexformat1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RegexFormat1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RegexFormat1BoxedNumber -public static final class RegexFormat1BoxedNumber
-extends [RegexFormat1Boxed](#regexformat1boxed) +public record RegexFormat1BoxedNumber
+implements [RegexFormat1Boxed](#regexformat1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RegexFormat1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RegexFormat1BoxedString -public static final class RegexFormat1BoxedString
-extends [RegexFormat1Boxed](#regexformat1boxed) +public record RegexFormat1BoxedString
+implements [RegexFormat1Boxed](#regexformat1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RegexFormat1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RegexFormat1BoxedList -public static final class RegexFormat1BoxedList
-extends [RegexFormat1Boxed](#regexformat1boxed) +public record RegexFormat1BoxedList
+implements [RegexFormat1Boxed](#regexformat1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RegexFormat1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RegexFormat1BoxedMap -public static final class RegexFormat1BoxedMap
-extends [RegexFormat1Boxed](#regexformat1boxed) +public record RegexFormat1BoxedMap
+implements [RegexFormat1Boxed](#regexformat1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RegexFormat1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RegexFormat1 public static class RegexFormat1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [RegexFormat1BoxedBoolean](#regexformat1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [RegexFormat1BoxedMap](#regexformat1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [RegexFormat1BoxedList](#regexformat1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [RegexFormat1Boxed](#regexformat1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/RegexesAreNotAnchoredByDefaultAndAreCaseSensitive.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/RegexesAreNotAnchoredByDefaultAndAreCaseSensitive.md index 856e3eed7aa..0947b3fc9e2 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/RegexesAreNotAnchoredByDefaultAndAreCaseSensitive.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/RegexesAreNotAnchoredByDefaultAndAreCaseSensitive.md @@ -4,29 +4,29 @@ public class RegexesAreNotAnchoredByDefaultAndAreCaseSensitive
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [RegexesAreNotAnchoredByDefaultAndAreCaseSensitive.RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1Boxed](#regexesarenotanchoredbydefaultandarecasesensitive1boxed)
abstract sealed validated payload class | -| static class | [RegexesAreNotAnchoredByDefaultAndAreCaseSensitive.RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedVoid](#regexesarenotanchoredbydefaultandarecasesensitive1boxedvoid)
boxed class to store validated null payloads | -| static class | [RegexesAreNotAnchoredByDefaultAndAreCaseSensitive.RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedBoolean](#regexesarenotanchoredbydefaultandarecasesensitive1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [RegexesAreNotAnchoredByDefaultAndAreCaseSensitive.RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedNumber](#regexesarenotanchoredbydefaultandarecasesensitive1boxednumber)
boxed class to store validated Number payloads | -| static class | [RegexesAreNotAnchoredByDefaultAndAreCaseSensitive.RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedString](#regexesarenotanchoredbydefaultandarecasesensitive1boxedstring)
boxed class to store validated String payloads | -| static class | [RegexesAreNotAnchoredByDefaultAndAreCaseSensitive.RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedList](#regexesarenotanchoredbydefaultandarecasesensitive1boxedlist)
boxed class to store validated List payloads | -| static class | [RegexesAreNotAnchoredByDefaultAndAreCaseSensitive.RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedMap](#regexesarenotanchoredbydefaultandarecasesensitive1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [RegexesAreNotAnchoredByDefaultAndAreCaseSensitive.RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1Boxed](#regexesarenotanchoredbydefaultandarecasesensitive1boxed)
sealed interface for validated payloads | +| record | [RegexesAreNotAnchoredByDefaultAndAreCaseSensitive.RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedVoid](#regexesarenotanchoredbydefaultandarecasesensitive1boxedvoid)
boxed class to store validated null payloads | +| record | [RegexesAreNotAnchoredByDefaultAndAreCaseSensitive.RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedBoolean](#regexesarenotanchoredbydefaultandarecasesensitive1boxedboolean)
boxed class to store validated boolean payloads | +| record | [RegexesAreNotAnchoredByDefaultAndAreCaseSensitive.RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedNumber](#regexesarenotanchoredbydefaultandarecasesensitive1boxednumber)
boxed class to store validated Number payloads | +| record | [RegexesAreNotAnchoredByDefaultAndAreCaseSensitive.RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedString](#regexesarenotanchoredbydefaultandarecasesensitive1boxedstring)
boxed class to store validated String payloads | +| record | [RegexesAreNotAnchoredByDefaultAndAreCaseSensitive.RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedList](#regexesarenotanchoredbydefaultandarecasesensitive1boxedlist)
boxed class to store validated List payloads | +| record | [RegexesAreNotAnchoredByDefaultAndAreCaseSensitive.RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedMap](#regexesarenotanchoredbydefaultandarecasesensitive1boxedmap)
boxed class to store validated Map payloads | | static class | [RegexesAreNotAnchoredByDefaultAndAreCaseSensitive.RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1](#regexesarenotanchoredbydefaultandarecasesensitive1)
schema class | -| static class | [RegexesAreNotAnchoredByDefaultAndAreCaseSensitive.XBoxed](#xboxed)
abstract sealed validated payload class | -| static class | [RegexesAreNotAnchoredByDefaultAndAreCaseSensitive.XBoxedString](#xboxedstring)
boxed class to store validated String payloads | +| sealed interface | [RegexesAreNotAnchoredByDefaultAndAreCaseSensitive.XBoxed](#xboxed)
sealed interface for validated payloads | +| record | [RegexesAreNotAnchoredByDefaultAndAreCaseSensitive.XBoxedString](#xboxedstring)
boxed class to store validated String payloads | | static class | [RegexesAreNotAnchoredByDefaultAndAreCaseSensitive.X](#x)
schema class | -| static class | [RegexesAreNotAnchoredByDefaultAndAreCaseSensitive.Schema092Boxed](#schema092boxed)
abstract sealed validated payload class | -| static class | [RegexesAreNotAnchoredByDefaultAndAreCaseSensitive.Schema092BoxedBoolean](#schema092boxedboolean)
boxed class to store validated boolean payloads | +| sealed interface | [RegexesAreNotAnchoredByDefaultAndAreCaseSensitive.Schema092Boxed](#schema092boxed)
sealed interface for validated payloads | +| record | [RegexesAreNotAnchoredByDefaultAndAreCaseSensitive.Schema092BoxedBoolean](#schema092boxedboolean)
boxed class to store validated boolean payloads | | static class | [RegexesAreNotAnchoredByDefaultAndAreCaseSensitive.Schema092](#schema092)
schema class | ## RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1Boxed -public static abstract sealed class RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1Boxed
+public sealed interface RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1Boxed
permits
[RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedVoid](#regexesarenotanchoredbydefaultandarecasesensitive1boxedvoid), [RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedBoolean](#regexesarenotanchoredbydefaultandarecasesensitive1boxedboolean), @@ -35,103 +35,109 @@ permits
[RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedList](#regexesarenotanchoredbydefaultandarecasesensitive1boxedlist), [RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedMap](#regexesarenotanchoredbydefaultandarecasesensitive1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedVoid -public static final class RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedVoid
-extends [RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1Boxed](#regexesarenotanchoredbydefaultandarecasesensitive1boxed) +public record RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedVoid
+implements [RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1Boxed](#regexesarenotanchoredbydefaultandarecasesensitive1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedBoolean -public static final class RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedBoolean
-extends [RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1Boxed](#regexesarenotanchoredbydefaultandarecasesensitive1boxed) +public record RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedBoolean
+implements [RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1Boxed](#regexesarenotanchoredbydefaultandarecasesensitive1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedNumber -public static final class RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedNumber
-extends [RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1Boxed](#regexesarenotanchoredbydefaultandarecasesensitive1boxed) +public record RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedNumber
+implements [RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1Boxed](#regexesarenotanchoredbydefaultandarecasesensitive1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedString -public static final class RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedString
-extends [RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1Boxed](#regexesarenotanchoredbydefaultandarecasesensitive1boxed) +public record RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedString
+implements [RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1Boxed](#regexesarenotanchoredbydefaultandarecasesensitive1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedList -public static final class RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedList
-extends [RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1Boxed](#regexesarenotanchoredbydefaultandarecasesensitive1boxed) +public record RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedList
+implements [RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1Boxed](#regexesarenotanchoredbydefaultandarecasesensitive1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedMap -public static final class RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedMap
-extends [RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1Boxed](#regexesarenotanchoredbydefaultandarecasesensitive1boxed) +public record RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedMap
+implements [RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1Boxed](#regexesarenotanchoredbydefaultandarecasesensitive1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1 public static class RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1
@@ -163,29 +169,32 @@ A schema class that validates payloads | [RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedBoolean](#regexesarenotanchoredbydefaultandarecasesensitive1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedMap](#regexesarenotanchoredbydefaultandarecasesensitive1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedList](#regexesarenotanchoredbydefaultandarecasesensitive1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1Boxed](#regexesarenotanchoredbydefaultandarecasesensitive1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## XBoxed -public static abstract sealed class XBoxed
+public sealed interface XBoxed
permits
[XBoxedString](#xboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## XBoxedString -public static final class XBoxedString
-extends [XBoxed](#xboxed) +public record XBoxedString
+implements [XBoxed](#xboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | XBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## X public static class X
@@ -199,27 +208,28 @@ A schema class that validates payloads | validateAndBox | ## Schema092Boxed -public static abstract sealed class Schema092Boxed
+public sealed interface Schema092Boxed
permits
[Schema092BoxedBoolean](#schema092boxedboolean) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema092BoxedBoolean -public static final class Schema092BoxedBoolean
-extends [Schema092Boxed](#schema092boxed) +public record Schema092BoxedBoolean
+implements [Schema092Boxed](#schema092boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema092BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema092 public static class Schema092
diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/RelativeJsonPointerFormat.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/RelativeJsonPointerFormat.md index 0d4605cf12f..ec19588c4a7 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/RelativeJsonPointerFormat.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/RelativeJsonPointerFormat.md @@ -4,23 +4,23 @@ public class RelativeJsonPointerFormat
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [RelativeJsonPointerFormat.RelativeJsonPointerFormat1Boxed](#relativejsonpointerformat1boxed)
abstract sealed validated payload class | -| static class | [RelativeJsonPointerFormat.RelativeJsonPointerFormat1BoxedVoid](#relativejsonpointerformat1boxedvoid)
boxed class to store validated null payloads | -| static class | [RelativeJsonPointerFormat.RelativeJsonPointerFormat1BoxedBoolean](#relativejsonpointerformat1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [RelativeJsonPointerFormat.RelativeJsonPointerFormat1BoxedNumber](#relativejsonpointerformat1boxednumber)
boxed class to store validated Number payloads | -| static class | [RelativeJsonPointerFormat.RelativeJsonPointerFormat1BoxedString](#relativejsonpointerformat1boxedstring)
boxed class to store validated String payloads | -| static class | [RelativeJsonPointerFormat.RelativeJsonPointerFormat1BoxedList](#relativejsonpointerformat1boxedlist)
boxed class to store validated List payloads | -| static class | [RelativeJsonPointerFormat.RelativeJsonPointerFormat1BoxedMap](#relativejsonpointerformat1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [RelativeJsonPointerFormat.RelativeJsonPointerFormat1Boxed](#relativejsonpointerformat1boxed)
sealed interface for validated payloads | +| record | [RelativeJsonPointerFormat.RelativeJsonPointerFormat1BoxedVoid](#relativejsonpointerformat1boxedvoid)
boxed class to store validated null payloads | +| record | [RelativeJsonPointerFormat.RelativeJsonPointerFormat1BoxedBoolean](#relativejsonpointerformat1boxedboolean)
boxed class to store validated boolean payloads | +| record | [RelativeJsonPointerFormat.RelativeJsonPointerFormat1BoxedNumber](#relativejsonpointerformat1boxednumber)
boxed class to store validated Number payloads | +| record | [RelativeJsonPointerFormat.RelativeJsonPointerFormat1BoxedString](#relativejsonpointerformat1boxedstring)
boxed class to store validated String payloads | +| record | [RelativeJsonPointerFormat.RelativeJsonPointerFormat1BoxedList](#relativejsonpointerformat1boxedlist)
boxed class to store validated List payloads | +| record | [RelativeJsonPointerFormat.RelativeJsonPointerFormat1BoxedMap](#relativejsonpointerformat1boxedmap)
boxed class to store validated Map payloads | | static class | [RelativeJsonPointerFormat.RelativeJsonPointerFormat1](#relativejsonpointerformat1)
schema class | ## RelativeJsonPointerFormat1Boxed -public static abstract sealed class RelativeJsonPointerFormat1Boxed
+public sealed interface RelativeJsonPointerFormat1Boxed
permits
[RelativeJsonPointerFormat1BoxedVoid](#relativejsonpointerformat1boxedvoid), [RelativeJsonPointerFormat1BoxedBoolean](#relativejsonpointerformat1boxedboolean), @@ -29,103 +29,109 @@ permits
[RelativeJsonPointerFormat1BoxedList](#relativejsonpointerformat1boxedlist), [RelativeJsonPointerFormat1BoxedMap](#relativejsonpointerformat1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## RelativeJsonPointerFormat1BoxedVoid -public static final class RelativeJsonPointerFormat1BoxedVoid
-extends [RelativeJsonPointerFormat1Boxed](#relativejsonpointerformat1boxed) +public record RelativeJsonPointerFormat1BoxedVoid
+implements [RelativeJsonPointerFormat1Boxed](#relativejsonpointerformat1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RelativeJsonPointerFormat1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RelativeJsonPointerFormat1BoxedBoolean -public static final class RelativeJsonPointerFormat1BoxedBoolean
-extends [RelativeJsonPointerFormat1Boxed](#relativejsonpointerformat1boxed) +public record RelativeJsonPointerFormat1BoxedBoolean
+implements [RelativeJsonPointerFormat1Boxed](#relativejsonpointerformat1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RelativeJsonPointerFormat1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RelativeJsonPointerFormat1BoxedNumber -public static final class RelativeJsonPointerFormat1BoxedNumber
-extends [RelativeJsonPointerFormat1Boxed](#relativejsonpointerformat1boxed) +public record RelativeJsonPointerFormat1BoxedNumber
+implements [RelativeJsonPointerFormat1Boxed](#relativejsonpointerformat1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RelativeJsonPointerFormat1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RelativeJsonPointerFormat1BoxedString -public static final class RelativeJsonPointerFormat1BoxedString
-extends [RelativeJsonPointerFormat1Boxed](#relativejsonpointerformat1boxed) +public record RelativeJsonPointerFormat1BoxedString
+implements [RelativeJsonPointerFormat1Boxed](#relativejsonpointerformat1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RelativeJsonPointerFormat1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RelativeJsonPointerFormat1BoxedList -public static final class RelativeJsonPointerFormat1BoxedList
-extends [RelativeJsonPointerFormat1Boxed](#relativejsonpointerformat1boxed) +public record RelativeJsonPointerFormat1BoxedList
+implements [RelativeJsonPointerFormat1Boxed](#relativejsonpointerformat1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RelativeJsonPointerFormat1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RelativeJsonPointerFormat1BoxedMap -public static final class RelativeJsonPointerFormat1BoxedMap
-extends [RelativeJsonPointerFormat1Boxed](#relativejsonpointerformat1boxed) +public record RelativeJsonPointerFormat1BoxedMap
+implements [RelativeJsonPointerFormat1Boxed](#relativejsonpointerformat1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RelativeJsonPointerFormat1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RelativeJsonPointerFormat1 public static class RelativeJsonPointerFormat1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [RelativeJsonPointerFormat1BoxedBoolean](#relativejsonpointerformat1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [RelativeJsonPointerFormat1BoxedMap](#relativejsonpointerformat1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [RelativeJsonPointerFormat1BoxedList](#relativejsonpointerformat1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [RelativeJsonPointerFormat1Boxed](#relativejsonpointerformat1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/RequiredDefaultValidation.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/RequiredDefaultValidation.md index e50e0a3c2e1..365a4f96ff4 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/RequiredDefaultValidation.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/RequiredDefaultValidation.md @@ -4,7 +4,7 @@ public class RequiredDefaultValidation
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,27 +12,27 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [RequiredDefaultValidation.RequiredDefaultValidation1Boxed](#requireddefaultvalidation1boxed)
abstract sealed validated payload class | -| static class | [RequiredDefaultValidation.RequiredDefaultValidation1BoxedVoid](#requireddefaultvalidation1boxedvoid)
boxed class to store validated null payloads | -| static class | [RequiredDefaultValidation.RequiredDefaultValidation1BoxedBoolean](#requireddefaultvalidation1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [RequiredDefaultValidation.RequiredDefaultValidation1BoxedNumber](#requireddefaultvalidation1boxednumber)
boxed class to store validated Number payloads | -| static class | [RequiredDefaultValidation.RequiredDefaultValidation1BoxedString](#requireddefaultvalidation1boxedstring)
boxed class to store validated String payloads | -| static class | [RequiredDefaultValidation.RequiredDefaultValidation1BoxedList](#requireddefaultvalidation1boxedlist)
boxed class to store validated List payloads | -| static class | [RequiredDefaultValidation.RequiredDefaultValidation1BoxedMap](#requireddefaultvalidation1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [RequiredDefaultValidation.RequiredDefaultValidation1Boxed](#requireddefaultvalidation1boxed)
sealed interface for validated payloads | +| record | [RequiredDefaultValidation.RequiredDefaultValidation1BoxedVoid](#requireddefaultvalidation1boxedvoid)
boxed class to store validated null payloads | +| record | [RequiredDefaultValidation.RequiredDefaultValidation1BoxedBoolean](#requireddefaultvalidation1boxedboolean)
boxed class to store validated boolean payloads | +| record | [RequiredDefaultValidation.RequiredDefaultValidation1BoxedNumber](#requireddefaultvalidation1boxednumber)
boxed class to store validated Number payloads | +| record | [RequiredDefaultValidation.RequiredDefaultValidation1BoxedString](#requireddefaultvalidation1boxedstring)
boxed class to store validated String payloads | +| record | [RequiredDefaultValidation.RequiredDefaultValidation1BoxedList](#requireddefaultvalidation1boxedlist)
boxed class to store validated List payloads | +| record | [RequiredDefaultValidation.RequiredDefaultValidation1BoxedMap](#requireddefaultvalidation1boxedmap)
boxed class to store validated Map payloads | | static class | [RequiredDefaultValidation.RequiredDefaultValidation1](#requireddefaultvalidation1)
schema class | | static class | [RequiredDefaultValidation.RequiredDefaultValidationMapBuilder](#requireddefaultvalidationmapbuilder)
builder for Map payloads | | static class | [RequiredDefaultValidation.RequiredDefaultValidationMap](#requireddefaultvalidationmap)
output class for Map payloads | -| static class | [RequiredDefaultValidation.FooBoxed](#fooboxed)
abstract sealed validated payload class | -| static class | [RequiredDefaultValidation.FooBoxedVoid](#fooboxedvoid)
boxed class to store validated null payloads | -| static class | [RequiredDefaultValidation.FooBoxedBoolean](#fooboxedboolean)
boxed class to store validated boolean payloads | -| static class | [RequiredDefaultValidation.FooBoxedNumber](#fooboxednumber)
boxed class to store validated Number payloads | -| static class | [RequiredDefaultValidation.FooBoxedString](#fooboxedstring)
boxed class to store validated String payloads | -| static class | [RequiredDefaultValidation.FooBoxedList](#fooboxedlist)
boxed class to store validated List payloads | -| static class | [RequiredDefaultValidation.FooBoxedMap](#fooboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [RequiredDefaultValidation.FooBoxed](#fooboxed)
sealed interface for validated payloads | +| record | [RequiredDefaultValidation.FooBoxedVoid](#fooboxedvoid)
boxed class to store validated null payloads | +| record | [RequiredDefaultValidation.FooBoxedBoolean](#fooboxedboolean)
boxed class to store validated boolean payloads | +| record | [RequiredDefaultValidation.FooBoxedNumber](#fooboxednumber)
boxed class to store validated Number payloads | +| record | [RequiredDefaultValidation.FooBoxedString](#fooboxedstring)
boxed class to store validated String payloads | +| record | [RequiredDefaultValidation.FooBoxedList](#fooboxedlist)
boxed class to store validated List payloads | +| record | [RequiredDefaultValidation.FooBoxedMap](#fooboxedmap)
boxed class to store validated Map payloads | | static class | [RequiredDefaultValidation.Foo](#foo)
schema class | ## RequiredDefaultValidation1Boxed -public static abstract sealed class RequiredDefaultValidation1Boxed
+public sealed interface RequiredDefaultValidation1Boxed
permits
[RequiredDefaultValidation1BoxedVoid](#requireddefaultvalidation1boxedvoid), [RequiredDefaultValidation1BoxedBoolean](#requireddefaultvalidation1boxedboolean), @@ -41,103 +41,109 @@ permits
[RequiredDefaultValidation1BoxedList](#requireddefaultvalidation1boxedlist), [RequiredDefaultValidation1BoxedMap](#requireddefaultvalidation1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## RequiredDefaultValidation1BoxedVoid -public static final class RequiredDefaultValidation1BoxedVoid
-extends [RequiredDefaultValidation1Boxed](#requireddefaultvalidation1boxed) +public record RequiredDefaultValidation1BoxedVoid
+implements [RequiredDefaultValidation1Boxed](#requireddefaultvalidation1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RequiredDefaultValidation1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RequiredDefaultValidation1BoxedBoolean -public static final class RequiredDefaultValidation1BoxedBoolean
-extends [RequiredDefaultValidation1Boxed](#requireddefaultvalidation1boxed) +public record RequiredDefaultValidation1BoxedBoolean
+implements [RequiredDefaultValidation1Boxed](#requireddefaultvalidation1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RequiredDefaultValidation1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RequiredDefaultValidation1BoxedNumber -public static final class RequiredDefaultValidation1BoxedNumber
-extends [RequiredDefaultValidation1Boxed](#requireddefaultvalidation1boxed) +public record RequiredDefaultValidation1BoxedNumber
+implements [RequiredDefaultValidation1Boxed](#requireddefaultvalidation1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RequiredDefaultValidation1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RequiredDefaultValidation1BoxedString -public static final class RequiredDefaultValidation1BoxedString
-extends [RequiredDefaultValidation1Boxed](#requireddefaultvalidation1boxed) +public record RequiredDefaultValidation1BoxedString
+implements [RequiredDefaultValidation1Boxed](#requireddefaultvalidation1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RequiredDefaultValidation1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RequiredDefaultValidation1BoxedList -public static final class RequiredDefaultValidation1BoxedList
-extends [RequiredDefaultValidation1Boxed](#requireddefaultvalidation1boxed) +public record RequiredDefaultValidation1BoxedList
+implements [RequiredDefaultValidation1Boxed](#requireddefaultvalidation1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RequiredDefaultValidation1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RequiredDefaultValidation1BoxedMap -public static final class RequiredDefaultValidation1BoxedMap
-extends [RequiredDefaultValidation1Boxed](#requireddefaultvalidation1boxed) +public record RequiredDefaultValidation1BoxedMap
+implements [RequiredDefaultValidation1Boxed](#requireddefaultvalidation1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RequiredDefaultValidation1BoxedMap([RequiredDefaultValidationMap](#requireddefaultvalidationmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [RequiredDefaultValidationMap](#requireddefaultvalidationmap) | data
validated payload | +| [RequiredDefaultValidationMap](#requireddefaultvalidationmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RequiredDefaultValidation1 public static class RequiredDefaultValidation1
@@ -169,7 +175,9 @@ A schema class that validates payloads | [RequiredDefaultValidation1BoxedBoolean](#requireddefaultvalidation1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [RequiredDefaultValidation1BoxedMap](#requireddefaultvalidation1boxedmap) | validateAndBox([Map<?, ?>](#requireddefaultvalidationmapbuilder) arg, SchemaConfiguration configuration) | | [RequiredDefaultValidation1BoxedList](#requireddefaultvalidation1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [RequiredDefaultValidation1Boxed](#requireddefaultvalidation1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## RequiredDefaultValidationMapBuilder public class RequiredDefaultValidationMapBuilder
builder for `Map` @@ -218,7 +226,7 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## FooBoxed -public static abstract sealed class FooBoxed
+public sealed interface FooBoxed
permits
[FooBoxedVoid](#fooboxedvoid), [FooBoxedBoolean](#fooboxedboolean), @@ -227,103 +235,109 @@ permits
[FooBoxedList](#fooboxedlist), [FooBoxedMap](#fooboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## FooBoxedVoid -public static final class FooBoxedVoid
-extends [FooBoxed](#fooboxed) +public record FooBoxedVoid
+implements [FooBoxed](#fooboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FooBoxedBoolean -public static final class FooBoxedBoolean
-extends [FooBoxed](#fooboxed) +public record FooBoxedBoolean
+implements [FooBoxed](#fooboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FooBoxedNumber -public static final class FooBoxedNumber
-extends [FooBoxed](#fooboxed) +public record FooBoxedNumber
+implements [FooBoxed](#fooboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FooBoxedString -public static final class FooBoxedString
-extends [FooBoxed](#fooboxed) +public record FooBoxedString
+implements [FooBoxed](#fooboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FooBoxedList -public static final class FooBoxedList
-extends [FooBoxed](#fooboxed) +public record FooBoxedList
+implements [FooBoxed](#fooboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FooBoxedMap -public static final class FooBoxedMap
-extends [FooBoxed](#fooboxed) +public record FooBoxedMap
+implements [FooBoxed](#fooboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Foo public static class Foo
diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames.md index 94e20aa9733..9fe35d634ae 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames.md @@ -4,7 +4,7 @@ public class RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,19 +12,19 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames.RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1Boxed](#requiredpropertieswhosenamesarejavascriptobjectpropertynames1boxed)
abstract sealed validated payload class | -| static class | [RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames.RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedVoid](#requiredpropertieswhosenamesarejavascriptobjectpropertynames1boxedvoid)
boxed class to store validated null payloads | -| static class | [RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames.RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedBoolean](#requiredpropertieswhosenamesarejavascriptobjectpropertynames1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames.RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedNumber](#requiredpropertieswhosenamesarejavascriptobjectpropertynames1boxednumber)
boxed class to store validated Number payloads | -| static class | [RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames.RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedString](#requiredpropertieswhosenamesarejavascriptobjectpropertynames1boxedstring)
boxed class to store validated String payloads | -| static class | [RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames.RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedList](#requiredpropertieswhosenamesarejavascriptobjectpropertynames1boxedlist)
boxed class to store validated List payloads | -| static class | [RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames.RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedMap](#requiredpropertieswhosenamesarejavascriptobjectpropertynames1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames.RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1Boxed](#requiredpropertieswhosenamesarejavascriptobjectpropertynames1boxed)
sealed interface for validated payloads | +| record | [RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames.RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedVoid](#requiredpropertieswhosenamesarejavascriptobjectpropertynames1boxedvoid)
boxed class to store validated null payloads | +| record | [RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames.RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedBoolean](#requiredpropertieswhosenamesarejavascriptobjectpropertynames1boxedboolean)
boxed class to store validated boolean payloads | +| record | [RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames.RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedNumber](#requiredpropertieswhosenamesarejavascriptobjectpropertynames1boxednumber)
boxed class to store validated Number payloads | +| record | [RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames.RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedString](#requiredpropertieswhosenamesarejavascriptobjectpropertynames1boxedstring)
boxed class to store validated String payloads | +| record | [RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames.RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedList](#requiredpropertieswhosenamesarejavascriptobjectpropertynames1boxedlist)
boxed class to store validated List payloads | +| record | [RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames.RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedMap](#requiredpropertieswhosenamesarejavascriptobjectpropertynames1boxedmap)
boxed class to store validated Map payloads | | static class | [RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames.RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1](#requiredpropertieswhosenamesarejavascriptobjectpropertynames1)
schema class | | static class | [RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames.RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNamesMapBuilder](#requiredpropertieswhosenamesarejavascriptobjectpropertynamesmapbuilder)
builder for Map payloads | | static class | [RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames.RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNamesMap](#requiredpropertieswhosenamesarejavascriptobjectpropertynamesmap)
output class for Map payloads | ## RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1Boxed -public static abstract sealed class RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1Boxed
+public sealed interface RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1Boxed
permits
[RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedVoid](#requiredpropertieswhosenamesarejavascriptobjectpropertynames1boxedvoid), [RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedBoolean](#requiredpropertieswhosenamesarejavascriptobjectpropertynames1boxedboolean), @@ -33,103 +33,109 @@ permits
[RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedList](#requiredpropertieswhosenamesarejavascriptobjectpropertynames1boxedlist), [RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedMap](#requiredpropertieswhosenamesarejavascriptobjectpropertynames1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedVoid -public static final class RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedVoid
-extends [RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1Boxed](#requiredpropertieswhosenamesarejavascriptobjectpropertynames1boxed) +public record RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedVoid
+implements [RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1Boxed](#requiredpropertieswhosenamesarejavascriptobjectpropertynames1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedBoolean -public static final class RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedBoolean
-extends [RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1Boxed](#requiredpropertieswhosenamesarejavascriptobjectpropertynames1boxed) +public record RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedBoolean
+implements [RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1Boxed](#requiredpropertieswhosenamesarejavascriptobjectpropertynames1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedNumber -public static final class RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedNumber
-extends [RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1Boxed](#requiredpropertieswhosenamesarejavascriptobjectpropertynames1boxed) +public record RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedNumber
+implements [RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1Boxed](#requiredpropertieswhosenamesarejavascriptobjectpropertynames1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedString -public static final class RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedString
-extends [RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1Boxed](#requiredpropertieswhosenamesarejavascriptobjectpropertynames1boxed) +public record RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedString
+implements [RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1Boxed](#requiredpropertieswhosenamesarejavascriptobjectpropertynames1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedList -public static final class RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedList
-extends [RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1Boxed](#requiredpropertieswhosenamesarejavascriptobjectpropertynames1boxed) +public record RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedList
+implements [RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1Boxed](#requiredpropertieswhosenamesarejavascriptobjectpropertynames1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedMap -public static final class RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedMap
-extends [RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1Boxed](#requiredpropertieswhosenamesarejavascriptobjectpropertynames1boxed) +public record RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedMap
+implements [RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1Boxed](#requiredpropertieswhosenamesarejavascriptobjectpropertynames1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedMap([RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNamesMap](#requiredpropertieswhosenamesarejavascriptobjectpropertynamesmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNamesMap](#requiredpropertieswhosenamesarejavascriptobjectpropertynamesmap) | data
validated payload | +| [RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNamesMap](#requiredpropertieswhosenamesarejavascriptobjectpropertynamesmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1 public static class RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1
@@ -161,7 +167,9 @@ A schema class that validates payloads | [RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedBoolean](#requiredpropertieswhosenamesarejavascriptobjectpropertynames1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedMap](#requiredpropertieswhosenamesarejavascriptobjectpropertynames1boxedmap) | validateAndBox([Map<?, ?>](#requiredpropertieswhosenamesarejavascriptobjectpropertynamesmapbuilder) arg, SchemaConfiguration configuration) | | [RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedList](#requiredpropertieswhosenamesarejavascriptobjectpropertynames1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1Boxed](#requiredpropertieswhosenamesarejavascriptobjectpropertynames1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNamesMap000Builder public class RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNamesMap000Builder
builder for `Map` diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/RequiredValidation.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/RequiredValidation.md index 8b9f025df75..8db2b0fbc2b 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/RequiredValidation.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/RequiredValidation.md @@ -4,7 +4,7 @@ public class RequiredValidation
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,35 +12,35 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [RequiredValidation.RequiredValidation1Boxed](#requiredvalidation1boxed)
abstract sealed validated payload class | -| static class | [RequiredValidation.RequiredValidation1BoxedVoid](#requiredvalidation1boxedvoid)
boxed class to store validated null payloads | -| static class | [RequiredValidation.RequiredValidation1BoxedBoolean](#requiredvalidation1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [RequiredValidation.RequiredValidation1BoxedNumber](#requiredvalidation1boxednumber)
boxed class to store validated Number payloads | -| static class | [RequiredValidation.RequiredValidation1BoxedString](#requiredvalidation1boxedstring)
boxed class to store validated String payloads | -| static class | [RequiredValidation.RequiredValidation1BoxedList](#requiredvalidation1boxedlist)
boxed class to store validated List payloads | -| static class | [RequiredValidation.RequiredValidation1BoxedMap](#requiredvalidation1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [RequiredValidation.RequiredValidation1Boxed](#requiredvalidation1boxed)
sealed interface for validated payloads | +| record | [RequiredValidation.RequiredValidation1BoxedVoid](#requiredvalidation1boxedvoid)
boxed class to store validated null payloads | +| record | [RequiredValidation.RequiredValidation1BoxedBoolean](#requiredvalidation1boxedboolean)
boxed class to store validated boolean payloads | +| record | [RequiredValidation.RequiredValidation1BoxedNumber](#requiredvalidation1boxednumber)
boxed class to store validated Number payloads | +| record | [RequiredValidation.RequiredValidation1BoxedString](#requiredvalidation1boxedstring)
boxed class to store validated String payloads | +| record | [RequiredValidation.RequiredValidation1BoxedList](#requiredvalidation1boxedlist)
boxed class to store validated List payloads | +| record | [RequiredValidation.RequiredValidation1BoxedMap](#requiredvalidation1boxedmap)
boxed class to store validated Map payloads | | static class | [RequiredValidation.RequiredValidation1](#requiredvalidation1)
schema class | | static class | [RequiredValidation.RequiredValidationMapBuilder](#requiredvalidationmapbuilder)
builder for Map payloads | | static class | [RequiredValidation.RequiredValidationMap](#requiredvalidationmap)
output class for Map payloads | -| static class | [RequiredValidation.BarBoxed](#barboxed)
abstract sealed validated payload class | -| static class | [RequiredValidation.BarBoxedVoid](#barboxedvoid)
boxed class to store validated null payloads | -| static class | [RequiredValidation.BarBoxedBoolean](#barboxedboolean)
boxed class to store validated boolean payloads | -| static class | [RequiredValidation.BarBoxedNumber](#barboxednumber)
boxed class to store validated Number payloads | -| static class | [RequiredValidation.BarBoxedString](#barboxedstring)
boxed class to store validated String payloads | -| static class | [RequiredValidation.BarBoxedList](#barboxedlist)
boxed class to store validated List payloads | -| static class | [RequiredValidation.BarBoxedMap](#barboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [RequiredValidation.BarBoxed](#barboxed)
sealed interface for validated payloads | +| record | [RequiredValidation.BarBoxedVoid](#barboxedvoid)
boxed class to store validated null payloads | +| record | [RequiredValidation.BarBoxedBoolean](#barboxedboolean)
boxed class to store validated boolean payloads | +| record | [RequiredValidation.BarBoxedNumber](#barboxednumber)
boxed class to store validated Number payloads | +| record | [RequiredValidation.BarBoxedString](#barboxedstring)
boxed class to store validated String payloads | +| record | [RequiredValidation.BarBoxedList](#barboxedlist)
boxed class to store validated List payloads | +| record | [RequiredValidation.BarBoxedMap](#barboxedmap)
boxed class to store validated Map payloads | | static class | [RequiredValidation.Bar](#bar)
schema class | -| static class | [RequiredValidation.FooBoxed](#fooboxed)
abstract sealed validated payload class | -| static class | [RequiredValidation.FooBoxedVoid](#fooboxedvoid)
boxed class to store validated null payloads | -| static class | [RequiredValidation.FooBoxedBoolean](#fooboxedboolean)
boxed class to store validated boolean payloads | -| static class | [RequiredValidation.FooBoxedNumber](#fooboxednumber)
boxed class to store validated Number payloads | -| static class | [RequiredValidation.FooBoxedString](#fooboxedstring)
boxed class to store validated String payloads | -| static class | [RequiredValidation.FooBoxedList](#fooboxedlist)
boxed class to store validated List payloads | -| static class | [RequiredValidation.FooBoxedMap](#fooboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [RequiredValidation.FooBoxed](#fooboxed)
sealed interface for validated payloads | +| record | [RequiredValidation.FooBoxedVoid](#fooboxedvoid)
boxed class to store validated null payloads | +| record | [RequiredValidation.FooBoxedBoolean](#fooboxedboolean)
boxed class to store validated boolean payloads | +| record | [RequiredValidation.FooBoxedNumber](#fooboxednumber)
boxed class to store validated Number payloads | +| record | [RequiredValidation.FooBoxedString](#fooboxedstring)
boxed class to store validated String payloads | +| record | [RequiredValidation.FooBoxedList](#fooboxedlist)
boxed class to store validated List payloads | +| record | [RequiredValidation.FooBoxedMap](#fooboxedmap)
boxed class to store validated Map payloads | | static class | [RequiredValidation.Foo](#foo)
schema class | ## RequiredValidation1Boxed -public static abstract sealed class RequiredValidation1Boxed
+public sealed interface RequiredValidation1Boxed
permits
[RequiredValidation1BoxedVoid](#requiredvalidation1boxedvoid), [RequiredValidation1BoxedBoolean](#requiredvalidation1boxedboolean), @@ -49,103 +49,109 @@ permits
[RequiredValidation1BoxedList](#requiredvalidation1boxedlist), [RequiredValidation1BoxedMap](#requiredvalidation1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## RequiredValidation1BoxedVoid -public static final class RequiredValidation1BoxedVoid
-extends [RequiredValidation1Boxed](#requiredvalidation1boxed) +public record RequiredValidation1BoxedVoid
+implements [RequiredValidation1Boxed](#requiredvalidation1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RequiredValidation1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RequiredValidation1BoxedBoolean -public static final class RequiredValidation1BoxedBoolean
-extends [RequiredValidation1Boxed](#requiredvalidation1boxed) +public record RequiredValidation1BoxedBoolean
+implements [RequiredValidation1Boxed](#requiredvalidation1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RequiredValidation1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RequiredValidation1BoxedNumber -public static final class RequiredValidation1BoxedNumber
-extends [RequiredValidation1Boxed](#requiredvalidation1boxed) +public record RequiredValidation1BoxedNumber
+implements [RequiredValidation1Boxed](#requiredvalidation1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RequiredValidation1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RequiredValidation1BoxedString -public static final class RequiredValidation1BoxedString
-extends [RequiredValidation1Boxed](#requiredvalidation1boxed) +public record RequiredValidation1BoxedString
+implements [RequiredValidation1Boxed](#requiredvalidation1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RequiredValidation1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RequiredValidation1BoxedList -public static final class RequiredValidation1BoxedList
-extends [RequiredValidation1Boxed](#requiredvalidation1boxed) +public record RequiredValidation1BoxedList
+implements [RequiredValidation1Boxed](#requiredvalidation1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RequiredValidation1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RequiredValidation1BoxedMap -public static final class RequiredValidation1BoxedMap
-extends [RequiredValidation1Boxed](#requiredvalidation1boxed) +public record RequiredValidation1BoxedMap
+implements [RequiredValidation1Boxed](#requiredvalidation1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RequiredValidation1BoxedMap([RequiredValidationMap](#requiredvalidationmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [RequiredValidationMap](#requiredvalidationmap) | data
validated payload | +| [RequiredValidationMap](#requiredvalidationmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RequiredValidation1 public static class RequiredValidation1
@@ -178,7 +184,9 @@ A schema class that validates payloads | [RequiredValidation1BoxedBoolean](#requiredvalidation1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [RequiredValidation1BoxedMap](#requiredvalidation1boxedmap) | validateAndBox([Map<?, ?>](#requiredvalidationmapbuilder) arg, SchemaConfiguration configuration) | | [RequiredValidation1BoxedList](#requiredvalidation1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [RequiredValidation1Boxed](#requiredvalidation1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## RequiredValidationMap0Builder public class RequiredValidationMap0Builder
builder for `Map` @@ -252,7 +260,7 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## BarBoxed -public static abstract sealed class BarBoxed
+public sealed interface BarBoxed
permits
[BarBoxedVoid](#barboxedvoid), [BarBoxedBoolean](#barboxedboolean), @@ -261,103 +269,109 @@ permits
[BarBoxedList](#barboxedlist), [BarBoxedMap](#barboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## BarBoxedVoid -public static final class BarBoxedVoid
-extends [BarBoxed](#barboxed) +public record BarBoxedVoid
+implements [BarBoxed](#barboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BarBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## BarBoxedBoolean -public static final class BarBoxedBoolean
-extends [BarBoxed](#barboxed) +public record BarBoxedBoolean
+implements [BarBoxed](#barboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BarBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## BarBoxedNumber -public static final class BarBoxedNumber
-extends [BarBoxed](#barboxed) +public record BarBoxedNumber
+implements [BarBoxed](#barboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BarBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## BarBoxedString -public static final class BarBoxedString
-extends [BarBoxed](#barboxed) +public record BarBoxedString
+implements [BarBoxed](#barboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BarBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## BarBoxedList -public static final class BarBoxedList
-extends [BarBoxed](#barboxed) +public record BarBoxedList
+implements [BarBoxed](#barboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BarBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## BarBoxedMap -public static final class BarBoxedMap
-extends [BarBoxed](#barboxed) +public record BarBoxedMap
+implements [BarBoxed](#barboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BarBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Bar public static class Bar
@@ -371,7 +385,7 @@ A schema class that validates payloads | validateAndBox | ## FooBoxed -public static abstract sealed class FooBoxed
+public sealed interface FooBoxed
permits
[FooBoxedVoid](#fooboxedvoid), [FooBoxedBoolean](#fooboxedboolean), @@ -380,103 +394,109 @@ permits
[FooBoxedList](#fooboxedlist), [FooBoxedMap](#fooboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## FooBoxedVoid -public static final class FooBoxedVoid
-extends [FooBoxed](#fooboxed) +public record FooBoxedVoid
+implements [FooBoxed](#fooboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FooBoxedBoolean -public static final class FooBoxedBoolean
-extends [FooBoxed](#fooboxed) +public record FooBoxedBoolean
+implements [FooBoxed](#fooboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FooBoxedNumber -public static final class FooBoxedNumber
-extends [FooBoxed](#fooboxed) +public record FooBoxedNumber
+implements [FooBoxed](#fooboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FooBoxedString -public static final class FooBoxedString
-extends [FooBoxed](#fooboxed) +public record FooBoxedString
+implements [FooBoxed](#fooboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FooBoxedList -public static final class FooBoxedList
-extends [FooBoxed](#fooboxed) +public record FooBoxedList
+implements [FooBoxed](#fooboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FooBoxedMap -public static final class FooBoxedMap
-extends [FooBoxed](#fooboxed) +public record FooBoxedMap
+implements [FooBoxed](#fooboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Foo public static class Foo
diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/RequiredWithEmptyArray.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/RequiredWithEmptyArray.md index 91edade5906..a1761569c18 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/RequiredWithEmptyArray.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/RequiredWithEmptyArray.md @@ -4,7 +4,7 @@ public class RequiredWithEmptyArray
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,27 +12,27 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [RequiredWithEmptyArray.RequiredWithEmptyArray1Boxed](#requiredwithemptyarray1boxed)
abstract sealed validated payload class | -| static class | [RequiredWithEmptyArray.RequiredWithEmptyArray1BoxedVoid](#requiredwithemptyarray1boxedvoid)
boxed class to store validated null payloads | -| static class | [RequiredWithEmptyArray.RequiredWithEmptyArray1BoxedBoolean](#requiredwithemptyarray1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [RequiredWithEmptyArray.RequiredWithEmptyArray1BoxedNumber](#requiredwithemptyarray1boxednumber)
boxed class to store validated Number payloads | -| static class | [RequiredWithEmptyArray.RequiredWithEmptyArray1BoxedString](#requiredwithemptyarray1boxedstring)
boxed class to store validated String payloads | -| static class | [RequiredWithEmptyArray.RequiredWithEmptyArray1BoxedList](#requiredwithemptyarray1boxedlist)
boxed class to store validated List payloads | -| static class | [RequiredWithEmptyArray.RequiredWithEmptyArray1BoxedMap](#requiredwithemptyarray1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [RequiredWithEmptyArray.RequiredWithEmptyArray1Boxed](#requiredwithemptyarray1boxed)
sealed interface for validated payloads | +| record | [RequiredWithEmptyArray.RequiredWithEmptyArray1BoxedVoid](#requiredwithemptyarray1boxedvoid)
boxed class to store validated null payloads | +| record | [RequiredWithEmptyArray.RequiredWithEmptyArray1BoxedBoolean](#requiredwithemptyarray1boxedboolean)
boxed class to store validated boolean payloads | +| record | [RequiredWithEmptyArray.RequiredWithEmptyArray1BoxedNumber](#requiredwithemptyarray1boxednumber)
boxed class to store validated Number payloads | +| record | [RequiredWithEmptyArray.RequiredWithEmptyArray1BoxedString](#requiredwithemptyarray1boxedstring)
boxed class to store validated String payloads | +| record | [RequiredWithEmptyArray.RequiredWithEmptyArray1BoxedList](#requiredwithemptyarray1boxedlist)
boxed class to store validated List payloads | +| record | [RequiredWithEmptyArray.RequiredWithEmptyArray1BoxedMap](#requiredwithemptyarray1boxedmap)
boxed class to store validated Map payloads | | static class | [RequiredWithEmptyArray.RequiredWithEmptyArray1](#requiredwithemptyarray1)
schema class | | static class | [RequiredWithEmptyArray.RequiredWithEmptyArrayMapBuilder](#requiredwithemptyarraymapbuilder)
builder for Map payloads | | static class | [RequiredWithEmptyArray.RequiredWithEmptyArrayMap](#requiredwithemptyarraymap)
output class for Map payloads | -| static class | [RequiredWithEmptyArray.FooBoxed](#fooboxed)
abstract sealed validated payload class | -| static class | [RequiredWithEmptyArray.FooBoxedVoid](#fooboxedvoid)
boxed class to store validated null payloads | -| static class | [RequiredWithEmptyArray.FooBoxedBoolean](#fooboxedboolean)
boxed class to store validated boolean payloads | -| static class | [RequiredWithEmptyArray.FooBoxedNumber](#fooboxednumber)
boxed class to store validated Number payloads | -| static class | [RequiredWithEmptyArray.FooBoxedString](#fooboxedstring)
boxed class to store validated String payloads | -| static class | [RequiredWithEmptyArray.FooBoxedList](#fooboxedlist)
boxed class to store validated List payloads | -| static class | [RequiredWithEmptyArray.FooBoxedMap](#fooboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [RequiredWithEmptyArray.FooBoxed](#fooboxed)
sealed interface for validated payloads | +| record | [RequiredWithEmptyArray.FooBoxedVoid](#fooboxedvoid)
boxed class to store validated null payloads | +| record | [RequiredWithEmptyArray.FooBoxedBoolean](#fooboxedboolean)
boxed class to store validated boolean payloads | +| record | [RequiredWithEmptyArray.FooBoxedNumber](#fooboxednumber)
boxed class to store validated Number payloads | +| record | [RequiredWithEmptyArray.FooBoxedString](#fooboxedstring)
boxed class to store validated String payloads | +| record | [RequiredWithEmptyArray.FooBoxedList](#fooboxedlist)
boxed class to store validated List payloads | +| record | [RequiredWithEmptyArray.FooBoxedMap](#fooboxedmap)
boxed class to store validated Map payloads | | static class | [RequiredWithEmptyArray.Foo](#foo)
schema class | ## RequiredWithEmptyArray1Boxed -public static abstract sealed class RequiredWithEmptyArray1Boxed
+public sealed interface RequiredWithEmptyArray1Boxed
permits
[RequiredWithEmptyArray1BoxedVoid](#requiredwithemptyarray1boxedvoid), [RequiredWithEmptyArray1BoxedBoolean](#requiredwithemptyarray1boxedboolean), @@ -41,103 +41,109 @@ permits
[RequiredWithEmptyArray1BoxedList](#requiredwithemptyarray1boxedlist), [RequiredWithEmptyArray1BoxedMap](#requiredwithemptyarray1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## RequiredWithEmptyArray1BoxedVoid -public static final class RequiredWithEmptyArray1BoxedVoid
-extends [RequiredWithEmptyArray1Boxed](#requiredwithemptyarray1boxed) +public record RequiredWithEmptyArray1BoxedVoid
+implements [RequiredWithEmptyArray1Boxed](#requiredwithemptyarray1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RequiredWithEmptyArray1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RequiredWithEmptyArray1BoxedBoolean -public static final class RequiredWithEmptyArray1BoxedBoolean
-extends [RequiredWithEmptyArray1Boxed](#requiredwithemptyarray1boxed) +public record RequiredWithEmptyArray1BoxedBoolean
+implements [RequiredWithEmptyArray1Boxed](#requiredwithemptyarray1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RequiredWithEmptyArray1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RequiredWithEmptyArray1BoxedNumber -public static final class RequiredWithEmptyArray1BoxedNumber
-extends [RequiredWithEmptyArray1Boxed](#requiredwithemptyarray1boxed) +public record RequiredWithEmptyArray1BoxedNumber
+implements [RequiredWithEmptyArray1Boxed](#requiredwithemptyarray1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RequiredWithEmptyArray1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RequiredWithEmptyArray1BoxedString -public static final class RequiredWithEmptyArray1BoxedString
-extends [RequiredWithEmptyArray1Boxed](#requiredwithemptyarray1boxed) +public record RequiredWithEmptyArray1BoxedString
+implements [RequiredWithEmptyArray1Boxed](#requiredwithemptyarray1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RequiredWithEmptyArray1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RequiredWithEmptyArray1BoxedList -public static final class RequiredWithEmptyArray1BoxedList
-extends [RequiredWithEmptyArray1Boxed](#requiredwithemptyarray1boxed) +public record RequiredWithEmptyArray1BoxedList
+implements [RequiredWithEmptyArray1Boxed](#requiredwithemptyarray1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RequiredWithEmptyArray1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RequiredWithEmptyArray1BoxedMap -public static final class RequiredWithEmptyArray1BoxedMap
-extends [RequiredWithEmptyArray1Boxed](#requiredwithemptyarray1boxed) +public record RequiredWithEmptyArray1BoxedMap
+implements [RequiredWithEmptyArray1Boxed](#requiredwithemptyarray1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RequiredWithEmptyArray1BoxedMap([RequiredWithEmptyArrayMap](#requiredwithemptyarraymap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [RequiredWithEmptyArrayMap](#requiredwithemptyarraymap) | data
validated payload | +| [RequiredWithEmptyArrayMap](#requiredwithemptyarraymap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RequiredWithEmptyArray1 public static class RequiredWithEmptyArray1
@@ -169,7 +175,9 @@ A schema class that validates payloads | [RequiredWithEmptyArray1BoxedBoolean](#requiredwithemptyarray1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [RequiredWithEmptyArray1BoxedMap](#requiredwithemptyarray1boxedmap) | validateAndBox([Map<?, ?>](#requiredwithemptyarraymapbuilder) arg, SchemaConfiguration configuration) | | [RequiredWithEmptyArray1BoxedList](#requiredwithemptyarray1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [RequiredWithEmptyArray1Boxed](#requiredwithemptyarray1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## RequiredWithEmptyArrayMapBuilder public class RequiredWithEmptyArrayMapBuilder
builder for `Map` @@ -218,7 +226,7 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## FooBoxed -public static abstract sealed class FooBoxed
+public sealed interface FooBoxed
permits
[FooBoxedVoid](#fooboxedvoid), [FooBoxedBoolean](#fooboxedboolean), @@ -227,103 +235,109 @@ permits
[FooBoxedList](#fooboxedlist), [FooBoxedMap](#fooboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## FooBoxedVoid -public static final class FooBoxedVoid
-extends [FooBoxed](#fooboxed) +public record FooBoxedVoid
+implements [FooBoxed](#fooboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FooBoxedBoolean -public static final class FooBoxedBoolean
-extends [FooBoxed](#fooboxed) +public record FooBoxedBoolean
+implements [FooBoxed](#fooboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FooBoxedNumber -public static final class FooBoxedNumber
-extends [FooBoxed](#fooboxed) +public record FooBoxedNumber
+implements [FooBoxed](#fooboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FooBoxedString -public static final class FooBoxedString
-extends [FooBoxed](#fooboxed) +public record FooBoxedString
+implements [FooBoxed](#fooboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FooBoxedList -public static final class FooBoxedList
-extends [FooBoxed](#fooboxed) +public record FooBoxedList
+implements [FooBoxed](#fooboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FooBoxedMap -public static final class FooBoxedMap
-extends [FooBoxed](#fooboxed) +public record FooBoxedMap
+implements [FooBoxed](#fooboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Foo public static class Foo
diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/RequiredWithEscapedCharacters.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/RequiredWithEscapedCharacters.md index 284e500c4d3..753c5d0241d 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/RequiredWithEscapedCharacters.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/RequiredWithEscapedCharacters.md @@ -4,7 +4,7 @@ public class RequiredWithEscapedCharacters
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,19 +12,19 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [RequiredWithEscapedCharacters.RequiredWithEscapedCharacters1Boxed](#requiredwithescapedcharacters1boxed)
abstract sealed validated payload class | -| static class | [RequiredWithEscapedCharacters.RequiredWithEscapedCharacters1BoxedVoid](#requiredwithescapedcharacters1boxedvoid)
boxed class to store validated null payloads | -| static class | [RequiredWithEscapedCharacters.RequiredWithEscapedCharacters1BoxedBoolean](#requiredwithescapedcharacters1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [RequiredWithEscapedCharacters.RequiredWithEscapedCharacters1BoxedNumber](#requiredwithescapedcharacters1boxednumber)
boxed class to store validated Number payloads | -| static class | [RequiredWithEscapedCharacters.RequiredWithEscapedCharacters1BoxedString](#requiredwithescapedcharacters1boxedstring)
boxed class to store validated String payloads | -| static class | [RequiredWithEscapedCharacters.RequiredWithEscapedCharacters1BoxedList](#requiredwithescapedcharacters1boxedlist)
boxed class to store validated List payloads | -| static class | [RequiredWithEscapedCharacters.RequiredWithEscapedCharacters1BoxedMap](#requiredwithescapedcharacters1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [RequiredWithEscapedCharacters.RequiredWithEscapedCharacters1Boxed](#requiredwithescapedcharacters1boxed)
sealed interface for validated payloads | +| record | [RequiredWithEscapedCharacters.RequiredWithEscapedCharacters1BoxedVoid](#requiredwithescapedcharacters1boxedvoid)
boxed class to store validated null payloads | +| record | [RequiredWithEscapedCharacters.RequiredWithEscapedCharacters1BoxedBoolean](#requiredwithescapedcharacters1boxedboolean)
boxed class to store validated boolean payloads | +| record | [RequiredWithEscapedCharacters.RequiredWithEscapedCharacters1BoxedNumber](#requiredwithescapedcharacters1boxednumber)
boxed class to store validated Number payloads | +| record | [RequiredWithEscapedCharacters.RequiredWithEscapedCharacters1BoxedString](#requiredwithescapedcharacters1boxedstring)
boxed class to store validated String payloads | +| record | [RequiredWithEscapedCharacters.RequiredWithEscapedCharacters1BoxedList](#requiredwithescapedcharacters1boxedlist)
boxed class to store validated List payloads | +| record | [RequiredWithEscapedCharacters.RequiredWithEscapedCharacters1BoxedMap](#requiredwithescapedcharacters1boxedmap)
boxed class to store validated Map payloads | | static class | [RequiredWithEscapedCharacters.RequiredWithEscapedCharacters1](#requiredwithescapedcharacters1)
schema class | | static class | [RequiredWithEscapedCharacters.RequiredWithEscapedCharactersMapBuilder](#requiredwithescapedcharactersmapbuilder)
builder for Map payloads | | static class | [RequiredWithEscapedCharacters.RequiredWithEscapedCharactersMap](#requiredwithescapedcharactersmap)
output class for Map payloads | ## RequiredWithEscapedCharacters1Boxed -public static abstract sealed class RequiredWithEscapedCharacters1Boxed
+public sealed interface RequiredWithEscapedCharacters1Boxed
permits
[RequiredWithEscapedCharacters1BoxedVoid](#requiredwithescapedcharacters1boxedvoid), [RequiredWithEscapedCharacters1BoxedBoolean](#requiredwithescapedcharacters1boxedboolean), @@ -33,103 +33,109 @@ permits
[RequiredWithEscapedCharacters1BoxedList](#requiredwithescapedcharacters1boxedlist), [RequiredWithEscapedCharacters1BoxedMap](#requiredwithescapedcharacters1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## RequiredWithEscapedCharacters1BoxedVoid -public static final class RequiredWithEscapedCharacters1BoxedVoid
-extends [RequiredWithEscapedCharacters1Boxed](#requiredwithescapedcharacters1boxed) +public record RequiredWithEscapedCharacters1BoxedVoid
+implements [RequiredWithEscapedCharacters1Boxed](#requiredwithescapedcharacters1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RequiredWithEscapedCharacters1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RequiredWithEscapedCharacters1BoxedBoolean -public static final class RequiredWithEscapedCharacters1BoxedBoolean
-extends [RequiredWithEscapedCharacters1Boxed](#requiredwithescapedcharacters1boxed) +public record RequiredWithEscapedCharacters1BoxedBoolean
+implements [RequiredWithEscapedCharacters1Boxed](#requiredwithescapedcharacters1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RequiredWithEscapedCharacters1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RequiredWithEscapedCharacters1BoxedNumber -public static final class RequiredWithEscapedCharacters1BoxedNumber
-extends [RequiredWithEscapedCharacters1Boxed](#requiredwithescapedcharacters1boxed) +public record RequiredWithEscapedCharacters1BoxedNumber
+implements [RequiredWithEscapedCharacters1Boxed](#requiredwithescapedcharacters1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RequiredWithEscapedCharacters1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RequiredWithEscapedCharacters1BoxedString -public static final class RequiredWithEscapedCharacters1BoxedString
-extends [RequiredWithEscapedCharacters1Boxed](#requiredwithescapedcharacters1boxed) +public record RequiredWithEscapedCharacters1BoxedString
+implements [RequiredWithEscapedCharacters1Boxed](#requiredwithescapedcharacters1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RequiredWithEscapedCharacters1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RequiredWithEscapedCharacters1BoxedList -public static final class RequiredWithEscapedCharacters1BoxedList
-extends [RequiredWithEscapedCharacters1Boxed](#requiredwithescapedcharacters1boxed) +public record RequiredWithEscapedCharacters1BoxedList
+implements [RequiredWithEscapedCharacters1Boxed](#requiredwithescapedcharacters1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RequiredWithEscapedCharacters1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RequiredWithEscapedCharacters1BoxedMap -public static final class RequiredWithEscapedCharacters1BoxedMap
-extends [RequiredWithEscapedCharacters1Boxed](#requiredwithescapedcharacters1boxed) +public record RequiredWithEscapedCharacters1BoxedMap
+implements [RequiredWithEscapedCharacters1Boxed](#requiredwithescapedcharacters1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | RequiredWithEscapedCharacters1BoxedMap([RequiredWithEscapedCharactersMap](#requiredwithescapedcharactersmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [RequiredWithEscapedCharactersMap](#requiredwithescapedcharactersmap) | data
validated payload | +| [RequiredWithEscapedCharactersMap](#requiredwithescapedcharactersmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## RequiredWithEscapedCharacters1 public static class RequiredWithEscapedCharacters1
@@ -161,7 +167,9 @@ A schema class that validates payloads | [RequiredWithEscapedCharacters1BoxedBoolean](#requiredwithescapedcharacters1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [RequiredWithEscapedCharacters1BoxedMap](#requiredwithescapedcharacters1boxedmap) | validateAndBox([Map<?, ?>](#requiredwithescapedcharactersmapbuilder) arg, SchemaConfiguration configuration) | | [RequiredWithEscapedCharacters1BoxedList](#requiredwithescapedcharacters1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [RequiredWithEscapedCharacters1Boxed](#requiredwithescapedcharacters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## RequiredWithEscapedCharactersMap000000Builder public class RequiredWithEscapedCharactersMap000000Builder
builder for `Map` diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/SimpleEnumValidation.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/SimpleEnumValidation.md index a1927ab15d9..f1b951c38a5 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/SimpleEnumValidation.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/SimpleEnumValidation.md @@ -4,15 +4,15 @@ public class SimpleEnumValidation
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - enum classes ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [SimpleEnumValidation.SimpleEnumValidation1Boxed](#simpleenumvalidation1boxed)
abstract sealed validated payload class | -| static class | [SimpleEnumValidation.SimpleEnumValidation1BoxedNumber](#simpleenumvalidation1boxednumber)
boxed class to store validated Number payloads | +| sealed interface | [SimpleEnumValidation.SimpleEnumValidation1Boxed](#simpleenumvalidation1boxed)
sealed interface for validated payloads | +| record | [SimpleEnumValidation.SimpleEnumValidation1BoxedNumber](#simpleenumvalidation1boxednumber)
boxed class to store validated Number payloads | | static class | [SimpleEnumValidation.SimpleEnumValidation1](#simpleenumvalidation1)
schema class | | enum | [SimpleEnumValidation.IntegerSimpleEnumValidationEnums](#integersimpleenumvalidationenums)
Integer enum | | enum | [SimpleEnumValidation.LongSimpleEnumValidationEnums](#longsimpleenumvalidationenums)
Long enum | @@ -20,27 +20,28 @@ A class that contains necessary nested | enum | [SimpleEnumValidation.DoubleSimpleEnumValidationEnums](#doublesimpleenumvalidationenums)
Double enum | ## SimpleEnumValidation1Boxed -public static abstract sealed class SimpleEnumValidation1Boxed
+public sealed interface SimpleEnumValidation1Boxed
permits
[SimpleEnumValidation1BoxedNumber](#simpleenumvalidation1boxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## SimpleEnumValidation1BoxedNumber -public static final class SimpleEnumValidation1BoxedNumber
-extends [SimpleEnumValidation1Boxed](#simpleenumvalidation1boxed) +public record SimpleEnumValidation1BoxedNumber
+implements [SimpleEnumValidation1Boxed](#simpleenumvalidation1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | SimpleEnumValidation1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## SimpleEnumValidation1 public static class SimpleEnumValidation1
@@ -81,7 +82,9 @@ int validatedPayload = SimpleEnumValidation.SimpleEnumValidation1.validate( | ----------------- | ---------------------- | | Number | validate(Number arg, SchemaConfiguration configuration) | | [SimpleEnumValidation1BoxedNumber](#simpleenumvalidation1boxednumber) | validateAndBox(Number arg, SchemaConfiguration configuration) | +| [SimpleEnumValidation1Boxed](#simpleenumvalidation1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## IntegerSimpleEnumValidationEnums public enum IntegerSimpleEnumValidationEnums
extends `Enum` diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/SingleDependency.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/SingleDependency.md index f013ae66dc6..feb7bdac989 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/SingleDependency.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/SingleDependency.md @@ -4,23 +4,23 @@ public class SingleDependency
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [SingleDependency.SingleDependency1Boxed](#singledependency1boxed)
abstract sealed validated payload class | -| static class | [SingleDependency.SingleDependency1BoxedVoid](#singledependency1boxedvoid)
boxed class to store validated null payloads | -| static class | [SingleDependency.SingleDependency1BoxedBoolean](#singledependency1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [SingleDependency.SingleDependency1BoxedNumber](#singledependency1boxednumber)
boxed class to store validated Number payloads | -| static class | [SingleDependency.SingleDependency1BoxedString](#singledependency1boxedstring)
boxed class to store validated String payloads | -| static class | [SingleDependency.SingleDependency1BoxedList](#singledependency1boxedlist)
boxed class to store validated List payloads | -| static class | [SingleDependency.SingleDependency1BoxedMap](#singledependency1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [SingleDependency.SingleDependency1Boxed](#singledependency1boxed)
sealed interface for validated payloads | +| record | [SingleDependency.SingleDependency1BoxedVoid](#singledependency1boxedvoid)
boxed class to store validated null payloads | +| record | [SingleDependency.SingleDependency1BoxedBoolean](#singledependency1boxedboolean)
boxed class to store validated boolean payloads | +| record | [SingleDependency.SingleDependency1BoxedNumber](#singledependency1boxednumber)
boxed class to store validated Number payloads | +| record | [SingleDependency.SingleDependency1BoxedString](#singledependency1boxedstring)
boxed class to store validated String payloads | +| record | [SingleDependency.SingleDependency1BoxedList](#singledependency1boxedlist)
boxed class to store validated List payloads | +| record | [SingleDependency.SingleDependency1BoxedMap](#singledependency1boxedmap)
boxed class to store validated Map payloads | | static class | [SingleDependency.SingleDependency1](#singledependency1)
schema class | ## SingleDependency1Boxed -public static abstract sealed class SingleDependency1Boxed
+public sealed interface SingleDependency1Boxed
permits
[SingleDependency1BoxedVoid](#singledependency1boxedvoid), [SingleDependency1BoxedBoolean](#singledependency1boxedboolean), @@ -29,103 +29,109 @@ permits
[SingleDependency1BoxedList](#singledependency1boxedlist), [SingleDependency1BoxedMap](#singledependency1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## SingleDependency1BoxedVoid -public static final class SingleDependency1BoxedVoid
-extends [SingleDependency1Boxed](#singledependency1boxed) +public record SingleDependency1BoxedVoid
+implements [SingleDependency1Boxed](#singledependency1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | SingleDependency1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## SingleDependency1BoxedBoolean -public static final class SingleDependency1BoxedBoolean
-extends [SingleDependency1Boxed](#singledependency1boxed) +public record SingleDependency1BoxedBoolean
+implements [SingleDependency1Boxed](#singledependency1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | SingleDependency1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## SingleDependency1BoxedNumber -public static final class SingleDependency1BoxedNumber
-extends [SingleDependency1Boxed](#singledependency1boxed) +public record SingleDependency1BoxedNumber
+implements [SingleDependency1Boxed](#singledependency1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | SingleDependency1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## SingleDependency1BoxedString -public static final class SingleDependency1BoxedString
-extends [SingleDependency1Boxed](#singledependency1boxed) +public record SingleDependency1BoxedString
+implements [SingleDependency1Boxed](#singledependency1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | SingleDependency1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## SingleDependency1BoxedList -public static final class SingleDependency1BoxedList
-extends [SingleDependency1Boxed](#singledependency1boxed) +public record SingleDependency1BoxedList
+implements [SingleDependency1Boxed](#singledependency1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | SingleDependency1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## SingleDependency1BoxedMap -public static final class SingleDependency1BoxedMap
-extends [SingleDependency1Boxed](#singledependency1boxed) +public record SingleDependency1BoxedMap
+implements [SingleDependency1Boxed](#singledependency1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | SingleDependency1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## SingleDependency1 public static class SingleDependency1
@@ -165,5 +171,7 @@ A schema class that validates payloads | [SingleDependency1BoxedBoolean](#singledependency1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [SingleDependency1BoxedMap](#singledependency1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [SingleDependency1BoxedList](#singledependency1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [SingleDependency1Boxed](#singledependency1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/SmallMultipleOfLargeInteger.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/SmallMultipleOfLargeInteger.md index 93b89796684..e7db63f15b8 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/SmallMultipleOfLargeInteger.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/SmallMultipleOfLargeInteger.md @@ -4,38 +4,39 @@ public class SmallMultipleOfLargeInteger
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [SmallMultipleOfLargeInteger.SmallMultipleOfLargeInteger1Boxed](#smallmultipleoflargeinteger1boxed)
abstract sealed validated payload class | -| static class | [SmallMultipleOfLargeInteger.SmallMultipleOfLargeInteger1BoxedNumber](#smallmultipleoflargeinteger1boxednumber)
boxed class to store validated Number payloads | +| sealed interface | [SmallMultipleOfLargeInteger.SmallMultipleOfLargeInteger1Boxed](#smallmultipleoflargeinteger1boxed)
sealed interface for validated payloads | +| record | [SmallMultipleOfLargeInteger.SmallMultipleOfLargeInteger1BoxedNumber](#smallmultipleoflargeinteger1boxednumber)
boxed class to store validated Number payloads | | static class | [SmallMultipleOfLargeInteger.SmallMultipleOfLargeInteger1](#smallmultipleoflargeinteger1)
schema class | ## SmallMultipleOfLargeInteger1Boxed -public static abstract sealed class SmallMultipleOfLargeInteger1Boxed
+public sealed interface SmallMultipleOfLargeInteger1Boxed
permits
[SmallMultipleOfLargeInteger1BoxedNumber](#smallmultipleoflargeinteger1boxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## SmallMultipleOfLargeInteger1BoxedNumber -public static final class SmallMultipleOfLargeInteger1BoxedNumber
-extends [SmallMultipleOfLargeInteger1Boxed](#smallmultipleoflargeinteger1boxed) +public record SmallMultipleOfLargeInteger1BoxedNumber
+implements [SmallMultipleOfLargeInteger1Boxed](#smallmultipleoflargeinteger1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | SmallMultipleOfLargeInteger1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## SmallMultipleOfLargeInteger1 public static class SmallMultipleOfLargeInteger1
@@ -77,5 +78,7 @@ int validatedPayload = SmallMultipleOfLargeInteger.SmallMultipleOfLargeInteger1. | ----------------- | ---------------------- | | long | validate(long arg, SchemaConfiguration configuration) | | [SmallMultipleOfLargeInteger1BoxedNumber](#smallmultipleoflargeinteger1boxednumber) | validateAndBox(Number arg, SchemaConfiguration configuration) | +| [SmallMultipleOfLargeInteger1Boxed](#smallmultipleoflargeinteger1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/StringTypeMatchesStrings.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/StringTypeMatchesStrings.md index 3d2c0b40869..5166ec0ed59 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/StringTypeMatchesStrings.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/StringTypeMatchesStrings.md @@ -4,38 +4,39 @@ public class StringTypeMatchesStrings
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [StringTypeMatchesStrings.StringTypeMatchesStrings1Boxed](#stringtypematchesstrings1boxed)
abstract sealed validated payload class | -| static class | [StringTypeMatchesStrings.StringTypeMatchesStrings1BoxedString](#stringtypematchesstrings1boxedstring)
boxed class to store validated String payloads | +| sealed interface | [StringTypeMatchesStrings.StringTypeMatchesStrings1Boxed](#stringtypematchesstrings1boxed)
sealed interface for validated payloads | +| record | [StringTypeMatchesStrings.StringTypeMatchesStrings1BoxedString](#stringtypematchesstrings1boxedstring)
boxed class to store validated String payloads | | static class | [StringTypeMatchesStrings.StringTypeMatchesStrings1](#stringtypematchesstrings1)
schema class | ## StringTypeMatchesStrings1Boxed -public static abstract sealed class StringTypeMatchesStrings1Boxed
+public sealed interface StringTypeMatchesStrings1Boxed
permits
[StringTypeMatchesStrings1BoxedString](#stringtypematchesstrings1boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## StringTypeMatchesStrings1BoxedString -public static final class StringTypeMatchesStrings1BoxedString
-extends [StringTypeMatchesStrings1Boxed](#stringtypematchesstrings1boxed) +public record StringTypeMatchesStrings1BoxedString
+implements [StringTypeMatchesStrings1Boxed](#stringtypematchesstrings1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | StringTypeMatchesStrings1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## StringTypeMatchesStrings1 public static class StringTypeMatchesStrings1
diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/TimeFormat.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/TimeFormat.md index 31f58c66057..aadc93a5b33 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/TimeFormat.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/TimeFormat.md @@ -4,23 +4,23 @@ public class TimeFormat
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [TimeFormat.TimeFormat1Boxed](#timeformat1boxed)
abstract sealed validated payload class | -| static class | [TimeFormat.TimeFormat1BoxedVoid](#timeformat1boxedvoid)
boxed class to store validated null payloads | -| static class | [TimeFormat.TimeFormat1BoxedBoolean](#timeformat1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [TimeFormat.TimeFormat1BoxedNumber](#timeformat1boxednumber)
boxed class to store validated Number payloads | -| static class | [TimeFormat.TimeFormat1BoxedString](#timeformat1boxedstring)
boxed class to store validated String payloads | -| static class | [TimeFormat.TimeFormat1BoxedList](#timeformat1boxedlist)
boxed class to store validated List payloads | -| static class | [TimeFormat.TimeFormat1BoxedMap](#timeformat1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [TimeFormat.TimeFormat1Boxed](#timeformat1boxed)
sealed interface for validated payloads | +| record | [TimeFormat.TimeFormat1BoxedVoid](#timeformat1boxedvoid)
boxed class to store validated null payloads | +| record | [TimeFormat.TimeFormat1BoxedBoolean](#timeformat1boxedboolean)
boxed class to store validated boolean payloads | +| record | [TimeFormat.TimeFormat1BoxedNumber](#timeformat1boxednumber)
boxed class to store validated Number payloads | +| record | [TimeFormat.TimeFormat1BoxedString](#timeformat1boxedstring)
boxed class to store validated String payloads | +| record | [TimeFormat.TimeFormat1BoxedList](#timeformat1boxedlist)
boxed class to store validated List payloads | +| record | [TimeFormat.TimeFormat1BoxedMap](#timeformat1boxedmap)
boxed class to store validated Map payloads | | static class | [TimeFormat.TimeFormat1](#timeformat1)
schema class | ## TimeFormat1Boxed -public static abstract sealed class TimeFormat1Boxed
+public sealed interface TimeFormat1Boxed
permits
[TimeFormat1BoxedVoid](#timeformat1boxedvoid), [TimeFormat1BoxedBoolean](#timeformat1boxedboolean), @@ -29,103 +29,109 @@ permits
[TimeFormat1BoxedList](#timeformat1boxedlist), [TimeFormat1BoxedMap](#timeformat1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## TimeFormat1BoxedVoid -public static final class TimeFormat1BoxedVoid
-extends [TimeFormat1Boxed](#timeformat1boxed) +public record TimeFormat1BoxedVoid
+implements [TimeFormat1Boxed](#timeformat1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | TimeFormat1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## TimeFormat1BoxedBoolean -public static final class TimeFormat1BoxedBoolean
-extends [TimeFormat1Boxed](#timeformat1boxed) +public record TimeFormat1BoxedBoolean
+implements [TimeFormat1Boxed](#timeformat1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | TimeFormat1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## TimeFormat1BoxedNumber -public static final class TimeFormat1BoxedNumber
-extends [TimeFormat1Boxed](#timeformat1boxed) +public record TimeFormat1BoxedNumber
+implements [TimeFormat1Boxed](#timeformat1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | TimeFormat1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## TimeFormat1BoxedString -public static final class TimeFormat1BoxedString
-extends [TimeFormat1Boxed](#timeformat1boxed) +public record TimeFormat1BoxedString
+implements [TimeFormat1Boxed](#timeformat1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | TimeFormat1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## TimeFormat1BoxedList -public static final class TimeFormat1BoxedList
-extends [TimeFormat1Boxed](#timeformat1boxed) +public record TimeFormat1BoxedList
+implements [TimeFormat1Boxed](#timeformat1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | TimeFormat1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## TimeFormat1BoxedMap -public static final class TimeFormat1BoxedMap
-extends [TimeFormat1Boxed](#timeformat1boxed) +public record TimeFormat1BoxedMap
+implements [TimeFormat1Boxed](#timeformat1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | TimeFormat1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## TimeFormat1 public static class TimeFormat1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [TimeFormat1BoxedBoolean](#timeformat1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [TimeFormat1BoxedMap](#timeformat1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [TimeFormat1BoxedList](#timeformat1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [TimeFormat1Boxed](#timeformat1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/TypeArrayObjectOrNull.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/TypeArrayObjectOrNull.md index adfc730c4de..0c1aaebdcbb 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/TypeArrayObjectOrNull.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/TypeArrayObjectOrNull.md @@ -4,74 +4,77 @@ public class TypeArrayObjectOrNull
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [TypeArrayObjectOrNull.TypeArrayObjectOrNull1Boxed](#typearrayobjectornull1boxed)
abstract sealed validated payload class | -| static class | [TypeArrayObjectOrNull.TypeArrayObjectOrNull1BoxedList](#typearrayobjectornull1boxedlist)
boxed class to store validated List payloads | -| static class | [TypeArrayObjectOrNull.TypeArrayObjectOrNull1BoxedMap](#typearrayobjectornull1boxedmap)
boxed class to store validated Map payloads | -| static class | [TypeArrayObjectOrNull.TypeArrayObjectOrNull1BoxedVoid](#typearrayobjectornull1boxedvoid)
boxed class to store validated null payloads | +| sealed interface | [TypeArrayObjectOrNull.TypeArrayObjectOrNull1Boxed](#typearrayobjectornull1boxed)
sealed interface for validated payloads | +| record | [TypeArrayObjectOrNull.TypeArrayObjectOrNull1BoxedList](#typearrayobjectornull1boxedlist)
boxed class to store validated List payloads | +| record | [TypeArrayObjectOrNull.TypeArrayObjectOrNull1BoxedMap](#typearrayobjectornull1boxedmap)
boxed class to store validated Map payloads | +| record | [TypeArrayObjectOrNull.TypeArrayObjectOrNull1BoxedVoid](#typearrayobjectornull1boxedvoid)
boxed class to store validated null payloads | | static class | [TypeArrayObjectOrNull.TypeArrayObjectOrNull1](#typearrayobjectornull1)
schema class | ## TypeArrayObjectOrNull1Boxed -public static abstract sealed class TypeArrayObjectOrNull1Boxed
+public sealed interface TypeArrayObjectOrNull1Boxed
permits
[TypeArrayObjectOrNull1BoxedList](#typearrayobjectornull1boxedlist), [TypeArrayObjectOrNull1BoxedMap](#typearrayobjectornull1boxedmap), [TypeArrayObjectOrNull1BoxedVoid](#typearrayobjectornull1boxedvoid) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## TypeArrayObjectOrNull1BoxedList -public static final class TypeArrayObjectOrNull1BoxedList
-extends [TypeArrayObjectOrNull1Boxed](#typearrayobjectornull1boxed) +public record TypeArrayObjectOrNull1BoxedList
+implements [TypeArrayObjectOrNull1Boxed](#typearrayobjectornull1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | TypeArrayObjectOrNull1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## TypeArrayObjectOrNull1BoxedMap -public static final class TypeArrayObjectOrNull1BoxedMap
-extends [TypeArrayObjectOrNull1Boxed](#typearrayobjectornull1boxed) +public record TypeArrayObjectOrNull1BoxedMap
+implements [TypeArrayObjectOrNull1Boxed](#typearrayobjectornull1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | TypeArrayObjectOrNull1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## TypeArrayObjectOrNull1BoxedVoid -public static final class TypeArrayObjectOrNull1BoxedVoid
-extends [TypeArrayObjectOrNull1Boxed](#typearrayobjectornull1boxed) +public record TypeArrayObjectOrNull1BoxedVoid
+implements [TypeArrayObjectOrNull1Boxed](#typearrayobjectornull1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | TypeArrayObjectOrNull1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## TypeArrayObjectOrNull1 public static class TypeArrayObjectOrNull1
@@ -115,5 +118,7 @@ Void validatedPayload = TypeArrayObjectOrNull.TypeArrayObjectOrNull1.validate( | [TypeArrayObjectOrNull1BoxedMap](#typearrayobjectornull1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | Void | validate(Void arg, SchemaConfiguration configuration) | | [TypeArrayObjectOrNull1BoxedVoid](#typearrayobjectornull1boxedvoid) | validateAndBox(Void arg, SchemaConfiguration configuration) | +| [TypeArrayObjectOrNull1Boxed](#typearrayobjectornull1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/TypeArrayOrObject.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/TypeArrayOrObject.md index 4ecc8248b86..5bb799c1fdb 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/TypeArrayOrObject.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/TypeArrayOrObject.md @@ -4,56 +4,58 @@ public class TypeArrayOrObject
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [TypeArrayOrObject.TypeArrayOrObject1Boxed](#typearrayorobject1boxed)
abstract sealed validated payload class | -| static class | [TypeArrayOrObject.TypeArrayOrObject1BoxedList](#typearrayorobject1boxedlist)
boxed class to store validated List payloads | -| static class | [TypeArrayOrObject.TypeArrayOrObject1BoxedMap](#typearrayorobject1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [TypeArrayOrObject.TypeArrayOrObject1Boxed](#typearrayorobject1boxed)
sealed interface for validated payloads | +| record | [TypeArrayOrObject.TypeArrayOrObject1BoxedList](#typearrayorobject1boxedlist)
boxed class to store validated List payloads | +| record | [TypeArrayOrObject.TypeArrayOrObject1BoxedMap](#typearrayorobject1boxedmap)
boxed class to store validated Map payloads | | static class | [TypeArrayOrObject.TypeArrayOrObject1](#typearrayorobject1)
schema class | ## TypeArrayOrObject1Boxed -public static abstract sealed class TypeArrayOrObject1Boxed
+public sealed interface TypeArrayOrObject1Boxed
permits
[TypeArrayOrObject1BoxedList](#typearrayorobject1boxedlist), [TypeArrayOrObject1BoxedMap](#typearrayorobject1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## TypeArrayOrObject1BoxedList -public static final class TypeArrayOrObject1BoxedList
-extends [TypeArrayOrObject1Boxed](#typearrayorobject1boxed) +public record TypeArrayOrObject1BoxedList
+implements [TypeArrayOrObject1Boxed](#typearrayorobject1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | TypeArrayOrObject1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## TypeArrayOrObject1BoxedMap -public static final class TypeArrayOrObject1BoxedMap
-extends [TypeArrayOrObject1Boxed](#typearrayorobject1boxed) +public record TypeArrayOrObject1BoxedMap
+implements [TypeArrayOrObject1Boxed](#typearrayorobject1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | TypeArrayOrObject1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## TypeArrayOrObject1 public static class TypeArrayOrObject1
@@ -73,5 +75,7 @@ A schema class that validates payloads | [TypeArrayOrObject1BoxedList](#typearrayorobject1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | | FrozenMap | validate(Map<?, ?> arg, SchemaConfiguration configuration) | | [TypeArrayOrObject1BoxedMap](#typearrayorobject1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | +| [TypeArrayOrObject1Boxed](#typearrayorobject1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/TypeAsArrayWithOneItem.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/TypeAsArrayWithOneItem.md index baa265bad82..a50422c5a6f 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/TypeAsArrayWithOneItem.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/TypeAsArrayWithOneItem.md @@ -4,38 +4,39 @@ public class TypeAsArrayWithOneItem
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [TypeAsArrayWithOneItem.TypeAsArrayWithOneItem1Boxed](#typeasarraywithoneitem1boxed)
abstract sealed validated payload class | -| static class | [TypeAsArrayWithOneItem.TypeAsArrayWithOneItem1BoxedString](#typeasarraywithoneitem1boxedstring)
boxed class to store validated String payloads | +| sealed interface | [TypeAsArrayWithOneItem.TypeAsArrayWithOneItem1Boxed](#typeasarraywithoneitem1boxed)
sealed interface for validated payloads | +| record | [TypeAsArrayWithOneItem.TypeAsArrayWithOneItem1BoxedString](#typeasarraywithoneitem1boxedstring)
boxed class to store validated String payloads | | static class | [TypeAsArrayWithOneItem.TypeAsArrayWithOneItem1](#typeasarraywithoneitem1)
schema class | ## TypeAsArrayWithOneItem1Boxed -public static abstract sealed class TypeAsArrayWithOneItem1Boxed
+public sealed interface TypeAsArrayWithOneItem1Boxed
permits
[TypeAsArrayWithOneItem1BoxedString](#typeasarraywithoneitem1boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## TypeAsArrayWithOneItem1BoxedString -public static final class TypeAsArrayWithOneItem1BoxedString
-extends [TypeAsArrayWithOneItem1Boxed](#typeasarraywithoneitem1boxed) +public record TypeAsArrayWithOneItem1BoxedString
+implements [TypeAsArrayWithOneItem1Boxed](#typeasarraywithoneitem1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | TypeAsArrayWithOneItem1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## TypeAsArrayWithOneItem1 public static class TypeAsArrayWithOneItem1
diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/UnevaluateditemsAsSchema.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/UnevaluateditemsAsSchema.md index acb0a361673..0d9460530b0 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/UnevaluateditemsAsSchema.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/UnevaluateditemsAsSchema.md @@ -4,26 +4,26 @@ public class UnevaluateditemsAsSchema
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [UnevaluateditemsAsSchema.UnevaluateditemsAsSchema1Boxed](#unevaluateditemsasschema1boxed)
abstract sealed validated payload class | -| static class | [UnevaluateditemsAsSchema.UnevaluateditemsAsSchema1BoxedVoid](#unevaluateditemsasschema1boxedvoid)
boxed class to store validated null payloads | -| static class | [UnevaluateditemsAsSchema.UnevaluateditemsAsSchema1BoxedBoolean](#unevaluateditemsasschema1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [UnevaluateditemsAsSchema.UnevaluateditemsAsSchema1BoxedNumber](#unevaluateditemsasschema1boxednumber)
boxed class to store validated Number payloads | -| static class | [UnevaluateditemsAsSchema.UnevaluateditemsAsSchema1BoxedString](#unevaluateditemsasschema1boxedstring)
boxed class to store validated String payloads | -| static class | [UnevaluateditemsAsSchema.UnevaluateditemsAsSchema1BoxedList](#unevaluateditemsasschema1boxedlist)
boxed class to store validated List payloads | -| static class | [UnevaluateditemsAsSchema.UnevaluateditemsAsSchema1BoxedMap](#unevaluateditemsasschema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [UnevaluateditemsAsSchema.UnevaluateditemsAsSchema1Boxed](#unevaluateditemsasschema1boxed)
sealed interface for validated payloads | +| record | [UnevaluateditemsAsSchema.UnevaluateditemsAsSchema1BoxedVoid](#unevaluateditemsasschema1boxedvoid)
boxed class to store validated null payloads | +| record | [UnevaluateditemsAsSchema.UnevaluateditemsAsSchema1BoxedBoolean](#unevaluateditemsasschema1boxedboolean)
boxed class to store validated boolean payloads | +| record | [UnevaluateditemsAsSchema.UnevaluateditemsAsSchema1BoxedNumber](#unevaluateditemsasschema1boxednumber)
boxed class to store validated Number payloads | +| record | [UnevaluateditemsAsSchema.UnevaluateditemsAsSchema1BoxedString](#unevaluateditemsasschema1boxedstring)
boxed class to store validated String payloads | +| record | [UnevaluateditemsAsSchema.UnevaluateditemsAsSchema1BoxedList](#unevaluateditemsasschema1boxedlist)
boxed class to store validated List payloads | +| record | [UnevaluateditemsAsSchema.UnevaluateditemsAsSchema1BoxedMap](#unevaluateditemsasschema1boxedmap)
boxed class to store validated Map payloads | | static class | [UnevaluateditemsAsSchema.UnevaluateditemsAsSchema1](#unevaluateditemsasschema1)
schema class | -| static class | [UnevaluateditemsAsSchema.UnevaluatedItemsBoxed](#unevaluateditemsboxed)
abstract sealed validated payload class | -| static class | [UnevaluateditemsAsSchema.UnevaluatedItemsBoxedString](#unevaluateditemsboxedstring)
boxed class to store validated String payloads | +| sealed interface | [UnevaluateditemsAsSchema.UnevaluatedItemsBoxed](#unevaluateditemsboxed)
sealed interface for validated payloads | +| record | [UnevaluateditemsAsSchema.UnevaluatedItemsBoxedString](#unevaluateditemsboxedstring)
boxed class to store validated String payloads | | static class | [UnevaluateditemsAsSchema.UnevaluatedItems](#unevaluateditems)
schema class | ## UnevaluateditemsAsSchema1Boxed -public static abstract sealed class UnevaluateditemsAsSchema1Boxed
+public sealed interface UnevaluateditemsAsSchema1Boxed
permits
[UnevaluateditemsAsSchema1BoxedVoid](#unevaluateditemsasschema1boxedvoid), [UnevaluateditemsAsSchema1BoxedBoolean](#unevaluateditemsasschema1boxedboolean), @@ -32,103 +32,109 @@ permits
[UnevaluateditemsAsSchema1BoxedList](#unevaluateditemsasschema1boxedlist), [UnevaluateditemsAsSchema1BoxedMap](#unevaluateditemsasschema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## UnevaluateditemsAsSchema1BoxedVoid -public static final class UnevaluateditemsAsSchema1BoxedVoid
-extends [UnevaluateditemsAsSchema1Boxed](#unevaluateditemsasschema1boxed) +public record UnevaluateditemsAsSchema1BoxedVoid
+implements [UnevaluateditemsAsSchema1Boxed](#unevaluateditemsasschema1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UnevaluateditemsAsSchema1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UnevaluateditemsAsSchema1BoxedBoolean -public static final class UnevaluateditemsAsSchema1BoxedBoolean
-extends [UnevaluateditemsAsSchema1Boxed](#unevaluateditemsasschema1boxed) +public record UnevaluateditemsAsSchema1BoxedBoolean
+implements [UnevaluateditemsAsSchema1Boxed](#unevaluateditemsasschema1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UnevaluateditemsAsSchema1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UnevaluateditemsAsSchema1BoxedNumber -public static final class UnevaluateditemsAsSchema1BoxedNumber
-extends [UnevaluateditemsAsSchema1Boxed](#unevaluateditemsasschema1boxed) +public record UnevaluateditemsAsSchema1BoxedNumber
+implements [UnevaluateditemsAsSchema1Boxed](#unevaluateditemsasschema1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UnevaluateditemsAsSchema1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UnevaluateditemsAsSchema1BoxedString -public static final class UnevaluateditemsAsSchema1BoxedString
-extends [UnevaluateditemsAsSchema1Boxed](#unevaluateditemsasschema1boxed) +public record UnevaluateditemsAsSchema1BoxedString
+implements [UnevaluateditemsAsSchema1Boxed](#unevaluateditemsasschema1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UnevaluateditemsAsSchema1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UnevaluateditemsAsSchema1BoxedList -public static final class UnevaluateditemsAsSchema1BoxedList
-extends [UnevaluateditemsAsSchema1Boxed](#unevaluateditemsasschema1boxed) +public record UnevaluateditemsAsSchema1BoxedList
+implements [UnevaluateditemsAsSchema1Boxed](#unevaluateditemsasschema1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UnevaluateditemsAsSchema1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UnevaluateditemsAsSchema1BoxedMap -public static final class UnevaluateditemsAsSchema1BoxedMap
-extends [UnevaluateditemsAsSchema1Boxed](#unevaluateditemsasschema1boxed) +public record UnevaluateditemsAsSchema1BoxedMap
+implements [UnevaluateditemsAsSchema1Boxed](#unevaluateditemsasschema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UnevaluateditemsAsSchema1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UnevaluateditemsAsSchema1 public static class UnevaluateditemsAsSchema1
@@ -160,29 +166,32 @@ A schema class that validates payloads | [UnevaluateditemsAsSchema1BoxedBoolean](#unevaluateditemsasschema1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [UnevaluateditemsAsSchema1BoxedMap](#unevaluateditemsasschema1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [UnevaluateditemsAsSchema1BoxedList](#unevaluateditemsasschema1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [UnevaluateditemsAsSchema1Boxed](#unevaluateditemsasschema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## UnevaluatedItemsBoxed -public static abstract sealed class UnevaluatedItemsBoxed
+public sealed interface UnevaluatedItemsBoxed
permits
[UnevaluatedItemsBoxedString](#unevaluateditemsboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## UnevaluatedItemsBoxedString -public static final class UnevaluatedItemsBoxedString
-extends [UnevaluatedItemsBoxed](#unevaluateditemsboxed) +public record UnevaluatedItemsBoxedString
+implements [UnevaluatedItemsBoxed](#unevaluateditemsboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UnevaluatedItemsBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UnevaluatedItems public static class UnevaluatedItems
diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/UnevaluateditemsDependsOnMultipleNestedContains.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/UnevaluateditemsDependsOnMultipleNestedContains.md index d92f28e6821..419b1e650e2 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/UnevaluateditemsDependsOnMultipleNestedContains.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/UnevaluateditemsDependsOnMultipleNestedContains.md @@ -4,63 +4,63 @@ public class UnevaluateditemsDependsOnMultipleNestedContains
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [UnevaluateditemsDependsOnMultipleNestedContains.UnevaluateditemsDependsOnMultipleNestedContains1Boxed](#unevaluateditemsdependsonmultiplenestedcontains1boxed)
abstract sealed validated payload class | -| static class | [UnevaluateditemsDependsOnMultipleNestedContains.UnevaluateditemsDependsOnMultipleNestedContains1BoxedVoid](#unevaluateditemsdependsonmultiplenestedcontains1boxedvoid)
boxed class to store validated null payloads | -| static class | [UnevaluateditemsDependsOnMultipleNestedContains.UnevaluateditemsDependsOnMultipleNestedContains1BoxedBoolean](#unevaluateditemsdependsonmultiplenestedcontains1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [UnevaluateditemsDependsOnMultipleNestedContains.UnevaluateditemsDependsOnMultipleNestedContains1BoxedNumber](#unevaluateditemsdependsonmultiplenestedcontains1boxednumber)
boxed class to store validated Number payloads | -| static class | [UnevaluateditemsDependsOnMultipleNestedContains.UnevaluateditemsDependsOnMultipleNestedContains1BoxedString](#unevaluateditemsdependsonmultiplenestedcontains1boxedstring)
boxed class to store validated String payloads | -| static class | [UnevaluateditemsDependsOnMultipleNestedContains.UnevaluateditemsDependsOnMultipleNestedContains1BoxedList](#unevaluateditemsdependsonmultiplenestedcontains1boxedlist)
boxed class to store validated List payloads | -| static class | [UnevaluateditemsDependsOnMultipleNestedContains.UnevaluateditemsDependsOnMultipleNestedContains1BoxedMap](#unevaluateditemsdependsonmultiplenestedcontains1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [UnevaluateditemsDependsOnMultipleNestedContains.UnevaluateditemsDependsOnMultipleNestedContains1Boxed](#unevaluateditemsdependsonmultiplenestedcontains1boxed)
sealed interface for validated payloads | +| record | [UnevaluateditemsDependsOnMultipleNestedContains.UnevaluateditemsDependsOnMultipleNestedContains1BoxedVoid](#unevaluateditemsdependsonmultiplenestedcontains1boxedvoid)
boxed class to store validated null payloads | +| record | [UnevaluateditemsDependsOnMultipleNestedContains.UnevaluateditemsDependsOnMultipleNestedContains1BoxedBoolean](#unevaluateditemsdependsonmultiplenestedcontains1boxedboolean)
boxed class to store validated boolean payloads | +| record | [UnevaluateditemsDependsOnMultipleNestedContains.UnevaluateditemsDependsOnMultipleNestedContains1BoxedNumber](#unevaluateditemsdependsonmultiplenestedcontains1boxednumber)
boxed class to store validated Number payloads | +| record | [UnevaluateditemsDependsOnMultipleNestedContains.UnevaluateditemsDependsOnMultipleNestedContains1BoxedString](#unevaluateditemsdependsonmultiplenestedcontains1boxedstring)
boxed class to store validated String payloads | +| record | [UnevaluateditemsDependsOnMultipleNestedContains.UnevaluateditemsDependsOnMultipleNestedContains1BoxedList](#unevaluateditemsdependsonmultiplenestedcontains1boxedlist)
boxed class to store validated List payloads | +| record | [UnevaluateditemsDependsOnMultipleNestedContains.UnevaluateditemsDependsOnMultipleNestedContains1BoxedMap](#unevaluateditemsdependsonmultiplenestedcontains1boxedmap)
boxed class to store validated Map payloads | | static class | [UnevaluateditemsDependsOnMultipleNestedContains.UnevaluateditemsDependsOnMultipleNestedContains1](#unevaluateditemsdependsonmultiplenestedcontains1)
schema class | -| static class | [UnevaluateditemsDependsOnMultipleNestedContains.UnevaluatedItemsBoxed](#unevaluateditemsboxed)
abstract sealed validated payload class | -| static class | [UnevaluateditemsDependsOnMultipleNestedContains.UnevaluatedItemsBoxedVoid](#unevaluateditemsboxedvoid)
boxed class to store validated null payloads | -| static class | [UnevaluateditemsDependsOnMultipleNestedContains.UnevaluatedItemsBoxedBoolean](#unevaluateditemsboxedboolean)
boxed class to store validated boolean payloads | -| static class | [UnevaluateditemsDependsOnMultipleNestedContains.UnevaluatedItemsBoxedNumber](#unevaluateditemsboxednumber)
boxed class to store validated Number payloads | -| static class | [UnevaluateditemsDependsOnMultipleNestedContains.UnevaluatedItemsBoxedString](#unevaluateditemsboxedstring)
boxed class to store validated String payloads | -| static class | [UnevaluateditemsDependsOnMultipleNestedContains.UnevaluatedItemsBoxedList](#unevaluateditemsboxedlist)
boxed class to store validated List payloads | -| static class | [UnevaluateditemsDependsOnMultipleNestedContains.UnevaluatedItemsBoxedMap](#unevaluateditemsboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [UnevaluateditemsDependsOnMultipleNestedContains.UnevaluatedItemsBoxed](#unevaluateditemsboxed)
sealed interface for validated payloads | +| record | [UnevaluateditemsDependsOnMultipleNestedContains.UnevaluatedItemsBoxedVoid](#unevaluateditemsboxedvoid)
boxed class to store validated null payloads | +| record | [UnevaluateditemsDependsOnMultipleNestedContains.UnevaluatedItemsBoxedBoolean](#unevaluateditemsboxedboolean)
boxed class to store validated boolean payloads | +| record | [UnevaluateditemsDependsOnMultipleNestedContains.UnevaluatedItemsBoxedNumber](#unevaluateditemsboxednumber)
boxed class to store validated Number payloads | +| record | [UnevaluateditemsDependsOnMultipleNestedContains.UnevaluatedItemsBoxedString](#unevaluateditemsboxedstring)
boxed class to store validated String payloads | +| record | [UnevaluateditemsDependsOnMultipleNestedContains.UnevaluatedItemsBoxedList](#unevaluateditemsboxedlist)
boxed class to store validated List payloads | +| record | [UnevaluateditemsDependsOnMultipleNestedContains.UnevaluatedItemsBoxedMap](#unevaluateditemsboxedmap)
boxed class to store validated Map payloads | | static class | [UnevaluateditemsDependsOnMultipleNestedContains.UnevaluatedItems](#unevaluateditems)
schema class | -| static class | [UnevaluateditemsDependsOnMultipleNestedContains.Schema1Boxed](#schema1boxed)
abstract sealed validated payload class | -| static class | [UnevaluateditemsDependsOnMultipleNestedContains.Schema1BoxedVoid](#schema1boxedvoid)
boxed class to store validated null payloads | -| static class | [UnevaluateditemsDependsOnMultipleNestedContains.Schema1BoxedBoolean](#schema1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [UnevaluateditemsDependsOnMultipleNestedContains.Schema1BoxedNumber](#schema1boxednumber)
boxed class to store validated Number payloads | -| static class | [UnevaluateditemsDependsOnMultipleNestedContains.Schema1BoxedString](#schema1boxedstring)
boxed class to store validated String payloads | -| static class | [UnevaluateditemsDependsOnMultipleNestedContains.Schema1BoxedList](#schema1boxedlist)
boxed class to store validated List payloads | -| static class | [UnevaluateditemsDependsOnMultipleNestedContains.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [UnevaluateditemsDependsOnMultipleNestedContains.Schema1Boxed](#schema1boxed)
sealed interface for validated payloads | +| record | [UnevaluateditemsDependsOnMultipleNestedContains.Schema1BoxedVoid](#schema1boxedvoid)
boxed class to store validated null payloads | +| record | [UnevaluateditemsDependsOnMultipleNestedContains.Schema1BoxedBoolean](#schema1boxedboolean)
boxed class to store validated boolean payloads | +| record | [UnevaluateditemsDependsOnMultipleNestedContains.Schema1BoxedNumber](#schema1boxednumber)
boxed class to store validated Number payloads | +| record | [UnevaluateditemsDependsOnMultipleNestedContains.Schema1BoxedString](#schema1boxedstring)
boxed class to store validated String payloads | +| record | [UnevaluateditemsDependsOnMultipleNestedContains.Schema1BoxedList](#schema1boxedlist)
boxed class to store validated List payloads | +| record | [UnevaluateditemsDependsOnMultipleNestedContains.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | | static class | [UnevaluateditemsDependsOnMultipleNestedContains.Schema1](#schema1)
schema class | -| static class | [UnevaluateditemsDependsOnMultipleNestedContains.Contains1Boxed](#contains1boxed)
abstract sealed validated payload class | -| static class | [UnevaluateditemsDependsOnMultipleNestedContains.Contains1BoxedVoid](#contains1boxedvoid)
boxed class to store validated null payloads | -| static class | [UnevaluateditemsDependsOnMultipleNestedContains.Contains1BoxedBoolean](#contains1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [UnevaluateditemsDependsOnMultipleNestedContains.Contains1BoxedNumber](#contains1boxednumber)
boxed class to store validated Number payloads | -| static class | [UnevaluateditemsDependsOnMultipleNestedContains.Contains1BoxedString](#contains1boxedstring)
boxed class to store validated String payloads | -| static class | [UnevaluateditemsDependsOnMultipleNestedContains.Contains1BoxedList](#contains1boxedlist)
boxed class to store validated List payloads | -| static class | [UnevaluateditemsDependsOnMultipleNestedContains.Contains1BoxedMap](#contains1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [UnevaluateditemsDependsOnMultipleNestedContains.Contains1Boxed](#contains1boxed)
sealed interface for validated payloads | +| record | [UnevaluateditemsDependsOnMultipleNestedContains.Contains1BoxedVoid](#contains1boxedvoid)
boxed class to store validated null payloads | +| record | [UnevaluateditemsDependsOnMultipleNestedContains.Contains1BoxedBoolean](#contains1boxedboolean)
boxed class to store validated boolean payloads | +| record | [UnevaluateditemsDependsOnMultipleNestedContains.Contains1BoxedNumber](#contains1boxednumber)
boxed class to store validated Number payloads | +| record | [UnevaluateditemsDependsOnMultipleNestedContains.Contains1BoxedString](#contains1boxedstring)
boxed class to store validated String payloads | +| record | [UnevaluateditemsDependsOnMultipleNestedContains.Contains1BoxedList](#contains1boxedlist)
boxed class to store validated List payloads | +| record | [UnevaluateditemsDependsOnMultipleNestedContains.Contains1BoxedMap](#contains1boxedmap)
boxed class to store validated Map payloads | | static class | [UnevaluateditemsDependsOnMultipleNestedContains.Contains1](#contains1)
schema class | -| static class | [UnevaluateditemsDependsOnMultipleNestedContains.Schema0Boxed](#schema0boxed)
abstract sealed validated payload class | -| static class | [UnevaluateditemsDependsOnMultipleNestedContains.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | -| static class | [UnevaluateditemsDependsOnMultipleNestedContains.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | -| static class | [UnevaluateditemsDependsOnMultipleNestedContains.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | -| static class | [UnevaluateditemsDependsOnMultipleNestedContains.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | -| static class | [UnevaluateditemsDependsOnMultipleNestedContains.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | -| static class | [UnevaluateditemsDependsOnMultipleNestedContains.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [UnevaluateditemsDependsOnMultipleNestedContains.Schema0Boxed](#schema0boxed)
sealed interface for validated payloads | +| record | [UnevaluateditemsDependsOnMultipleNestedContains.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | +| record | [UnevaluateditemsDependsOnMultipleNestedContains.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | +| record | [UnevaluateditemsDependsOnMultipleNestedContains.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | +| record | [UnevaluateditemsDependsOnMultipleNestedContains.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | +| record | [UnevaluateditemsDependsOnMultipleNestedContains.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | +| record | [UnevaluateditemsDependsOnMultipleNestedContains.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | | static class | [UnevaluateditemsDependsOnMultipleNestedContains.Schema0](#schema0)
schema class | -| static class | [UnevaluateditemsDependsOnMultipleNestedContains.ContainsBoxed](#containsboxed)
abstract sealed validated payload class | -| static class | [UnevaluateditemsDependsOnMultipleNestedContains.ContainsBoxedVoid](#containsboxedvoid)
boxed class to store validated null payloads | -| static class | [UnevaluateditemsDependsOnMultipleNestedContains.ContainsBoxedBoolean](#containsboxedboolean)
boxed class to store validated boolean payloads | -| static class | [UnevaluateditemsDependsOnMultipleNestedContains.ContainsBoxedNumber](#containsboxednumber)
boxed class to store validated Number payloads | -| static class | [UnevaluateditemsDependsOnMultipleNestedContains.ContainsBoxedString](#containsboxedstring)
boxed class to store validated String payloads | -| static class | [UnevaluateditemsDependsOnMultipleNestedContains.ContainsBoxedList](#containsboxedlist)
boxed class to store validated List payloads | -| static class | [UnevaluateditemsDependsOnMultipleNestedContains.ContainsBoxedMap](#containsboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [UnevaluateditemsDependsOnMultipleNestedContains.ContainsBoxed](#containsboxed)
sealed interface for validated payloads | +| record | [UnevaluateditemsDependsOnMultipleNestedContains.ContainsBoxedVoid](#containsboxedvoid)
boxed class to store validated null payloads | +| record | [UnevaluateditemsDependsOnMultipleNestedContains.ContainsBoxedBoolean](#containsboxedboolean)
boxed class to store validated boolean payloads | +| record | [UnevaluateditemsDependsOnMultipleNestedContains.ContainsBoxedNumber](#containsboxednumber)
boxed class to store validated Number payloads | +| record | [UnevaluateditemsDependsOnMultipleNestedContains.ContainsBoxedString](#containsboxedstring)
boxed class to store validated String payloads | +| record | [UnevaluateditemsDependsOnMultipleNestedContains.ContainsBoxedList](#containsboxedlist)
boxed class to store validated List payloads | +| record | [UnevaluateditemsDependsOnMultipleNestedContains.ContainsBoxedMap](#containsboxedmap)
boxed class to store validated Map payloads | | static class | [UnevaluateditemsDependsOnMultipleNestedContains.Contains](#contains)
schema class | ## UnevaluateditemsDependsOnMultipleNestedContains1Boxed -public static abstract sealed class UnevaluateditemsDependsOnMultipleNestedContains1Boxed
+public sealed interface UnevaluateditemsDependsOnMultipleNestedContains1Boxed
permits
[UnevaluateditemsDependsOnMultipleNestedContains1BoxedVoid](#unevaluateditemsdependsonmultiplenestedcontains1boxedvoid), [UnevaluateditemsDependsOnMultipleNestedContains1BoxedBoolean](#unevaluateditemsdependsonmultiplenestedcontains1boxedboolean), @@ -69,103 +69,109 @@ permits
[UnevaluateditemsDependsOnMultipleNestedContains1BoxedList](#unevaluateditemsdependsonmultiplenestedcontains1boxedlist), [UnevaluateditemsDependsOnMultipleNestedContains1BoxedMap](#unevaluateditemsdependsonmultiplenestedcontains1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## UnevaluateditemsDependsOnMultipleNestedContains1BoxedVoid -public static final class UnevaluateditemsDependsOnMultipleNestedContains1BoxedVoid
-extends [UnevaluateditemsDependsOnMultipleNestedContains1Boxed](#unevaluateditemsdependsonmultiplenestedcontains1boxed) +public record UnevaluateditemsDependsOnMultipleNestedContains1BoxedVoid
+implements [UnevaluateditemsDependsOnMultipleNestedContains1Boxed](#unevaluateditemsdependsonmultiplenestedcontains1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UnevaluateditemsDependsOnMultipleNestedContains1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UnevaluateditemsDependsOnMultipleNestedContains1BoxedBoolean -public static final class UnevaluateditemsDependsOnMultipleNestedContains1BoxedBoolean
-extends [UnevaluateditemsDependsOnMultipleNestedContains1Boxed](#unevaluateditemsdependsonmultiplenestedcontains1boxed) +public record UnevaluateditemsDependsOnMultipleNestedContains1BoxedBoolean
+implements [UnevaluateditemsDependsOnMultipleNestedContains1Boxed](#unevaluateditemsdependsonmultiplenestedcontains1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UnevaluateditemsDependsOnMultipleNestedContains1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UnevaluateditemsDependsOnMultipleNestedContains1BoxedNumber -public static final class UnevaluateditemsDependsOnMultipleNestedContains1BoxedNumber
-extends [UnevaluateditemsDependsOnMultipleNestedContains1Boxed](#unevaluateditemsdependsonmultiplenestedcontains1boxed) +public record UnevaluateditemsDependsOnMultipleNestedContains1BoxedNumber
+implements [UnevaluateditemsDependsOnMultipleNestedContains1Boxed](#unevaluateditemsdependsonmultiplenestedcontains1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UnevaluateditemsDependsOnMultipleNestedContains1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UnevaluateditemsDependsOnMultipleNestedContains1BoxedString -public static final class UnevaluateditemsDependsOnMultipleNestedContains1BoxedString
-extends [UnevaluateditemsDependsOnMultipleNestedContains1Boxed](#unevaluateditemsdependsonmultiplenestedcontains1boxed) +public record UnevaluateditemsDependsOnMultipleNestedContains1BoxedString
+implements [UnevaluateditemsDependsOnMultipleNestedContains1Boxed](#unevaluateditemsdependsonmultiplenestedcontains1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UnevaluateditemsDependsOnMultipleNestedContains1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UnevaluateditemsDependsOnMultipleNestedContains1BoxedList -public static final class UnevaluateditemsDependsOnMultipleNestedContains1BoxedList
-extends [UnevaluateditemsDependsOnMultipleNestedContains1Boxed](#unevaluateditemsdependsonmultiplenestedcontains1boxed) +public record UnevaluateditemsDependsOnMultipleNestedContains1BoxedList
+implements [UnevaluateditemsDependsOnMultipleNestedContains1Boxed](#unevaluateditemsdependsonmultiplenestedcontains1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UnevaluateditemsDependsOnMultipleNestedContains1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UnevaluateditemsDependsOnMultipleNestedContains1BoxedMap -public static final class UnevaluateditemsDependsOnMultipleNestedContains1BoxedMap
-extends [UnevaluateditemsDependsOnMultipleNestedContains1Boxed](#unevaluateditemsdependsonmultiplenestedcontains1boxed) +public record UnevaluateditemsDependsOnMultipleNestedContains1BoxedMap
+implements [UnevaluateditemsDependsOnMultipleNestedContains1Boxed](#unevaluateditemsdependsonmultiplenestedcontains1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UnevaluateditemsDependsOnMultipleNestedContains1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UnevaluateditemsDependsOnMultipleNestedContains1 public static class UnevaluateditemsDependsOnMultipleNestedContains1
@@ -198,9 +204,11 @@ A schema class that validates payloads | [UnevaluateditemsDependsOnMultipleNestedContains1BoxedBoolean](#unevaluateditemsdependsonmultiplenestedcontains1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [UnevaluateditemsDependsOnMultipleNestedContains1BoxedMap](#unevaluateditemsdependsonmultiplenestedcontains1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [UnevaluateditemsDependsOnMultipleNestedContains1BoxedList](#unevaluateditemsdependsonmultiplenestedcontains1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [UnevaluateditemsDependsOnMultipleNestedContains1Boxed](#unevaluateditemsdependsonmultiplenestedcontains1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## UnevaluatedItemsBoxed -public static abstract sealed class UnevaluatedItemsBoxed
+public sealed interface UnevaluatedItemsBoxed
permits
[UnevaluatedItemsBoxedVoid](#unevaluateditemsboxedvoid), [UnevaluatedItemsBoxedBoolean](#unevaluateditemsboxedboolean), @@ -209,103 +217,109 @@ permits
[UnevaluatedItemsBoxedList](#unevaluateditemsboxedlist), [UnevaluatedItemsBoxedMap](#unevaluateditemsboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## UnevaluatedItemsBoxedVoid -public static final class UnevaluatedItemsBoxedVoid
-extends [UnevaluatedItemsBoxed](#unevaluateditemsboxed) +public record UnevaluatedItemsBoxedVoid
+implements [UnevaluatedItemsBoxed](#unevaluateditemsboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UnevaluatedItemsBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UnevaluatedItemsBoxedBoolean -public static final class UnevaluatedItemsBoxedBoolean
-extends [UnevaluatedItemsBoxed](#unevaluateditemsboxed) +public record UnevaluatedItemsBoxedBoolean
+implements [UnevaluatedItemsBoxed](#unevaluateditemsboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UnevaluatedItemsBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UnevaluatedItemsBoxedNumber -public static final class UnevaluatedItemsBoxedNumber
-extends [UnevaluatedItemsBoxed](#unevaluateditemsboxed) +public record UnevaluatedItemsBoxedNumber
+implements [UnevaluatedItemsBoxed](#unevaluateditemsboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UnevaluatedItemsBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UnevaluatedItemsBoxedString -public static final class UnevaluatedItemsBoxedString
-extends [UnevaluatedItemsBoxed](#unevaluateditemsboxed) +public record UnevaluatedItemsBoxedString
+implements [UnevaluatedItemsBoxed](#unevaluateditemsboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UnevaluatedItemsBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UnevaluatedItemsBoxedList -public static final class UnevaluatedItemsBoxedList
-extends [UnevaluatedItemsBoxed](#unevaluateditemsboxed) +public record UnevaluatedItemsBoxedList
+implements [UnevaluatedItemsBoxed](#unevaluateditemsboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UnevaluatedItemsBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UnevaluatedItemsBoxedMap -public static final class UnevaluatedItemsBoxedMap
-extends [UnevaluatedItemsBoxed](#unevaluateditemsboxed) +public record UnevaluatedItemsBoxedMap
+implements [UnevaluatedItemsBoxed](#unevaluateditemsboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UnevaluatedItemsBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UnevaluatedItems public static class UnevaluatedItems
@@ -337,9 +351,11 @@ A schema class that validates payloads | [UnevaluatedItemsBoxedBoolean](#unevaluateditemsboxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [UnevaluatedItemsBoxedMap](#unevaluateditemsboxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [UnevaluatedItemsBoxedList](#unevaluateditemsboxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [UnevaluatedItemsBoxed](#unevaluateditemsboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema1Boxed -public static abstract sealed class Schema1Boxed
+public sealed interface Schema1Boxed
permits
[Schema1BoxedVoid](#schema1boxedvoid), [Schema1BoxedBoolean](#schema1boxedboolean), @@ -348,103 +364,109 @@ permits
[Schema1BoxedList](#schema1boxedlist), [Schema1BoxedMap](#schema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema1BoxedVoid -public static final class Schema1BoxedVoid
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedVoid
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedBoolean -public static final class Schema1BoxedBoolean
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedBoolean
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedNumber -public static final class Schema1BoxedNumber
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedNumber
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedString -public static final class Schema1BoxedString
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedString
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedList -public static final class Schema1BoxedList
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedList
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1BoxedMap -public static final class Schema1BoxedMap
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedMap
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1 public static class Schema1
@@ -476,9 +498,11 @@ A schema class that validates payloads | [Schema1BoxedBoolean](#schema1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Schema1BoxedMap](#schema1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [Schema1BoxedList](#schema1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Schema1Boxed](#schema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Contains1Boxed -public static abstract sealed class Contains1Boxed
+public sealed interface Contains1Boxed
permits
[Contains1BoxedVoid](#contains1boxedvoid), [Contains1BoxedBoolean](#contains1boxedboolean), @@ -487,103 +511,109 @@ permits
[Contains1BoxedList](#contains1boxedlist), [Contains1BoxedMap](#contains1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Contains1BoxedVoid -public static final class Contains1BoxedVoid
-extends [Contains1Boxed](#contains1boxed) +public record Contains1BoxedVoid
+implements [Contains1Boxed](#contains1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Contains1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Contains1BoxedBoolean -public static final class Contains1BoxedBoolean
-extends [Contains1Boxed](#contains1boxed) +public record Contains1BoxedBoolean
+implements [Contains1Boxed](#contains1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Contains1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Contains1BoxedNumber -public static final class Contains1BoxedNumber
-extends [Contains1Boxed](#contains1boxed) +public record Contains1BoxedNumber
+implements [Contains1Boxed](#contains1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Contains1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Contains1BoxedString -public static final class Contains1BoxedString
-extends [Contains1Boxed](#contains1boxed) +public record Contains1BoxedString
+implements [Contains1Boxed](#contains1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Contains1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Contains1BoxedList -public static final class Contains1BoxedList
-extends [Contains1Boxed](#contains1boxed) +public record Contains1BoxedList
+implements [Contains1Boxed](#contains1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Contains1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Contains1BoxedMap -public static final class Contains1BoxedMap
-extends [Contains1Boxed](#contains1boxed) +public record Contains1BoxedMap
+implements [Contains1Boxed](#contains1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Contains1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Contains1 public static class Contains1
@@ -615,9 +645,11 @@ A schema class that validates payloads | [Contains1BoxedBoolean](#contains1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Contains1BoxedMap](#contains1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [Contains1BoxedList](#contains1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Contains1Boxed](#contains1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema0Boxed -public static abstract sealed class Schema0Boxed
+public sealed interface Schema0Boxed
permits
[Schema0BoxedVoid](#schema0boxedvoid), [Schema0BoxedBoolean](#schema0boxedboolean), @@ -626,103 +658,109 @@ permits
[Schema0BoxedList](#schema0boxedlist), [Schema0BoxedMap](#schema0boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema0BoxedVoid -public static final class Schema0BoxedVoid
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedVoid
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedBoolean -public static final class Schema0BoxedBoolean
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedBoolean
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedNumber -public static final class Schema0BoxedNumber
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedNumber
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedString -public static final class Schema0BoxedString
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedString
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedList -public static final class Schema0BoxedList
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedList
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedMap -public static final class Schema0BoxedMap
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedMap
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0 public static class Schema0
@@ -754,9 +792,11 @@ A schema class that validates payloads | [Schema0BoxedBoolean](#schema0boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Schema0BoxedMap](#schema0boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [Schema0BoxedList](#schema0boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Schema0Boxed](#schema0boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ContainsBoxed -public static abstract sealed class ContainsBoxed
+public sealed interface ContainsBoxed
permits
[ContainsBoxedVoid](#containsboxedvoid), [ContainsBoxedBoolean](#containsboxedboolean), @@ -765,103 +805,109 @@ permits
[ContainsBoxedList](#containsboxedlist), [ContainsBoxedMap](#containsboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ContainsBoxedVoid -public static final class ContainsBoxedVoid
-extends [ContainsBoxed](#containsboxed) +public record ContainsBoxedVoid
+implements [ContainsBoxed](#containsboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ContainsBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ContainsBoxedBoolean -public static final class ContainsBoxedBoolean
-extends [ContainsBoxed](#containsboxed) +public record ContainsBoxedBoolean
+implements [ContainsBoxed](#containsboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ContainsBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ContainsBoxedNumber -public static final class ContainsBoxedNumber
-extends [ContainsBoxed](#containsboxed) +public record ContainsBoxedNumber
+implements [ContainsBoxed](#containsboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ContainsBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ContainsBoxedString -public static final class ContainsBoxedString
-extends [ContainsBoxed](#containsboxed) +public record ContainsBoxedString
+implements [ContainsBoxed](#containsboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ContainsBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ContainsBoxedList -public static final class ContainsBoxedList
-extends [ContainsBoxed](#containsboxed) +public record ContainsBoxedList
+implements [ContainsBoxed](#containsboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ContainsBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ContainsBoxedMap -public static final class ContainsBoxedMap
-extends [ContainsBoxed](#containsboxed) +public record ContainsBoxedMap
+implements [ContainsBoxed](#containsboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ContainsBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Contains public static class Contains
@@ -893,5 +939,7 @@ A schema class that validates payloads | [ContainsBoxedBoolean](#containsboxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [ContainsBoxedMap](#containsboxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [ContainsBoxedList](#containsboxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [ContainsBoxed](#containsboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/UnevaluateditemsWithItems.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/UnevaluateditemsWithItems.md index e3e995f14b8..11448ba2e23 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/UnevaluateditemsWithItems.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/UnevaluateditemsWithItems.md @@ -4,7 +4,7 @@ public class UnevaluateditemsWithItems
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated list payloads, extends FrozenList - classes to build inputs for list payloads @@ -12,40 +12,41 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [UnevaluateditemsWithItems.UnevaluateditemsWithItems1Boxed](#unevaluateditemswithitems1boxed)
abstract sealed validated payload class | -| static class | [UnevaluateditemsWithItems.UnevaluateditemsWithItems1BoxedList](#unevaluateditemswithitems1boxedlist)
boxed class to store validated List payloads | +| sealed interface | [UnevaluateditemsWithItems.UnevaluateditemsWithItems1Boxed](#unevaluateditemswithitems1boxed)
sealed interface for validated payloads | +| record | [UnevaluateditemsWithItems.UnevaluateditemsWithItems1BoxedList](#unevaluateditemswithitems1boxedlist)
boxed class to store validated List payloads | | static class | [UnevaluateditemsWithItems.UnevaluateditemsWithItems1](#unevaluateditemswithitems1)
schema class | -| static class | [UnevaluateditemsWithItems.UnevaluatedItemsBoxed](#unevaluateditemsboxed)
abstract sealed validated payload class | -| static class | [UnevaluateditemsWithItems.UnevaluatedItemsBoxedString](#unevaluateditemsboxedstring)
boxed class to store validated String payloads | +| sealed interface | [UnevaluateditemsWithItems.UnevaluatedItemsBoxed](#unevaluateditemsboxed)
sealed interface for validated payloads | +| record | [UnevaluateditemsWithItems.UnevaluatedItemsBoxedString](#unevaluateditemsboxedstring)
boxed class to store validated String payloads | | static class | [UnevaluateditemsWithItems.UnevaluatedItems](#unevaluateditems)
schema class | | static class | [UnevaluateditemsWithItems.UnevaluateditemsWithItemsListBuilder](#unevaluateditemswithitemslistbuilder)
builder for List payloads | | static class | [UnevaluateditemsWithItems.UnevaluateditemsWithItemsList](#unevaluateditemswithitemslist)
output class for List payloads | -| static class | [UnevaluateditemsWithItems.ItemsBoxed](#itemsboxed)
abstract sealed validated payload class | -| static class | [UnevaluateditemsWithItems.ItemsBoxedNumber](#itemsboxednumber)
boxed class to store validated Number payloads | +| sealed interface | [UnevaluateditemsWithItems.ItemsBoxed](#itemsboxed)
sealed interface for validated payloads | +| record | [UnevaluateditemsWithItems.ItemsBoxedNumber](#itemsboxednumber)
boxed class to store validated Number payloads | | static class | [UnevaluateditemsWithItems.Items](#items)
schema class | ## UnevaluateditemsWithItems1Boxed -public static abstract sealed class UnevaluateditemsWithItems1Boxed
+public sealed interface UnevaluateditemsWithItems1Boxed
permits
[UnevaluateditemsWithItems1BoxedList](#unevaluateditemswithitems1boxedlist) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## UnevaluateditemsWithItems1BoxedList -public static final class UnevaluateditemsWithItems1BoxedList
-extends [UnevaluateditemsWithItems1Boxed](#unevaluateditemswithitems1boxed) +public record UnevaluateditemsWithItems1BoxedList
+implements [UnevaluateditemsWithItems1Boxed](#unevaluateditemswithitems1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UnevaluateditemsWithItems1BoxedList([UnevaluateditemsWithItemsList](#unevaluateditemswithitemslist) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [UnevaluateditemsWithItemsList](#unevaluateditemswithitemslist) | data
validated payload | +| [UnevaluateditemsWithItemsList](#unevaluateditemswithitemslist) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UnevaluateditemsWithItems1 public static class UnevaluateditemsWithItems1
@@ -91,29 +92,32 @@ UnevaluateditemsWithItems.UnevaluateditemsWithItemsList validatedPayload = | ----------------- | ---------------------- | | [UnevaluateditemsWithItemsList](#unevaluateditemswithitemslist) | validate([List](#unevaluateditemswithitemslistbuilder) arg, SchemaConfiguration configuration) | | [UnevaluateditemsWithItems1BoxedList](#unevaluateditemswithitems1boxedlist) | validateAndBox([List](#unevaluateditemswithitemslistbuilder) arg, SchemaConfiguration configuration) | +| [UnevaluateditemsWithItems1Boxed](#unevaluateditemswithitems1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## UnevaluatedItemsBoxed -public static abstract sealed class UnevaluatedItemsBoxed
+public sealed interface UnevaluatedItemsBoxed
permits
[UnevaluatedItemsBoxedString](#unevaluateditemsboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## UnevaluatedItemsBoxedString -public static final class UnevaluatedItemsBoxedString
-extends [UnevaluatedItemsBoxed](#unevaluateditemsboxed) +public record UnevaluatedItemsBoxedString
+implements [UnevaluatedItemsBoxed](#unevaluateditemsboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UnevaluatedItemsBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UnevaluatedItems public static class UnevaluatedItems
@@ -159,27 +163,28 @@ A class to store validated List payloads | static [UnevaluateditemsWithItemsList](#unevaluateditemswithitemslist) | of([List](#unevaluateditemswithitemslistbuilder) arg, SchemaConfiguration configuration) | ## ItemsBoxed -public static abstract sealed class ItemsBoxed
+public sealed interface ItemsBoxed
permits
[ItemsBoxedNumber](#itemsboxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ItemsBoxedNumber -public static final class ItemsBoxedNumber
-extends [ItemsBoxed](#itemsboxed) +public record ItemsBoxedNumber
+implements [ItemsBoxed](#itemsboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ItemsBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Items public static class Items
diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/UnevaluateditemsWithNullInstanceElements.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/UnevaluateditemsWithNullInstanceElements.md index 313284c4981..3fc8d9e757c 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/UnevaluateditemsWithNullInstanceElements.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/UnevaluateditemsWithNullInstanceElements.md @@ -4,26 +4,26 @@ public class UnevaluateditemsWithNullInstanceElements
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [UnevaluateditemsWithNullInstanceElements.UnevaluateditemsWithNullInstanceElements1Boxed](#unevaluateditemswithnullinstanceelements1boxed)
abstract sealed validated payload class | -| static class | [UnevaluateditemsWithNullInstanceElements.UnevaluateditemsWithNullInstanceElements1BoxedVoid](#unevaluateditemswithnullinstanceelements1boxedvoid)
boxed class to store validated null payloads | -| static class | [UnevaluateditemsWithNullInstanceElements.UnevaluateditemsWithNullInstanceElements1BoxedBoolean](#unevaluateditemswithnullinstanceelements1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [UnevaluateditemsWithNullInstanceElements.UnevaluateditemsWithNullInstanceElements1BoxedNumber](#unevaluateditemswithnullinstanceelements1boxednumber)
boxed class to store validated Number payloads | -| static class | [UnevaluateditemsWithNullInstanceElements.UnevaluateditemsWithNullInstanceElements1BoxedString](#unevaluateditemswithnullinstanceelements1boxedstring)
boxed class to store validated String payloads | -| static class | [UnevaluateditemsWithNullInstanceElements.UnevaluateditemsWithNullInstanceElements1BoxedList](#unevaluateditemswithnullinstanceelements1boxedlist)
boxed class to store validated List payloads | -| static class | [UnevaluateditemsWithNullInstanceElements.UnevaluateditemsWithNullInstanceElements1BoxedMap](#unevaluateditemswithnullinstanceelements1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [UnevaluateditemsWithNullInstanceElements.UnevaluateditemsWithNullInstanceElements1Boxed](#unevaluateditemswithnullinstanceelements1boxed)
sealed interface for validated payloads | +| record | [UnevaluateditemsWithNullInstanceElements.UnevaluateditemsWithNullInstanceElements1BoxedVoid](#unevaluateditemswithnullinstanceelements1boxedvoid)
boxed class to store validated null payloads | +| record | [UnevaluateditemsWithNullInstanceElements.UnevaluateditemsWithNullInstanceElements1BoxedBoolean](#unevaluateditemswithnullinstanceelements1boxedboolean)
boxed class to store validated boolean payloads | +| record | [UnevaluateditemsWithNullInstanceElements.UnevaluateditemsWithNullInstanceElements1BoxedNumber](#unevaluateditemswithnullinstanceelements1boxednumber)
boxed class to store validated Number payloads | +| record | [UnevaluateditemsWithNullInstanceElements.UnevaluateditemsWithNullInstanceElements1BoxedString](#unevaluateditemswithnullinstanceelements1boxedstring)
boxed class to store validated String payloads | +| record | [UnevaluateditemsWithNullInstanceElements.UnevaluateditemsWithNullInstanceElements1BoxedList](#unevaluateditemswithnullinstanceelements1boxedlist)
boxed class to store validated List payloads | +| record | [UnevaluateditemsWithNullInstanceElements.UnevaluateditemsWithNullInstanceElements1BoxedMap](#unevaluateditemswithnullinstanceelements1boxedmap)
boxed class to store validated Map payloads | | static class | [UnevaluateditemsWithNullInstanceElements.UnevaluateditemsWithNullInstanceElements1](#unevaluateditemswithnullinstanceelements1)
schema class | -| static class | [UnevaluateditemsWithNullInstanceElements.UnevaluatedItemsBoxed](#unevaluateditemsboxed)
abstract sealed validated payload class | -| static class | [UnevaluateditemsWithNullInstanceElements.UnevaluatedItemsBoxedVoid](#unevaluateditemsboxedvoid)
boxed class to store validated null payloads | +| sealed interface | [UnevaluateditemsWithNullInstanceElements.UnevaluatedItemsBoxed](#unevaluateditemsboxed)
sealed interface for validated payloads | +| record | [UnevaluateditemsWithNullInstanceElements.UnevaluatedItemsBoxedVoid](#unevaluateditemsboxedvoid)
boxed class to store validated null payloads | | static class | [UnevaluateditemsWithNullInstanceElements.UnevaluatedItems](#unevaluateditems)
schema class | ## UnevaluateditemsWithNullInstanceElements1Boxed -public static abstract sealed class UnevaluateditemsWithNullInstanceElements1Boxed
+public sealed interface UnevaluateditemsWithNullInstanceElements1Boxed
permits
[UnevaluateditemsWithNullInstanceElements1BoxedVoid](#unevaluateditemswithnullinstanceelements1boxedvoid), [UnevaluateditemsWithNullInstanceElements1BoxedBoolean](#unevaluateditemswithnullinstanceelements1boxedboolean), @@ -32,103 +32,109 @@ permits
[UnevaluateditemsWithNullInstanceElements1BoxedList](#unevaluateditemswithnullinstanceelements1boxedlist), [UnevaluateditemsWithNullInstanceElements1BoxedMap](#unevaluateditemswithnullinstanceelements1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## UnevaluateditemsWithNullInstanceElements1BoxedVoid -public static final class UnevaluateditemsWithNullInstanceElements1BoxedVoid
-extends [UnevaluateditemsWithNullInstanceElements1Boxed](#unevaluateditemswithnullinstanceelements1boxed) +public record UnevaluateditemsWithNullInstanceElements1BoxedVoid
+implements [UnevaluateditemsWithNullInstanceElements1Boxed](#unevaluateditemswithnullinstanceelements1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UnevaluateditemsWithNullInstanceElements1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UnevaluateditemsWithNullInstanceElements1BoxedBoolean -public static final class UnevaluateditemsWithNullInstanceElements1BoxedBoolean
-extends [UnevaluateditemsWithNullInstanceElements1Boxed](#unevaluateditemswithnullinstanceelements1boxed) +public record UnevaluateditemsWithNullInstanceElements1BoxedBoolean
+implements [UnevaluateditemsWithNullInstanceElements1Boxed](#unevaluateditemswithnullinstanceelements1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UnevaluateditemsWithNullInstanceElements1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UnevaluateditemsWithNullInstanceElements1BoxedNumber -public static final class UnevaluateditemsWithNullInstanceElements1BoxedNumber
-extends [UnevaluateditemsWithNullInstanceElements1Boxed](#unevaluateditemswithnullinstanceelements1boxed) +public record UnevaluateditemsWithNullInstanceElements1BoxedNumber
+implements [UnevaluateditemsWithNullInstanceElements1Boxed](#unevaluateditemswithnullinstanceelements1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UnevaluateditemsWithNullInstanceElements1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UnevaluateditemsWithNullInstanceElements1BoxedString -public static final class UnevaluateditemsWithNullInstanceElements1BoxedString
-extends [UnevaluateditemsWithNullInstanceElements1Boxed](#unevaluateditemswithnullinstanceelements1boxed) +public record UnevaluateditemsWithNullInstanceElements1BoxedString
+implements [UnevaluateditemsWithNullInstanceElements1Boxed](#unevaluateditemswithnullinstanceelements1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UnevaluateditemsWithNullInstanceElements1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UnevaluateditemsWithNullInstanceElements1BoxedList -public static final class UnevaluateditemsWithNullInstanceElements1BoxedList
-extends [UnevaluateditemsWithNullInstanceElements1Boxed](#unevaluateditemswithnullinstanceelements1boxed) +public record UnevaluateditemsWithNullInstanceElements1BoxedList
+implements [UnevaluateditemsWithNullInstanceElements1Boxed](#unevaluateditemswithnullinstanceelements1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UnevaluateditemsWithNullInstanceElements1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UnevaluateditemsWithNullInstanceElements1BoxedMap -public static final class UnevaluateditemsWithNullInstanceElements1BoxedMap
-extends [UnevaluateditemsWithNullInstanceElements1Boxed](#unevaluateditemswithnullinstanceelements1boxed) +public record UnevaluateditemsWithNullInstanceElements1BoxedMap
+implements [UnevaluateditemsWithNullInstanceElements1Boxed](#unevaluateditemswithnullinstanceelements1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UnevaluateditemsWithNullInstanceElements1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UnevaluateditemsWithNullInstanceElements1 public static class UnevaluateditemsWithNullInstanceElements1
@@ -160,29 +166,32 @@ A schema class that validates payloads | [UnevaluateditemsWithNullInstanceElements1BoxedBoolean](#unevaluateditemswithnullinstanceelements1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [UnevaluateditemsWithNullInstanceElements1BoxedMap](#unevaluateditemswithnullinstanceelements1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [UnevaluateditemsWithNullInstanceElements1BoxedList](#unevaluateditemswithnullinstanceelements1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [UnevaluateditemsWithNullInstanceElements1Boxed](#unevaluateditemswithnullinstanceelements1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## UnevaluatedItemsBoxed -public static abstract sealed class UnevaluatedItemsBoxed
+public sealed interface UnevaluatedItemsBoxed
permits
[UnevaluatedItemsBoxedVoid](#unevaluateditemsboxedvoid) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## UnevaluatedItemsBoxedVoid -public static final class UnevaluatedItemsBoxedVoid
-extends [UnevaluatedItemsBoxed](#unevaluateditemsboxed) +public record UnevaluatedItemsBoxedVoid
+implements [UnevaluatedItemsBoxed](#unevaluateditemsboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UnevaluatedItemsBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UnevaluatedItems public static class UnevaluatedItems
diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/UnevaluatedpropertiesNotAffectedByPropertynames.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/UnevaluatedpropertiesNotAffectedByPropertynames.md index 5722ada90f8..b86451826dc 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/UnevaluatedpropertiesNotAffectedByPropertynames.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/UnevaluatedpropertiesNotAffectedByPropertynames.md @@ -4,29 +4,29 @@ public class UnevaluatedpropertiesNotAffectedByPropertynames
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [UnevaluatedpropertiesNotAffectedByPropertynames.UnevaluatedpropertiesNotAffectedByPropertynames1Boxed](#unevaluatedpropertiesnotaffectedbypropertynames1boxed)
abstract sealed validated payload class | -| static class | [UnevaluatedpropertiesNotAffectedByPropertynames.UnevaluatedpropertiesNotAffectedByPropertynames1BoxedVoid](#unevaluatedpropertiesnotaffectedbypropertynames1boxedvoid)
boxed class to store validated null payloads | -| static class | [UnevaluatedpropertiesNotAffectedByPropertynames.UnevaluatedpropertiesNotAffectedByPropertynames1BoxedBoolean](#unevaluatedpropertiesnotaffectedbypropertynames1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [UnevaluatedpropertiesNotAffectedByPropertynames.UnevaluatedpropertiesNotAffectedByPropertynames1BoxedNumber](#unevaluatedpropertiesnotaffectedbypropertynames1boxednumber)
boxed class to store validated Number payloads | -| static class | [UnevaluatedpropertiesNotAffectedByPropertynames.UnevaluatedpropertiesNotAffectedByPropertynames1BoxedString](#unevaluatedpropertiesnotaffectedbypropertynames1boxedstring)
boxed class to store validated String payloads | -| static class | [UnevaluatedpropertiesNotAffectedByPropertynames.UnevaluatedpropertiesNotAffectedByPropertynames1BoxedList](#unevaluatedpropertiesnotaffectedbypropertynames1boxedlist)
boxed class to store validated List payloads | -| static class | [UnevaluatedpropertiesNotAffectedByPropertynames.UnevaluatedpropertiesNotAffectedByPropertynames1BoxedMap](#unevaluatedpropertiesnotaffectedbypropertynames1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [UnevaluatedpropertiesNotAffectedByPropertynames.UnevaluatedpropertiesNotAffectedByPropertynames1Boxed](#unevaluatedpropertiesnotaffectedbypropertynames1boxed)
sealed interface for validated payloads | +| record | [UnevaluatedpropertiesNotAffectedByPropertynames.UnevaluatedpropertiesNotAffectedByPropertynames1BoxedVoid](#unevaluatedpropertiesnotaffectedbypropertynames1boxedvoid)
boxed class to store validated null payloads | +| record | [UnevaluatedpropertiesNotAffectedByPropertynames.UnevaluatedpropertiesNotAffectedByPropertynames1BoxedBoolean](#unevaluatedpropertiesnotaffectedbypropertynames1boxedboolean)
boxed class to store validated boolean payloads | +| record | [UnevaluatedpropertiesNotAffectedByPropertynames.UnevaluatedpropertiesNotAffectedByPropertynames1BoxedNumber](#unevaluatedpropertiesnotaffectedbypropertynames1boxednumber)
boxed class to store validated Number payloads | +| record | [UnevaluatedpropertiesNotAffectedByPropertynames.UnevaluatedpropertiesNotAffectedByPropertynames1BoxedString](#unevaluatedpropertiesnotaffectedbypropertynames1boxedstring)
boxed class to store validated String payloads | +| record | [UnevaluatedpropertiesNotAffectedByPropertynames.UnevaluatedpropertiesNotAffectedByPropertynames1BoxedList](#unevaluatedpropertiesnotaffectedbypropertynames1boxedlist)
boxed class to store validated List payloads | +| record | [UnevaluatedpropertiesNotAffectedByPropertynames.UnevaluatedpropertiesNotAffectedByPropertynames1BoxedMap](#unevaluatedpropertiesnotaffectedbypropertynames1boxedmap)
boxed class to store validated Map payloads | | static class | [UnevaluatedpropertiesNotAffectedByPropertynames.UnevaluatedpropertiesNotAffectedByPropertynames1](#unevaluatedpropertiesnotaffectedbypropertynames1)
schema class | -| static class | [UnevaluatedpropertiesNotAffectedByPropertynames.UnevaluatedPropertiesBoxed](#unevaluatedpropertiesboxed)
abstract sealed validated payload class | -| static class | [UnevaluatedpropertiesNotAffectedByPropertynames.UnevaluatedPropertiesBoxedNumber](#unevaluatedpropertiesboxednumber)
boxed class to store validated Number payloads | +| sealed interface | [UnevaluatedpropertiesNotAffectedByPropertynames.UnevaluatedPropertiesBoxed](#unevaluatedpropertiesboxed)
sealed interface for validated payloads | +| record | [UnevaluatedpropertiesNotAffectedByPropertynames.UnevaluatedPropertiesBoxedNumber](#unevaluatedpropertiesboxednumber)
boxed class to store validated Number payloads | | static class | [UnevaluatedpropertiesNotAffectedByPropertynames.UnevaluatedProperties](#unevaluatedproperties)
schema class | -| static class | [UnevaluatedpropertiesNotAffectedByPropertynames.PropertyNamesBoxed](#propertynamesboxed)
abstract sealed validated payload class | -| static class | [UnevaluatedpropertiesNotAffectedByPropertynames.PropertyNamesBoxedString](#propertynamesboxedstring)
boxed class to store validated String payloads | +| sealed interface | [UnevaluatedpropertiesNotAffectedByPropertynames.PropertyNamesBoxed](#propertynamesboxed)
sealed interface for validated payloads | +| record | [UnevaluatedpropertiesNotAffectedByPropertynames.PropertyNamesBoxedString](#propertynamesboxedstring)
boxed class to store validated String payloads | | static class | [UnevaluatedpropertiesNotAffectedByPropertynames.PropertyNames](#propertynames)
schema class | ## UnevaluatedpropertiesNotAffectedByPropertynames1Boxed -public static abstract sealed class UnevaluatedpropertiesNotAffectedByPropertynames1Boxed
+public sealed interface UnevaluatedpropertiesNotAffectedByPropertynames1Boxed
permits
[UnevaluatedpropertiesNotAffectedByPropertynames1BoxedVoid](#unevaluatedpropertiesnotaffectedbypropertynames1boxedvoid), [UnevaluatedpropertiesNotAffectedByPropertynames1BoxedBoolean](#unevaluatedpropertiesnotaffectedbypropertynames1boxedboolean), @@ -35,103 +35,109 @@ permits
[UnevaluatedpropertiesNotAffectedByPropertynames1BoxedList](#unevaluatedpropertiesnotaffectedbypropertynames1boxedlist), [UnevaluatedpropertiesNotAffectedByPropertynames1BoxedMap](#unevaluatedpropertiesnotaffectedbypropertynames1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## UnevaluatedpropertiesNotAffectedByPropertynames1BoxedVoid -public static final class UnevaluatedpropertiesNotAffectedByPropertynames1BoxedVoid
-extends [UnevaluatedpropertiesNotAffectedByPropertynames1Boxed](#unevaluatedpropertiesnotaffectedbypropertynames1boxed) +public record UnevaluatedpropertiesNotAffectedByPropertynames1BoxedVoid
+implements [UnevaluatedpropertiesNotAffectedByPropertynames1Boxed](#unevaluatedpropertiesnotaffectedbypropertynames1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UnevaluatedpropertiesNotAffectedByPropertynames1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UnevaluatedpropertiesNotAffectedByPropertynames1BoxedBoolean -public static final class UnevaluatedpropertiesNotAffectedByPropertynames1BoxedBoolean
-extends [UnevaluatedpropertiesNotAffectedByPropertynames1Boxed](#unevaluatedpropertiesnotaffectedbypropertynames1boxed) +public record UnevaluatedpropertiesNotAffectedByPropertynames1BoxedBoolean
+implements [UnevaluatedpropertiesNotAffectedByPropertynames1Boxed](#unevaluatedpropertiesnotaffectedbypropertynames1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UnevaluatedpropertiesNotAffectedByPropertynames1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UnevaluatedpropertiesNotAffectedByPropertynames1BoxedNumber -public static final class UnevaluatedpropertiesNotAffectedByPropertynames1BoxedNumber
-extends [UnevaluatedpropertiesNotAffectedByPropertynames1Boxed](#unevaluatedpropertiesnotaffectedbypropertynames1boxed) +public record UnevaluatedpropertiesNotAffectedByPropertynames1BoxedNumber
+implements [UnevaluatedpropertiesNotAffectedByPropertynames1Boxed](#unevaluatedpropertiesnotaffectedbypropertynames1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UnevaluatedpropertiesNotAffectedByPropertynames1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UnevaluatedpropertiesNotAffectedByPropertynames1BoxedString -public static final class UnevaluatedpropertiesNotAffectedByPropertynames1BoxedString
-extends [UnevaluatedpropertiesNotAffectedByPropertynames1Boxed](#unevaluatedpropertiesnotaffectedbypropertynames1boxed) +public record UnevaluatedpropertiesNotAffectedByPropertynames1BoxedString
+implements [UnevaluatedpropertiesNotAffectedByPropertynames1Boxed](#unevaluatedpropertiesnotaffectedbypropertynames1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UnevaluatedpropertiesNotAffectedByPropertynames1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UnevaluatedpropertiesNotAffectedByPropertynames1BoxedList -public static final class UnevaluatedpropertiesNotAffectedByPropertynames1BoxedList
-extends [UnevaluatedpropertiesNotAffectedByPropertynames1Boxed](#unevaluatedpropertiesnotaffectedbypropertynames1boxed) +public record UnevaluatedpropertiesNotAffectedByPropertynames1BoxedList
+implements [UnevaluatedpropertiesNotAffectedByPropertynames1Boxed](#unevaluatedpropertiesnotaffectedbypropertynames1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UnevaluatedpropertiesNotAffectedByPropertynames1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UnevaluatedpropertiesNotAffectedByPropertynames1BoxedMap -public static final class UnevaluatedpropertiesNotAffectedByPropertynames1BoxedMap
-extends [UnevaluatedpropertiesNotAffectedByPropertynames1Boxed](#unevaluatedpropertiesnotaffectedbypropertynames1boxed) +public record UnevaluatedpropertiesNotAffectedByPropertynames1BoxedMap
+implements [UnevaluatedpropertiesNotAffectedByPropertynames1Boxed](#unevaluatedpropertiesnotaffectedbypropertynames1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UnevaluatedpropertiesNotAffectedByPropertynames1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UnevaluatedpropertiesNotAffectedByPropertynames1 public static class UnevaluatedpropertiesNotAffectedByPropertynames1
@@ -164,29 +170,32 @@ A schema class that validates payloads | [UnevaluatedpropertiesNotAffectedByPropertynames1BoxedBoolean](#unevaluatedpropertiesnotaffectedbypropertynames1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [UnevaluatedpropertiesNotAffectedByPropertynames1BoxedMap](#unevaluatedpropertiesnotaffectedbypropertynames1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [UnevaluatedpropertiesNotAffectedByPropertynames1BoxedList](#unevaluatedpropertiesnotaffectedbypropertynames1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [UnevaluatedpropertiesNotAffectedByPropertynames1Boxed](#unevaluatedpropertiesnotaffectedbypropertynames1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## UnevaluatedPropertiesBoxed -public static abstract sealed class UnevaluatedPropertiesBoxed
+public sealed interface UnevaluatedPropertiesBoxed
permits
[UnevaluatedPropertiesBoxedNumber](#unevaluatedpropertiesboxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## UnevaluatedPropertiesBoxedNumber -public static final class UnevaluatedPropertiesBoxedNumber
-extends [UnevaluatedPropertiesBoxed](#unevaluatedpropertiesboxed) +public record UnevaluatedPropertiesBoxedNumber
+implements [UnevaluatedPropertiesBoxed](#unevaluatedpropertiesboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UnevaluatedPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UnevaluatedProperties public static class UnevaluatedProperties
@@ -200,27 +209,28 @@ A schema class that validates payloads | validateAndBox | ## PropertyNamesBoxed -public static abstract sealed class PropertyNamesBoxed
+public sealed interface PropertyNamesBoxed
permits
[PropertyNamesBoxedString](#propertynamesboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## PropertyNamesBoxedString -public static final class PropertyNamesBoxedString
-extends [PropertyNamesBoxed](#propertynamesboxed) +public record PropertyNamesBoxedString
+implements [PropertyNamesBoxed](#propertynamesboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PropertyNamesBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PropertyNames public static class PropertyNames
@@ -261,5 +271,7 @@ String validatedPayload = UnevaluatedpropertiesNotAffectedByPropertynames.Proper | ----------------- | ---------------------- | | String | validate(String arg, SchemaConfiguration configuration) | | [PropertyNamesBoxedString](#propertynamesboxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [PropertyNamesBoxed](#propertynamesboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/UnevaluatedpropertiesSchema.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/UnevaluatedpropertiesSchema.md index e0afa2a059c..36d0b5dd424 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/UnevaluatedpropertiesSchema.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/UnevaluatedpropertiesSchema.md @@ -4,41 +4,42 @@ public class UnevaluatedpropertiesSchema
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [UnevaluatedpropertiesSchema.UnevaluatedpropertiesSchema1Boxed](#unevaluatedpropertiesschema1boxed)
abstract sealed validated payload class | -| static class | [UnevaluatedpropertiesSchema.UnevaluatedpropertiesSchema1BoxedMap](#unevaluatedpropertiesschema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [UnevaluatedpropertiesSchema.UnevaluatedpropertiesSchema1Boxed](#unevaluatedpropertiesschema1boxed)
sealed interface for validated payloads | +| record | [UnevaluatedpropertiesSchema.UnevaluatedpropertiesSchema1BoxedMap](#unevaluatedpropertiesschema1boxedmap)
boxed class to store validated Map payloads | | static class | [UnevaluatedpropertiesSchema.UnevaluatedpropertiesSchema1](#unevaluatedpropertiesschema1)
schema class | -| static class | [UnevaluatedpropertiesSchema.UnevaluatedPropertiesBoxed](#unevaluatedpropertiesboxed)
abstract sealed validated payload class | -| static class | [UnevaluatedpropertiesSchema.UnevaluatedPropertiesBoxedString](#unevaluatedpropertiesboxedstring)
boxed class to store validated String payloads | +| sealed interface | [UnevaluatedpropertiesSchema.UnevaluatedPropertiesBoxed](#unevaluatedpropertiesboxed)
sealed interface for validated payloads | +| record | [UnevaluatedpropertiesSchema.UnevaluatedPropertiesBoxedString](#unevaluatedpropertiesboxedstring)
boxed class to store validated String payloads | | static class | [UnevaluatedpropertiesSchema.UnevaluatedProperties](#unevaluatedproperties)
schema class | ## UnevaluatedpropertiesSchema1Boxed -public static abstract sealed class UnevaluatedpropertiesSchema1Boxed
+public sealed interface UnevaluatedpropertiesSchema1Boxed
permits
[UnevaluatedpropertiesSchema1BoxedMap](#unevaluatedpropertiesschema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## UnevaluatedpropertiesSchema1BoxedMap -public static final class UnevaluatedpropertiesSchema1BoxedMap
-extends [UnevaluatedpropertiesSchema1Boxed](#unevaluatedpropertiesschema1boxed) +public record UnevaluatedpropertiesSchema1BoxedMap
+implements [UnevaluatedpropertiesSchema1Boxed](#unevaluatedpropertiesschema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UnevaluatedpropertiesSchema1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UnevaluatedpropertiesSchema1 public static class UnevaluatedpropertiesSchema1
@@ -57,29 +58,32 @@ A schema class that validates payloads | ----------------- | ---------------------- | | FrozenMap | validate(Map<?, ?> arg, SchemaConfiguration configuration) | | [UnevaluatedpropertiesSchema1BoxedMap](#unevaluatedpropertiesschema1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | +| [UnevaluatedpropertiesSchema1Boxed](#unevaluatedpropertiesschema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## UnevaluatedPropertiesBoxed -public static abstract sealed class UnevaluatedPropertiesBoxed
+public sealed interface UnevaluatedPropertiesBoxed
permits
[UnevaluatedPropertiesBoxedString](#unevaluatedpropertiesboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## UnevaluatedPropertiesBoxedString -public static final class UnevaluatedPropertiesBoxedString
-extends [UnevaluatedPropertiesBoxed](#unevaluatedpropertiesboxed) +public record UnevaluatedPropertiesBoxedString
+implements [UnevaluatedPropertiesBoxed](#unevaluatedpropertiesboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UnevaluatedPropertiesBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UnevaluatedProperties public static class UnevaluatedProperties
@@ -120,5 +124,7 @@ String validatedPayload = UnevaluatedpropertiesSchema.UnevaluatedProperties.vali | ----------------- | ---------------------- | | String | validate(String arg, SchemaConfiguration configuration) | | [UnevaluatedPropertiesBoxedString](#unevaluatedpropertiesboxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [UnevaluatedPropertiesBoxed](#unevaluatedpropertiesboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/UnevaluatedpropertiesWithAdjacentAdditionalproperties.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/UnevaluatedpropertiesWithAdjacentAdditionalproperties.md index c51e89ed94b..862619af3f6 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/UnevaluatedpropertiesWithAdjacentAdditionalproperties.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/UnevaluatedpropertiesWithAdjacentAdditionalproperties.md @@ -4,7 +4,7 @@ public class UnevaluatedpropertiesWithAdjacentAdditionalproperties
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,53 +12,54 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [UnevaluatedpropertiesWithAdjacentAdditionalproperties.UnevaluatedpropertiesWithAdjacentAdditionalproperties1Boxed](#unevaluatedpropertieswithadjacentadditionalproperties1boxed)
abstract sealed validated payload class | -| static class | [UnevaluatedpropertiesWithAdjacentAdditionalproperties.UnevaluatedpropertiesWithAdjacentAdditionalproperties1BoxedMap](#unevaluatedpropertieswithadjacentadditionalproperties1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [UnevaluatedpropertiesWithAdjacentAdditionalproperties.UnevaluatedpropertiesWithAdjacentAdditionalproperties1Boxed](#unevaluatedpropertieswithadjacentadditionalproperties1boxed)
sealed interface for validated payloads | +| record | [UnevaluatedpropertiesWithAdjacentAdditionalproperties.UnevaluatedpropertiesWithAdjacentAdditionalproperties1BoxedMap](#unevaluatedpropertieswithadjacentadditionalproperties1boxedmap)
boxed class to store validated Map payloads | | static class | [UnevaluatedpropertiesWithAdjacentAdditionalproperties.UnevaluatedpropertiesWithAdjacentAdditionalproperties1](#unevaluatedpropertieswithadjacentadditionalproperties1)
schema class | -| static class | [UnevaluatedpropertiesWithAdjacentAdditionalproperties.UnevaluatedPropertiesBoxed](#unevaluatedpropertiesboxed)
abstract sealed validated payload class | -| static class | [UnevaluatedpropertiesWithAdjacentAdditionalproperties.UnevaluatedPropertiesBoxedVoid](#unevaluatedpropertiesboxedvoid)
boxed class to store validated null payloads | -| static class | [UnevaluatedpropertiesWithAdjacentAdditionalproperties.UnevaluatedPropertiesBoxedBoolean](#unevaluatedpropertiesboxedboolean)
boxed class to store validated boolean payloads | -| static class | [UnevaluatedpropertiesWithAdjacentAdditionalproperties.UnevaluatedPropertiesBoxedNumber](#unevaluatedpropertiesboxednumber)
boxed class to store validated Number payloads | -| static class | [UnevaluatedpropertiesWithAdjacentAdditionalproperties.UnevaluatedPropertiesBoxedString](#unevaluatedpropertiesboxedstring)
boxed class to store validated String payloads | -| static class | [UnevaluatedpropertiesWithAdjacentAdditionalproperties.UnevaluatedPropertiesBoxedList](#unevaluatedpropertiesboxedlist)
boxed class to store validated List payloads | -| static class | [UnevaluatedpropertiesWithAdjacentAdditionalproperties.UnevaluatedPropertiesBoxedMap](#unevaluatedpropertiesboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [UnevaluatedpropertiesWithAdjacentAdditionalproperties.UnevaluatedPropertiesBoxed](#unevaluatedpropertiesboxed)
sealed interface for validated payloads | +| record | [UnevaluatedpropertiesWithAdjacentAdditionalproperties.UnevaluatedPropertiesBoxedVoid](#unevaluatedpropertiesboxedvoid)
boxed class to store validated null payloads | +| record | [UnevaluatedpropertiesWithAdjacentAdditionalproperties.UnevaluatedPropertiesBoxedBoolean](#unevaluatedpropertiesboxedboolean)
boxed class to store validated boolean payloads | +| record | [UnevaluatedpropertiesWithAdjacentAdditionalproperties.UnevaluatedPropertiesBoxedNumber](#unevaluatedpropertiesboxednumber)
boxed class to store validated Number payloads | +| record | [UnevaluatedpropertiesWithAdjacentAdditionalproperties.UnevaluatedPropertiesBoxedString](#unevaluatedpropertiesboxedstring)
boxed class to store validated String payloads | +| record | [UnevaluatedpropertiesWithAdjacentAdditionalproperties.UnevaluatedPropertiesBoxedList](#unevaluatedpropertiesboxedlist)
boxed class to store validated List payloads | +| record | [UnevaluatedpropertiesWithAdjacentAdditionalproperties.UnevaluatedPropertiesBoxedMap](#unevaluatedpropertiesboxedmap)
boxed class to store validated Map payloads | | static class | [UnevaluatedpropertiesWithAdjacentAdditionalproperties.UnevaluatedProperties](#unevaluatedproperties)
schema class | | static class | [UnevaluatedpropertiesWithAdjacentAdditionalproperties.UnevaluatedpropertiesWithAdjacentAdditionalpropertiesMapBuilder](#unevaluatedpropertieswithadjacentadditionalpropertiesmapbuilder)
builder for Map payloads | | static class | [UnevaluatedpropertiesWithAdjacentAdditionalproperties.UnevaluatedpropertiesWithAdjacentAdditionalpropertiesMap](#unevaluatedpropertieswithadjacentadditionalpropertiesmap)
output class for Map payloads | -| static class | [UnevaluatedpropertiesWithAdjacentAdditionalproperties.FooBoxed](#fooboxed)
abstract sealed validated payload class | -| static class | [UnevaluatedpropertiesWithAdjacentAdditionalproperties.FooBoxedString](#fooboxedstring)
boxed class to store validated String payloads | +| sealed interface | [UnevaluatedpropertiesWithAdjacentAdditionalproperties.FooBoxed](#fooboxed)
sealed interface for validated payloads | +| record | [UnevaluatedpropertiesWithAdjacentAdditionalproperties.FooBoxedString](#fooboxedstring)
boxed class to store validated String payloads | | static class | [UnevaluatedpropertiesWithAdjacentAdditionalproperties.Foo](#foo)
schema class | -| static class | [UnevaluatedpropertiesWithAdjacentAdditionalproperties.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
abstract sealed validated payload class | -| static class | [UnevaluatedpropertiesWithAdjacentAdditionalproperties.AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid)
boxed class to store validated null payloads | -| static class | [UnevaluatedpropertiesWithAdjacentAdditionalproperties.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | -| static class | [UnevaluatedpropertiesWithAdjacentAdditionalproperties.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | -| static class | [UnevaluatedpropertiesWithAdjacentAdditionalproperties.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | -| static class | [UnevaluatedpropertiesWithAdjacentAdditionalproperties.AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist)
boxed class to store validated List payloads | -| static class | [UnevaluatedpropertiesWithAdjacentAdditionalproperties.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [UnevaluatedpropertiesWithAdjacentAdditionalproperties.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
sealed interface for validated payloads | +| record | [UnevaluatedpropertiesWithAdjacentAdditionalproperties.AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid)
boxed class to store validated null payloads | +| record | [UnevaluatedpropertiesWithAdjacentAdditionalproperties.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | +| record | [UnevaluatedpropertiesWithAdjacentAdditionalproperties.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | +| record | [UnevaluatedpropertiesWithAdjacentAdditionalproperties.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | +| record | [UnevaluatedpropertiesWithAdjacentAdditionalproperties.AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist)
boxed class to store validated List payloads | +| record | [UnevaluatedpropertiesWithAdjacentAdditionalproperties.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | | static class | [UnevaluatedpropertiesWithAdjacentAdditionalproperties.AdditionalProperties](#additionalproperties)
schema class | ## UnevaluatedpropertiesWithAdjacentAdditionalproperties1Boxed -public static abstract sealed class UnevaluatedpropertiesWithAdjacentAdditionalproperties1Boxed
+public sealed interface UnevaluatedpropertiesWithAdjacentAdditionalproperties1Boxed
permits
[UnevaluatedpropertiesWithAdjacentAdditionalproperties1BoxedMap](#unevaluatedpropertieswithadjacentadditionalproperties1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## UnevaluatedpropertiesWithAdjacentAdditionalproperties1BoxedMap -public static final class UnevaluatedpropertiesWithAdjacentAdditionalproperties1BoxedMap
-extends [UnevaluatedpropertiesWithAdjacentAdditionalproperties1Boxed](#unevaluatedpropertieswithadjacentadditionalproperties1boxed) +public record UnevaluatedpropertiesWithAdjacentAdditionalproperties1BoxedMap
+implements [UnevaluatedpropertiesWithAdjacentAdditionalproperties1Boxed](#unevaluatedpropertieswithadjacentadditionalproperties1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UnevaluatedpropertiesWithAdjacentAdditionalproperties1BoxedMap([UnevaluatedpropertiesWithAdjacentAdditionalpropertiesMap](#unevaluatedpropertieswithadjacentadditionalpropertiesmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [UnevaluatedpropertiesWithAdjacentAdditionalpropertiesMap](#unevaluatedpropertieswithadjacentadditionalpropertiesmap) | data
validated payload | +| [UnevaluatedpropertiesWithAdjacentAdditionalpropertiesMap](#unevaluatedpropertieswithadjacentadditionalpropertiesmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UnevaluatedpropertiesWithAdjacentAdditionalproperties1 public static class UnevaluatedpropertiesWithAdjacentAdditionalproperties1
@@ -105,9 +106,11 @@ UnevaluatedpropertiesWithAdjacentAdditionalproperties.UnevaluatedpropertiesWithA | ----------------- | ---------------------- | | [UnevaluatedpropertiesWithAdjacentAdditionalpropertiesMap](#unevaluatedpropertieswithadjacentadditionalpropertiesmap) | validate([Map<?, ?>](#unevaluatedpropertieswithadjacentadditionalpropertiesmapbuilder) arg, SchemaConfiguration configuration) | | [UnevaluatedpropertiesWithAdjacentAdditionalproperties1BoxedMap](#unevaluatedpropertieswithadjacentadditionalproperties1boxedmap) | validateAndBox([Map<?, ?>](#unevaluatedpropertieswithadjacentadditionalpropertiesmapbuilder) arg, SchemaConfiguration configuration) | +| [UnevaluatedpropertiesWithAdjacentAdditionalproperties1Boxed](#unevaluatedpropertieswithadjacentadditionalproperties1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## UnevaluatedPropertiesBoxed -public static abstract sealed class UnevaluatedPropertiesBoxed
+public sealed interface UnevaluatedPropertiesBoxed
permits
[UnevaluatedPropertiesBoxedVoid](#unevaluatedpropertiesboxedvoid), [UnevaluatedPropertiesBoxedBoolean](#unevaluatedpropertiesboxedboolean), @@ -116,103 +119,109 @@ permits
[UnevaluatedPropertiesBoxedList](#unevaluatedpropertiesboxedlist), [UnevaluatedPropertiesBoxedMap](#unevaluatedpropertiesboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## UnevaluatedPropertiesBoxedVoid -public static final class UnevaluatedPropertiesBoxedVoid
-extends [UnevaluatedPropertiesBoxed](#unevaluatedpropertiesboxed) +public record UnevaluatedPropertiesBoxedVoid
+implements [UnevaluatedPropertiesBoxed](#unevaluatedpropertiesboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UnevaluatedPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UnevaluatedPropertiesBoxedBoolean -public static final class UnevaluatedPropertiesBoxedBoolean
-extends [UnevaluatedPropertiesBoxed](#unevaluatedpropertiesboxed) +public record UnevaluatedPropertiesBoxedBoolean
+implements [UnevaluatedPropertiesBoxed](#unevaluatedpropertiesboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UnevaluatedPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UnevaluatedPropertiesBoxedNumber -public static final class UnevaluatedPropertiesBoxedNumber
-extends [UnevaluatedPropertiesBoxed](#unevaluatedpropertiesboxed) +public record UnevaluatedPropertiesBoxedNumber
+implements [UnevaluatedPropertiesBoxed](#unevaluatedpropertiesboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UnevaluatedPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UnevaluatedPropertiesBoxedString -public static final class UnevaluatedPropertiesBoxedString
-extends [UnevaluatedPropertiesBoxed](#unevaluatedpropertiesboxed) +public record UnevaluatedPropertiesBoxedString
+implements [UnevaluatedPropertiesBoxed](#unevaluatedpropertiesboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UnevaluatedPropertiesBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UnevaluatedPropertiesBoxedList -public static final class UnevaluatedPropertiesBoxedList
-extends [UnevaluatedPropertiesBoxed](#unevaluatedpropertiesboxed) +public record UnevaluatedPropertiesBoxedList
+implements [UnevaluatedPropertiesBoxed](#unevaluatedpropertiesboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UnevaluatedPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UnevaluatedPropertiesBoxedMap -public static final class UnevaluatedPropertiesBoxedMap
-extends [UnevaluatedPropertiesBoxed](#unevaluatedpropertiesboxed) +public record UnevaluatedPropertiesBoxedMap
+implements [UnevaluatedPropertiesBoxed](#unevaluatedpropertiesboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UnevaluatedPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UnevaluatedProperties public static class UnevaluatedProperties
@@ -265,27 +274,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## FooBoxed -public static abstract sealed class FooBoxed
+public sealed interface FooBoxed
permits
[FooBoxedString](#fooboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## FooBoxedString -public static final class FooBoxedString
-extends [FooBoxed](#fooboxed) +public record FooBoxedString
+implements [FooBoxed](#fooboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Foo public static class Foo
@@ -299,7 +309,7 @@ A schema class that validates payloads | validateAndBox | ## AdditionalPropertiesBoxed -public static abstract sealed class AdditionalPropertiesBoxed
+public sealed interface AdditionalPropertiesBoxed
permits
[AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid), [AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean), @@ -308,103 +318,109 @@ permits
[AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist), [AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AdditionalPropertiesBoxedVoid -public static final class AdditionalPropertiesBoxedVoid
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedVoid
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedBoolean -public static final class AdditionalPropertiesBoxedBoolean
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedBoolean
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedNumber -public static final class AdditionalPropertiesBoxedNumber
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedNumber
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedString -public static final class AdditionalPropertiesBoxedString
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedString
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedList -public static final class AdditionalPropertiesBoxedList
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedList
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedMap -public static final class AdditionalPropertiesBoxedMap
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedMap
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalProperties public static class AdditionalProperties
diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/UnevaluatedpropertiesWithNullValuedInstanceProperties.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/UnevaluatedpropertiesWithNullValuedInstanceProperties.md index 8d1e7953dc1..128bdcf42de 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/UnevaluatedpropertiesWithNullValuedInstanceProperties.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/UnevaluatedpropertiesWithNullValuedInstanceProperties.md @@ -4,26 +4,26 @@ public class UnevaluatedpropertiesWithNullValuedInstanceProperties
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [UnevaluatedpropertiesWithNullValuedInstanceProperties.UnevaluatedpropertiesWithNullValuedInstanceProperties1Boxed](#unevaluatedpropertieswithnullvaluedinstanceproperties1boxed)
abstract sealed validated payload class | -| static class | [UnevaluatedpropertiesWithNullValuedInstanceProperties.UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedVoid](#unevaluatedpropertieswithnullvaluedinstanceproperties1boxedvoid)
boxed class to store validated null payloads | -| static class | [UnevaluatedpropertiesWithNullValuedInstanceProperties.UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedBoolean](#unevaluatedpropertieswithnullvaluedinstanceproperties1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [UnevaluatedpropertiesWithNullValuedInstanceProperties.UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedNumber](#unevaluatedpropertieswithnullvaluedinstanceproperties1boxednumber)
boxed class to store validated Number payloads | -| static class | [UnevaluatedpropertiesWithNullValuedInstanceProperties.UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedString](#unevaluatedpropertieswithnullvaluedinstanceproperties1boxedstring)
boxed class to store validated String payloads | -| static class | [UnevaluatedpropertiesWithNullValuedInstanceProperties.UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedList](#unevaluatedpropertieswithnullvaluedinstanceproperties1boxedlist)
boxed class to store validated List payloads | -| static class | [UnevaluatedpropertiesWithNullValuedInstanceProperties.UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedMap](#unevaluatedpropertieswithnullvaluedinstanceproperties1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [UnevaluatedpropertiesWithNullValuedInstanceProperties.UnevaluatedpropertiesWithNullValuedInstanceProperties1Boxed](#unevaluatedpropertieswithnullvaluedinstanceproperties1boxed)
sealed interface for validated payloads | +| record | [UnevaluatedpropertiesWithNullValuedInstanceProperties.UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedVoid](#unevaluatedpropertieswithnullvaluedinstanceproperties1boxedvoid)
boxed class to store validated null payloads | +| record | [UnevaluatedpropertiesWithNullValuedInstanceProperties.UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedBoolean](#unevaluatedpropertieswithnullvaluedinstanceproperties1boxedboolean)
boxed class to store validated boolean payloads | +| record | [UnevaluatedpropertiesWithNullValuedInstanceProperties.UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedNumber](#unevaluatedpropertieswithnullvaluedinstanceproperties1boxednumber)
boxed class to store validated Number payloads | +| record | [UnevaluatedpropertiesWithNullValuedInstanceProperties.UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedString](#unevaluatedpropertieswithnullvaluedinstanceproperties1boxedstring)
boxed class to store validated String payloads | +| record | [UnevaluatedpropertiesWithNullValuedInstanceProperties.UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedList](#unevaluatedpropertieswithnullvaluedinstanceproperties1boxedlist)
boxed class to store validated List payloads | +| record | [UnevaluatedpropertiesWithNullValuedInstanceProperties.UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedMap](#unevaluatedpropertieswithnullvaluedinstanceproperties1boxedmap)
boxed class to store validated Map payloads | | static class | [UnevaluatedpropertiesWithNullValuedInstanceProperties.UnevaluatedpropertiesWithNullValuedInstanceProperties1](#unevaluatedpropertieswithnullvaluedinstanceproperties1)
schema class | -| static class | [UnevaluatedpropertiesWithNullValuedInstanceProperties.UnevaluatedPropertiesBoxed](#unevaluatedpropertiesboxed)
abstract sealed validated payload class | -| static class | [UnevaluatedpropertiesWithNullValuedInstanceProperties.UnevaluatedPropertiesBoxedVoid](#unevaluatedpropertiesboxedvoid)
boxed class to store validated null payloads | +| sealed interface | [UnevaluatedpropertiesWithNullValuedInstanceProperties.UnevaluatedPropertiesBoxed](#unevaluatedpropertiesboxed)
sealed interface for validated payloads | +| record | [UnevaluatedpropertiesWithNullValuedInstanceProperties.UnevaluatedPropertiesBoxedVoid](#unevaluatedpropertiesboxedvoid)
boxed class to store validated null payloads | | static class | [UnevaluatedpropertiesWithNullValuedInstanceProperties.UnevaluatedProperties](#unevaluatedproperties)
schema class | ## UnevaluatedpropertiesWithNullValuedInstanceProperties1Boxed -public static abstract sealed class UnevaluatedpropertiesWithNullValuedInstanceProperties1Boxed
+public sealed interface UnevaluatedpropertiesWithNullValuedInstanceProperties1Boxed
permits
[UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedVoid](#unevaluatedpropertieswithnullvaluedinstanceproperties1boxedvoid), [UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedBoolean](#unevaluatedpropertieswithnullvaluedinstanceproperties1boxedboolean), @@ -32,103 +32,109 @@ permits
[UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedList](#unevaluatedpropertieswithnullvaluedinstanceproperties1boxedlist), [UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedMap](#unevaluatedpropertieswithnullvaluedinstanceproperties1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedVoid -public static final class UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedVoid
-extends [UnevaluatedpropertiesWithNullValuedInstanceProperties1Boxed](#unevaluatedpropertieswithnullvaluedinstanceproperties1boxed) +public record UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedVoid
+implements [UnevaluatedpropertiesWithNullValuedInstanceProperties1Boxed](#unevaluatedpropertieswithnullvaluedinstanceproperties1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedBoolean -public static final class UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedBoolean
-extends [UnevaluatedpropertiesWithNullValuedInstanceProperties1Boxed](#unevaluatedpropertieswithnullvaluedinstanceproperties1boxed) +public record UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedBoolean
+implements [UnevaluatedpropertiesWithNullValuedInstanceProperties1Boxed](#unevaluatedpropertieswithnullvaluedinstanceproperties1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedNumber -public static final class UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedNumber
-extends [UnevaluatedpropertiesWithNullValuedInstanceProperties1Boxed](#unevaluatedpropertieswithnullvaluedinstanceproperties1boxed) +public record UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedNumber
+implements [UnevaluatedpropertiesWithNullValuedInstanceProperties1Boxed](#unevaluatedpropertieswithnullvaluedinstanceproperties1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedString -public static final class UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedString
-extends [UnevaluatedpropertiesWithNullValuedInstanceProperties1Boxed](#unevaluatedpropertieswithnullvaluedinstanceproperties1boxed) +public record UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedString
+implements [UnevaluatedpropertiesWithNullValuedInstanceProperties1Boxed](#unevaluatedpropertieswithnullvaluedinstanceproperties1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedList -public static final class UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedList
-extends [UnevaluatedpropertiesWithNullValuedInstanceProperties1Boxed](#unevaluatedpropertieswithnullvaluedinstanceproperties1boxed) +public record UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedList
+implements [UnevaluatedpropertiesWithNullValuedInstanceProperties1Boxed](#unevaluatedpropertieswithnullvaluedinstanceproperties1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedMap -public static final class UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedMap
-extends [UnevaluatedpropertiesWithNullValuedInstanceProperties1Boxed](#unevaluatedpropertieswithnullvaluedinstanceproperties1boxed) +public record UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedMap
+implements [UnevaluatedpropertiesWithNullValuedInstanceProperties1Boxed](#unevaluatedpropertieswithnullvaluedinstanceproperties1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UnevaluatedpropertiesWithNullValuedInstanceProperties1 public static class UnevaluatedpropertiesWithNullValuedInstanceProperties1
@@ -160,29 +166,32 @@ A schema class that validates payloads | [UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedBoolean](#unevaluatedpropertieswithnullvaluedinstanceproperties1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedMap](#unevaluatedpropertieswithnullvaluedinstanceproperties1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedList](#unevaluatedpropertieswithnullvaluedinstanceproperties1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [UnevaluatedpropertiesWithNullValuedInstanceProperties1Boxed](#unevaluatedpropertieswithnullvaluedinstanceproperties1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## UnevaluatedPropertiesBoxed -public static abstract sealed class UnevaluatedPropertiesBoxed
+public sealed interface UnevaluatedPropertiesBoxed
permits
[UnevaluatedPropertiesBoxedVoid](#unevaluatedpropertiesboxedvoid) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## UnevaluatedPropertiesBoxedVoid -public static final class UnevaluatedPropertiesBoxedVoid
-extends [UnevaluatedPropertiesBoxed](#unevaluatedpropertiesboxed) +public record UnevaluatedPropertiesBoxedVoid
+implements [UnevaluatedPropertiesBoxed](#unevaluatedpropertiesboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UnevaluatedPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UnevaluatedProperties public static class UnevaluatedProperties
diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/UniqueitemsFalseValidation.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/UniqueitemsFalseValidation.md index d535b08ed84..322fd231596 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/UniqueitemsFalseValidation.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/UniqueitemsFalseValidation.md @@ -4,23 +4,23 @@ public class UniqueitemsFalseValidation
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [UniqueitemsFalseValidation.UniqueitemsFalseValidation1Boxed](#uniqueitemsfalsevalidation1boxed)
abstract sealed validated payload class | -| static class | [UniqueitemsFalseValidation.UniqueitemsFalseValidation1BoxedVoid](#uniqueitemsfalsevalidation1boxedvoid)
boxed class to store validated null payloads | -| static class | [UniqueitemsFalseValidation.UniqueitemsFalseValidation1BoxedBoolean](#uniqueitemsfalsevalidation1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [UniqueitemsFalseValidation.UniqueitemsFalseValidation1BoxedNumber](#uniqueitemsfalsevalidation1boxednumber)
boxed class to store validated Number payloads | -| static class | [UniqueitemsFalseValidation.UniqueitemsFalseValidation1BoxedString](#uniqueitemsfalsevalidation1boxedstring)
boxed class to store validated String payloads | -| static class | [UniqueitemsFalseValidation.UniqueitemsFalseValidation1BoxedList](#uniqueitemsfalsevalidation1boxedlist)
boxed class to store validated List payloads | -| static class | [UniqueitemsFalseValidation.UniqueitemsFalseValidation1BoxedMap](#uniqueitemsfalsevalidation1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [UniqueitemsFalseValidation.UniqueitemsFalseValidation1Boxed](#uniqueitemsfalsevalidation1boxed)
sealed interface for validated payloads | +| record | [UniqueitemsFalseValidation.UniqueitemsFalseValidation1BoxedVoid](#uniqueitemsfalsevalidation1boxedvoid)
boxed class to store validated null payloads | +| record | [UniqueitemsFalseValidation.UniqueitemsFalseValidation1BoxedBoolean](#uniqueitemsfalsevalidation1boxedboolean)
boxed class to store validated boolean payloads | +| record | [UniqueitemsFalseValidation.UniqueitemsFalseValidation1BoxedNumber](#uniqueitemsfalsevalidation1boxednumber)
boxed class to store validated Number payloads | +| record | [UniqueitemsFalseValidation.UniqueitemsFalseValidation1BoxedString](#uniqueitemsfalsevalidation1boxedstring)
boxed class to store validated String payloads | +| record | [UniqueitemsFalseValidation.UniqueitemsFalseValidation1BoxedList](#uniqueitemsfalsevalidation1boxedlist)
boxed class to store validated List payloads | +| record | [UniqueitemsFalseValidation.UniqueitemsFalseValidation1BoxedMap](#uniqueitemsfalsevalidation1boxedmap)
boxed class to store validated Map payloads | | static class | [UniqueitemsFalseValidation.UniqueitemsFalseValidation1](#uniqueitemsfalsevalidation1)
schema class | ## UniqueitemsFalseValidation1Boxed -public static abstract sealed class UniqueitemsFalseValidation1Boxed
+public sealed interface UniqueitemsFalseValidation1Boxed
permits
[UniqueitemsFalseValidation1BoxedVoid](#uniqueitemsfalsevalidation1boxedvoid), [UniqueitemsFalseValidation1BoxedBoolean](#uniqueitemsfalsevalidation1boxedboolean), @@ -29,103 +29,109 @@ permits
[UniqueitemsFalseValidation1BoxedList](#uniqueitemsfalsevalidation1boxedlist), [UniqueitemsFalseValidation1BoxedMap](#uniqueitemsfalsevalidation1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## UniqueitemsFalseValidation1BoxedVoid -public static final class UniqueitemsFalseValidation1BoxedVoid
-extends [UniqueitemsFalseValidation1Boxed](#uniqueitemsfalsevalidation1boxed) +public record UniqueitemsFalseValidation1BoxedVoid
+implements [UniqueitemsFalseValidation1Boxed](#uniqueitemsfalsevalidation1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UniqueitemsFalseValidation1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UniqueitemsFalseValidation1BoxedBoolean -public static final class UniqueitemsFalseValidation1BoxedBoolean
-extends [UniqueitemsFalseValidation1Boxed](#uniqueitemsfalsevalidation1boxed) +public record UniqueitemsFalseValidation1BoxedBoolean
+implements [UniqueitemsFalseValidation1Boxed](#uniqueitemsfalsevalidation1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UniqueitemsFalseValidation1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UniqueitemsFalseValidation1BoxedNumber -public static final class UniqueitemsFalseValidation1BoxedNumber
-extends [UniqueitemsFalseValidation1Boxed](#uniqueitemsfalsevalidation1boxed) +public record UniqueitemsFalseValidation1BoxedNumber
+implements [UniqueitemsFalseValidation1Boxed](#uniqueitemsfalsevalidation1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UniqueitemsFalseValidation1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UniqueitemsFalseValidation1BoxedString -public static final class UniqueitemsFalseValidation1BoxedString
-extends [UniqueitemsFalseValidation1Boxed](#uniqueitemsfalsevalidation1boxed) +public record UniqueitemsFalseValidation1BoxedString
+implements [UniqueitemsFalseValidation1Boxed](#uniqueitemsfalsevalidation1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UniqueitemsFalseValidation1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UniqueitemsFalseValidation1BoxedList -public static final class UniqueitemsFalseValidation1BoxedList
-extends [UniqueitemsFalseValidation1Boxed](#uniqueitemsfalsevalidation1boxed) +public record UniqueitemsFalseValidation1BoxedList
+implements [UniqueitemsFalseValidation1Boxed](#uniqueitemsfalsevalidation1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UniqueitemsFalseValidation1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UniqueitemsFalseValidation1BoxedMap -public static final class UniqueitemsFalseValidation1BoxedMap
-extends [UniqueitemsFalseValidation1Boxed](#uniqueitemsfalsevalidation1boxed) +public record UniqueitemsFalseValidation1BoxedMap
+implements [UniqueitemsFalseValidation1Boxed](#uniqueitemsfalsevalidation1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UniqueitemsFalseValidation1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UniqueitemsFalseValidation1 public static class UniqueitemsFalseValidation1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [UniqueitemsFalseValidation1BoxedBoolean](#uniqueitemsfalsevalidation1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [UniqueitemsFalseValidation1BoxedMap](#uniqueitemsfalsevalidation1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [UniqueitemsFalseValidation1BoxedList](#uniqueitemsfalsevalidation1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [UniqueitemsFalseValidation1Boxed](#uniqueitemsfalsevalidation1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/UniqueitemsFalseWithAnArrayOfItems.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/UniqueitemsFalseWithAnArrayOfItems.md index b612b9cc2cd..1ecfacb8e78 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/UniqueitemsFalseWithAnArrayOfItems.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/UniqueitemsFalseWithAnArrayOfItems.md @@ -4,7 +4,7 @@ public class UniqueitemsFalseWithAnArrayOfItems
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated list payloads, extends FrozenList - classes to build inputs for list payloads @@ -12,25 +12,25 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [UniqueitemsFalseWithAnArrayOfItems.UniqueitemsFalseWithAnArrayOfItems1Boxed](#uniqueitemsfalsewithanarrayofitems1boxed)
abstract sealed validated payload class | -| static class | [UniqueitemsFalseWithAnArrayOfItems.UniqueitemsFalseWithAnArrayOfItems1BoxedVoid](#uniqueitemsfalsewithanarrayofitems1boxedvoid)
boxed class to store validated null payloads | -| static class | [UniqueitemsFalseWithAnArrayOfItems.UniqueitemsFalseWithAnArrayOfItems1BoxedBoolean](#uniqueitemsfalsewithanarrayofitems1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [UniqueitemsFalseWithAnArrayOfItems.UniqueitemsFalseWithAnArrayOfItems1BoxedNumber](#uniqueitemsfalsewithanarrayofitems1boxednumber)
boxed class to store validated Number payloads | -| static class | [UniqueitemsFalseWithAnArrayOfItems.UniqueitemsFalseWithAnArrayOfItems1BoxedString](#uniqueitemsfalsewithanarrayofitems1boxedstring)
boxed class to store validated String payloads | -| static class | [UniqueitemsFalseWithAnArrayOfItems.UniqueitemsFalseWithAnArrayOfItems1BoxedList](#uniqueitemsfalsewithanarrayofitems1boxedlist)
boxed class to store validated List payloads | -| static class | [UniqueitemsFalseWithAnArrayOfItems.UniqueitemsFalseWithAnArrayOfItems1BoxedMap](#uniqueitemsfalsewithanarrayofitems1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [UniqueitemsFalseWithAnArrayOfItems.UniqueitemsFalseWithAnArrayOfItems1Boxed](#uniqueitemsfalsewithanarrayofitems1boxed)
sealed interface for validated payloads | +| record | [UniqueitemsFalseWithAnArrayOfItems.UniqueitemsFalseWithAnArrayOfItems1BoxedVoid](#uniqueitemsfalsewithanarrayofitems1boxedvoid)
boxed class to store validated null payloads | +| record | [UniqueitemsFalseWithAnArrayOfItems.UniqueitemsFalseWithAnArrayOfItems1BoxedBoolean](#uniqueitemsfalsewithanarrayofitems1boxedboolean)
boxed class to store validated boolean payloads | +| record | [UniqueitemsFalseWithAnArrayOfItems.UniqueitemsFalseWithAnArrayOfItems1BoxedNumber](#uniqueitemsfalsewithanarrayofitems1boxednumber)
boxed class to store validated Number payloads | +| record | [UniqueitemsFalseWithAnArrayOfItems.UniqueitemsFalseWithAnArrayOfItems1BoxedString](#uniqueitemsfalsewithanarrayofitems1boxedstring)
boxed class to store validated String payloads | +| record | [UniqueitemsFalseWithAnArrayOfItems.UniqueitemsFalseWithAnArrayOfItems1BoxedList](#uniqueitemsfalsewithanarrayofitems1boxedlist)
boxed class to store validated List payloads | +| record | [UniqueitemsFalseWithAnArrayOfItems.UniqueitemsFalseWithAnArrayOfItems1BoxedMap](#uniqueitemsfalsewithanarrayofitems1boxedmap)
boxed class to store validated Map payloads | | static class | [UniqueitemsFalseWithAnArrayOfItems.UniqueitemsFalseWithAnArrayOfItems1](#uniqueitemsfalsewithanarrayofitems1)
schema class | -| static class | [UniqueitemsFalseWithAnArrayOfItems.Schema1Boxed](#schema1boxed)
abstract sealed validated payload class | -| static class | [UniqueitemsFalseWithAnArrayOfItems.Schema1BoxedBoolean](#schema1boxedboolean)
boxed class to store validated boolean payloads | +| sealed interface | [UniqueitemsFalseWithAnArrayOfItems.Schema1Boxed](#schema1boxed)
sealed interface for validated payloads | +| record | [UniqueitemsFalseWithAnArrayOfItems.Schema1BoxedBoolean](#schema1boxedboolean)
boxed class to store validated boolean payloads | | static class | [UniqueitemsFalseWithAnArrayOfItems.Schema1](#schema1)
schema class | -| static class | [UniqueitemsFalseWithAnArrayOfItems.Schema0Boxed](#schema0boxed)
abstract sealed validated payload class | -| static class | [UniqueitemsFalseWithAnArrayOfItems.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | +| sealed interface | [UniqueitemsFalseWithAnArrayOfItems.Schema0Boxed](#schema0boxed)
sealed interface for validated payloads | +| record | [UniqueitemsFalseWithAnArrayOfItems.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | | static class | [UniqueitemsFalseWithAnArrayOfItems.Schema0](#schema0)
schema class | | static class | [UniqueitemsFalseWithAnArrayOfItems.UniqueitemsFalseWithAnArrayOfItemsListBuilder](#uniqueitemsfalsewithanarrayofitemslistbuilder)
builder for List payloads | | static class | [UniqueitemsFalseWithAnArrayOfItems.UniqueitemsFalseWithAnArrayOfItemsList](#uniqueitemsfalsewithanarrayofitemslist)
output class for List payloads | ## UniqueitemsFalseWithAnArrayOfItems1Boxed -public static abstract sealed class UniqueitemsFalseWithAnArrayOfItems1Boxed
+public sealed interface UniqueitemsFalseWithAnArrayOfItems1Boxed
permits
[UniqueitemsFalseWithAnArrayOfItems1BoxedVoid](#uniqueitemsfalsewithanarrayofitems1boxedvoid), [UniqueitemsFalseWithAnArrayOfItems1BoxedBoolean](#uniqueitemsfalsewithanarrayofitems1boxedboolean), @@ -39,103 +39,109 @@ permits
[UniqueitemsFalseWithAnArrayOfItems1BoxedList](#uniqueitemsfalsewithanarrayofitems1boxedlist), [UniqueitemsFalseWithAnArrayOfItems1BoxedMap](#uniqueitemsfalsewithanarrayofitems1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## UniqueitemsFalseWithAnArrayOfItems1BoxedVoid -public static final class UniqueitemsFalseWithAnArrayOfItems1BoxedVoid
-extends [UniqueitemsFalseWithAnArrayOfItems1Boxed](#uniqueitemsfalsewithanarrayofitems1boxed) +public record UniqueitemsFalseWithAnArrayOfItems1BoxedVoid
+implements [UniqueitemsFalseWithAnArrayOfItems1Boxed](#uniqueitemsfalsewithanarrayofitems1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UniqueitemsFalseWithAnArrayOfItems1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UniqueitemsFalseWithAnArrayOfItems1BoxedBoolean -public static final class UniqueitemsFalseWithAnArrayOfItems1BoxedBoolean
-extends [UniqueitemsFalseWithAnArrayOfItems1Boxed](#uniqueitemsfalsewithanarrayofitems1boxed) +public record UniqueitemsFalseWithAnArrayOfItems1BoxedBoolean
+implements [UniqueitemsFalseWithAnArrayOfItems1Boxed](#uniqueitemsfalsewithanarrayofitems1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UniqueitemsFalseWithAnArrayOfItems1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UniqueitemsFalseWithAnArrayOfItems1BoxedNumber -public static final class UniqueitemsFalseWithAnArrayOfItems1BoxedNumber
-extends [UniqueitemsFalseWithAnArrayOfItems1Boxed](#uniqueitemsfalsewithanarrayofitems1boxed) +public record UniqueitemsFalseWithAnArrayOfItems1BoxedNumber
+implements [UniqueitemsFalseWithAnArrayOfItems1Boxed](#uniqueitemsfalsewithanarrayofitems1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UniqueitemsFalseWithAnArrayOfItems1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UniqueitemsFalseWithAnArrayOfItems1BoxedString -public static final class UniqueitemsFalseWithAnArrayOfItems1BoxedString
-extends [UniqueitemsFalseWithAnArrayOfItems1Boxed](#uniqueitemsfalsewithanarrayofitems1boxed) +public record UniqueitemsFalseWithAnArrayOfItems1BoxedString
+implements [UniqueitemsFalseWithAnArrayOfItems1Boxed](#uniqueitemsfalsewithanarrayofitems1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UniqueitemsFalseWithAnArrayOfItems1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UniqueitemsFalseWithAnArrayOfItems1BoxedList -public static final class UniqueitemsFalseWithAnArrayOfItems1BoxedList
-extends [UniqueitemsFalseWithAnArrayOfItems1Boxed](#uniqueitemsfalsewithanarrayofitems1boxed) +public record UniqueitemsFalseWithAnArrayOfItems1BoxedList
+implements [UniqueitemsFalseWithAnArrayOfItems1Boxed](#uniqueitemsfalsewithanarrayofitems1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UniqueitemsFalseWithAnArrayOfItems1BoxedList([UniqueitemsFalseWithAnArrayOfItemsList](#uniqueitemsfalsewithanarrayofitemslist) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [UniqueitemsFalseWithAnArrayOfItemsList](#uniqueitemsfalsewithanarrayofitemslist) | data
validated payload | +| [UniqueitemsFalseWithAnArrayOfItemsList](#uniqueitemsfalsewithanarrayofitemslist) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UniqueitemsFalseWithAnArrayOfItems1BoxedMap -public static final class UniqueitemsFalseWithAnArrayOfItems1BoxedMap
-extends [UniqueitemsFalseWithAnArrayOfItems1Boxed](#uniqueitemsfalsewithanarrayofitems1boxed) +public record UniqueitemsFalseWithAnArrayOfItems1BoxedMap
+implements [UniqueitemsFalseWithAnArrayOfItems1Boxed](#uniqueitemsfalsewithanarrayofitems1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UniqueitemsFalseWithAnArrayOfItems1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UniqueitemsFalseWithAnArrayOfItems1 public static class UniqueitemsFalseWithAnArrayOfItems1
@@ -168,29 +174,32 @@ A schema class that validates payloads | [UniqueitemsFalseWithAnArrayOfItems1BoxedBoolean](#uniqueitemsfalsewithanarrayofitems1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [UniqueitemsFalseWithAnArrayOfItems1BoxedMap](#uniqueitemsfalsewithanarrayofitems1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [UniqueitemsFalseWithAnArrayOfItems1BoxedList](#uniqueitemsfalsewithanarrayofitems1boxedlist) | validateAndBox([List](#uniqueitemsfalsewithanarrayofitemslistbuilder) arg, SchemaConfiguration configuration) | +| [UniqueitemsFalseWithAnArrayOfItems1Boxed](#uniqueitemsfalsewithanarrayofitems1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema1Boxed -public static abstract sealed class Schema1Boxed
+public sealed interface Schema1Boxed
permits
[Schema1BoxedBoolean](#schema1boxedboolean) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema1BoxedBoolean -public static final class Schema1BoxedBoolean
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedBoolean
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1 public static class Schema1
@@ -204,27 +213,28 @@ A schema class that validates payloads | validateAndBox | ## Schema0Boxed -public static abstract sealed class Schema0Boxed
+public sealed interface Schema0Boxed
permits
[Schema0BoxedBoolean](#schema0boxedboolean) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema0BoxedBoolean -public static final class Schema0BoxedBoolean
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedBoolean
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0 public static class Schema0
diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/UniqueitemsValidation.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/UniqueitemsValidation.md index ba4c7a9730c..be6b794fe51 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/UniqueitemsValidation.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/UniqueitemsValidation.md @@ -4,23 +4,23 @@ public class UniqueitemsValidation
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [UniqueitemsValidation.UniqueitemsValidation1Boxed](#uniqueitemsvalidation1boxed)
abstract sealed validated payload class | -| static class | [UniqueitemsValidation.UniqueitemsValidation1BoxedVoid](#uniqueitemsvalidation1boxedvoid)
boxed class to store validated null payloads | -| static class | [UniqueitemsValidation.UniqueitemsValidation1BoxedBoolean](#uniqueitemsvalidation1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [UniqueitemsValidation.UniqueitemsValidation1BoxedNumber](#uniqueitemsvalidation1boxednumber)
boxed class to store validated Number payloads | -| static class | [UniqueitemsValidation.UniqueitemsValidation1BoxedString](#uniqueitemsvalidation1boxedstring)
boxed class to store validated String payloads | -| static class | [UniqueitemsValidation.UniqueitemsValidation1BoxedList](#uniqueitemsvalidation1boxedlist)
boxed class to store validated List payloads | -| static class | [UniqueitemsValidation.UniqueitemsValidation1BoxedMap](#uniqueitemsvalidation1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [UniqueitemsValidation.UniqueitemsValidation1Boxed](#uniqueitemsvalidation1boxed)
sealed interface for validated payloads | +| record | [UniqueitemsValidation.UniqueitemsValidation1BoxedVoid](#uniqueitemsvalidation1boxedvoid)
boxed class to store validated null payloads | +| record | [UniqueitemsValidation.UniqueitemsValidation1BoxedBoolean](#uniqueitemsvalidation1boxedboolean)
boxed class to store validated boolean payloads | +| record | [UniqueitemsValidation.UniqueitemsValidation1BoxedNumber](#uniqueitemsvalidation1boxednumber)
boxed class to store validated Number payloads | +| record | [UniqueitemsValidation.UniqueitemsValidation1BoxedString](#uniqueitemsvalidation1boxedstring)
boxed class to store validated String payloads | +| record | [UniqueitemsValidation.UniqueitemsValidation1BoxedList](#uniqueitemsvalidation1boxedlist)
boxed class to store validated List payloads | +| record | [UniqueitemsValidation.UniqueitemsValidation1BoxedMap](#uniqueitemsvalidation1boxedmap)
boxed class to store validated Map payloads | | static class | [UniqueitemsValidation.UniqueitemsValidation1](#uniqueitemsvalidation1)
schema class | ## UniqueitemsValidation1Boxed -public static abstract sealed class UniqueitemsValidation1Boxed
+public sealed interface UniqueitemsValidation1Boxed
permits
[UniqueitemsValidation1BoxedVoid](#uniqueitemsvalidation1boxedvoid), [UniqueitemsValidation1BoxedBoolean](#uniqueitemsvalidation1boxedboolean), @@ -29,103 +29,109 @@ permits
[UniqueitemsValidation1BoxedList](#uniqueitemsvalidation1boxedlist), [UniqueitemsValidation1BoxedMap](#uniqueitemsvalidation1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## UniqueitemsValidation1BoxedVoid -public static final class UniqueitemsValidation1BoxedVoid
-extends [UniqueitemsValidation1Boxed](#uniqueitemsvalidation1boxed) +public record UniqueitemsValidation1BoxedVoid
+implements [UniqueitemsValidation1Boxed](#uniqueitemsvalidation1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UniqueitemsValidation1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UniqueitemsValidation1BoxedBoolean -public static final class UniqueitemsValidation1BoxedBoolean
-extends [UniqueitemsValidation1Boxed](#uniqueitemsvalidation1boxed) +public record UniqueitemsValidation1BoxedBoolean
+implements [UniqueitemsValidation1Boxed](#uniqueitemsvalidation1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UniqueitemsValidation1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UniqueitemsValidation1BoxedNumber -public static final class UniqueitemsValidation1BoxedNumber
-extends [UniqueitemsValidation1Boxed](#uniqueitemsvalidation1boxed) +public record UniqueitemsValidation1BoxedNumber
+implements [UniqueitemsValidation1Boxed](#uniqueitemsvalidation1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UniqueitemsValidation1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UniqueitemsValidation1BoxedString -public static final class UniqueitemsValidation1BoxedString
-extends [UniqueitemsValidation1Boxed](#uniqueitemsvalidation1boxed) +public record UniqueitemsValidation1BoxedString
+implements [UniqueitemsValidation1Boxed](#uniqueitemsvalidation1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UniqueitemsValidation1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UniqueitemsValidation1BoxedList -public static final class UniqueitemsValidation1BoxedList
-extends [UniqueitemsValidation1Boxed](#uniqueitemsvalidation1boxed) +public record UniqueitemsValidation1BoxedList
+implements [UniqueitemsValidation1Boxed](#uniqueitemsvalidation1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UniqueitemsValidation1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UniqueitemsValidation1BoxedMap -public static final class UniqueitemsValidation1BoxedMap
-extends [UniqueitemsValidation1Boxed](#uniqueitemsvalidation1boxed) +public record UniqueitemsValidation1BoxedMap
+implements [UniqueitemsValidation1Boxed](#uniqueitemsvalidation1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UniqueitemsValidation1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UniqueitemsValidation1 public static class UniqueitemsValidation1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [UniqueitemsValidation1BoxedBoolean](#uniqueitemsvalidation1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [UniqueitemsValidation1BoxedMap](#uniqueitemsvalidation1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [UniqueitemsValidation1BoxedList](#uniqueitemsvalidation1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [UniqueitemsValidation1Boxed](#uniqueitemsvalidation1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/UniqueitemsWithAnArrayOfItems.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/UniqueitemsWithAnArrayOfItems.md index a27972ce379..ca977d4c703 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/UniqueitemsWithAnArrayOfItems.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/UniqueitemsWithAnArrayOfItems.md @@ -4,7 +4,7 @@ public class UniqueitemsWithAnArrayOfItems
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated list payloads, extends FrozenList - classes to build inputs for list payloads @@ -12,25 +12,25 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [UniqueitemsWithAnArrayOfItems.UniqueitemsWithAnArrayOfItems1Boxed](#uniqueitemswithanarrayofitems1boxed)
abstract sealed validated payload class | -| static class | [UniqueitemsWithAnArrayOfItems.UniqueitemsWithAnArrayOfItems1BoxedVoid](#uniqueitemswithanarrayofitems1boxedvoid)
boxed class to store validated null payloads | -| static class | [UniqueitemsWithAnArrayOfItems.UniqueitemsWithAnArrayOfItems1BoxedBoolean](#uniqueitemswithanarrayofitems1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [UniqueitemsWithAnArrayOfItems.UniqueitemsWithAnArrayOfItems1BoxedNumber](#uniqueitemswithanarrayofitems1boxednumber)
boxed class to store validated Number payloads | -| static class | [UniqueitemsWithAnArrayOfItems.UniqueitemsWithAnArrayOfItems1BoxedString](#uniqueitemswithanarrayofitems1boxedstring)
boxed class to store validated String payloads | -| static class | [UniqueitemsWithAnArrayOfItems.UniqueitemsWithAnArrayOfItems1BoxedList](#uniqueitemswithanarrayofitems1boxedlist)
boxed class to store validated List payloads | -| static class | [UniqueitemsWithAnArrayOfItems.UniqueitemsWithAnArrayOfItems1BoxedMap](#uniqueitemswithanarrayofitems1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [UniqueitemsWithAnArrayOfItems.UniqueitemsWithAnArrayOfItems1Boxed](#uniqueitemswithanarrayofitems1boxed)
sealed interface for validated payloads | +| record | [UniqueitemsWithAnArrayOfItems.UniqueitemsWithAnArrayOfItems1BoxedVoid](#uniqueitemswithanarrayofitems1boxedvoid)
boxed class to store validated null payloads | +| record | [UniqueitemsWithAnArrayOfItems.UniqueitemsWithAnArrayOfItems1BoxedBoolean](#uniqueitemswithanarrayofitems1boxedboolean)
boxed class to store validated boolean payloads | +| record | [UniqueitemsWithAnArrayOfItems.UniqueitemsWithAnArrayOfItems1BoxedNumber](#uniqueitemswithanarrayofitems1boxednumber)
boxed class to store validated Number payloads | +| record | [UniqueitemsWithAnArrayOfItems.UniqueitemsWithAnArrayOfItems1BoxedString](#uniqueitemswithanarrayofitems1boxedstring)
boxed class to store validated String payloads | +| record | [UniqueitemsWithAnArrayOfItems.UniqueitemsWithAnArrayOfItems1BoxedList](#uniqueitemswithanarrayofitems1boxedlist)
boxed class to store validated List payloads | +| record | [UniqueitemsWithAnArrayOfItems.UniqueitemsWithAnArrayOfItems1BoxedMap](#uniqueitemswithanarrayofitems1boxedmap)
boxed class to store validated Map payloads | | static class | [UniqueitemsWithAnArrayOfItems.UniqueitemsWithAnArrayOfItems1](#uniqueitemswithanarrayofitems1)
schema class | -| static class | [UniqueitemsWithAnArrayOfItems.Schema1Boxed](#schema1boxed)
abstract sealed validated payload class | -| static class | [UniqueitemsWithAnArrayOfItems.Schema1BoxedBoolean](#schema1boxedboolean)
boxed class to store validated boolean payloads | +| sealed interface | [UniqueitemsWithAnArrayOfItems.Schema1Boxed](#schema1boxed)
sealed interface for validated payloads | +| record | [UniqueitemsWithAnArrayOfItems.Schema1BoxedBoolean](#schema1boxedboolean)
boxed class to store validated boolean payloads | | static class | [UniqueitemsWithAnArrayOfItems.Schema1](#schema1)
schema class | -| static class | [UniqueitemsWithAnArrayOfItems.Schema0Boxed](#schema0boxed)
abstract sealed validated payload class | -| static class | [UniqueitemsWithAnArrayOfItems.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | +| sealed interface | [UniqueitemsWithAnArrayOfItems.Schema0Boxed](#schema0boxed)
sealed interface for validated payloads | +| record | [UniqueitemsWithAnArrayOfItems.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | | static class | [UniqueitemsWithAnArrayOfItems.Schema0](#schema0)
schema class | | static class | [UniqueitemsWithAnArrayOfItems.UniqueitemsWithAnArrayOfItemsListBuilder](#uniqueitemswithanarrayofitemslistbuilder)
builder for List payloads | | static class | [UniqueitemsWithAnArrayOfItems.UniqueitemsWithAnArrayOfItemsList](#uniqueitemswithanarrayofitemslist)
output class for List payloads | ## UniqueitemsWithAnArrayOfItems1Boxed -public static abstract sealed class UniqueitemsWithAnArrayOfItems1Boxed
+public sealed interface UniqueitemsWithAnArrayOfItems1Boxed
permits
[UniqueitemsWithAnArrayOfItems1BoxedVoid](#uniqueitemswithanarrayofitems1boxedvoid), [UniqueitemsWithAnArrayOfItems1BoxedBoolean](#uniqueitemswithanarrayofitems1boxedboolean), @@ -39,103 +39,109 @@ permits
[UniqueitemsWithAnArrayOfItems1BoxedList](#uniqueitemswithanarrayofitems1boxedlist), [UniqueitemsWithAnArrayOfItems1BoxedMap](#uniqueitemswithanarrayofitems1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## UniqueitemsWithAnArrayOfItems1BoxedVoid -public static final class UniqueitemsWithAnArrayOfItems1BoxedVoid
-extends [UniqueitemsWithAnArrayOfItems1Boxed](#uniqueitemswithanarrayofitems1boxed) +public record UniqueitemsWithAnArrayOfItems1BoxedVoid
+implements [UniqueitemsWithAnArrayOfItems1Boxed](#uniqueitemswithanarrayofitems1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UniqueitemsWithAnArrayOfItems1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UniqueitemsWithAnArrayOfItems1BoxedBoolean -public static final class UniqueitemsWithAnArrayOfItems1BoxedBoolean
-extends [UniqueitemsWithAnArrayOfItems1Boxed](#uniqueitemswithanarrayofitems1boxed) +public record UniqueitemsWithAnArrayOfItems1BoxedBoolean
+implements [UniqueitemsWithAnArrayOfItems1Boxed](#uniqueitemswithanarrayofitems1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UniqueitemsWithAnArrayOfItems1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UniqueitemsWithAnArrayOfItems1BoxedNumber -public static final class UniqueitemsWithAnArrayOfItems1BoxedNumber
-extends [UniqueitemsWithAnArrayOfItems1Boxed](#uniqueitemswithanarrayofitems1boxed) +public record UniqueitemsWithAnArrayOfItems1BoxedNumber
+implements [UniqueitemsWithAnArrayOfItems1Boxed](#uniqueitemswithanarrayofitems1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UniqueitemsWithAnArrayOfItems1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UniqueitemsWithAnArrayOfItems1BoxedString -public static final class UniqueitemsWithAnArrayOfItems1BoxedString
-extends [UniqueitemsWithAnArrayOfItems1Boxed](#uniqueitemswithanarrayofitems1boxed) +public record UniqueitemsWithAnArrayOfItems1BoxedString
+implements [UniqueitemsWithAnArrayOfItems1Boxed](#uniqueitemswithanarrayofitems1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UniqueitemsWithAnArrayOfItems1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UniqueitemsWithAnArrayOfItems1BoxedList -public static final class UniqueitemsWithAnArrayOfItems1BoxedList
-extends [UniqueitemsWithAnArrayOfItems1Boxed](#uniqueitemswithanarrayofitems1boxed) +public record UniqueitemsWithAnArrayOfItems1BoxedList
+implements [UniqueitemsWithAnArrayOfItems1Boxed](#uniqueitemswithanarrayofitems1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UniqueitemsWithAnArrayOfItems1BoxedList([UniqueitemsWithAnArrayOfItemsList](#uniqueitemswithanarrayofitemslist) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [UniqueitemsWithAnArrayOfItemsList](#uniqueitemswithanarrayofitemslist) | data
validated payload | +| [UniqueitemsWithAnArrayOfItemsList](#uniqueitemswithanarrayofitemslist) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UniqueitemsWithAnArrayOfItems1BoxedMap -public static final class UniqueitemsWithAnArrayOfItems1BoxedMap
-extends [UniqueitemsWithAnArrayOfItems1Boxed](#uniqueitemswithanarrayofitems1boxed) +public record UniqueitemsWithAnArrayOfItems1BoxedMap
+implements [UniqueitemsWithAnArrayOfItems1Boxed](#uniqueitemswithanarrayofitems1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UniqueitemsWithAnArrayOfItems1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UniqueitemsWithAnArrayOfItems1 public static class UniqueitemsWithAnArrayOfItems1
@@ -168,29 +174,32 @@ A schema class that validates payloads | [UniqueitemsWithAnArrayOfItems1BoxedBoolean](#uniqueitemswithanarrayofitems1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [UniqueitemsWithAnArrayOfItems1BoxedMap](#uniqueitemswithanarrayofitems1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [UniqueitemsWithAnArrayOfItems1BoxedList](#uniqueitemswithanarrayofitems1boxedlist) | validateAndBox([List](#uniqueitemswithanarrayofitemslistbuilder) arg, SchemaConfiguration configuration) | +| [UniqueitemsWithAnArrayOfItems1Boxed](#uniqueitemswithanarrayofitems1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema1Boxed -public static abstract sealed class Schema1Boxed
+public sealed interface Schema1Boxed
permits
[Schema1BoxedBoolean](#schema1boxedboolean) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema1BoxedBoolean -public static final class Schema1BoxedBoolean
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedBoolean
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1 public static class Schema1
@@ -204,27 +213,28 @@ A schema class that validates payloads | validateAndBox | ## Schema0Boxed -public static abstract sealed class Schema0Boxed
+public sealed interface Schema0Boxed
permits
[Schema0BoxedBoolean](#schema0boxedboolean) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema0BoxedBoolean -public static final class Schema0BoxedBoolean
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedBoolean
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0 public static class Schema0
diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/UriFormat.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/UriFormat.md index e88ec7c7e06..86070ed0198 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/UriFormat.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/UriFormat.md @@ -4,23 +4,23 @@ public class UriFormat
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [UriFormat.UriFormat1Boxed](#uriformat1boxed)
abstract sealed validated payload class | -| static class | [UriFormat.UriFormat1BoxedVoid](#uriformat1boxedvoid)
boxed class to store validated null payloads | -| static class | [UriFormat.UriFormat1BoxedBoolean](#uriformat1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [UriFormat.UriFormat1BoxedNumber](#uriformat1boxednumber)
boxed class to store validated Number payloads | -| static class | [UriFormat.UriFormat1BoxedString](#uriformat1boxedstring)
boxed class to store validated String payloads | -| static class | [UriFormat.UriFormat1BoxedList](#uriformat1boxedlist)
boxed class to store validated List payloads | -| static class | [UriFormat.UriFormat1BoxedMap](#uriformat1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [UriFormat.UriFormat1Boxed](#uriformat1boxed)
sealed interface for validated payloads | +| record | [UriFormat.UriFormat1BoxedVoid](#uriformat1boxedvoid)
boxed class to store validated null payloads | +| record | [UriFormat.UriFormat1BoxedBoolean](#uriformat1boxedboolean)
boxed class to store validated boolean payloads | +| record | [UriFormat.UriFormat1BoxedNumber](#uriformat1boxednumber)
boxed class to store validated Number payloads | +| record | [UriFormat.UriFormat1BoxedString](#uriformat1boxedstring)
boxed class to store validated String payloads | +| record | [UriFormat.UriFormat1BoxedList](#uriformat1boxedlist)
boxed class to store validated List payloads | +| record | [UriFormat.UriFormat1BoxedMap](#uriformat1boxedmap)
boxed class to store validated Map payloads | | static class | [UriFormat.UriFormat1](#uriformat1)
schema class | ## UriFormat1Boxed -public static abstract sealed class UriFormat1Boxed
+public sealed interface UriFormat1Boxed
permits
[UriFormat1BoxedVoid](#uriformat1boxedvoid), [UriFormat1BoxedBoolean](#uriformat1boxedboolean), @@ -29,103 +29,109 @@ permits
[UriFormat1BoxedList](#uriformat1boxedlist), [UriFormat1BoxedMap](#uriformat1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## UriFormat1BoxedVoid -public static final class UriFormat1BoxedVoid
-extends [UriFormat1Boxed](#uriformat1boxed) +public record UriFormat1BoxedVoid
+implements [UriFormat1Boxed](#uriformat1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UriFormat1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UriFormat1BoxedBoolean -public static final class UriFormat1BoxedBoolean
-extends [UriFormat1Boxed](#uriformat1boxed) +public record UriFormat1BoxedBoolean
+implements [UriFormat1Boxed](#uriformat1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UriFormat1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UriFormat1BoxedNumber -public static final class UriFormat1BoxedNumber
-extends [UriFormat1Boxed](#uriformat1boxed) +public record UriFormat1BoxedNumber
+implements [UriFormat1Boxed](#uriformat1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UriFormat1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UriFormat1BoxedString -public static final class UriFormat1BoxedString
-extends [UriFormat1Boxed](#uriformat1boxed) +public record UriFormat1BoxedString
+implements [UriFormat1Boxed](#uriformat1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UriFormat1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UriFormat1BoxedList -public static final class UriFormat1BoxedList
-extends [UriFormat1Boxed](#uriformat1boxed) +public record UriFormat1BoxedList
+implements [UriFormat1Boxed](#uriformat1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UriFormat1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UriFormat1BoxedMap -public static final class UriFormat1BoxedMap
-extends [UriFormat1Boxed](#uriformat1boxed) +public record UriFormat1BoxedMap
+implements [UriFormat1Boxed](#uriformat1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UriFormat1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UriFormat1 public static class UriFormat1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [UriFormat1BoxedBoolean](#uriformat1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [UriFormat1BoxedMap](#uriformat1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [UriFormat1BoxedList](#uriformat1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [UriFormat1Boxed](#uriformat1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/UriReferenceFormat.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/UriReferenceFormat.md index 6292b784449..9b8f21979a3 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/UriReferenceFormat.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/UriReferenceFormat.md @@ -4,23 +4,23 @@ public class UriReferenceFormat
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [UriReferenceFormat.UriReferenceFormat1Boxed](#urireferenceformat1boxed)
abstract sealed validated payload class | -| static class | [UriReferenceFormat.UriReferenceFormat1BoxedVoid](#urireferenceformat1boxedvoid)
boxed class to store validated null payloads | -| static class | [UriReferenceFormat.UriReferenceFormat1BoxedBoolean](#urireferenceformat1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [UriReferenceFormat.UriReferenceFormat1BoxedNumber](#urireferenceformat1boxednumber)
boxed class to store validated Number payloads | -| static class | [UriReferenceFormat.UriReferenceFormat1BoxedString](#urireferenceformat1boxedstring)
boxed class to store validated String payloads | -| static class | [UriReferenceFormat.UriReferenceFormat1BoxedList](#urireferenceformat1boxedlist)
boxed class to store validated List payloads | -| static class | [UriReferenceFormat.UriReferenceFormat1BoxedMap](#urireferenceformat1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [UriReferenceFormat.UriReferenceFormat1Boxed](#urireferenceformat1boxed)
sealed interface for validated payloads | +| record | [UriReferenceFormat.UriReferenceFormat1BoxedVoid](#urireferenceformat1boxedvoid)
boxed class to store validated null payloads | +| record | [UriReferenceFormat.UriReferenceFormat1BoxedBoolean](#urireferenceformat1boxedboolean)
boxed class to store validated boolean payloads | +| record | [UriReferenceFormat.UriReferenceFormat1BoxedNumber](#urireferenceformat1boxednumber)
boxed class to store validated Number payloads | +| record | [UriReferenceFormat.UriReferenceFormat1BoxedString](#urireferenceformat1boxedstring)
boxed class to store validated String payloads | +| record | [UriReferenceFormat.UriReferenceFormat1BoxedList](#urireferenceformat1boxedlist)
boxed class to store validated List payloads | +| record | [UriReferenceFormat.UriReferenceFormat1BoxedMap](#urireferenceformat1boxedmap)
boxed class to store validated Map payloads | | static class | [UriReferenceFormat.UriReferenceFormat1](#urireferenceformat1)
schema class | ## UriReferenceFormat1Boxed -public static abstract sealed class UriReferenceFormat1Boxed
+public sealed interface UriReferenceFormat1Boxed
permits
[UriReferenceFormat1BoxedVoid](#urireferenceformat1boxedvoid), [UriReferenceFormat1BoxedBoolean](#urireferenceformat1boxedboolean), @@ -29,103 +29,109 @@ permits
[UriReferenceFormat1BoxedList](#urireferenceformat1boxedlist), [UriReferenceFormat1BoxedMap](#urireferenceformat1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## UriReferenceFormat1BoxedVoid -public static final class UriReferenceFormat1BoxedVoid
-extends [UriReferenceFormat1Boxed](#urireferenceformat1boxed) +public record UriReferenceFormat1BoxedVoid
+implements [UriReferenceFormat1Boxed](#urireferenceformat1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UriReferenceFormat1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UriReferenceFormat1BoxedBoolean -public static final class UriReferenceFormat1BoxedBoolean
-extends [UriReferenceFormat1Boxed](#urireferenceformat1boxed) +public record UriReferenceFormat1BoxedBoolean
+implements [UriReferenceFormat1Boxed](#urireferenceformat1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UriReferenceFormat1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UriReferenceFormat1BoxedNumber -public static final class UriReferenceFormat1BoxedNumber
-extends [UriReferenceFormat1Boxed](#urireferenceformat1boxed) +public record UriReferenceFormat1BoxedNumber
+implements [UriReferenceFormat1Boxed](#urireferenceformat1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UriReferenceFormat1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UriReferenceFormat1BoxedString -public static final class UriReferenceFormat1BoxedString
-extends [UriReferenceFormat1Boxed](#urireferenceformat1boxed) +public record UriReferenceFormat1BoxedString
+implements [UriReferenceFormat1Boxed](#urireferenceformat1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UriReferenceFormat1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UriReferenceFormat1BoxedList -public static final class UriReferenceFormat1BoxedList
-extends [UriReferenceFormat1Boxed](#urireferenceformat1boxed) +public record UriReferenceFormat1BoxedList
+implements [UriReferenceFormat1Boxed](#urireferenceformat1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UriReferenceFormat1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UriReferenceFormat1BoxedMap -public static final class UriReferenceFormat1BoxedMap
-extends [UriReferenceFormat1Boxed](#urireferenceformat1boxed) +public record UriReferenceFormat1BoxedMap
+implements [UriReferenceFormat1Boxed](#urireferenceformat1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UriReferenceFormat1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UriReferenceFormat1 public static class UriReferenceFormat1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [UriReferenceFormat1BoxedBoolean](#urireferenceformat1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [UriReferenceFormat1BoxedMap](#urireferenceformat1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [UriReferenceFormat1BoxedList](#urireferenceformat1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [UriReferenceFormat1Boxed](#urireferenceformat1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/UriTemplateFormat.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/UriTemplateFormat.md index 22c921701b2..a95971b7ca9 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/UriTemplateFormat.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/UriTemplateFormat.md @@ -4,23 +4,23 @@ public class UriTemplateFormat
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [UriTemplateFormat.UriTemplateFormat1Boxed](#uritemplateformat1boxed)
abstract sealed validated payload class | -| static class | [UriTemplateFormat.UriTemplateFormat1BoxedVoid](#uritemplateformat1boxedvoid)
boxed class to store validated null payloads | -| static class | [UriTemplateFormat.UriTemplateFormat1BoxedBoolean](#uritemplateformat1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [UriTemplateFormat.UriTemplateFormat1BoxedNumber](#uritemplateformat1boxednumber)
boxed class to store validated Number payloads | -| static class | [UriTemplateFormat.UriTemplateFormat1BoxedString](#uritemplateformat1boxedstring)
boxed class to store validated String payloads | -| static class | [UriTemplateFormat.UriTemplateFormat1BoxedList](#uritemplateformat1boxedlist)
boxed class to store validated List payloads | -| static class | [UriTemplateFormat.UriTemplateFormat1BoxedMap](#uritemplateformat1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [UriTemplateFormat.UriTemplateFormat1Boxed](#uritemplateformat1boxed)
sealed interface for validated payloads | +| record | [UriTemplateFormat.UriTemplateFormat1BoxedVoid](#uritemplateformat1boxedvoid)
boxed class to store validated null payloads | +| record | [UriTemplateFormat.UriTemplateFormat1BoxedBoolean](#uritemplateformat1boxedboolean)
boxed class to store validated boolean payloads | +| record | [UriTemplateFormat.UriTemplateFormat1BoxedNumber](#uritemplateformat1boxednumber)
boxed class to store validated Number payloads | +| record | [UriTemplateFormat.UriTemplateFormat1BoxedString](#uritemplateformat1boxedstring)
boxed class to store validated String payloads | +| record | [UriTemplateFormat.UriTemplateFormat1BoxedList](#uritemplateformat1boxedlist)
boxed class to store validated List payloads | +| record | [UriTemplateFormat.UriTemplateFormat1BoxedMap](#uritemplateformat1boxedmap)
boxed class to store validated Map payloads | | static class | [UriTemplateFormat.UriTemplateFormat1](#uritemplateformat1)
schema class | ## UriTemplateFormat1Boxed -public static abstract sealed class UriTemplateFormat1Boxed
+public sealed interface UriTemplateFormat1Boxed
permits
[UriTemplateFormat1BoxedVoid](#uritemplateformat1boxedvoid), [UriTemplateFormat1BoxedBoolean](#uritemplateformat1boxedboolean), @@ -29,103 +29,109 @@ permits
[UriTemplateFormat1BoxedList](#uritemplateformat1boxedlist), [UriTemplateFormat1BoxedMap](#uritemplateformat1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## UriTemplateFormat1BoxedVoid -public static final class UriTemplateFormat1BoxedVoid
-extends [UriTemplateFormat1Boxed](#uritemplateformat1boxed) +public record UriTemplateFormat1BoxedVoid
+implements [UriTemplateFormat1Boxed](#uritemplateformat1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UriTemplateFormat1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UriTemplateFormat1BoxedBoolean -public static final class UriTemplateFormat1BoxedBoolean
-extends [UriTemplateFormat1Boxed](#uritemplateformat1boxed) +public record UriTemplateFormat1BoxedBoolean
+implements [UriTemplateFormat1Boxed](#uritemplateformat1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UriTemplateFormat1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UriTemplateFormat1BoxedNumber -public static final class UriTemplateFormat1BoxedNumber
-extends [UriTemplateFormat1Boxed](#uritemplateformat1boxed) +public record UriTemplateFormat1BoxedNumber
+implements [UriTemplateFormat1Boxed](#uritemplateformat1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UriTemplateFormat1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UriTemplateFormat1BoxedString -public static final class UriTemplateFormat1BoxedString
-extends [UriTemplateFormat1Boxed](#uritemplateformat1boxed) +public record UriTemplateFormat1BoxedString
+implements [UriTemplateFormat1Boxed](#uritemplateformat1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UriTemplateFormat1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UriTemplateFormat1BoxedList -public static final class UriTemplateFormat1BoxedList
-extends [UriTemplateFormat1Boxed](#uritemplateformat1boxed) +public record UriTemplateFormat1BoxedList
+implements [UriTemplateFormat1Boxed](#uritemplateformat1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UriTemplateFormat1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UriTemplateFormat1BoxedMap -public static final class UriTemplateFormat1BoxedMap
-extends [UriTemplateFormat1Boxed](#uritemplateformat1boxed) +public record UriTemplateFormat1BoxedMap
+implements [UriTemplateFormat1Boxed](#uritemplateformat1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UriTemplateFormat1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UriTemplateFormat1 public static class UriTemplateFormat1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [UriTemplateFormat1BoxedBoolean](#uritemplateformat1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [UriTemplateFormat1BoxedMap](#uritemplateformat1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [UriTemplateFormat1BoxedList](#uritemplateformat1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [UriTemplateFormat1Boxed](#uritemplateformat1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/UuidFormat.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/UuidFormat.md index bbe14d4538d..ed984bd9617 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/UuidFormat.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/UuidFormat.md @@ -4,23 +4,23 @@ public class UuidFormat
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [UuidFormat.UuidFormat1Boxed](#uuidformat1boxed)
abstract sealed validated payload class | -| static class | [UuidFormat.UuidFormat1BoxedVoid](#uuidformat1boxedvoid)
boxed class to store validated null payloads | -| static class | [UuidFormat.UuidFormat1BoxedBoolean](#uuidformat1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [UuidFormat.UuidFormat1BoxedNumber](#uuidformat1boxednumber)
boxed class to store validated Number payloads | -| static class | [UuidFormat.UuidFormat1BoxedString](#uuidformat1boxedstring)
boxed class to store validated String payloads | -| static class | [UuidFormat.UuidFormat1BoxedList](#uuidformat1boxedlist)
boxed class to store validated List payloads | -| static class | [UuidFormat.UuidFormat1BoxedMap](#uuidformat1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [UuidFormat.UuidFormat1Boxed](#uuidformat1boxed)
sealed interface for validated payloads | +| record | [UuidFormat.UuidFormat1BoxedVoid](#uuidformat1boxedvoid)
boxed class to store validated null payloads | +| record | [UuidFormat.UuidFormat1BoxedBoolean](#uuidformat1boxedboolean)
boxed class to store validated boolean payloads | +| record | [UuidFormat.UuidFormat1BoxedNumber](#uuidformat1boxednumber)
boxed class to store validated Number payloads | +| record | [UuidFormat.UuidFormat1BoxedString](#uuidformat1boxedstring)
boxed class to store validated String payloads | +| record | [UuidFormat.UuidFormat1BoxedList](#uuidformat1boxedlist)
boxed class to store validated List payloads | +| record | [UuidFormat.UuidFormat1BoxedMap](#uuidformat1boxedmap)
boxed class to store validated Map payloads | | static class | [UuidFormat.UuidFormat1](#uuidformat1)
schema class | ## UuidFormat1Boxed -public static abstract sealed class UuidFormat1Boxed
+public sealed interface UuidFormat1Boxed
permits
[UuidFormat1BoxedVoid](#uuidformat1boxedvoid), [UuidFormat1BoxedBoolean](#uuidformat1boxedboolean), @@ -29,103 +29,109 @@ permits
[UuidFormat1BoxedList](#uuidformat1boxedlist), [UuidFormat1BoxedMap](#uuidformat1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## UuidFormat1BoxedVoid -public static final class UuidFormat1BoxedVoid
-extends [UuidFormat1Boxed](#uuidformat1boxed) +public record UuidFormat1BoxedVoid
+implements [UuidFormat1Boxed](#uuidformat1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UuidFormat1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UuidFormat1BoxedBoolean -public static final class UuidFormat1BoxedBoolean
-extends [UuidFormat1Boxed](#uuidformat1boxed) +public record UuidFormat1BoxedBoolean
+implements [UuidFormat1Boxed](#uuidformat1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UuidFormat1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UuidFormat1BoxedNumber -public static final class UuidFormat1BoxedNumber
-extends [UuidFormat1Boxed](#uuidformat1boxed) +public record UuidFormat1BoxedNumber
+implements [UuidFormat1Boxed](#uuidformat1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UuidFormat1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UuidFormat1BoxedString -public static final class UuidFormat1BoxedString
-extends [UuidFormat1Boxed](#uuidformat1boxed) +public record UuidFormat1BoxedString
+implements [UuidFormat1Boxed](#uuidformat1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UuidFormat1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UuidFormat1BoxedList -public static final class UuidFormat1BoxedList
-extends [UuidFormat1Boxed](#uuidformat1boxed) +public record UuidFormat1BoxedList
+implements [UuidFormat1Boxed](#uuidformat1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UuidFormat1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UuidFormat1BoxedMap -public static final class UuidFormat1BoxedMap
-extends [UuidFormat1Boxed](#uuidformat1boxed) +public record UuidFormat1BoxedMap
+implements [UuidFormat1Boxed](#uuidformat1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UuidFormat1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UuidFormat1 public static class UuidFormat1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [UuidFormat1BoxedBoolean](#uuidformat1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [UuidFormat1BoxedMap](#uuidformat1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [UuidFormat1BoxedList](#uuidformat1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [UuidFormat1Boxed](#uuidformat1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_1_0_unit_test/java/docs/components/schemas/ValidateAgainstCorrectBranchThenVsElse.md b/samples/client/3_1_0_unit_test/java/docs/components/schemas/ValidateAgainstCorrectBranchThenVsElse.md index d816f82ac38..38fda5efcca 100644 --- a/samples/client/3_1_0_unit_test/java/docs/components/schemas/ValidateAgainstCorrectBranchThenVsElse.md +++ b/samples/client/3_1_0_unit_test/java/docs/components/schemas/ValidateAgainstCorrectBranchThenVsElse.md @@ -4,47 +4,47 @@ public class ValidateAgainstCorrectBranchThenVsElse
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ValidateAgainstCorrectBranchThenVsElse.ValidateAgainstCorrectBranchThenVsElse1Boxed](#validateagainstcorrectbranchthenvselse1boxed)
abstract sealed validated payload class | -| static class | [ValidateAgainstCorrectBranchThenVsElse.ValidateAgainstCorrectBranchThenVsElse1BoxedVoid](#validateagainstcorrectbranchthenvselse1boxedvoid)
boxed class to store validated null payloads | -| static class | [ValidateAgainstCorrectBranchThenVsElse.ValidateAgainstCorrectBranchThenVsElse1BoxedBoolean](#validateagainstcorrectbranchthenvselse1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [ValidateAgainstCorrectBranchThenVsElse.ValidateAgainstCorrectBranchThenVsElse1BoxedNumber](#validateagainstcorrectbranchthenvselse1boxednumber)
boxed class to store validated Number payloads | -| static class | [ValidateAgainstCorrectBranchThenVsElse.ValidateAgainstCorrectBranchThenVsElse1BoxedString](#validateagainstcorrectbranchthenvselse1boxedstring)
boxed class to store validated String payloads | -| static class | [ValidateAgainstCorrectBranchThenVsElse.ValidateAgainstCorrectBranchThenVsElse1BoxedList](#validateagainstcorrectbranchthenvselse1boxedlist)
boxed class to store validated List payloads | -| static class | [ValidateAgainstCorrectBranchThenVsElse.ValidateAgainstCorrectBranchThenVsElse1BoxedMap](#validateagainstcorrectbranchthenvselse1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ValidateAgainstCorrectBranchThenVsElse.ValidateAgainstCorrectBranchThenVsElse1Boxed](#validateagainstcorrectbranchthenvselse1boxed)
sealed interface for validated payloads | +| record | [ValidateAgainstCorrectBranchThenVsElse.ValidateAgainstCorrectBranchThenVsElse1BoxedVoid](#validateagainstcorrectbranchthenvselse1boxedvoid)
boxed class to store validated null payloads | +| record | [ValidateAgainstCorrectBranchThenVsElse.ValidateAgainstCorrectBranchThenVsElse1BoxedBoolean](#validateagainstcorrectbranchthenvselse1boxedboolean)
boxed class to store validated boolean payloads | +| record | [ValidateAgainstCorrectBranchThenVsElse.ValidateAgainstCorrectBranchThenVsElse1BoxedNumber](#validateagainstcorrectbranchthenvselse1boxednumber)
boxed class to store validated Number payloads | +| record | [ValidateAgainstCorrectBranchThenVsElse.ValidateAgainstCorrectBranchThenVsElse1BoxedString](#validateagainstcorrectbranchthenvselse1boxedstring)
boxed class to store validated String payloads | +| record | [ValidateAgainstCorrectBranchThenVsElse.ValidateAgainstCorrectBranchThenVsElse1BoxedList](#validateagainstcorrectbranchthenvselse1boxedlist)
boxed class to store validated List payloads | +| record | [ValidateAgainstCorrectBranchThenVsElse.ValidateAgainstCorrectBranchThenVsElse1BoxedMap](#validateagainstcorrectbranchthenvselse1boxedmap)
boxed class to store validated Map payloads | | static class | [ValidateAgainstCorrectBranchThenVsElse.ValidateAgainstCorrectBranchThenVsElse1](#validateagainstcorrectbranchthenvselse1)
schema class | -| static class | [ValidateAgainstCorrectBranchThenVsElse.ThenBoxed](#thenboxed)
abstract sealed validated payload class | -| static class | [ValidateAgainstCorrectBranchThenVsElse.ThenBoxedVoid](#thenboxedvoid)
boxed class to store validated null payloads | -| static class | [ValidateAgainstCorrectBranchThenVsElse.ThenBoxedBoolean](#thenboxedboolean)
boxed class to store validated boolean payloads | -| static class | [ValidateAgainstCorrectBranchThenVsElse.ThenBoxedNumber](#thenboxednumber)
boxed class to store validated Number payloads | -| static class | [ValidateAgainstCorrectBranchThenVsElse.ThenBoxedString](#thenboxedstring)
boxed class to store validated String payloads | -| static class | [ValidateAgainstCorrectBranchThenVsElse.ThenBoxedList](#thenboxedlist)
boxed class to store validated List payloads | -| static class | [ValidateAgainstCorrectBranchThenVsElse.ThenBoxedMap](#thenboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ValidateAgainstCorrectBranchThenVsElse.ThenBoxed](#thenboxed)
sealed interface for validated payloads | +| record | [ValidateAgainstCorrectBranchThenVsElse.ThenBoxedVoid](#thenboxedvoid)
boxed class to store validated null payloads | +| record | [ValidateAgainstCorrectBranchThenVsElse.ThenBoxedBoolean](#thenboxedboolean)
boxed class to store validated boolean payloads | +| record | [ValidateAgainstCorrectBranchThenVsElse.ThenBoxedNumber](#thenboxednumber)
boxed class to store validated Number payloads | +| record | [ValidateAgainstCorrectBranchThenVsElse.ThenBoxedString](#thenboxedstring)
boxed class to store validated String payloads | +| record | [ValidateAgainstCorrectBranchThenVsElse.ThenBoxedList](#thenboxedlist)
boxed class to store validated List payloads | +| record | [ValidateAgainstCorrectBranchThenVsElse.ThenBoxedMap](#thenboxedmap)
boxed class to store validated Map payloads | | static class | [ValidateAgainstCorrectBranchThenVsElse.Then](#then)
schema class | -| static class | [ValidateAgainstCorrectBranchThenVsElse.IfSchemaBoxed](#ifschemaboxed)
abstract sealed validated payload class | -| static class | [ValidateAgainstCorrectBranchThenVsElse.IfSchemaBoxedVoid](#ifschemaboxedvoid)
boxed class to store validated null payloads | -| static class | [ValidateAgainstCorrectBranchThenVsElse.IfSchemaBoxedBoolean](#ifschemaboxedboolean)
boxed class to store validated boolean payloads | -| static class | [ValidateAgainstCorrectBranchThenVsElse.IfSchemaBoxedNumber](#ifschemaboxednumber)
boxed class to store validated Number payloads | -| static class | [ValidateAgainstCorrectBranchThenVsElse.IfSchemaBoxedString](#ifschemaboxedstring)
boxed class to store validated String payloads | -| static class | [ValidateAgainstCorrectBranchThenVsElse.IfSchemaBoxedList](#ifschemaboxedlist)
boxed class to store validated List payloads | -| static class | [ValidateAgainstCorrectBranchThenVsElse.IfSchemaBoxedMap](#ifschemaboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ValidateAgainstCorrectBranchThenVsElse.IfSchemaBoxed](#ifschemaboxed)
sealed interface for validated payloads | +| record | [ValidateAgainstCorrectBranchThenVsElse.IfSchemaBoxedVoid](#ifschemaboxedvoid)
boxed class to store validated null payloads | +| record | [ValidateAgainstCorrectBranchThenVsElse.IfSchemaBoxedBoolean](#ifschemaboxedboolean)
boxed class to store validated boolean payloads | +| record | [ValidateAgainstCorrectBranchThenVsElse.IfSchemaBoxedNumber](#ifschemaboxednumber)
boxed class to store validated Number payloads | +| record | [ValidateAgainstCorrectBranchThenVsElse.IfSchemaBoxedString](#ifschemaboxedstring)
boxed class to store validated String payloads | +| record | [ValidateAgainstCorrectBranchThenVsElse.IfSchemaBoxedList](#ifschemaboxedlist)
boxed class to store validated List payloads | +| record | [ValidateAgainstCorrectBranchThenVsElse.IfSchemaBoxedMap](#ifschemaboxedmap)
boxed class to store validated Map payloads | | static class | [ValidateAgainstCorrectBranchThenVsElse.IfSchema](#ifschema)
schema class | -| static class | [ValidateAgainstCorrectBranchThenVsElse.ElseSchemaBoxed](#elseschemaboxed)
abstract sealed validated payload class | -| static class | [ValidateAgainstCorrectBranchThenVsElse.ElseSchemaBoxedVoid](#elseschemaboxedvoid)
boxed class to store validated null payloads | -| static class | [ValidateAgainstCorrectBranchThenVsElse.ElseSchemaBoxedBoolean](#elseschemaboxedboolean)
boxed class to store validated boolean payloads | -| static class | [ValidateAgainstCorrectBranchThenVsElse.ElseSchemaBoxedNumber](#elseschemaboxednumber)
boxed class to store validated Number payloads | -| static class | [ValidateAgainstCorrectBranchThenVsElse.ElseSchemaBoxedString](#elseschemaboxedstring)
boxed class to store validated String payloads | -| static class | [ValidateAgainstCorrectBranchThenVsElse.ElseSchemaBoxedList](#elseschemaboxedlist)
boxed class to store validated List payloads | -| static class | [ValidateAgainstCorrectBranchThenVsElse.ElseSchemaBoxedMap](#elseschemaboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ValidateAgainstCorrectBranchThenVsElse.ElseSchemaBoxed](#elseschemaboxed)
sealed interface for validated payloads | +| record | [ValidateAgainstCorrectBranchThenVsElse.ElseSchemaBoxedVoid](#elseschemaboxedvoid)
boxed class to store validated null payloads | +| record | [ValidateAgainstCorrectBranchThenVsElse.ElseSchemaBoxedBoolean](#elseschemaboxedboolean)
boxed class to store validated boolean payloads | +| record | [ValidateAgainstCorrectBranchThenVsElse.ElseSchemaBoxedNumber](#elseschemaboxednumber)
boxed class to store validated Number payloads | +| record | [ValidateAgainstCorrectBranchThenVsElse.ElseSchemaBoxedString](#elseschemaboxedstring)
boxed class to store validated String payloads | +| record | [ValidateAgainstCorrectBranchThenVsElse.ElseSchemaBoxedList](#elseschemaboxedlist)
boxed class to store validated List payloads | +| record | [ValidateAgainstCorrectBranchThenVsElse.ElseSchemaBoxedMap](#elseschemaboxedmap)
boxed class to store validated Map payloads | | static class | [ValidateAgainstCorrectBranchThenVsElse.ElseSchema](#elseschema)
schema class | ## ValidateAgainstCorrectBranchThenVsElse1Boxed -public static abstract sealed class ValidateAgainstCorrectBranchThenVsElse1Boxed
+public sealed interface ValidateAgainstCorrectBranchThenVsElse1Boxed
permits
[ValidateAgainstCorrectBranchThenVsElse1BoxedVoid](#validateagainstcorrectbranchthenvselse1boxedvoid), [ValidateAgainstCorrectBranchThenVsElse1BoxedBoolean](#validateagainstcorrectbranchthenvselse1boxedboolean), @@ -53,103 +53,109 @@ permits
[ValidateAgainstCorrectBranchThenVsElse1BoxedList](#validateagainstcorrectbranchthenvselse1boxedlist), [ValidateAgainstCorrectBranchThenVsElse1BoxedMap](#validateagainstcorrectbranchthenvselse1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ValidateAgainstCorrectBranchThenVsElse1BoxedVoid -public static final class ValidateAgainstCorrectBranchThenVsElse1BoxedVoid
-extends [ValidateAgainstCorrectBranchThenVsElse1Boxed](#validateagainstcorrectbranchthenvselse1boxed) +public record ValidateAgainstCorrectBranchThenVsElse1BoxedVoid
+implements [ValidateAgainstCorrectBranchThenVsElse1Boxed](#validateagainstcorrectbranchthenvselse1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ValidateAgainstCorrectBranchThenVsElse1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ValidateAgainstCorrectBranchThenVsElse1BoxedBoolean -public static final class ValidateAgainstCorrectBranchThenVsElse1BoxedBoolean
-extends [ValidateAgainstCorrectBranchThenVsElse1Boxed](#validateagainstcorrectbranchthenvselse1boxed) +public record ValidateAgainstCorrectBranchThenVsElse1BoxedBoolean
+implements [ValidateAgainstCorrectBranchThenVsElse1Boxed](#validateagainstcorrectbranchthenvselse1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ValidateAgainstCorrectBranchThenVsElse1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ValidateAgainstCorrectBranchThenVsElse1BoxedNumber -public static final class ValidateAgainstCorrectBranchThenVsElse1BoxedNumber
-extends [ValidateAgainstCorrectBranchThenVsElse1Boxed](#validateagainstcorrectbranchthenvselse1boxed) +public record ValidateAgainstCorrectBranchThenVsElse1BoxedNumber
+implements [ValidateAgainstCorrectBranchThenVsElse1Boxed](#validateagainstcorrectbranchthenvselse1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ValidateAgainstCorrectBranchThenVsElse1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ValidateAgainstCorrectBranchThenVsElse1BoxedString -public static final class ValidateAgainstCorrectBranchThenVsElse1BoxedString
-extends [ValidateAgainstCorrectBranchThenVsElse1Boxed](#validateagainstcorrectbranchthenvselse1boxed) +public record ValidateAgainstCorrectBranchThenVsElse1BoxedString
+implements [ValidateAgainstCorrectBranchThenVsElse1Boxed](#validateagainstcorrectbranchthenvselse1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ValidateAgainstCorrectBranchThenVsElse1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ValidateAgainstCorrectBranchThenVsElse1BoxedList -public static final class ValidateAgainstCorrectBranchThenVsElse1BoxedList
-extends [ValidateAgainstCorrectBranchThenVsElse1Boxed](#validateagainstcorrectbranchthenvselse1boxed) +public record ValidateAgainstCorrectBranchThenVsElse1BoxedList
+implements [ValidateAgainstCorrectBranchThenVsElse1Boxed](#validateagainstcorrectbranchthenvselse1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ValidateAgainstCorrectBranchThenVsElse1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ValidateAgainstCorrectBranchThenVsElse1BoxedMap -public static final class ValidateAgainstCorrectBranchThenVsElse1BoxedMap
-extends [ValidateAgainstCorrectBranchThenVsElse1Boxed](#validateagainstcorrectbranchthenvselse1boxed) +public record ValidateAgainstCorrectBranchThenVsElse1BoxedMap
+implements [ValidateAgainstCorrectBranchThenVsElse1Boxed](#validateagainstcorrectbranchthenvselse1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ValidateAgainstCorrectBranchThenVsElse1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ValidateAgainstCorrectBranchThenVsElse1 public static class ValidateAgainstCorrectBranchThenVsElse1
@@ -183,9 +189,11 @@ A schema class that validates payloads | [ValidateAgainstCorrectBranchThenVsElse1BoxedBoolean](#validateagainstcorrectbranchthenvselse1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [ValidateAgainstCorrectBranchThenVsElse1BoxedMap](#validateagainstcorrectbranchthenvselse1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [ValidateAgainstCorrectBranchThenVsElse1BoxedList](#validateagainstcorrectbranchthenvselse1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [ValidateAgainstCorrectBranchThenVsElse1Boxed](#validateagainstcorrectbranchthenvselse1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ThenBoxed -public static abstract sealed class ThenBoxed
+public sealed interface ThenBoxed
permits
[ThenBoxedVoid](#thenboxedvoid), [ThenBoxedBoolean](#thenboxedboolean), @@ -194,103 +202,109 @@ permits
[ThenBoxedList](#thenboxedlist), [ThenBoxedMap](#thenboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ThenBoxedVoid -public static final class ThenBoxedVoid
-extends [ThenBoxed](#thenboxed) +public record ThenBoxedVoid
+implements [ThenBoxed](#thenboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ThenBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ThenBoxedBoolean -public static final class ThenBoxedBoolean
-extends [ThenBoxed](#thenboxed) +public record ThenBoxedBoolean
+implements [ThenBoxed](#thenboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ThenBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ThenBoxedNumber -public static final class ThenBoxedNumber
-extends [ThenBoxed](#thenboxed) +public record ThenBoxedNumber
+implements [ThenBoxed](#thenboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ThenBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ThenBoxedString -public static final class ThenBoxedString
-extends [ThenBoxed](#thenboxed) +public record ThenBoxedString
+implements [ThenBoxed](#thenboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ThenBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ThenBoxedList -public static final class ThenBoxedList
-extends [ThenBoxed](#thenboxed) +public record ThenBoxedList
+implements [ThenBoxed](#thenboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ThenBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ThenBoxedMap -public static final class ThenBoxedMap
-extends [ThenBoxed](#thenboxed) +public record ThenBoxedMap
+implements [ThenBoxed](#thenboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ThenBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Then public static class Then
@@ -322,9 +336,11 @@ A schema class that validates payloads | [ThenBoxedBoolean](#thenboxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [ThenBoxedMap](#thenboxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [ThenBoxedList](#thenboxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [ThenBoxed](#thenboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## IfSchemaBoxed -public static abstract sealed class IfSchemaBoxed
+public sealed interface IfSchemaBoxed
permits
[IfSchemaBoxedVoid](#ifschemaboxedvoid), [IfSchemaBoxedBoolean](#ifschemaboxedboolean), @@ -333,103 +349,109 @@ permits
[IfSchemaBoxedList](#ifschemaboxedlist), [IfSchemaBoxedMap](#ifschemaboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## IfSchemaBoxedVoid -public static final class IfSchemaBoxedVoid
-extends [IfSchemaBoxed](#ifschemaboxed) +public record IfSchemaBoxedVoid
+implements [IfSchemaBoxed](#ifschemaboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IfSchemaBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IfSchemaBoxedBoolean -public static final class IfSchemaBoxedBoolean
-extends [IfSchemaBoxed](#ifschemaboxed) +public record IfSchemaBoxedBoolean
+implements [IfSchemaBoxed](#ifschemaboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IfSchemaBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IfSchemaBoxedNumber -public static final class IfSchemaBoxedNumber
-extends [IfSchemaBoxed](#ifschemaboxed) +public record IfSchemaBoxedNumber
+implements [IfSchemaBoxed](#ifschemaboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IfSchemaBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IfSchemaBoxedString -public static final class IfSchemaBoxedString
-extends [IfSchemaBoxed](#ifschemaboxed) +public record IfSchemaBoxedString
+implements [IfSchemaBoxed](#ifschemaboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IfSchemaBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IfSchemaBoxedList -public static final class IfSchemaBoxedList
-extends [IfSchemaBoxed](#ifschemaboxed) +public record IfSchemaBoxedList
+implements [IfSchemaBoxed](#ifschemaboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IfSchemaBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IfSchemaBoxedMap -public static final class IfSchemaBoxedMap
-extends [IfSchemaBoxed](#ifschemaboxed) +public record IfSchemaBoxedMap
+implements [IfSchemaBoxed](#ifschemaboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IfSchemaBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IfSchema public static class IfSchema
@@ -461,9 +483,11 @@ A schema class that validates payloads | [IfSchemaBoxedBoolean](#ifschemaboxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [IfSchemaBoxedMap](#ifschemaboxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [IfSchemaBoxedList](#ifschemaboxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [IfSchemaBoxed](#ifschemaboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ElseSchemaBoxed -public static abstract sealed class ElseSchemaBoxed
+public sealed interface ElseSchemaBoxed
permits
[ElseSchemaBoxedVoid](#elseschemaboxedvoid), [ElseSchemaBoxedBoolean](#elseschemaboxedboolean), @@ -472,103 +496,109 @@ permits
[ElseSchemaBoxedList](#elseschemaboxedlist), [ElseSchemaBoxedMap](#elseschemaboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ElseSchemaBoxedVoid -public static final class ElseSchemaBoxedVoid
-extends [ElseSchemaBoxed](#elseschemaboxed) +public record ElseSchemaBoxedVoid
+implements [ElseSchemaBoxed](#elseschemaboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ElseSchemaBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ElseSchemaBoxedBoolean -public static final class ElseSchemaBoxedBoolean
-extends [ElseSchemaBoxed](#elseschemaboxed) +public record ElseSchemaBoxedBoolean
+implements [ElseSchemaBoxed](#elseschemaboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ElseSchemaBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ElseSchemaBoxedNumber -public static final class ElseSchemaBoxedNumber
-extends [ElseSchemaBoxed](#elseschemaboxed) +public record ElseSchemaBoxedNumber
+implements [ElseSchemaBoxed](#elseschemaboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ElseSchemaBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ElseSchemaBoxedString -public static final class ElseSchemaBoxedString
-extends [ElseSchemaBoxed](#elseschemaboxed) +public record ElseSchemaBoxedString
+implements [ElseSchemaBoxed](#elseschemaboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ElseSchemaBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ElseSchemaBoxedList -public static final class ElseSchemaBoxedList
-extends [ElseSchemaBoxed](#elseschemaboxed) +public record ElseSchemaBoxedList
+implements [ElseSchemaBoxed](#elseschemaboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ElseSchemaBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ElseSchemaBoxedMap -public static final class ElseSchemaBoxedMap
-extends [ElseSchemaBoxed](#elseschemaboxed) +public record ElseSchemaBoxedMap
+implements [ElseSchemaBoxed](#elseschemaboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ElseSchemaBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ElseSchema public static class ElseSchema
@@ -600,5 +630,7 @@ A schema class that validates payloads | [ElseSchemaBoxedBoolean](#elseschemaboxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [ElseSchemaBoxedMap](#elseschemaboxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [ElseSchemaBoxedList](#elseschemaboxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [ElseSchemaBoxed](#elseschemaboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/3_1_0_unit_test/java/pom.xml b/samples/client/3_1_0_unit_test/java/pom.xml index 84f83c6e874..ebb2e4b2c11 100644 --- a/samples/client/3_1_0_unit_test/java/pom.xml +++ b/samples/client/3_1_0_unit_test/java/pom.xml @@ -94,7 +94,7 @@ org.apache.maven.plugins maven-surefire-plugin - 2.12 + 3.2.5 @@ -103,8 +103,8 @@ -Xms512m -Xmx1500m - methods - pertest + classes + true diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ASchemaGivenForPrefixitems.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ASchemaGivenForPrefixitems.java index 1482812de1d..16b1fdbff62 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ASchemaGivenForPrefixitems.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ASchemaGivenForPrefixitems.java @@ -131,78 +131,54 @@ public static Schema1 getInstance() { } - public static abstract sealed class ASchemaGivenForPrefixitems1Boxed permits ASchemaGivenForPrefixitems1BoxedVoid, ASchemaGivenForPrefixitems1BoxedBoolean, ASchemaGivenForPrefixitems1BoxedNumber, ASchemaGivenForPrefixitems1BoxedString, ASchemaGivenForPrefixitems1BoxedList, ASchemaGivenForPrefixitems1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface ASchemaGivenForPrefixitems1Boxed permits ASchemaGivenForPrefixitems1BoxedVoid, ASchemaGivenForPrefixitems1BoxedBoolean, ASchemaGivenForPrefixitems1BoxedNumber, ASchemaGivenForPrefixitems1BoxedString, ASchemaGivenForPrefixitems1BoxedList, ASchemaGivenForPrefixitems1BoxedMap { + @Nullable Object getData(); } - public static final class ASchemaGivenForPrefixitems1BoxedVoid extends ASchemaGivenForPrefixitems1Boxed { - public final Void data; - private ASchemaGivenForPrefixitems1BoxedVoid(Void data) { - this.data = data; - } + public record ASchemaGivenForPrefixitems1BoxedVoid(Void data) implements ASchemaGivenForPrefixitems1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ASchemaGivenForPrefixitems1BoxedBoolean extends ASchemaGivenForPrefixitems1Boxed { - public final boolean data; - private ASchemaGivenForPrefixitems1BoxedBoolean(boolean data) { - this.data = data; - } + public record ASchemaGivenForPrefixitems1BoxedBoolean(boolean data) implements ASchemaGivenForPrefixitems1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ASchemaGivenForPrefixitems1BoxedNumber extends ASchemaGivenForPrefixitems1Boxed { - public final Number data; - private ASchemaGivenForPrefixitems1BoxedNumber(Number data) { - this.data = data; - } + public record ASchemaGivenForPrefixitems1BoxedNumber(Number data) implements ASchemaGivenForPrefixitems1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ASchemaGivenForPrefixitems1BoxedString extends ASchemaGivenForPrefixitems1Boxed { - public final String data; - private ASchemaGivenForPrefixitems1BoxedString(String data) { - this.data = data; - } + public record ASchemaGivenForPrefixitems1BoxedString(String data) implements ASchemaGivenForPrefixitems1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ASchemaGivenForPrefixitems1BoxedList extends ASchemaGivenForPrefixitems1Boxed { - public final ASchemaGivenForPrefixitemsList data; - private ASchemaGivenForPrefixitems1BoxedList(ASchemaGivenForPrefixitemsList data) { - this.data = data; - } + public record ASchemaGivenForPrefixitems1BoxedList(ASchemaGivenForPrefixitemsList data) implements ASchemaGivenForPrefixitems1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ASchemaGivenForPrefixitems1BoxedMap extends ASchemaGivenForPrefixitems1Boxed { - public final FrozenMap<@Nullable Object> data; - private ASchemaGivenForPrefixitems1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record ASchemaGivenForPrefixitems1BoxedMap(FrozenMap<@Nullable Object> data) implements ASchemaGivenForPrefixitems1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ASchemaGivenForPrefixitems1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, MapSchemaValidator, ASchemaGivenForPrefixitems1BoxedMap> { + public static class ASchemaGivenForPrefixitems1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, MapSchemaValidator, ASchemaGivenForPrefixitems1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -310,11 +286,11 @@ public ASchemaGivenForPrefixitemsList getNewInstance(List arg, List p for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -345,11 +321,11 @@ public ASchemaGivenForPrefixitemsList validate(List arg, SchemaConfiguration List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -428,5 +404,24 @@ public ASchemaGivenForPrefixitems1BoxedList validateAndBox(List arg, SchemaCo public ASchemaGivenForPrefixitems1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ASchemaGivenForPrefixitems1BoxedMap(validate(arg, configuration)); } + @Override + public ASchemaGivenForPrefixitems1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalItemsAreAllowedByDefault.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalItemsAreAllowedByDefault.java index 8572ce1e4da..f9c32af6fec 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalItemsAreAllowedByDefault.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalItemsAreAllowedByDefault.java @@ -119,78 +119,54 @@ public static Schema0 getInstance() { } - public static abstract sealed class AdditionalItemsAreAllowedByDefault1Boxed permits AdditionalItemsAreAllowedByDefault1BoxedVoid, AdditionalItemsAreAllowedByDefault1BoxedBoolean, AdditionalItemsAreAllowedByDefault1BoxedNumber, AdditionalItemsAreAllowedByDefault1BoxedString, AdditionalItemsAreAllowedByDefault1BoxedList, AdditionalItemsAreAllowedByDefault1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface AdditionalItemsAreAllowedByDefault1Boxed permits AdditionalItemsAreAllowedByDefault1BoxedVoid, AdditionalItemsAreAllowedByDefault1BoxedBoolean, AdditionalItemsAreAllowedByDefault1BoxedNumber, AdditionalItemsAreAllowedByDefault1BoxedString, AdditionalItemsAreAllowedByDefault1BoxedList, AdditionalItemsAreAllowedByDefault1BoxedMap { + @Nullable Object getData(); } - public static final class AdditionalItemsAreAllowedByDefault1BoxedVoid extends AdditionalItemsAreAllowedByDefault1Boxed { - public final Void data; - private AdditionalItemsAreAllowedByDefault1BoxedVoid(Void data) { - this.data = data; - } + public record AdditionalItemsAreAllowedByDefault1BoxedVoid(Void data) implements AdditionalItemsAreAllowedByDefault1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AdditionalItemsAreAllowedByDefault1BoxedBoolean extends AdditionalItemsAreAllowedByDefault1Boxed { - public final boolean data; - private AdditionalItemsAreAllowedByDefault1BoxedBoolean(boolean data) { - this.data = data; - } + public record AdditionalItemsAreAllowedByDefault1BoxedBoolean(boolean data) implements AdditionalItemsAreAllowedByDefault1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AdditionalItemsAreAllowedByDefault1BoxedNumber extends AdditionalItemsAreAllowedByDefault1Boxed { - public final Number data; - private AdditionalItemsAreAllowedByDefault1BoxedNumber(Number data) { - this.data = data; - } + public record AdditionalItemsAreAllowedByDefault1BoxedNumber(Number data) implements AdditionalItemsAreAllowedByDefault1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AdditionalItemsAreAllowedByDefault1BoxedString extends AdditionalItemsAreAllowedByDefault1Boxed { - public final String data; - private AdditionalItemsAreAllowedByDefault1BoxedString(String data) { - this.data = data; - } + public record AdditionalItemsAreAllowedByDefault1BoxedString(String data) implements AdditionalItemsAreAllowedByDefault1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AdditionalItemsAreAllowedByDefault1BoxedList extends AdditionalItemsAreAllowedByDefault1Boxed { - public final AdditionalItemsAreAllowedByDefaultList data; - private AdditionalItemsAreAllowedByDefault1BoxedList(AdditionalItemsAreAllowedByDefaultList data) { - this.data = data; - } + public record AdditionalItemsAreAllowedByDefault1BoxedList(AdditionalItemsAreAllowedByDefaultList data) implements AdditionalItemsAreAllowedByDefault1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AdditionalItemsAreAllowedByDefault1BoxedMap extends AdditionalItemsAreAllowedByDefault1Boxed { - public final FrozenMap<@Nullable Object> data; - private AdditionalItemsAreAllowedByDefault1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record AdditionalItemsAreAllowedByDefault1BoxedMap(FrozenMap<@Nullable Object> data) implements AdditionalItemsAreAllowedByDefault1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class AdditionalItemsAreAllowedByDefault1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, MapSchemaValidator, AdditionalItemsAreAllowedByDefault1BoxedMap> { + public static class AdditionalItemsAreAllowedByDefault1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, MapSchemaValidator, AdditionalItemsAreAllowedByDefault1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -297,11 +273,11 @@ public AdditionalItemsAreAllowedByDefaultList getNewInstance(List arg, List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -332,11 +308,11 @@ public AdditionalItemsAreAllowedByDefaultList validate(List arg, SchemaConfig List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -415,5 +391,24 @@ public AdditionalItemsAreAllowedByDefault1BoxedList validateAndBox(List arg, public AdditionalItemsAreAllowedByDefault1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new AdditionalItemsAreAllowedByDefault1BoxedMap(validate(arg, configuration)); } + @Override + public AdditionalItemsAreAllowedByDefault1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAreAllowedByDefault.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAreAllowedByDefault.java index f572d0ef637..e6517f75b10 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAreAllowedByDefault.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesAreAllowedByDefault.java @@ -236,78 +236,54 @@ public AdditionalpropertiesAreAllowedByDefaultMapBuilder getBuilderAfterAddition } - public static abstract sealed class AdditionalpropertiesAreAllowedByDefault1Boxed permits AdditionalpropertiesAreAllowedByDefault1BoxedVoid, AdditionalpropertiesAreAllowedByDefault1BoxedBoolean, AdditionalpropertiesAreAllowedByDefault1BoxedNumber, AdditionalpropertiesAreAllowedByDefault1BoxedString, AdditionalpropertiesAreAllowedByDefault1BoxedList, AdditionalpropertiesAreAllowedByDefault1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface AdditionalpropertiesAreAllowedByDefault1Boxed permits AdditionalpropertiesAreAllowedByDefault1BoxedVoid, AdditionalpropertiesAreAllowedByDefault1BoxedBoolean, AdditionalpropertiesAreAllowedByDefault1BoxedNumber, AdditionalpropertiesAreAllowedByDefault1BoxedString, AdditionalpropertiesAreAllowedByDefault1BoxedList, AdditionalpropertiesAreAllowedByDefault1BoxedMap { + @Nullable Object getData(); } - public static final class AdditionalpropertiesAreAllowedByDefault1BoxedVoid extends AdditionalpropertiesAreAllowedByDefault1Boxed { - public final Void data; - private AdditionalpropertiesAreAllowedByDefault1BoxedVoid(Void data) { - this.data = data; - } + public record AdditionalpropertiesAreAllowedByDefault1BoxedVoid(Void data) implements AdditionalpropertiesAreAllowedByDefault1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AdditionalpropertiesAreAllowedByDefault1BoxedBoolean extends AdditionalpropertiesAreAllowedByDefault1Boxed { - public final boolean data; - private AdditionalpropertiesAreAllowedByDefault1BoxedBoolean(boolean data) { - this.data = data; - } + public record AdditionalpropertiesAreAllowedByDefault1BoxedBoolean(boolean data) implements AdditionalpropertiesAreAllowedByDefault1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AdditionalpropertiesAreAllowedByDefault1BoxedNumber extends AdditionalpropertiesAreAllowedByDefault1Boxed { - public final Number data; - private AdditionalpropertiesAreAllowedByDefault1BoxedNumber(Number data) { - this.data = data; - } + public record AdditionalpropertiesAreAllowedByDefault1BoxedNumber(Number data) implements AdditionalpropertiesAreAllowedByDefault1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AdditionalpropertiesAreAllowedByDefault1BoxedString extends AdditionalpropertiesAreAllowedByDefault1Boxed { - public final String data; - private AdditionalpropertiesAreAllowedByDefault1BoxedString(String data) { - this.data = data; - } + public record AdditionalpropertiesAreAllowedByDefault1BoxedString(String data) implements AdditionalpropertiesAreAllowedByDefault1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AdditionalpropertiesAreAllowedByDefault1BoxedList extends AdditionalpropertiesAreAllowedByDefault1Boxed { - public final FrozenList<@Nullable Object> data; - private AdditionalpropertiesAreAllowedByDefault1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record AdditionalpropertiesAreAllowedByDefault1BoxedList(FrozenList<@Nullable Object> data) implements AdditionalpropertiesAreAllowedByDefault1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AdditionalpropertiesAreAllowedByDefault1BoxedMap extends AdditionalpropertiesAreAllowedByDefault1Boxed { - public final AdditionalpropertiesAreAllowedByDefaultMap data; - private AdditionalpropertiesAreAllowedByDefault1BoxedMap(AdditionalpropertiesAreAllowedByDefaultMap data) { - this.data = data; - } + public record AdditionalpropertiesAreAllowedByDefault1BoxedMap(AdditionalpropertiesAreAllowedByDefaultMap data) implements AdditionalpropertiesAreAllowedByDefault1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class AdditionalpropertiesAreAllowedByDefault1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, AdditionalpropertiesAreAllowedByDefault1BoxedList>, MapSchemaValidator { + public static class AdditionalpropertiesAreAllowedByDefault1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, AdditionalpropertiesAreAllowedByDefault1BoxedList>, MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -415,11 +391,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -450,11 +426,11 @@ public AdditionalpropertiesAreAllowedByDefaultMap getNewInstance(Map arg, List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -533,5 +509,24 @@ public AdditionalpropertiesAreAllowedByDefault1BoxedList validateAndBox(List public AdditionalpropertiesAreAllowedByDefault1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new AdditionalpropertiesAreAllowedByDefault1BoxedMap(validate(arg, configuration)); } + @Override + public AdditionalpropertiesAreAllowedByDefault1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesCanExistByItself.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesCanExistByItself.java index 3b243ef9a6c..649e69307db 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesCanExistByItself.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesCanExistByItself.java @@ -93,23 +93,19 @@ public AdditionalpropertiesCanExistByItselfMapBuilder getBuilderAfterAdditionalP } - public static abstract sealed class AdditionalpropertiesCanExistByItself1Boxed permits AdditionalpropertiesCanExistByItself1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface AdditionalpropertiesCanExistByItself1Boxed permits AdditionalpropertiesCanExistByItself1BoxedMap { + @Nullable Object getData(); } - public static final class AdditionalpropertiesCanExistByItself1BoxedMap extends AdditionalpropertiesCanExistByItself1Boxed { - public final AdditionalpropertiesCanExistByItselfMap data; - private AdditionalpropertiesCanExistByItself1BoxedMap(AdditionalpropertiesCanExistByItselfMap data) { - this.data = data; - } + public record AdditionalpropertiesCanExistByItself1BoxedMap(AdditionalpropertiesCanExistByItselfMap data) implements AdditionalpropertiesCanExistByItself1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class AdditionalpropertiesCanExistByItself1 extends JsonSchema implements MapSchemaValidator { + public static class AdditionalpropertiesCanExistByItself1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -143,11 +139,11 @@ public AdditionalpropertiesCanExistByItselfMap getNewInstance(Map arg, Lis List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Boolean)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -187,6 +183,13 @@ public AdditionalpropertiesCanExistByItselfMap validate(Map arg, SchemaCon public AdditionalpropertiesCanExistByItself1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new AdditionalpropertiesCanExistByItself1BoxedMap(validate(arg, configuration)); } + @Override + public AdditionalpropertiesCanExistByItself1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesDoesNotLookInApplicators.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesDoesNotLookInApplicators.java index 2b31f327d3c..94d89c88eab 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesDoesNotLookInApplicators.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesDoesNotLookInApplicators.java @@ -170,78 +170,54 @@ public Schema0MapBuilder getBuilderAfterAdditionalProperty(Map data; - private Schema0BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Schema0BoxedList(FrozenList<@Nullable Object> data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedMap extends Schema0Boxed { - public final Schema0Map data; - private Schema0BoxedMap(Schema0Map data) { - this.data = data; - } + public record Schema0BoxedMap(Schema0Map data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema0BoxedList>, MapSchemaValidator { + public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema0BoxedList>, MapSchemaValidator { private static @Nullable Schema0 instance = null; protected Schema0() { @@ -342,11 +318,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -377,11 +353,11 @@ public Schema0Map getNewInstance(Map arg, List pathToItem, PathToS List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -460,6 +436,25 @@ public Schema0BoxedList validateAndBox(List arg, SchemaConfiguration configur public Schema0BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema0BoxedMap(validate(arg, configuration)); } + @Override + public Schema0Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class AdditionalpropertiesDoesNotLookInApplicatorsMap extends FrozenMap { @@ -516,78 +511,54 @@ public AdditionalpropertiesDoesNotLookInApplicatorsMapBuilder getBuilderAfterAdd } - public static abstract sealed class AdditionalpropertiesDoesNotLookInApplicators1Boxed permits AdditionalpropertiesDoesNotLookInApplicators1BoxedVoid, AdditionalpropertiesDoesNotLookInApplicators1BoxedBoolean, AdditionalpropertiesDoesNotLookInApplicators1BoxedNumber, AdditionalpropertiesDoesNotLookInApplicators1BoxedString, AdditionalpropertiesDoesNotLookInApplicators1BoxedList, AdditionalpropertiesDoesNotLookInApplicators1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface AdditionalpropertiesDoesNotLookInApplicators1Boxed permits AdditionalpropertiesDoesNotLookInApplicators1BoxedVoid, AdditionalpropertiesDoesNotLookInApplicators1BoxedBoolean, AdditionalpropertiesDoesNotLookInApplicators1BoxedNumber, AdditionalpropertiesDoesNotLookInApplicators1BoxedString, AdditionalpropertiesDoesNotLookInApplicators1BoxedList, AdditionalpropertiesDoesNotLookInApplicators1BoxedMap { + @Nullable Object getData(); } - public static final class AdditionalpropertiesDoesNotLookInApplicators1BoxedVoid extends AdditionalpropertiesDoesNotLookInApplicators1Boxed { - public final Void data; - private AdditionalpropertiesDoesNotLookInApplicators1BoxedVoid(Void data) { - this.data = data; - } + public record AdditionalpropertiesDoesNotLookInApplicators1BoxedVoid(Void data) implements AdditionalpropertiesDoesNotLookInApplicators1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AdditionalpropertiesDoesNotLookInApplicators1BoxedBoolean extends AdditionalpropertiesDoesNotLookInApplicators1Boxed { - public final boolean data; - private AdditionalpropertiesDoesNotLookInApplicators1BoxedBoolean(boolean data) { - this.data = data; - } + public record AdditionalpropertiesDoesNotLookInApplicators1BoxedBoolean(boolean data) implements AdditionalpropertiesDoesNotLookInApplicators1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AdditionalpropertiesDoesNotLookInApplicators1BoxedNumber extends AdditionalpropertiesDoesNotLookInApplicators1Boxed { - public final Number data; - private AdditionalpropertiesDoesNotLookInApplicators1BoxedNumber(Number data) { - this.data = data; - } + public record AdditionalpropertiesDoesNotLookInApplicators1BoxedNumber(Number data) implements AdditionalpropertiesDoesNotLookInApplicators1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AdditionalpropertiesDoesNotLookInApplicators1BoxedString extends AdditionalpropertiesDoesNotLookInApplicators1Boxed { - public final String data; - private AdditionalpropertiesDoesNotLookInApplicators1BoxedString(String data) { - this.data = data; - } + public record AdditionalpropertiesDoesNotLookInApplicators1BoxedString(String data) implements AdditionalpropertiesDoesNotLookInApplicators1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AdditionalpropertiesDoesNotLookInApplicators1BoxedList extends AdditionalpropertiesDoesNotLookInApplicators1Boxed { - public final FrozenList<@Nullable Object> data; - private AdditionalpropertiesDoesNotLookInApplicators1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record AdditionalpropertiesDoesNotLookInApplicators1BoxedList(FrozenList<@Nullable Object> data) implements AdditionalpropertiesDoesNotLookInApplicators1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AdditionalpropertiesDoesNotLookInApplicators1BoxedMap extends AdditionalpropertiesDoesNotLookInApplicators1Boxed { - public final AdditionalpropertiesDoesNotLookInApplicatorsMap data; - private AdditionalpropertiesDoesNotLookInApplicators1BoxedMap(AdditionalpropertiesDoesNotLookInApplicatorsMap data) { - this.data = data; - } + public record AdditionalpropertiesDoesNotLookInApplicators1BoxedMap(AdditionalpropertiesDoesNotLookInApplicatorsMap data) implements AdditionalpropertiesDoesNotLookInApplicators1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class AdditionalpropertiesDoesNotLookInApplicators1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, AdditionalpropertiesDoesNotLookInApplicators1BoxedList>, MapSchemaValidator { + public static class AdditionalpropertiesDoesNotLookInApplicators1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, AdditionalpropertiesDoesNotLookInApplicators1BoxedList>, MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -695,11 +666,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -730,11 +701,11 @@ public AdditionalpropertiesDoesNotLookInApplicatorsMap getNewInstance(Map List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Boolean)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -816,5 +787,24 @@ public AdditionalpropertiesDoesNotLookInApplicators1BoxedList validateAndBox(Lis public AdditionalpropertiesDoesNotLookInApplicators1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new AdditionalpropertiesDoesNotLookInApplicators1BoxedMap(validate(arg, configuration)); } + @Override + public AdditionalpropertiesDoesNotLookInApplicators1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesWithNullValuedInstanceProperties.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesWithNullValuedInstanceProperties.java index d4ff8b22d9d..bec67224249 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesWithNullValuedInstanceProperties.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesWithNullValuedInstanceProperties.java @@ -88,23 +88,19 @@ public AdditionalpropertiesWithNullValuedInstancePropertiesMapBuilder getBuilder } - public static abstract sealed class AdditionalpropertiesWithNullValuedInstanceProperties1Boxed permits AdditionalpropertiesWithNullValuedInstanceProperties1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface AdditionalpropertiesWithNullValuedInstanceProperties1Boxed permits AdditionalpropertiesWithNullValuedInstanceProperties1BoxedMap { + @Nullable Object getData(); } - public static final class AdditionalpropertiesWithNullValuedInstanceProperties1BoxedMap extends AdditionalpropertiesWithNullValuedInstanceProperties1Boxed { - public final AdditionalpropertiesWithNullValuedInstancePropertiesMap data; - private AdditionalpropertiesWithNullValuedInstanceProperties1BoxedMap(AdditionalpropertiesWithNullValuedInstancePropertiesMap data) { - this.data = data; - } + public record AdditionalpropertiesWithNullValuedInstanceProperties1BoxedMap(AdditionalpropertiesWithNullValuedInstancePropertiesMap data) implements AdditionalpropertiesWithNullValuedInstanceProperties1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class AdditionalpropertiesWithNullValuedInstanceProperties1 extends JsonSchema implements MapSchemaValidator { + public static class AdditionalpropertiesWithNullValuedInstanceProperties1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -138,11 +134,11 @@ public AdditionalpropertiesWithNullValuedInstancePropertiesMap getNewInstance(Ma List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance == null || propertyInstance instanceof Void)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -182,6 +178,13 @@ public AdditionalpropertiesWithNullValuedInstancePropertiesMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new AdditionalpropertiesWithNullValuedInstanceProperties1BoxedMap(validate(arg, configuration)); } + @Override + public AdditionalpropertiesWithNullValuedInstanceProperties1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesWithSchema.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesWithSchema.java index 1ccdefbdcea..8a657893b71 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesWithSchema.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalpropertiesWithSchema.java @@ -255,23 +255,19 @@ public AdditionalpropertiesWithSchemaMapBuilder getBuilderAfterAdditionalPropert } - public static abstract sealed class AdditionalpropertiesWithSchema1Boxed permits AdditionalpropertiesWithSchema1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface AdditionalpropertiesWithSchema1Boxed permits AdditionalpropertiesWithSchema1BoxedMap { + @Nullable Object getData(); } - public static final class AdditionalpropertiesWithSchema1BoxedMap extends AdditionalpropertiesWithSchema1Boxed { - public final AdditionalpropertiesWithSchemaMap data; - private AdditionalpropertiesWithSchema1BoxedMap(AdditionalpropertiesWithSchemaMap data) { - this.data = data; - } + public record AdditionalpropertiesWithSchema1BoxedMap(AdditionalpropertiesWithSchemaMap data) implements AdditionalpropertiesWithSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class AdditionalpropertiesWithSchema1 extends JsonSchema implements MapSchemaValidator { + public static class AdditionalpropertiesWithSchema1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -309,11 +305,11 @@ public AdditionalpropertiesWithSchemaMap getNewInstance(Map arg, List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -350,6 +346,13 @@ public AdditionalpropertiesWithSchemaMap validate(Map arg, SchemaConfigura public AdditionalpropertiesWithSchema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new AdditionalpropertiesWithSchema1BoxedMap(validate(arg, configuration)); } + @Override + public AdditionalpropertiesWithSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java index a21785e89d4..f2c3bac9dfb 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Allof.java @@ -142,78 +142,54 @@ public Schema0Map0Builder getBuilderAfterBar(Map insta } - public static abstract sealed class Schema0Boxed permits Schema0BoxedVoid, Schema0BoxedBoolean, Schema0BoxedNumber, Schema0BoxedString, Schema0BoxedList, Schema0BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Schema0Boxed permits Schema0BoxedVoid, Schema0BoxedBoolean, Schema0BoxedNumber, Schema0BoxedString, Schema0BoxedList, Schema0BoxedMap { + @Nullable Object getData(); } - public static final class Schema0BoxedVoid extends Schema0Boxed { - public final Void data; - private Schema0BoxedVoid(Void data) { - this.data = data; - } + public record Schema0BoxedVoid(Void data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedBoolean extends Schema0Boxed { - public final boolean data; - private Schema0BoxedBoolean(boolean data) { - this.data = data; - } + public record Schema0BoxedBoolean(boolean data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedNumber extends Schema0Boxed { - public final Number data; - private Schema0BoxedNumber(Number data) { - this.data = data; - } + public record Schema0BoxedNumber(Number data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedString extends Schema0Boxed { - public final String data; - private Schema0BoxedString(String data) { - this.data = data; - } + public record Schema0BoxedString(String data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedList extends Schema0Boxed { - public final FrozenList<@Nullable Object> data; - private Schema0BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Schema0BoxedList(FrozenList<@Nullable Object> data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedMap extends Schema0Boxed { - public final Schema0Map data; - private Schema0BoxedMap(Schema0Map data) { - this.data = data; - } + public record Schema0BoxedMap(Schema0Map data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema0BoxedList>, MapSchemaValidator { + public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema0BoxedList>, MapSchemaValidator { private static @Nullable Schema0 instance = null; protected Schema0() { @@ -317,11 +293,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -352,11 +328,11 @@ public Schema0Map getNewInstance(Map arg, List pathToItem, PathToS List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -435,6 +411,25 @@ public Schema0BoxedList validateAndBox(List arg, SchemaConfiguration configur public Schema0BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema0BoxedMap(validate(arg, configuration)); } + @Override + public Schema0Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class Foo extends StringJsonSchema.StringJsonSchema1 { @@ -522,78 +517,54 @@ public Schema1Map0Builder getBuilderAfterFoo(Map insta } - public static abstract sealed class Schema1Boxed permits Schema1BoxedVoid, Schema1BoxedBoolean, Schema1BoxedNumber, Schema1BoxedString, Schema1BoxedList, Schema1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Schema1Boxed permits Schema1BoxedVoid, Schema1BoxedBoolean, Schema1BoxedNumber, Schema1BoxedString, Schema1BoxedList, Schema1BoxedMap { + @Nullable Object getData(); } - public static final class Schema1BoxedVoid extends Schema1Boxed { - public final Void data; - private Schema1BoxedVoid(Void data) { - this.data = data; - } + public record Schema1BoxedVoid(Void data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedBoolean extends Schema1Boxed { - public final boolean data; - private Schema1BoxedBoolean(boolean data) { - this.data = data; - } + public record Schema1BoxedBoolean(boolean data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedNumber extends Schema1Boxed { - public final Number data; - private Schema1BoxedNumber(Number data) { - this.data = data; - } + public record Schema1BoxedNumber(Number data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedString extends Schema1Boxed { - public final String data; - private Schema1BoxedString(String data) { - this.data = data; - } + public record Schema1BoxedString(String data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedList extends Schema1Boxed { - public final FrozenList<@Nullable Object> data; - private Schema1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Schema1BoxedList(FrozenList<@Nullable Object> data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedMap extends Schema1Boxed { - public final Schema1Map data; - private Schema1BoxedMap(Schema1Map data) { - this.data = data; - } + public record Schema1BoxedMap(Schema1Map data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema1BoxedList>, MapSchemaValidator { + public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema1BoxedList>, MapSchemaValidator { private static @Nullable Schema1 instance = null; protected Schema1() { @@ -697,11 +668,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -732,11 +703,11 @@ public Schema1Map getNewInstance(Map arg, List pathToItem, PathToS List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -815,80 +786,75 @@ public Schema1BoxedList validateAndBox(List arg, SchemaConfiguration configur public Schema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema1BoxedMap(validate(arg, configuration)); } + @Override + public Schema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class Allof1Boxed permits Allof1BoxedVoid, Allof1BoxedBoolean, Allof1BoxedNumber, Allof1BoxedString, Allof1BoxedList, Allof1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Allof1Boxed permits Allof1BoxedVoid, Allof1BoxedBoolean, Allof1BoxedNumber, Allof1BoxedString, Allof1BoxedList, Allof1BoxedMap { + @Nullable Object getData(); } - public static final class Allof1BoxedVoid extends Allof1Boxed { - public final Void data; - private Allof1BoxedVoid(Void data) { - this.data = data; - } + public record Allof1BoxedVoid(Void data) implements Allof1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Allof1BoxedBoolean extends Allof1Boxed { - public final boolean data; - private Allof1BoxedBoolean(boolean data) { - this.data = data; - } + public record Allof1BoxedBoolean(boolean data) implements Allof1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Allof1BoxedNumber extends Allof1Boxed { - public final Number data; - private Allof1BoxedNumber(Number data) { - this.data = data; - } + public record Allof1BoxedNumber(Number data) implements Allof1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Allof1BoxedString extends Allof1Boxed { - public final String data; - private Allof1BoxedString(String data) { - this.data = data; - } + public record Allof1BoxedString(String data) implements Allof1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Allof1BoxedList extends Allof1Boxed { - public final FrozenList<@Nullable Object> data; - private Allof1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Allof1BoxedList(FrozenList<@Nullable Object> data) implements Allof1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Allof1BoxedMap extends Allof1Boxed { - public final FrozenMap<@Nullable Object> data; - private Allof1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record Allof1BoxedMap(FrozenMap<@Nullable Object> data) implements Allof1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Allof1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Allof1BoxedList>, MapSchemaValidator, Allof1BoxedMap> { + public static class Allof1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Allof1BoxedList>, MapSchemaValidator, Allof1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -996,11 +962,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -1031,11 +997,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -1114,5 +1080,24 @@ public Allof1BoxedList validateAndBox(List arg, SchemaConfiguration configura public Allof1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Allof1BoxedMap(validate(arg, configuration)); } + @Override + public Allof1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofCombinedWithAnyofOneof.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofCombinedWithAnyofOneof.java index eb146be7828..e17daac12ce 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofCombinedWithAnyofOneof.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofCombinedWithAnyofOneof.java @@ -36,78 +36,54 @@ public class AllofCombinedWithAnyofOneof { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class Schema02Boxed permits Schema02BoxedVoid, Schema02BoxedBoolean, Schema02BoxedNumber, Schema02BoxedString, Schema02BoxedList, Schema02BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Schema02Boxed permits Schema02BoxedVoid, Schema02BoxedBoolean, Schema02BoxedNumber, Schema02BoxedString, Schema02BoxedList, Schema02BoxedMap { + @Nullable Object getData(); } - public static final class Schema02BoxedVoid extends Schema02Boxed { - public final Void data; - private Schema02BoxedVoid(Void data) { - this.data = data; - } + public record Schema02BoxedVoid(Void data) implements Schema02Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema02BoxedBoolean extends Schema02Boxed { - public final boolean data; - private Schema02BoxedBoolean(boolean data) { - this.data = data; - } + public record Schema02BoxedBoolean(boolean data) implements Schema02Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema02BoxedNumber extends Schema02Boxed { - public final Number data; - private Schema02BoxedNumber(Number data) { - this.data = data; - } + public record Schema02BoxedNumber(Number data) implements Schema02Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema02BoxedString extends Schema02Boxed { - public final String data; - private Schema02BoxedString(String data) { - this.data = data; - } + public record Schema02BoxedString(String data) implements Schema02Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema02BoxedList extends Schema02Boxed { - public final FrozenList<@Nullable Object> data; - private Schema02BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Schema02BoxedList(FrozenList<@Nullable Object> data) implements Schema02Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema02BoxedMap extends Schema02Boxed { - public final FrozenMap<@Nullable Object> data; - private Schema02BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record Schema02BoxedMap(FrozenMap<@Nullable Object> data) implements Schema02Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema02 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema02BoxedList>, MapSchemaValidator, Schema02BoxedMap> { + public static class Schema02 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema02BoxedList>, MapSchemaValidator, Schema02BoxedMap> { private static @Nullable Schema02 instance = null; protected Schema02() { @@ -206,11 +182,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -241,11 +217,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -324,80 +300,75 @@ public Schema02BoxedList validateAndBox(List arg, SchemaConfiguration configu public Schema02BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema02BoxedMap(validate(arg, configuration)); } + @Override + public Schema02Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class Schema01Boxed permits Schema01BoxedVoid, Schema01BoxedBoolean, Schema01BoxedNumber, Schema01BoxedString, Schema01BoxedList, Schema01BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Schema01Boxed permits Schema01BoxedVoid, Schema01BoxedBoolean, Schema01BoxedNumber, Schema01BoxedString, Schema01BoxedList, Schema01BoxedMap { + @Nullable Object getData(); } - public static final class Schema01BoxedVoid extends Schema01Boxed { - public final Void data; - private Schema01BoxedVoid(Void data) { - this.data = data; - } + public record Schema01BoxedVoid(Void data) implements Schema01Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema01BoxedBoolean extends Schema01Boxed { - public final boolean data; - private Schema01BoxedBoolean(boolean data) { - this.data = data; - } + public record Schema01BoxedBoolean(boolean data) implements Schema01Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema01BoxedNumber extends Schema01Boxed { - public final Number data; - private Schema01BoxedNumber(Number data) { - this.data = data; - } + public record Schema01BoxedNumber(Number data) implements Schema01Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema01BoxedString extends Schema01Boxed { - public final String data; - private Schema01BoxedString(String data) { - this.data = data; - } + public record Schema01BoxedString(String data) implements Schema01Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema01BoxedList extends Schema01Boxed { - public final FrozenList<@Nullable Object> data; - private Schema01BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Schema01BoxedList(FrozenList<@Nullable Object> data) implements Schema01Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema01BoxedMap extends Schema01Boxed { - public final FrozenMap<@Nullable Object> data; - private Schema01BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record Schema01BoxedMap(FrozenMap<@Nullable Object> data) implements Schema01Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema01 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema01BoxedList>, MapSchemaValidator, Schema01BoxedMap> { + public static class Schema01 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema01BoxedList>, MapSchemaValidator, Schema01BoxedMap> { private static @Nullable Schema01 instance = null; protected Schema01() { @@ -496,11 +467,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -531,11 +502,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -614,80 +585,75 @@ public Schema01BoxedList validateAndBox(List arg, SchemaConfiguration configu public Schema01BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema01BoxedMap(validate(arg, configuration)); } + @Override + public Schema01Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class Schema0Boxed permits Schema0BoxedVoid, Schema0BoxedBoolean, Schema0BoxedNumber, Schema0BoxedString, Schema0BoxedList, Schema0BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Schema0Boxed permits Schema0BoxedVoid, Schema0BoxedBoolean, Schema0BoxedNumber, Schema0BoxedString, Schema0BoxedList, Schema0BoxedMap { + @Nullable Object getData(); } - public static final class Schema0BoxedVoid extends Schema0Boxed { - public final Void data; - private Schema0BoxedVoid(Void data) { - this.data = data; - } + public record Schema0BoxedVoid(Void data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedBoolean extends Schema0Boxed { - public final boolean data; - private Schema0BoxedBoolean(boolean data) { - this.data = data; - } + public record Schema0BoxedBoolean(boolean data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedNumber extends Schema0Boxed { - public final Number data; - private Schema0BoxedNumber(Number data) { - this.data = data; - } + public record Schema0BoxedNumber(Number data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedString extends Schema0Boxed { - public final String data; - private Schema0BoxedString(String data) { - this.data = data; - } + public record Schema0BoxedString(String data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedList extends Schema0Boxed { - public final FrozenList<@Nullable Object> data; - private Schema0BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Schema0BoxedList(FrozenList<@Nullable Object> data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedMap extends Schema0Boxed { - public final FrozenMap<@Nullable Object> data; - private Schema0BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record Schema0BoxedMap(FrozenMap<@Nullable Object> data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema0BoxedList>, MapSchemaValidator, Schema0BoxedMap> { + public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema0BoxedList>, MapSchemaValidator, Schema0BoxedMap> { private static @Nullable Schema0 instance = null; protected Schema0() { @@ -786,11 +752,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -821,11 +787,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -904,80 +870,75 @@ public Schema0BoxedList validateAndBox(List arg, SchemaConfiguration configur public Schema0BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema0BoxedMap(validate(arg, configuration)); } + @Override + public Schema0Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class AllofCombinedWithAnyofOneof1Boxed permits AllofCombinedWithAnyofOneof1BoxedVoid, AllofCombinedWithAnyofOneof1BoxedBoolean, AllofCombinedWithAnyofOneof1BoxedNumber, AllofCombinedWithAnyofOneof1BoxedString, AllofCombinedWithAnyofOneof1BoxedList, AllofCombinedWithAnyofOneof1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface AllofCombinedWithAnyofOneof1Boxed permits AllofCombinedWithAnyofOneof1BoxedVoid, AllofCombinedWithAnyofOneof1BoxedBoolean, AllofCombinedWithAnyofOneof1BoxedNumber, AllofCombinedWithAnyofOneof1BoxedString, AllofCombinedWithAnyofOneof1BoxedList, AllofCombinedWithAnyofOneof1BoxedMap { + @Nullable Object getData(); } - public static final class AllofCombinedWithAnyofOneof1BoxedVoid extends AllofCombinedWithAnyofOneof1Boxed { - public final Void data; - private AllofCombinedWithAnyofOneof1BoxedVoid(Void data) { - this.data = data; - } + public record AllofCombinedWithAnyofOneof1BoxedVoid(Void data) implements AllofCombinedWithAnyofOneof1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AllofCombinedWithAnyofOneof1BoxedBoolean extends AllofCombinedWithAnyofOneof1Boxed { - public final boolean data; - private AllofCombinedWithAnyofOneof1BoxedBoolean(boolean data) { - this.data = data; - } + public record AllofCombinedWithAnyofOneof1BoxedBoolean(boolean data) implements AllofCombinedWithAnyofOneof1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AllofCombinedWithAnyofOneof1BoxedNumber extends AllofCombinedWithAnyofOneof1Boxed { - public final Number data; - private AllofCombinedWithAnyofOneof1BoxedNumber(Number data) { - this.data = data; - } + public record AllofCombinedWithAnyofOneof1BoxedNumber(Number data) implements AllofCombinedWithAnyofOneof1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AllofCombinedWithAnyofOneof1BoxedString extends AllofCombinedWithAnyofOneof1Boxed { - public final String data; - private AllofCombinedWithAnyofOneof1BoxedString(String data) { - this.data = data; - } + public record AllofCombinedWithAnyofOneof1BoxedString(String data) implements AllofCombinedWithAnyofOneof1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AllofCombinedWithAnyofOneof1BoxedList extends AllofCombinedWithAnyofOneof1Boxed { - public final FrozenList<@Nullable Object> data; - private AllofCombinedWithAnyofOneof1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record AllofCombinedWithAnyofOneof1BoxedList(FrozenList<@Nullable Object> data) implements AllofCombinedWithAnyofOneof1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AllofCombinedWithAnyofOneof1BoxedMap extends AllofCombinedWithAnyofOneof1Boxed { - public final FrozenMap<@Nullable Object> data; - private AllofCombinedWithAnyofOneof1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record AllofCombinedWithAnyofOneof1BoxedMap(FrozenMap<@Nullable Object> data) implements AllofCombinedWithAnyofOneof1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class AllofCombinedWithAnyofOneof1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, AllofCombinedWithAnyofOneof1BoxedList>, MapSchemaValidator, AllofCombinedWithAnyofOneof1BoxedMap> { + public static class AllofCombinedWithAnyofOneof1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, AllofCombinedWithAnyofOneof1BoxedList>, MapSchemaValidator, AllofCombinedWithAnyofOneof1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -1090,11 +1051,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -1125,11 +1086,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -1208,5 +1169,24 @@ public AllofCombinedWithAnyofOneof1BoxedList validateAndBox(List arg, SchemaC public AllofCombinedWithAnyofOneof1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new AllofCombinedWithAnyofOneof1BoxedMap(validate(arg, configuration)); } + @Override + public AllofCombinedWithAnyofOneof1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofSimpleTypes.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofSimpleTypes.java index 781a8fc1595..4c9d473a2f9 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofSimpleTypes.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofSimpleTypes.java @@ -35,78 +35,54 @@ public class AllofSimpleTypes { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class Schema0Boxed permits Schema0BoxedVoid, Schema0BoxedBoolean, Schema0BoxedNumber, Schema0BoxedString, Schema0BoxedList, Schema0BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Schema0Boxed permits Schema0BoxedVoid, Schema0BoxedBoolean, Schema0BoxedNumber, Schema0BoxedString, Schema0BoxedList, Schema0BoxedMap { + @Nullable Object getData(); } - public static final class Schema0BoxedVoid extends Schema0Boxed { - public final Void data; - private Schema0BoxedVoid(Void data) { - this.data = data; - } + public record Schema0BoxedVoid(Void data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedBoolean extends Schema0Boxed { - public final boolean data; - private Schema0BoxedBoolean(boolean data) { - this.data = data; - } + public record Schema0BoxedBoolean(boolean data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedNumber extends Schema0Boxed { - public final Number data; - private Schema0BoxedNumber(Number data) { - this.data = data; - } + public record Schema0BoxedNumber(Number data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedString extends Schema0Boxed { - public final String data; - private Schema0BoxedString(String data) { - this.data = data; - } + public record Schema0BoxedString(String data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedList extends Schema0Boxed { - public final FrozenList<@Nullable Object> data; - private Schema0BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Schema0BoxedList(FrozenList<@Nullable Object> data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedMap extends Schema0Boxed { - public final FrozenMap<@Nullable Object> data; - private Schema0BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record Schema0BoxedMap(FrozenMap<@Nullable Object> data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema0BoxedList>, MapSchemaValidator, Schema0BoxedMap> { + public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema0BoxedList>, MapSchemaValidator, Schema0BoxedMap> { private static @Nullable Schema0 instance = null; protected Schema0() { @@ -205,11 +181,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -240,11 +216,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -323,80 +299,75 @@ public Schema0BoxedList validateAndBox(List arg, SchemaConfiguration configur public Schema0BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema0BoxedMap(validate(arg, configuration)); } + @Override + public Schema0Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class Schema1Boxed permits Schema1BoxedVoid, Schema1BoxedBoolean, Schema1BoxedNumber, Schema1BoxedString, Schema1BoxedList, Schema1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Schema1Boxed permits Schema1BoxedVoid, Schema1BoxedBoolean, Schema1BoxedNumber, Schema1BoxedString, Schema1BoxedList, Schema1BoxedMap { + @Nullable Object getData(); } - public static final class Schema1BoxedVoid extends Schema1Boxed { - public final Void data; - private Schema1BoxedVoid(Void data) { - this.data = data; - } + public record Schema1BoxedVoid(Void data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedBoolean extends Schema1Boxed { - public final boolean data; - private Schema1BoxedBoolean(boolean data) { - this.data = data; - } + public record Schema1BoxedBoolean(boolean data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedNumber extends Schema1Boxed { - public final Number data; - private Schema1BoxedNumber(Number data) { - this.data = data; - } + public record Schema1BoxedNumber(Number data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedString extends Schema1Boxed { - public final String data; - private Schema1BoxedString(String data) { - this.data = data; - } + public record Schema1BoxedString(String data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedList extends Schema1Boxed { - public final FrozenList<@Nullable Object> data; - private Schema1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Schema1BoxedList(FrozenList<@Nullable Object> data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedMap extends Schema1Boxed { - public final FrozenMap<@Nullable Object> data; - private Schema1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record Schema1BoxedMap(FrozenMap<@Nullable Object> data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema1BoxedList>, MapSchemaValidator, Schema1BoxedMap> { + public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema1BoxedList>, MapSchemaValidator, Schema1BoxedMap> { private static @Nullable Schema1 instance = null; protected Schema1() { @@ -495,11 +466,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -530,11 +501,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -613,80 +584,75 @@ public Schema1BoxedList validateAndBox(List arg, SchemaConfiguration configur public Schema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema1BoxedMap(validate(arg, configuration)); } + @Override + public Schema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class AllofSimpleTypes1Boxed permits AllofSimpleTypes1BoxedVoid, AllofSimpleTypes1BoxedBoolean, AllofSimpleTypes1BoxedNumber, AllofSimpleTypes1BoxedString, AllofSimpleTypes1BoxedList, AllofSimpleTypes1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface AllofSimpleTypes1Boxed permits AllofSimpleTypes1BoxedVoid, AllofSimpleTypes1BoxedBoolean, AllofSimpleTypes1BoxedNumber, AllofSimpleTypes1BoxedString, AllofSimpleTypes1BoxedList, AllofSimpleTypes1BoxedMap { + @Nullable Object getData(); } - public static final class AllofSimpleTypes1BoxedVoid extends AllofSimpleTypes1Boxed { - public final Void data; - private AllofSimpleTypes1BoxedVoid(Void data) { - this.data = data; - } + public record AllofSimpleTypes1BoxedVoid(Void data) implements AllofSimpleTypes1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AllofSimpleTypes1BoxedBoolean extends AllofSimpleTypes1Boxed { - public final boolean data; - private AllofSimpleTypes1BoxedBoolean(boolean data) { - this.data = data; - } + public record AllofSimpleTypes1BoxedBoolean(boolean data) implements AllofSimpleTypes1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AllofSimpleTypes1BoxedNumber extends AllofSimpleTypes1Boxed { - public final Number data; - private AllofSimpleTypes1BoxedNumber(Number data) { - this.data = data; - } + public record AllofSimpleTypes1BoxedNumber(Number data) implements AllofSimpleTypes1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AllofSimpleTypes1BoxedString extends AllofSimpleTypes1Boxed { - public final String data; - private AllofSimpleTypes1BoxedString(String data) { - this.data = data; - } + public record AllofSimpleTypes1BoxedString(String data) implements AllofSimpleTypes1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AllofSimpleTypes1BoxedList extends AllofSimpleTypes1Boxed { - public final FrozenList<@Nullable Object> data; - private AllofSimpleTypes1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record AllofSimpleTypes1BoxedList(FrozenList<@Nullable Object> data) implements AllofSimpleTypes1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AllofSimpleTypes1BoxedMap extends AllofSimpleTypes1Boxed { - public final FrozenMap<@Nullable Object> data; - private AllofSimpleTypes1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record AllofSimpleTypes1BoxedMap(FrozenMap<@Nullable Object> data) implements AllofSimpleTypes1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class AllofSimpleTypes1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, AllofSimpleTypes1BoxedList>, MapSchemaValidator, AllofSimpleTypes1BoxedMap> { + public static class AllofSimpleTypes1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, AllofSimpleTypes1BoxedList>, MapSchemaValidator, AllofSimpleTypes1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -794,11 +760,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -829,11 +795,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -912,5 +878,24 @@ public AllofSimpleTypes1BoxedList validateAndBox(List arg, SchemaConfiguratio public AllofSimpleTypes1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new AllofSimpleTypes1BoxedMap(validate(arg, configuration)); } + @Override + public AllofSimpleTypes1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java index f640bab85f2..a67e189c9e4 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithBaseSchema.java @@ -125,78 +125,54 @@ public Schema0Map0Builder getBuilderAfterFoo(Map insta } - public static abstract sealed class Schema0Boxed permits Schema0BoxedVoid, Schema0BoxedBoolean, Schema0BoxedNumber, Schema0BoxedString, Schema0BoxedList, Schema0BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Schema0Boxed permits Schema0BoxedVoid, Schema0BoxedBoolean, Schema0BoxedNumber, Schema0BoxedString, Schema0BoxedList, Schema0BoxedMap { + @Nullable Object getData(); } - public static final class Schema0BoxedVoid extends Schema0Boxed { - public final Void data; - private Schema0BoxedVoid(Void data) { - this.data = data; - } + public record Schema0BoxedVoid(Void data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedBoolean extends Schema0Boxed { - public final boolean data; - private Schema0BoxedBoolean(boolean data) { - this.data = data; - } + public record Schema0BoxedBoolean(boolean data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedNumber extends Schema0Boxed { - public final Number data; - private Schema0BoxedNumber(Number data) { - this.data = data; - } + public record Schema0BoxedNumber(Number data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedString extends Schema0Boxed { - public final String data; - private Schema0BoxedString(String data) { - this.data = data; - } + public record Schema0BoxedString(String data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedList extends Schema0Boxed { - public final FrozenList<@Nullable Object> data; - private Schema0BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Schema0BoxedList(FrozenList<@Nullable Object> data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedMap extends Schema0Boxed { - public final Schema0Map data; - private Schema0BoxedMap(Schema0Map data) { - this.data = data; - } + public record Schema0BoxedMap(Schema0Map data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema0BoxedList>, MapSchemaValidator { + public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema0BoxedList>, MapSchemaValidator { private static @Nullable Schema0 instance = null; protected Schema0() { @@ -300,11 +276,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -335,11 +311,11 @@ public Schema0Map getNewInstance(Map arg, List pathToItem, PathToS List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -418,6 +394,25 @@ public Schema0BoxedList validateAndBox(List arg, SchemaConfiguration configur public Schema0BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema0BoxedMap(validate(arg, configuration)); } + @Override + public Schema0Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class Baz extends NullJsonSchema.NullJsonSchema1 { @@ -505,78 +500,54 @@ public Schema1Map0Builder getBuilderAfterBaz(Map insta } - public static abstract sealed class Schema1Boxed permits Schema1BoxedVoid, Schema1BoxedBoolean, Schema1BoxedNumber, Schema1BoxedString, Schema1BoxedList, Schema1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Schema1Boxed permits Schema1BoxedVoid, Schema1BoxedBoolean, Schema1BoxedNumber, Schema1BoxedString, Schema1BoxedList, Schema1BoxedMap { + @Nullable Object getData(); } - public static final class Schema1BoxedVoid extends Schema1Boxed { - public final Void data; - private Schema1BoxedVoid(Void data) { - this.data = data; - } + public record Schema1BoxedVoid(Void data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedBoolean extends Schema1Boxed { - public final boolean data; - private Schema1BoxedBoolean(boolean data) { - this.data = data; - } + public record Schema1BoxedBoolean(boolean data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedNumber extends Schema1Boxed { - public final Number data; - private Schema1BoxedNumber(Number data) { - this.data = data; - } + public record Schema1BoxedNumber(Number data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedString extends Schema1Boxed { - public final String data; - private Schema1BoxedString(String data) { - this.data = data; - } + public record Schema1BoxedString(String data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedList extends Schema1Boxed { - public final FrozenList<@Nullable Object> data; - private Schema1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Schema1BoxedList(FrozenList<@Nullable Object> data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedMap extends Schema1Boxed { - public final Schema1Map data; - private Schema1BoxedMap(Schema1Map data) { - this.data = data; - } + public record Schema1BoxedMap(Schema1Map data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema1BoxedList>, MapSchemaValidator { + public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema1BoxedList>, MapSchemaValidator { private static @Nullable Schema1 instance = null; protected Schema1() { @@ -680,11 +651,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -715,11 +686,11 @@ public Schema1Map getNewInstance(Map arg, List pathToItem, PathToS List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -798,6 +769,25 @@ public Schema1BoxedList validateAndBox(List arg, SchemaConfiguration configur public Schema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema1BoxedMap(validate(arg, configuration)); } + @Override + public Schema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class Bar extends IntJsonSchema.IntJsonSchema1 { @@ -903,78 +893,54 @@ public AllofWithBaseSchemaMap0Builder getBuilderAfterBar(Map data; - private AllofWithBaseSchema1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record AllofWithBaseSchema1BoxedList(FrozenList<@Nullable Object> data) implements AllofWithBaseSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AllofWithBaseSchema1BoxedMap extends AllofWithBaseSchema1Boxed { - public final AllofWithBaseSchemaMap data; - private AllofWithBaseSchema1BoxedMap(AllofWithBaseSchemaMap data) { - this.data = data; - } + public record AllofWithBaseSchema1BoxedMap(AllofWithBaseSchemaMap data) implements AllofWithBaseSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class AllofWithBaseSchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, AllofWithBaseSchema1BoxedList>, MapSchemaValidator { + public static class AllofWithBaseSchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, AllofWithBaseSchema1BoxedList>, MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -1088,11 +1054,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -1123,11 +1089,11 @@ public AllofWithBaseSchemaMap getNewInstance(Map arg, List pathToI List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -1206,5 +1172,24 @@ public AllofWithBaseSchema1BoxedList validateAndBox(List arg, SchemaConfigura public AllofWithBaseSchema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new AllofWithBaseSchema1BoxedMap(validate(arg, configuration)); } + @Override + public AllofWithBaseSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithOneEmptySchema.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithOneEmptySchema.java index ba7f3cd1473..6ad17067551 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithOneEmptySchema.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithOneEmptySchema.java @@ -47,78 +47,54 @@ public static Schema0 getInstance() { } - public static abstract sealed class AllofWithOneEmptySchema1Boxed permits AllofWithOneEmptySchema1BoxedVoid, AllofWithOneEmptySchema1BoxedBoolean, AllofWithOneEmptySchema1BoxedNumber, AllofWithOneEmptySchema1BoxedString, AllofWithOneEmptySchema1BoxedList, AllofWithOneEmptySchema1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface AllofWithOneEmptySchema1Boxed permits AllofWithOneEmptySchema1BoxedVoid, AllofWithOneEmptySchema1BoxedBoolean, AllofWithOneEmptySchema1BoxedNumber, AllofWithOneEmptySchema1BoxedString, AllofWithOneEmptySchema1BoxedList, AllofWithOneEmptySchema1BoxedMap { + @Nullable Object getData(); } - public static final class AllofWithOneEmptySchema1BoxedVoid extends AllofWithOneEmptySchema1Boxed { - public final Void data; - private AllofWithOneEmptySchema1BoxedVoid(Void data) { - this.data = data; - } + public record AllofWithOneEmptySchema1BoxedVoid(Void data) implements AllofWithOneEmptySchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AllofWithOneEmptySchema1BoxedBoolean extends AllofWithOneEmptySchema1Boxed { - public final boolean data; - private AllofWithOneEmptySchema1BoxedBoolean(boolean data) { - this.data = data; - } + public record AllofWithOneEmptySchema1BoxedBoolean(boolean data) implements AllofWithOneEmptySchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AllofWithOneEmptySchema1BoxedNumber extends AllofWithOneEmptySchema1Boxed { - public final Number data; - private AllofWithOneEmptySchema1BoxedNumber(Number data) { - this.data = data; - } + public record AllofWithOneEmptySchema1BoxedNumber(Number data) implements AllofWithOneEmptySchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AllofWithOneEmptySchema1BoxedString extends AllofWithOneEmptySchema1Boxed { - public final String data; - private AllofWithOneEmptySchema1BoxedString(String data) { - this.data = data; - } + public record AllofWithOneEmptySchema1BoxedString(String data) implements AllofWithOneEmptySchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AllofWithOneEmptySchema1BoxedList extends AllofWithOneEmptySchema1Boxed { - public final FrozenList<@Nullable Object> data; - private AllofWithOneEmptySchema1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record AllofWithOneEmptySchema1BoxedList(FrozenList<@Nullable Object> data) implements AllofWithOneEmptySchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AllofWithOneEmptySchema1BoxedMap extends AllofWithOneEmptySchema1Boxed { - public final FrozenMap<@Nullable Object> data; - private AllofWithOneEmptySchema1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record AllofWithOneEmptySchema1BoxedMap(FrozenMap<@Nullable Object> data) implements AllofWithOneEmptySchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class AllofWithOneEmptySchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, AllofWithOneEmptySchema1BoxedList>, MapSchemaValidator, AllofWithOneEmptySchema1BoxedMap> { + public static class AllofWithOneEmptySchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, AllofWithOneEmptySchema1BoxedList>, MapSchemaValidator, AllofWithOneEmptySchema1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -225,11 +201,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -260,11 +236,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -343,5 +319,24 @@ public AllofWithOneEmptySchema1BoxedList validateAndBox(List arg, SchemaConfi public AllofWithOneEmptySchema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new AllofWithOneEmptySchema1BoxedMap(validate(arg, configuration)); } + @Override + public AllofWithOneEmptySchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheFirstEmptySchema.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheFirstEmptySchema.java index 0a0ea1cf8f4..77063ed5e5c 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheFirstEmptySchema.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheFirstEmptySchema.java @@ -59,78 +59,54 @@ public static Schema1 getInstance() { } - public static abstract sealed class AllofWithTheFirstEmptySchema1Boxed permits AllofWithTheFirstEmptySchema1BoxedVoid, AllofWithTheFirstEmptySchema1BoxedBoolean, AllofWithTheFirstEmptySchema1BoxedNumber, AllofWithTheFirstEmptySchema1BoxedString, AllofWithTheFirstEmptySchema1BoxedList, AllofWithTheFirstEmptySchema1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface AllofWithTheFirstEmptySchema1Boxed permits AllofWithTheFirstEmptySchema1BoxedVoid, AllofWithTheFirstEmptySchema1BoxedBoolean, AllofWithTheFirstEmptySchema1BoxedNumber, AllofWithTheFirstEmptySchema1BoxedString, AllofWithTheFirstEmptySchema1BoxedList, AllofWithTheFirstEmptySchema1BoxedMap { + @Nullable Object getData(); } - public static final class AllofWithTheFirstEmptySchema1BoxedVoid extends AllofWithTheFirstEmptySchema1Boxed { - public final Void data; - private AllofWithTheFirstEmptySchema1BoxedVoid(Void data) { - this.data = data; - } + public record AllofWithTheFirstEmptySchema1BoxedVoid(Void data) implements AllofWithTheFirstEmptySchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AllofWithTheFirstEmptySchema1BoxedBoolean extends AllofWithTheFirstEmptySchema1Boxed { - public final boolean data; - private AllofWithTheFirstEmptySchema1BoxedBoolean(boolean data) { - this.data = data; - } + public record AllofWithTheFirstEmptySchema1BoxedBoolean(boolean data) implements AllofWithTheFirstEmptySchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AllofWithTheFirstEmptySchema1BoxedNumber extends AllofWithTheFirstEmptySchema1Boxed { - public final Number data; - private AllofWithTheFirstEmptySchema1BoxedNumber(Number data) { - this.data = data; - } + public record AllofWithTheFirstEmptySchema1BoxedNumber(Number data) implements AllofWithTheFirstEmptySchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AllofWithTheFirstEmptySchema1BoxedString extends AllofWithTheFirstEmptySchema1Boxed { - public final String data; - private AllofWithTheFirstEmptySchema1BoxedString(String data) { - this.data = data; - } + public record AllofWithTheFirstEmptySchema1BoxedString(String data) implements AllofWithTheFirstEmptySchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AllofWithTheFirstEmptySchema1BoxedList extends AllofWithTheFirstEmptySchema1Boxed { - public final FrozenList<@Nullable Object> data; - private AllofWithTheFirstEmptySchema1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record AllofWithTheFirstEmptySchema1BoxedList(FrozenList<@Nullable Object> data) implements AllofWithTheFirstEmptySchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AllofWithTheFirstEmptySchema1BoxedMap extends AllofWithTheFirstEmptySchema1Boxed { - public final FrozenMap<@Nullable Object> data; - private AllofWithTheFirstEmptySchema1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record AllofWithTheFirstEmptySchema1BoxedMap(FrozenMap<@Nullable Object> data) implements AllofWithTheFirstEmptySchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class AllofWithTheFirstEmptySchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, AllofWithTheFirstEmptySchema1BoxedList>, MapSchemaValidator, AllofWithTheFirstEmptySchema1BoxedMap> { + public static class AllofWithTheFirstEmptySchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, AllofWithTheFirstEmptySchema1BoxedList>, MapSchemaValidator, AllofWithTheFirstEmptySchema1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -238,11 +214,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -273,11 +249,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -356,5 +332,24 @@ public AllofWithTheFirstEmptySchema1BoxedList validateAndBox(List arg, Schema public AllofWithTheFirstEmptySchema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new AllofWithTheFirstEmptySchema1BoxedMap(validate(arg, configuration)); } + @Override + public AllofWithTheFirstEmptySchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheLastEmptySchema.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheLastEmptySchema.java index 9f4988b7e52..0ea5f48a712 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheLastEmptySchema.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTheLastEmptySchema.java @@ -59,78 +59,54 @@ public static Schema1 getInstance() { } - public static abstract sealed class AllofWithTheLastEmptySchema1Boxed permits AllofWithTheLastEmptySchema1BoxedVoid, AllofWithTheLastEmptySchema1BoxedBoolean, AllofWithTheLastEmptySchema1BoxedNumber, AllofWithTheLastEmptySchema1BoxedString, AllofWithTheLastEmptySchema1BoxedList, AllofWithTheLastEmptySchema1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface AllofWithTheLastEmptySchema1Boxed permits AllofWithTheLastEmptySchema1BoxedVoid, AllofWithTheLastEmptySchema1BoxedBoolean, AllofWithTheLastEmptySchema1BoxedNumber, AllofWithTheLastEmptySchema1BoxedString, AllofWithTheLastEmptySchema1BoxedList, AllofWithTheLastEmptySchema1BoxedMap { + @Nullable Object getData(); } - public static final class AllofWithTheLastEmptySchema1BoxedVoid extends AllofWithTheLastEmptySchema1Boxed { - public final Void data; - private AllofWithTheLastEmptySchema1BoxedVoid(Void data) { - this.data = data; - } + public record AllofWithTheLastEmptySchema1BoxedVoid(Void data) implements AllofWithTheLastEmptySchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AllofWithTheLastEmptySchema1BoxedBoolean extends AllofWithTheLastEmptySchema1Boxed { - public final boolean data; - private AllofWithTheLastEmptySchema1BoxedBoolean(boolean data) { - this.data = data; - } + public record AllofWithTheLastEmptySchema1BoxedBoolean(boolean data) implements AllofWithTheLastEmptySchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AllofWithTheLastEmptySchema1BoxedNumber extends AllofWithTheLastEmptySchema1Boxed { - public final Number data; - private AllofWithTheLastEmptySchema1BoxedNumber(Number data) { - this.data = data; - } + public record AllofWithTheLastEmptySchema1BoxedNumber(Number data) implements AllofWithTheLastEmptySchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AllofWithTheLastEmptySchema1BoxedString extends AllofWithTheLastEmptySchema1Boxed { - public final String data; - private AllofWithTheLastEmptySchema1BoxedString(String data) { - this.data = data; - } + public record AllofWithTheLastEmptySchema1BoxedString(String data) implements AllofWithTheLastEmptySchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AllofWithTheLastEmptySchema1BoxedList extends AllofWithTheLastEmptySchema1Boxed { - public final FrozenList<@Nullable Object> data; - private AllofWithTheLastEmptySchema1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record AllofWithTheLastEmptySchema1BoxedList(FrozenList<@Nullable Object> data) implements AllofWithTheLastEmptySchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AllofWithTheLastEmptySchema1BoxedMap extends AllofWithTheLastEmptySchema1Boxed { - public final FrozenMap<@Nullable Object> data; - private AllofWithTheLastEmptySchema1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record AllofWithTheLastEmptySchema1BoxedMap(FrozenMap<@Nullable Object> data) implements AllofWithTheLastEmptySchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class AllofWithTheLastEmptySchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, AllofWithTheLastEmptySchema1BoxedList>, MapSchemaValidator, AllofWithTheLastEmptySchema1BoxedMap> { + public static class AllofWithTheLastEmptySchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, AllofWithTheLastEmptySchema1BoxedList>, MapSchemaValidator, AllofWithTheLastEmptySchema1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -238,11 +214,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -273,11 +249,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -356,5 +332,24 @@ public AllofWithTheLastEmptySchema1BoxedList validateAndBox(List arg, SchemaC public AllofWithTheLastEmptySchema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new AllofWithTheLastEmptySchema1BoxedMap(validate(arg, configuration)); } + @Override + public AllofWithTheLastEmptySchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTwoEmptySchemas.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTwoEmptySchemas.java index 5ba07d47c64..6430ce42fd0 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTwoEmptySchemas.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AllofWithTwoEmptySchemas.java @@ -58,78 +58,54 @@ public static Schema1 getInstance() { } - public static abstract sealed class AllofWithTwoEmptySchemas1Boxed permits AllofWithTwoEmptySchemas1BoxedVoid, AllofWithTwoEmptySchemas1BoxedBoolean, AllofWithTwoEmptySchemas1BoxedNumber, AllofWithTwoEmptySchemas1BoxedString, AllofWithTwoEmptySchemas1BoxedList, AllofWithTwoEmptySchemas1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface AllofWithTwoEmptySchemas1Boxed permits AllofWithTwoEmptySchemas1BoxedVoid, AllofWithTwoEmptySchemas1BoxedBoolean, AllofWithTwoEmptySchemas1BoxedNumber, AllofWithTwoEmptySchemas1BoxedString, AllofWithTwoEmptySchemas1BoxedList, AllofWithTwoEmptySchemas1BoxedMap { + @Nullable Object getData(); } - public static final class AllofWithTwoEmptySchemas1BoxedVoid extends AllofWithTwoEmptySchemas1Boxed { - public final Void data; - private AllofWithTwoEmptySchemas1BoxedVoid(Void data) { - this.data = data; - } + public record AllofWithTwoEmptySchemas1BoxedVoid(Void data) implements AllofWithTwoEmptySchemas1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AllofWithTwoEmptySchemas1BoxedBoolean extends AllofWithTwoEmptySchemas1Boxed { - public final boolean data; - private AllofWithTwoEmptySchemas1BoxedBoolean(boolean data) { - this.data = data; - } + public record AllofWithTwoEmptySchemas1BoxedBoolean(boolean data) implements AllofWithTwoEmptySchemas1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AllofWithTwoEmptySchemas1BoxedNumber extends AllofWithTwoEmptySchemas1Boxed { - public final Number data; - private AllofWithTwoEmptySchemas1BoxedNumber(Number data) { - this.data = data; - } + public record AllofWithTwoEmptySchemas1BoxedNumber(Number data) implements AllofWithTwoEmptySchemas1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AllofWithTwoEmptySchemas1BoxedString extends AllofWithTwoEmptySchemas1Boxed { - public final String data; - private AllofWithTwoEmptySchemas1BoxedString(String data) { - this.data = data; - } + public record AllofWithTwoEmptySchemas1BoxedString(String data) implements AllofWithTwoEmptySchemas1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AllofWithTwoEmptySchemas1BoxedList extends AllofWithTwoEmptySchemas1Boxed { - public final FrozenList<@Nullable Object> data; - private AllofWithTwoEmptySchemas1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record AllofWithTwoEmptySchemas1BoxedList(FrozenList<@Nullable Object> data) implements AllofWithTwoEmptySchemas1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AllofWithTwoEmptySchemas1BoxedMap extends AllofWithTwoEmptySchemas1Boxed { - public final FrozenMap<@Nullable Object> data; - private AllofWithTwoEmptySchemas1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record AllofWithTwoEmptySchemas1BoxedMap(FrozenMap<@Nullable Object> data) implements AllofWithTwoEmptySchemas1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class AllofWithTwoEmptySchemas1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, AllofWithTwoEmptySchemas1BoxedList>, MapSchemaValidator, AllofWithTwoEmptySchemas1BoxedMap> { + public static class AllofWithTwoEmptySchemas1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, AllofWithTwoEmptySchemas1BoxedList>, MapSchemaValidator, AllofWithTwoEmptySchemas1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -237,11 +213,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -272,11 +248,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -355,5 +331,24 @@ public AllofWithTwoEmptySchemas1BoxedList validateAndBox(List arg, SchemaConf public AllofWithTwoEmptySchemas1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new AllofWithTwoEmptySchemas1BoxedMap(validate(arg, configuration)); } + @Override + public AllofWithTwoEmptySchemas1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Anyof.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Anyof.java index 12c165c5bf4..901e8939216 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Anyof.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Anyof.java @@ -47,78 +47,54 @@ public static Schema0 getInstance() { } - public static abstract sealed class Schema1Boxed permits Schema1BoxedVoid, Schema1BoxedBoolean, Schema1BoxedNumber, Schema1BoxedString, Schema1BoxedList, Schema1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Schema1Boxed permits Schema1BoxedVoid, Schema1BoxedBoolean, Schema1BoxedNumber, Schema1BoxedString, Schema1BoxedList, Schema1BoxedMap { + @Nullable Object getData(); } - public static final class Schema1BoxedVoid extends Schema1Boxed { - public final Void data; - private Schema1BoxedVoid(Void data) { - this.data = data; - } + public record Schema1BoxedVoid(Void data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedBoolean extends Schema1Boxed { - public final boolean data; - private Schema1BoxedBoolean(boolean data) { - this.data = data; - } + public record Schema1BoxedBoolean(boolean data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedNumber extends Schema1Boxed { - public final Number data; - private Schema1BoxedNumber(Number data) { - this.data = data; - } + public record Schema1BoxedNumber(Number data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedString extends Schema1Boxed { - public final String data; - private Schema1BoxedString(String data) { - this.data = data; - } + public record Schema1BoxedString(String data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedList extends Schema1Boxed { - public final FrozenList<@Nullable Object> data; - private Schema1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Schema1BoxedList(FrozenList<@Nullable Object> data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedMap extends Schema1Boxed { - public final FrozenMap<@Nullable Object> data; - private Schema1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record Schema1BoxedMap(FrozenMap<@Nullable Object> data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema1BoxedList>, MapSchemaValidator, Schema1BoxedMap> { + public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema1BoxedList>, MapSchemaValidator, Schema1BoxedMap> { private static @Nullable Schema1 instance = null; protected Schema1() { @@ -217,11 +193,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -252,11 +228,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -335,80 +311,75 @@ public Schema1BoxedList validateAndBox(List arg, SchemaConfiguration configur public Schema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema1BoxedMap(validate(arg, configuration)); } + @Override + public Schema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class Anyof1Boxed permits Anyof1BoxedVoid, Anyof1BoxedBoolean, Anyof1BoxedNumber, Anyof1BoxedString, Anyof1BoxedList, Anyof1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Anyof1Boxed permits Anyof1BoxedVoid, Anyof1BoxedBoolean, Anyof1BoxedNumber, Anyof1BoxedString, Anyof1BoxedList, Anyof1BoxedMap { + @Nullable Object getData(); } - public static final class Anyof1BoxedVoid extends Anyof1Boxed { - public final Void data; - private Anyof1BoxedVoid(Void data) { - this.data = data; - } + public record Anyof1BoxedVoid(Void data) implements Anyof1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Anyof1BoxedBoolean extends Anyof1Boxed { - public final boolean data; - private Anyof1BoxedBoolean(boolean data) { - this.data = data; - } + public record Anyof1BoxedBoolean(boolean data) implements Anyof1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Anyof1BoxedNumber extends Anyof1Boxed { - public final Number data; - private Anyof1BoxedNumber(Number data) { - this.data = data; - } + public record Anyof1BoxedNumber(Number data) implements Anyof1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Anyof1BoxedString extends Anyof1Boxed { - public final String data; - private Anyof1BoxedString(String data) { - this.data = data; - } + public record Anyof1BoxedString(String data) implements Anyof1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Anyof1BoxedList extends Anyof1Boxed { - public final FrozenList<@Nullable Object> data; - private Anyof1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Anyof1BoxedList(FrozenList<@Nullable Object> data) implements Anyof1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Anyof1BoxedMap extends Anyof1Boxed { - public final FrozenMap<@Nullable Object> data; - private Anyof1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record Anyof1BoxedMap(FrozenMap<@Nullable Object> data) implements Anyof1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Anyof1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Anyof1BoxedList>, MapSchemaValidator, Anyof1BoxedMap> { + public static class Anyof1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Anyof1BoxedList>, MapSchemaValidator, Anyof1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -516,11 +487,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -551,11 +522,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -634,5 +605,24 @@ public Anyof1BoxedList validateAndBox(List arg, SchemaConfiguration configura public Anyof1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Anyof1BoxedMap(validate(arg, configuration)); } + @Override + public Anyof1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java index 652c79e8ee9..1057b9bce71 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofComplexTypes.java @@ -142,78 +142,54 @@ public Schema0Map0Builder getBuilderAfterBar(Map insta } - public static abstract sealed class Schema0Boxed permits Schema0BoxedVoid, Schema0BoxedBoolean, Schema0BoxedNumber, Schema0BoxedString, Schema0BoxedList, Schema0BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Schema0Boxed permits Schema0BoxedVoid, Schema0BoxedBoolean, Schema0BoxedNumber, Schema0BoxedString, Schema0BoxedList, Schema0BoxedMap { + @Nullable Object getData(); } - public static final class Schema0BoxedVoid extends Schema0Boxed { - public final Void data; - private Schema0BoxedVoid(Void data) { - this.data = data; - } + public record Schema0BoxedVoid(Void data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedBoolean extends Schema0Boxed { - public final boolean data; - private Schema0BoxedBoolean(boolean data) { - this.data = data; - } + public record Schema0BoxedBoolean(boolean data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedNumber extends Schema0Boxed { - public final Number data; - private Schema0BoxedNumber(Number data) { - this.data = data; - } + public record Schema0BoxedNumber(Number data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedString extends Schema0Boxed { - public final String data; - private Schema0BoxedString(String data) { - this.data = data; - } + public record Schema0BoxedString(String data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedList extends Schema0Boxed { - public final FrozenList<@Nullable Object> data; - private Schema0BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Schema0BoxedList(FrozenList<@Nullable Object> data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedMap extends Schema0Boxed { - public final Schema0Map data; - private Schema0BoxedMap(Schema0Map data) { - this.data = data; - } + public record Schema0BoxedMap(Schema0Map data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema0BoxedList>, MapSchemaValidator { + public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema0BoxedList>, MapSchemaValidator { private static @Nullable Schema0 instance = null; protected Schema0() { @@ -317,11 +293,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -352,11 +328,11 @@ public Schema0Map getNewInstance(Map arg, List pathToItem, PathToS List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -435,6 +411,25 @@ public Schema0BoxedList validateAndBox(List arg, SchemaConfiguration configur public Schema0BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema0BoxedMap(validate(arg, configuration)); } + @Override + public Schema0Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class Foo extends StringJsonSchema.StringJsonSchema1 { @@ -522,78 +517,54 @@ public Schema1Map0Builder getBuilderAfterFoo(Map insta } - public static abstract sealed class Schema1Boxed permits Schema1BoxedVoid, Schema1BoxedBoolean, Schema1BoxedNumber, Schema1BoxedString, Schema1BoxedList, Schema1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Schema1Boxed permits Schema1BoxedVoid, Schema1BoxedBoolean, Schema1BoxedNumber, Schema1BoxedString, Schema1BoxedList, Schema1BoxedMap { + @Nullable Object getData(); } - public static final class Schema1BoxedVoid extends Schema1Boxed { - public final Void data; - private Schema1BoxedVoid(Void data) { - this.data = data; - } + public record Schema1BoxedVoid(Void data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedBoolean extends Schema1Boxed { - public final boolean data; - private Schema1BoxedBoolean(boolean data) { - this.data = data; - } + public record Schema1BoxedBoolean(boolean data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedNumber extends Schema1Boxed { - public final Number data; - private Schema1BoxedNumber(Number data) { - this.data = data; - } + public record Schema1BoxedNumber(Number data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedString extends Schema1Boxed { - public final String data; - private Schema1BoxedString(String data) { - this.data = data; - } + public record Schema1BoxedString(String data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedList extends Schema1Boxed { - public final FrozenList<@Nullable Object> data; - private Schema1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Schema1BoxedList(FrozenList<@Nullable Object> data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedMap extends Schema1Boxed { - public final Schema1Map data; - private Schema1BoxedMap(Schema1Map data) { - this.data = data; - } + public record Schema1BoxedMap(Schema1Map data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema1BoxedList>, MapSchemaValidator { + public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema1BoxedList>, MapSchemaValidator { private static @Nullable Schema1 instance = null; protected Schema1() { @@ -697,11 +668,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -732,11 +703,11 @@ public Schema1Map getNewInstance(Map arg, List pathToItem, PathToS List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -815,80 +786,75 @@ public Schema1BoxedList validateAndBox(List arg, SchemaConfiguration configur public Schema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema1BoxedMap(validate(arg, configuration)); } + @Override + public Schema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class AnyofComplexTypes1Boxed permits AnyofComplexTypes1BoxedVoid, AnyofComplexTypes1BoxedBoolean, AnyofComplexTypes1BoxedNumber, AnyofComplexTypes1BoxedString, AnyofComplexTypes1BoxedList, AnyofComplexTypes1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface AnyofComplexTypes1Boxed permits AnyofComplexTypes1BoxedVoid, AnyofComplexTypes1BoxedBoolean, AnyofComplexTypes1BoxedNumber, AnyofComplexTypes1BoxedString, AnyofComplexTypes1BoxedList, AnyofComplexTypes1BoxedMap { + @Nullable Object getData(); } - public static final class AnyofComplexTypes1BoxedVoid extends AnyofComplexTypes1Boxed { - public final Void data; - private AnyofComplexTypes1BoxedVoid(Void data) { - this.data = data; - } + public record AnyofComplexTypes1BoxedVoid(Void data) implements AnyofComplexTypes1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AnyofComplexTypes1BoxedBoolean extends AnyofComplexTypes1Boxed { - public final boolean data; - private AnyofComplexTypes1BoxedBoolean(boolean data) { - this.data = data; - } + public record AnyofComplexTypes1BoxedBoolean(boolean data) implements AnyofComplexTypes1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AnyofComplexTypes1BoxedNumber extends AnyofComplexTypes1Boxed { - public final Number data; - private AnyofComplexTypes1BoxedNumber(Number data) { - this.data = data; - } + public record AnyofComplexTypes1BoxedNumber(Number data) implements AnyofComplexTypes1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AnyofComplexTypes1BoxedString extends AnyofComplexTypes1Boxed { - public final String data; - private AnyofComplexTypes1BoxedString(String data) { - this.data = data; - } + public record AnyofComplexTypes1BoxedString(String data) implements AnyofComplexTypes1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AnyofComplexTypes1BoxedList extends AnyofComplexTypes1Boxed { - public final FrozenList<@Nullable Object> data; - private AnyofComplexTypes1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record AnyofComplexTypes1BoxedList(FrozenList<@Nullable Object> data) implements AnyofComplexTypes1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AnyofComplexTypes1BoxedMap extends AnyofComplexTypes1Boxed { - public final FrozenMap<@Nullable Object> data; - private AnyofComplexTypes1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record AnyofComplexTypes1BoxedMap(FrozenMap<@Nullable Object> data) implements AnyofComplexTypes1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class AnyofComplexTypes1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, AnyofComplexTypes1BoxedList>, MapSchemaValidator, AnyofComplexTypes1BoxedMap> { + public static class AnyofComplexTypes1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, AnyofComplexTypes1BoxedList>, MapSchemaValidator, AnyofComplexTypes1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -996,11 +962,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -1031,11 +997,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -1114,5 +1080,24 @@ public AnyofComplexTypes1BoxedList validateAndBox(List arg, SchemaConfigurati public AnyofComplexTypes1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new AnyofComplexTypes1BoxedMap(validate(arg, configuration)); } + @Override + public AnyofComplexTypes1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithBaseSchema.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithBaseSchema.java index 485bb707f91..c3885e3556d 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithBaseSchema.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithBaseSchema.java @@ -35,78 +35,54 @@ public class AnyofWithBaseSchema { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class Schema0Boxed permits Schema0BoxedVoid, Schema0BoxedBoolean, Schema0BoxedNumber, Schema0BoxedString, Schema0BoxedList, Schema0BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Schema0Boxed permits Schema0BoxedVoid, Schema0BoxedBoolean, Schema0BoxedNumber, Schema0BoxedString, Schema0BoxedList, Schema0BoxedMap { + @Nullable Object getData(); } - public static final class Schema0BoxedVoid extends Schema0Boxed { - public final Void data; - private Schema0BoxedVoid(Void data) { - this.data = data; - } + public record Schema0BoxedVoid(Void data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedBoolean extends Schema0Boxed { - public final boolean data; - private Schema0BoxedBoolean(boolean data) { - this.data = data; - } + public record Schema0BoxedBoolean(boolean data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedNumber extends Schema0Boxed { - public final Number data; - private Schema0BoxedNumber(Number data) { - this.data = data; - } + public record Schema0BoxedNumber(Number data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedString extends Schema0Boxed { - public final String data; - private Schema0BoxedString(String data) { - this.data = data; - } + public record Schema0BoxedString(String data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedList extends Schema0Boxed { - public final FrozenList<@Nullable Object> data; - private Schema0BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Schema0BoxedList(FrozenList<@Nullable Object> data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedMap extends Schema0Boxed { - public final FrozenMap<@Nullable Object> data; - private Schema0BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record Schema0BoxedMap(FrozenMap<@Nullable Object> data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema0BoxedList>, MapSchemaValidator, Schema0BoxedMap> { + public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema0BoxedList>, MapSchemaValidator, Schema0BoxedMap> { private static @Nullable Schema0 instance = null; protected Schema0() { @@ -205,11 +181,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -240,11 +216,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -323,80 +299,75 @@ public Schema0BoxedList validateAndBox(List arg, SchemaConfiguration configur public Schema0BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema0BoxedMap(validate(arg, configuration)); } + @Override + public Schema0Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class Schema1Boxed permits Schema1BoxedVoid, Schema1BoxedBoolean, Schema1BoxedNumber, Schema1BoxedString, Schema1BoxedList, Schema1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Schema1Boxed permits Schema1BoxedVoid, Schema1BoxedBoolean, Schema1BoxedNumber, Schema1BoxedString, Schema1BoxedList, Schema1BoxedMap { + @Nullable Object getData(); } - public static final class Schema1BoxedVoid extends Schema1Boxed { - public final Void data; - private Schema1BoxedVoid(Void data) { - this.data = data; - } + public record Schema1BoxedVoid(Void data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedBoolean extends Schema1Boxed { - public final boolean data; - private Schema1BoxedBoolean(boolean data) { - this.data = data; - } + public record Schema1BoxedBoolean(boolean data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedNumber extends Schema1Boxed { - public final Number data; - private Schema1BoxedNumber(Number data) { - this.data = data; - } + public record Schema1BoxedNumber(Number data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedString extends Schema1Boxed { - public final String data; - private Schema1BoxedString(String data) { - this.data = data; - } + public record Schema1BoxedString(String data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedList extends Schema1Boxed { - public final FrozenList<@Nullable Object> data; - private Schema1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Schema1BoxedList(FrozenList<@Nullable Object> data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedMap extends Schema1Boxed { - public final FrozenMap<@Nullable Object> data; - private Schema1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record Schema1BoxedMap(FrozenMap<@Nullable Object> data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema1BoxedList>, MapSchemaValidator, Schema1BoxedMap> { + public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema1BoxedList>, MapSchemaValidator, Schema1BoxedMap> { private static @Nullable Schema1 instance = null; protected Schema1() { @@ -495,11 +466,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -530,11 +501,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -613,26 +584,41 @@ public Schema1BoxedList validateAndBox(List arg, SchemaConfiguration configur public Schema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema1BoxedMap(validate(arg, configuration)); } + @Override + public Schema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class AnyofWithBaseSchema1Boxed permits AnyofWithBaseSchema1BoxedString { - public abstract @Nullable Object data(); + public sealed interface AnyofWithBaseSchema1Boxed permits AnyofWithBaseSchema1BoxedString { + @Nullable Object getData(); } - public static final class AnyofWithBaseSchema1BoxedString extends AnyofWithBaseSchema1Boxed { - public final String data; - private AnyofWithBaseSchema1BoxedString(String data) { - this.data = data; - } + public record AnyofWithBaseSchema1BoxedString(String data) implements AnyofWithBaseSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class AnyofWithBaseSchema1 extends JsonSchema implements StringSchemaValidator { + public static class AnyofWithBaseSchema1 extends JsonSchema implements StringSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -689,5 +675,12 @@ public String validate(String arg, SchemaConfiguration configuration) throws Val public AnyofWithBaseSchema1BoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new AnyofWithBaseSchema1BoxedString(validate(arg, configuration)); } + @Override + public AnyofWithBaseSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithOneEmptySchema.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithOneEmptySchema.java index fff47f1c4a3..8566d7392b2 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithOneEmptySchema.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyofWithOneEmptySchema.java @@ -59,78 +59,54 @@ public static Schema1 getInstance() { } - public static abstract sealed class AnyofWithOneEmptySchema1Boxed permits AnyofWithOneEmptySchema1BoxedVoid, AnyofWithOneEmptySchema1BoxedBoolean, AnyofWithOneEmptySchema1BoxedNumber, AnyofWithOneEmptySchema1BoxedString, AnyofWithOneEmptySchema1BoxedList, AnyofWithOneEmptySchema1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface AnyofWithOneEmptySchema1Boxed permits AnyofWithOneEmptySchema1BoxedVoid, AnyofWithOneEmptySchema1BoxedBoolean, AnyofWithOneEmptySchema1BoxedNumber, AnyofWithOneEmptySchema1BoxedString, AnyofWithOneEmptySchema1BoxedList, AnyofWithOneEmptySchema1BoxedMap { + @Nullable Object getData(); } - public static final class AnyofWithOneEmptySchema1BoxedVoid extends AnyofWithOneEmptySchema1Boxed { - public final Void data; - private AnyofWithOneEmptySchema1BoxedVoid(Void data) { - this.data = data; - } + public record AnyofWithOneEmptySchema1BoxedVoid(Void data) implements AnyofWithOneEmptySchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AnyofWithOneEmptySchema1BoxedBoolean extends AnyofWithOneEmptySchema1Boxed { - public final boolean data; - private AnyofWithOneEmptySchema1BoxedBoolean(boolean data) { - this.data = data; - } + public record AnyofWithOneEmptySchema1BoxedBoolean(boolean data) implements AnyofWithOneEmptySchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AnyofWithOneEmptySchema1BoxedNumber extends AnyofWithOneEmptySchema1Boxed { - public final Number data; - private AnyofWithOneEmptySchema1BoxedNumber(Number data) { - this.data = data; - } + public record AnyofWithOneEmptySchema1BoxedNumber(Number data) implements AnyofWithOneEmptySchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AnyofWithOneEmptySchema1BoxedString extends AnyofWithOneEmptySchema1Boxed { - public final String data; - private AnyofWithOneEmptySchema1BoxedString(String data) { - this.data = data; - } + public record AnyofWithOneEmptySchema1BoxedString(String data) implements AnyofWithOneEmptySchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AnyofWithOneEmptySchema1BoxedList extends AnyofWithOneEmptySchema1Boxed { - public final FrozenList<@Nullable Object> data; - private AnyofWithOneEmptySchema1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record AnyofWithOneEmptySchema1BoxedList(FrozenList<@Nullable Object> data) implements AnyofWithOneEmptySchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AnyofWithOneEmptySchema1BoxedMap extends AnyofWithOneEmptySchema1Boxed { - public final FrozenMap<@Nullable Object> data; - private AnyofWithOneEmptySchema1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record AnyofWithOneEmptySchema1BoxedMap(FrozenMap<@Nullable Object> data) implements AnyofWithOneEmptySchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class AnyofWithOneEmptySchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, AnyofWithOneEmptySchema1BoxedList>, MapSchemaValidator, AnyofWithOneEmptySchema1BoxedMap> { + public static class AnyofWithOneEmptySchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, AnyofWithOneEmptySchema1BoxedList>, MapSchemaValidator, AnyofWithOneEmptySchema1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -238,11 +214,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -273,11 +249,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -356,5 +332,24 @@ public AnyofWithOneEmptySchema1BoxedList validateAndBox(List arg, SchemaConfi public AnyofWithOneEmptySchema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new AnyofWithOneEmptySchema1BoxedMap(validate(arg, configuration)); } + @Override + public AnyofWithOneEmptySchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByInt.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByInt.java index 7c73de0f7d5..ebcbb032fc3 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByInt.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByInt.java @@ -36,78 +36,54 @@ public class ByInt { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class ByInt1Boxed permits ByInt1BoxedVoid, ByInt1BoxedBoolean, ByInt1BoxedNumber, ByInt1BoxedString, ByInt1BoxedList, ByInt1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface ByInt1Boxed permits ByInt1BoxedVoid, ByInt1BoxedBoolean, ByInt1BoxedNumber, ByInt1BoxedString, ByInt1BoxedList, ByInt1BoxedMap { + @Nullable Object getData(); } - public static final class ByInt1BoxedVoid extends ByInt1Boxed { - public final Void data; - private ByInt1BoxedVoid(Void data) { - this.data = data; - } + public record ByInt1BoxedVoid(Void data) implements ByInt1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ByInt1BoxedBoolean extends ByInt1Boxed { - public final boolean data; - private ByInt1BoxedBoolean(boolean data) { - this.data = data; - } + public record ByInt1BoxedBoolean(boolean data) implements ByInt1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ByInt1BoxedNumber extends ByInt1Boxed { - public final Number data; - private ByInt1BoxedNumber(Number data) { - this.data = data; - } + public record ByInt1BoxedNumber(Number data) implements ByInt1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ByInt1BoxedString extends ByInt1Boxed { - public final String data; - private ByInt1BoxedString(String data) { - this.data = data; - } + public record ByInt1BoxedString(String data) implements ByInt1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ByInt1BoxedList extends ByInt1Boxed { - public final FrozenList<@Nullable Object> data; - private ByInt1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record ByInt1BoxedList(FrozenList<@Nullable Object> data) implements ByInt1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ByInt1BoxedMap extends ByInt1Boxed { - public final FrozenMap<@Nullable Object> data; - private ByInt1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record ByInt1BoxedMap(FrozenMap<@Nullable Object> data) implements ByInt1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ByInt1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ByInt1BoxedList>, MapSchemaValidator, ByInt1BoxedMap> { + public static class ByInt1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ByInt1BoxedList>, MapSchemaValidator, ByInt1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -212,11 +188,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -247,11 +223,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -330,5 +306,24 @@ public ByInt1BoxedList validateAndBox(List arg, SchemaConfiguration configura public ByInt1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ByInt1BoxedMap(validate(arg, configuration)); } + @Override + public ByInt1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByNumber.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByNumber.java index 2827c47bd81..828c756720c 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByNumber.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ByNumber.java @@ -36,78 +36,54 @@ public class ByNumber { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class ByNumber1Boxed permits ByNumber1BoxedVoid, ByNumber1BoxedBoolean, ByNumber1BoxedNumber, ByNumber1BoxedString, ByNumber1BoxedList, ByNumber1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface ByNumber1Boxed permits ByNumber1BoxedVoid, ByNumber1BoxedBoolean, ByNumber1BoxedNumber, ByNumber1BoxedString, ByNumber1BoxedList, ByNumber1BoxedMap { + @Nullable Object getData(); } - public static final class ByNumber1BoxedVoid extends ByNumber1Boxed { - public final Void data; - private ByNumber1BoxedVoid(Void data) { - this.data = data; - } + public record ByNumber1BoxedVoid(Void data) implements ByNumber1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ByNumber1BoxedBoolean extends ByNumber1Boxed { - public final boolean data; - private ByNumber1BoxedBoolean(boolean data) { - this.data = data; - } + public record ByNumber1BoxedBoolean(boolean data) implements ByNumber1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ByNumber1BoxedNumber extends ByNumber1Boxed { - public final Number data; - private ByNumber1BoxedNumber(Number data) { - this.data = data; - } + public record ByNumber1BoxedNumber(Number data) implements ByNumber1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ByNumber1BoxedString extends ByNumber1Boxed { - public final String data; - private ByNumber1BoxedString(String data) { - this.data = data; - } + public record ByNumber1BoxedString(String data) implements ByNumber1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ByNumber1BoxedList extends ByNumber1Boxed { - public final FrozenList<@Nullable Object> data; - private ByNumber1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record ByNumber1BoxedList(FrozenList<@Nullable Object> data) implements ByNumber1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ByNumber1BoxedMap extends ByNumber1Boxed { - public final FrozenMap<@Nullable Object> data; - private ByNumber1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record ByNumber1BoxedMap(FrozenMap<@Nullable Object> data) implements ByNumber1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ByNumber1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ByNumber1BoxedList>, MapSchemaValidator, ByNumber1BoxedMap> { + public static class ByNumber1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ByNumber1BoxedList>, MapSchemaValidator, ByNumber1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -212,11 +188,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -247,11 +223,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -330,5 +306,24 @@ public ByNumber1BoxedList validateAndBox(List arg, SchemaConfiguration config public ByNumber1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ByNumber1BoxedMap(validate(arg, configuration)); } + @Override + public ByNumber1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/BySmallNumber.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/BySmallNumber.java index 2a0c8430099..c91371daa4a 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/BySmallNumber.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/BySmallNumber.java @@ -36,78 +36,54 @@ public class BySmallNumber { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class BySmallNumber1Boxed permits BySmallNumber1BoxedVoid, BySmallNumber1BoxedBoolean, BySmallNumber1BoxedNumber, BySmallNumber1BoxedString, BySmallNumber1BoxedList, BySmallNumber1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface BySmallNumber1Boxed permits BySmallNumber1BoxedVoid, BySmallNumber1BoxedBoolean, BySmallNumber1BoxedNumber, BySmallNumber1BoxedString, BySmallNumber1BoxedList, BySmallNumber1BoxedMap { + @Nullable Object getData(); } - public static final class BySmallNumber1BoxedVoid extends BySmallNumber1Boxed { - public final Void data; - private BySmallNumber1BoxedVoid(Void data) { - this.data = data; - } + public record BySmallNumber1BoxedVoid(Void data) implements BySmallNumber1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class BySmallNumber1BoxedBoolean extends BySmallNumber1Boxed { - public final boolean data; - private BySmallNumber1BoxedBoolean(boolean data) { - this.data = data; - } + public record BySmallNumber1BoxedBoolean(boolean data) implements BySmallNumber1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class BySmallNumber1BoxedNumber extends BySmallNumber1Boxed { - public final Number data; - private BySmallNumber1BoxedNumber(Number data) { - this.data = data; - } + public record BySmallNumber1BoxedNumber(Number data) implements BySmallNumber1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class BySmallNumber1BoxedString extends BySmallNumber1Boxed { - public final String data; - private BySmallNumber1BoxedString(String data) { - this.data = data; - } + public record BySmallNumber1BoxedString(String data) implements BySmallNumber1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class BySmallNumber1BoxedList extends BySmallNumber1Boxed { - public final FrozenList<@Nullable Object> data; - private BySmallNumber1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record BySmallNumber1BoxedList(FrozenList<@Nullable Object> data) implements BySmallNumber1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class BySmallNumber1BoxedMap extends BySmallNumber1Boxed { - public final FrozenMap<@Nullable Object> data; - private BySmallNumber1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record BySmallNumber1BoxedMap(FrozenMap<@Nullable Object> data) implements BySmallNumber1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class BySmallNumber1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, BySmallNumber1BoxedList>, MapSchemaValidator, BySmallNumber1BoxedMap> { + public static class BySmallNumber1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, BySmallNumber1BoxedList>, MapSchemaValidator, BySmallNumber1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -212,11 +188,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -247,11 +223,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -330,5 +306,24 @@ public BySmallNumber1BoxedList validateAndBox(List arg, SchemaConfiguration c public BySmallNumber1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new BySmallNumber1BoxedMap(validate(arg, configuration)); } + @Override + public BySmallNumber1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ConstNulCharactersInStrings.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ConstNulCharactersInStrings.java index 21e231a89b0..a0830962bc1 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ConstNulCharactersInStrings.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ConstNulCharactersInStrings.java @@ -49,78 +49,54 @@ public String value() { } - public static abstract sealed class ConstNulCharactersInStrings1Boxed permits ConstNulCharactersInStrings1BoxedVoid, ConstNulCharactersInStrings1BoxedBoolean, ConstNulCharactersInStrings1BoxedNumber, ConstNulCharactersInStrings1BoxedString, ConstNulCharactersInStrings1BoxedList, ConstNulCharactersInStrings1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface ConstNulCharactersInStrings1Boxed permits ConstNulCharactersInStrings1BoxedVoid, ConstNulCharactersInStrings1BoxedBoolean, ConstNulCharactersInStrings1BoxedNumber, ConstNulCharactersInStrings1BoxedString, ConstNulCharactersInStrings1BoxedList, ConstNulCharactersInStrings1BoxedMap { + @Nullable Object getData(); } - public static final class ConstNulCharactersInStrings1BoxedVoid extends ConstNulCharactersInStrings1Boxed { - public final Void data; - private ConstNulCharactersInStrings1BoxedVoid(Void data) { - this.data = data; - } + public record ConstNulCharactersInStrings1BoxedVoid(Void data) implements ConstNulCharactersInStrings1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ConstNulCharactersInStrings1BoxedBoolean extends ConstNulCharactersInStrings1Boxed { - public final boolean data; - private ConstNulCharactersInStrings1BoxedBoolean(boolean data) { - this.data = data; - } + public record ConstNulCharactersInStrings1BoxedBoolean(boolean data) implements ConstNulCharactersInStrings1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ConstNulCharactersInStrings1BoxedNumber extends ConstNulCharactersInStrings1Boxed { - public final Number data; - private ConstNulCharactersInStrings1BoxedNumber(Number data) { - this.data = data; - } + public record ConstNulCharactersInStrings1BoxedNumber(Number data) implements ConstNulCharactersInStrings1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ConstNulCharactersInStrings1BoxedString extends ConstNulCharactersInStrings1Boxed { - public final String data; - private ConstNulCharactersInStrings1BoxedString(String data) { - this.data = data; - } + public record ConstNulCharactersInStrings1BoxedString(String data) implements ConstNulCharactersInStrings1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ConstNulCharactersInStrings1BoxedList extends ConstNulCharactersInStrings1Boxed { - public final FrozenList<@Nullable Object> data; - private ConstNulCharactersInStrings1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record ConstNulCharactersInStrings1BoxedList(FrozenList<@Nullable Object> data) implements ConstNulCharactersInStrings1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ConstNulCharactersInStrings1BoxedMap extends ConstNulCharactersInStrings1Boxed { - public final FrozenMap<@Nullable Object> data; - private ConstNulCharactersInStrings1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record ConstNulCharactersInStrings1BoxedMap(FrozenMap<@Nullable Object> data) implements ConstNulCharactersInStrings1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ConstNulCharactersInStrings1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ConstNulCharactersInStrings1BoxedList>, MapSchemaValidator, ConstNulCharactersInStrings1BoxedMap> { + public static class ConstNulCharactersInStrings1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ConstNulCharactersInStrings1BoxedList>, MapSchemaValidator, ConstNulCharactersInStrings1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -225,11 +201,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -260,11 +236,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -343,5 +319,24 @@ public ConstNulCharactersInStrings1BoxedList validateAndBox(List arg, SchemaC public ConstNulCharactersInStrings1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ConstNulCharactersInStrings1BoxedMap(validate(arg, configuration)); } + @Override + public ConstNulCharactersInStrings1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ContainsKeywordValidation.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ContainsKeywordValidation.java index 5ff964d32c4..b01a97a19a3 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ContainsKeywordValidation.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ContainsKeywordValidation.java @@ -35,78 +35,54 @@ public class ContainsKeywordValidation { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class ContainsBoxed permits ContainsBoxedVoid, ContainsBoxedBoolean, ContainsBoxedNumber, ContainsBoxedString, ContainsBoxedList, ContainsBoxedMap { - public abstract @Nullable Object data(); + public sealed interface ContainsBoxed permits ContainsBoxedVoid, ContainsBoxedBoolean, ContainsBoxedNumber, ContainsBoxedString, ContainsBoxedList, ContainsBoxedMap { + @Nullable Object getData(); } - public static final class ContainsBoxedVoid extends ContainsBoxed { - public final Void data; - private ContainsBoxedVoid(Void data) { - this.data = data; - } + public record ContainsBoxedVoid(Void data) implements ContainsBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ContainsBoxedBoolean extends ContainsBoxed { - public final boolean data; - private ContainsBoxedBoolean(boolean data) { - this.data = data; - } + public record ContainsBoxedBoolean(boolean data) implements ContainsBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ContainsBoxedNumber extends ContainsBoxed { - public final Number data; - private ContainsBoxedNumber(Number data) { - this.data = data; - } + public record ContainsBoxedNumber(Number data) implements ContainsBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ContainsBoxedString extends ContainsBoxed { - public final String data; - private ContainsBoxedString(String data) { - this.data = data; - } + public record ContainsBoxedString(String data) implements ContainsBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ContainsBoxedList extends ContainsBoxed { - public final FrozenList<@Nullable Object> data; - private ContainsBoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record ContainsBoxedList(FrozenList<@Nullable Object> data) implements ContainsBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ContainsBoxedMap extends ContainsBoxed { - public final FrozenMap<@Nullable Object> data; - private ContainsBoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record ContainsBoxedMap(FrozenMap<@Nullable Object> data) implements ContainsBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Contains extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ContainsBoxedList>, MapSchemaValidator, ContainsBoxedMap> { + public static class Contains extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ContainsBoxedList>, MapSchemaValidator, ContainsBoxedMap> { private static @Nullable Contains instance = null; protected Contains() { @@ -205,11 +181,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -240,11 +216,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -323,80 +299,75 @@ public ContainsBoxedList validateAndBox(List arg, SchemaConfiguration configu public ContainsBoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ContainsBoxedMap(validate(arg, configuration)); } + @Override + public ContainsBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class ContainsKeywordValidation1Boxed permits ContainsKeywordValidation1BoxedVoid, ContainsKeywordValidation1BoxedBoolean, ContainsKeywordValidation1BoxedNumber, ContainsKeywordValidation1BoxedString, ContainsKeywordValidation1BoxedList, ContainsKeywordValidation1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface ContainsKeywordValidation1Boxed permits ContainsKeywordValidation1BoxedVoid, ContainsKeywordValidation1BoxedBoolean, ContainsKeywordValidation1BoxedNumber, ContainsKeywordValidation1BoxedString, ContainsKeywordValidation1BoxedList, ContainsKeywordValidation1BoxedMap { + @Nullable Object getData(); } - public static final class ContainsKeywordValidation1BoxedVoid extends ContainsKeywordValidation1Boxed { - public final Void data; - private ContainsKeywordValidation1BoxedVoid(Void data) { - this.data = data; - } + public record ContainsKeywordValidation1BoxedVoid(Void data) implements ContainsKeywordValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ContainsKeywordValidation1BoxedBoolean extends ContainsKeywordValidation1Boxed { - public final boolean data; - private ContainsKeywordValidation1BoxedBoolean(boolean data) { - this.data = data; - } + public record ContainsKeywordValidation1BoxedBoolean(boolean data) implements ContainsKeywordValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ContainsKeywordValidation1BoxedNumber extends ContainsKeywordValidation1Boxed { - public final Number data; - private ContainsKeywordValidation1BoxedNumber(Number data) { - this.data = data; - } + public record ContainsKeywordValidation1BoxedNumber(Number data) implements ContainsKeywordValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ContainsKeywordValidation1BoxedString extends ContainsKeywordValidation1Boxed { - public final String data; - private ContainsKeywordValidation1BoxedString(String data) { - this.data = data; - } + public record ContainsKeywordValidation1BoxedString(String data) implements ContainsKeywordValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ContainsKeywordValidation1BoxedList extends ContainsKeywordValidation1Boxed { - public final FrozenList<@Nullable Object> data; - private ContainsKeywordValidation1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record ContainsKeywordValidation1BoxedList(FrozenList<@Nullable Object> data) implements ContainsKeywordValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ContainsKeywordValidation1BoxedMap extends ContainsKeywordValidation1Boxed { - public final FrozenMap<@Nullable Object> data; - private ContainsKeywordValidation1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record ContainsKeywordValidation1BoxedMap(FrozenMap<@Nullable Object> data) implements ContainsKeywordValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ContainsKeywordValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ContainsKeywordValidation1BoxedList>, MapSchemaValidator, ContainsKeywordValidation1BoxedMap> { + public static class ContainsKeywordValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ContainsKeywordValidation1BoxedList>, MapSchemaValidator, ContainsKeywordValidation1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -501,11 +472,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -536,11 +507,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -619,5 +590,24 @@ public ContainsKeywordValidation1BoxedList validateAndBox(List arg, SchemaCon public ContainsKeywordValidation1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ContainsKeywordValidation1BoxedMap(validate(arg, configuration)); } + @Override + public ContainsKeywordValidation1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ContainsWithNullInstanceElements.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ContainsWithNullInstanceElements.java index 6d6f4de6d01..ba2b387ffe4 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ContainsWithNullInstanceElements.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ContainsWithNullInstanceElements.java @@ -47,78 +47,54 @@ public static Contains getInstance() { } - public static abstract sealed class ContainsWithNullInstanceElements1Boxed permits ContainsWithNullInstanceElements1BoxedVoid, ContainsWithNullInstanceElements1BoxedBoolean, ContainsWithNullInstanceElements1BoxedNumber, ContainsWithNullInstanceElements1BoxedString, ContainsWithNullInstanceElements1BoxedList, ContainsWithNullInstanceElements1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface ContainsWithNullInstanceElements1Boxed permits ContainsWithNullInstanceElements1BoxedVoid, ContainsWithNullInstanceElements1BoxedBoolean, ContainsWithNullInstanceElements1BoxedNumber, ContainsWithNullInstanceElements1BoxedString, ContainsWithNullInstanceElements1BoxedList, ContainsWithNullInstanceElements1BoxedMap { + @Nullable Object getData(); } - public static final class ContainsWithNullInstanceElements1BoxedVoid extends ContainsWithNullInstanceElements1Boxed { - public final Void data; - private ContainsWithNullInstanceElements1BoxedVoid(Void data) { - this.data = data; - } + public record ContainsWithNullInstanceElements1BoxedVoid(Void data) implements ContainsWithNullInstanceElements1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ContainsWithNullInstanceElements1BoxedBoolean extends ContainsWithNullInstanceElements1Boxed { - public final boolean data; - private ContainsWithNullInstanceElements1BoxedBoolean(boolean data) { - this.data = data; - } + public record ContainsWithNullInstanceElements1BoxedBoolean(boolean data) implements ContainsWithNullInstanceElements1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ContainsWithNullInstanceElements1BoxedNumber extends ContainsWithNullInstanceElements1Boxed { - public final Number data; - private ContainsWithNullInstanceElements1BoxedNumber(Number data) { - this.data = data; - } + public record ContainsWithNullInstanceElements1BoxedNumber(Number data) implements ContainsWithNullInstanceElements1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ContainsWithNullInstanceElements1BoxedString extends ContainsWithNullInstanceElements1Boxed { - public final String data; - private ContainsWithNullInstanceElements1BoxedString(String data) { - this.data = data; - } + public record ContainsWithNullInstanceElements1BoxedString(String data) implements ContainsWithNullInstanceElements1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ContainsWithNullInstanceElements1BoxedList extends ContainsWithNullInstanceElements1Boxed { - public final FrozenList<@Nullable Object> data; - private ContainsWithNullInstanceElements1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record ContainsWithNullInstanceElements1BoxedList(FrozenList<@Nullable Object> data) implements ContainsWithNullInstanceElements1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ContainsWithNullInstanceElements1BoxedMap extends ContainsWithNullInstanceElements1Boxed { - public final FrozenMap<@Nullable Object> data; - private ContainsWithNullInstanceElements1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record ContainsWithNullInstanceElements1BoxedMap(FrozenMap<@Nullable Object> data) implements ContainsWithNullInstanceElements1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ContainsWithNullInstanceElements1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ContainsWithNullInstanceElements1BoxedList>, MapSchemaValidator, ContainsWithNullInstanceElements1BoxedMap> { + public static class ContainsWithNullInstanceElements1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ContainsWithNullInstanceElements1BoxedList>, MapSchemaValidator, ContainsWithNullInstanceElements1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -223,11 +199,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -258,11 +234,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -341,5 +317,24 @@ public ContainsWithNullInstanceElements1BoxedList validateAndBox(List arg, Sc public ContainsWithNullInstanceElements1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ContainsWithNullInstanceElements1BoxedMap(validate(arg, configuration)); } + @Override + public ContainsWithNullInstanceElements1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateFormat.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateFormat.java index 53c0c2527eb..06354a2929a 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateFormat.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateFormat.java @@ -35,78 +35,54 @@ public class DateFormat { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class DateFormat1Boxed permits DateFormat1BoxedVoid, DateFormat1BoxedBoolean, DateFormat1BoxedNumber, DateFormat1BoxedString, DateFormat1BoxedList, DateFormat1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface DateFormat1Boxed permits DateFormat1BoxedVoid, DateFormat1BoxedBoolean, DateFormat1BoxedNumber, DateFormat1BoxedString, DateFormat1BoxedList, DateFormat1BoxedMap { + @Nullable Object getData(); } - public static final class DateFormat1BoxedVoid extends DateFormat1Boxed { - public final Void data; - private DateFormat1BoxedVoid(Void data) { - this.data = data; - } + public record DateFormat1BoxedVoid(Void data) implements DateFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class DateFormat1BoxedBoolean extends DateFormat1Boxed { - public final boolean data; - private DateFormat1BoxedBoolean(boolean data) { - this.data = data; - } + public record DateFormat1BoxedBoolean(boolean data) implements DateFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class DateFormat1BoxedNumber extends DateFormat1Boxed { - public final Number data; - private DateFormat1BoxedNumber(Number data) { - this.data = data; - } + public record DateFormat1BoxedNumber(Number data) implements DateFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class DateFormat1BoxedString extends DateFormat1Boxed { - public final String data; - private DateFormat1BoxedString(String data) { - this.data = data; - } + public record DateFormat1BoxedString(String data) implements DateFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class DateFormat1BoxedList extends DateFormat1Boxed { - public final FrozenList<@Nullable Object> data; - private DateFormat1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record DateFormat1BoxedList(FrozenList<@Nullable Object> data) implements DateFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class DateFormat1BoxedMap extends DateFormat1Boxed { - public final FrozenMap<@Nullable Object> data; - private DateFormat1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record DateFormat1BoxedMap(FrozenMap<@Nullable Object> data) implements DateFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class DateFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, DateFormat1BoxedList>, MapSchemaValidator, DateFormat1BoxedMap> { + public static class DateFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, DateFormat1BoxedList>, MapSchemaValidator, DateFormat1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -211,11 +187,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -246,11 +222,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -329,5 +305,24 @@ public DateFormat1BoxedList validateAndBox(List arg, SchemaConfiguration conf public DateFormat1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new DateFormat1BoxedMap(validate(arg, configuration)); } + @Override + public DateFormat1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateTimeFormat.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateTimeFormat.java index 5eeb37ac76c..fd3953683af 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateTimeFormat.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateTimeFormat.java @@ -35,78 +35,54 @@ public class DateTimeFormat { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class DateTimeFormat1Boxed permits DateTimeFormat1BoxedVoid, DateTimeFormat1BoxedBoolean, DateTimeFormat1BoxedNumber, DateTimeFormat1BoxedString, DateTimeFormat1BoxedList, DateTimeFormat1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface DateTimeFormat1Boxed permits DateTimeFormat1BoxedVoid, DateTimeFormat1BoxedBoolean, DateTimeFormat1BoxedNumber, DateTimeFormat1BoxedString, DateTimeFormat1BoxedList, DateTimeFormat1BoxedMap { + @Nullable Object getData(); } - public static final class DateTimeFormat1BoxedVoid extends DateTimeFormat1Boxed { - public final Void data; - private DateTimeFormat1BoxedVoid(Void data) { - this.data = data; - } + public record DateTimeFormat1BoxedVoid(Void data) implements DateTimeFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class DateTimeFormat1BoxedBoolean extends DateTimeFormat1Boxed { - public final boolean data; - private DateTimeFormat1BoxedBoolean(boolean data) { - this.data = data; - } + public record DateTimeFormat1BoxedBoolean(boolean data) implements DateTimeFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class DateTimeFormat1BoxedNumber extends DateTimeFormat1Boxed { - public final Number data; - private DateTimeFormat1BoxedNumber(Number data) { - this.data = data; - } + public record DateTimeFormat1BoxedNumber(Number data) implements DateTimeFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class DateTimeFormat1BoxedString extends DateTimeFormat1Boxed { - public final String data; - private DateTimeFormat1BoxedString(String data) { - this.data = data; - } + public record DateTimeFormat1BoxedString(String data) implements DateTimeFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class DateTimeFormat1BoxedList extends DateTimeFormat1Boxed { - public final FrozenList<@Nullable Object> data; - private DateTimeFormat1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record DateTimeFormat1BoxedList(FrozenList<@Nullable Object> data) implements DateTimeFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class DateTimeFormat1BoxedMap extends DateTimeFormat1Boxed { - public final FrozenMap<@Nullable Object> data; - private DateTimeFormat1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record DateTimeFormat1BoxedMap(FrozenMap<@Nullable Object> data) implements DateTimeFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class DateTimeFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, DateTimeFormat1BoxedList>, MapSchemaValidator, DateTimeFormat1BoxedMap> { + public static class DateTimeFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, DateTimeFormat1BoxedList>, MapSchemaValidator, DateTimeFormat1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -211,11 +187,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -246,11 +222,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -329,5 +305,24 @@ public DateTimeFormat1BoxedList validateAndBox(List arg, SchemaConfiguration public DateTimeFormat1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new DateTimeFormat1BoxedMap(validate(arg, configuration)); } + @Override + public DateTimeFormat1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DependentSchemasDependenciesWithEscapedCharacters.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DependentSchemasDependenciesWithEscapedCharacters.java index 9040bd8f581..ade713923cb 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DependentSchemasDependenciesWithEscapedCharacters.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DependentSchemasDependenciesWithEscapedCharacters.java @@ -37,78 +37,54 @@ public class DependentSchemasDependenciesWithEscapedCharacters { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class FootbarBoxed permits FootbarBoxedVoid, FootbarBoxedBoolean, FootbarBoxedNumber, FootbarBoxedString, FootbarBoxedList, FootbarBoxedMap { - public abstract @Nullable Object data(); + public sealed interface FootbarBoxed permits FootbarBoxedVoid, FootbarBoxedBoolean, FootbarBoxedNumber, FootbarBoxedString, FootbarBoxedList, FootbarBoxedMap { + @Nullable Object getData(); } - public static final class FootbarBoxedVoid extends FootbarBoxed { - public final Void data; - private FootbarBoxedVoid(Void data) { - this.data = data; - } + public record FootbarBoxedVoid(Void data) implements FootbarBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class FootbarBoxedBoolean extends FootbarBoxed { - public final boolean data; - private FootbarBoxedBoolean(boolean data) { - this.data = data; - } + public record FootbarBoxedBoolean(boolean data) implements FootbarBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class FootbarBoxedNumber extends FootbarBoxed { - public final Number data; - private FootbarBoxedNumber(Number data) { - this.data = data; - } + public record FootbarBoxedNumber(Number data) implements FootbarBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class FootbarBoxedString extends FootbarBoxed { - public final String data; - private FootbarBoxedString(String data) { - this.data = data; - } + public record FootbarBoxedString(String data) implements FootbarBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class FootbarBoxedList extends FootbarBoxed { - public final FrozenList<@Nullable Object> data; - private FootbarBoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record FootbarBoxedList(FrozenList<@Nullable Object> data) implements FootbarBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class FootbarBoxedMap extends FootbarBoxed { - public final FrozenMap<@Nullable Object> data; - private FootbarBoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record FootbarBoxedMap(FrozenMap<@Nullable Object> data) implements FootbarBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Footbar extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, FootbarBoxedList>, MapSchemaValidator, FootbarBoxedMap> { + public static class Footbar extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, FootbarBoxedList>, MapSchemaValidator, FootbarBoxedMap> { private static @Nullable Footbar instance = null; protected Footbar() { @@ -207,11 +183,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -242,11 +218,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -325,6 +301,25 @@ public FootbarBoxedList validateAndBox(List arg, SchemaConfiguration configur public FootbarBoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new FootbarBoxedMap(validate(arg, configuration)); } + @Override + public FootbarBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class FoobarMap extends FrozenMap<@Nullable Object> { @@ -441,78 +436,54 @@ public FoobarMap0Builder getBuilderAfterFoobar1(Map in } - public static abstract sealed class FoobarBoxed permits FoobarBoxedVoid, FoobarBoxedBoolean, FoobarBoxedNumber, FoobarBoxedString, FoobarBoxedList, FoobarBoxedMap { - public abstract @Nullable Object data(); + public sealed interface FoobarBoxed permits FoobarBoxedVoid, FoobarBoxedBoolean, FoobarBoxedNumber, FoobarBoxedString, FoobarBoxedList, FoobarBoxedMap { + @Nullable Object getData(); } - public static final class FoobarBoxedVoid extends FoobarBoxed { - public final Void data; - private FoobarBoxedVoid(Void data) { - this.data = data; - } + public record FoobarBoxedVoid(Void data) implements FoobarBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class FoobarBoxedBoolean extends FoobarBoxed { - public final boolean data; - private FoobarBoxedBoolean(boolean data) { - this.data = data; - } + public record FoobarBoxedBoolean(boolean data) implements FoobarBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class FoobarBoxedNumber extends FoobarBoxed { - public final Number data; - private FoobarBoxedNumber(Number data) { - this.data = data; - } + public record FoobarBoxedNumber(Number data) implements FoobarBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class FoobarBoxedString extends FoobarBoxed { - public final String data; - private FoobarBoxedString(String data) { - this.data = data; - } + public record FoobarBoxedString(String data) implements FoobarBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class FoobarBoxedList extends FoobarBoxed { - public final FrozenList<@Nullable Object> data; - private FoobarBoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record FoobarBoxedList(FrozenList<@Nullable Object> data) implements FoobarBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class FoobarBoxedMap extends FoobarBoxed { - public final FoobarMap data; - private FoobarBoxedMap(FoobarMap data) { - this.data = data; - } + public record FoobarBoxedMap(FoobarMap data) implements FoobarBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Foobar extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, FoobarBoxedList>, MapSchemaValidator { + public static class Foobar extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, FoobarBoxedList>, MapSchemaValidator { private static @Nullable Foobar instance = null; protected Foobar() { @@ -613,11 +584,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -648,11 +619,11 @@ public FoobarMap getNewInstance(Map arg, List pathToItem, PathToSc List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -731,80 +702,75 @@ public FoobarBoxedList validateAndBox(List arg, SchemaConfiguration configura public FoobarBoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new FoobarBoxedMap(validate(arg, configuration)); } + @Override + public FoobarBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class DependentSchemasDependenciesWithEscapedCharacters1Boxed permits DependentSchemasDependenciesWithEscapedCharacters1BoxedVoid, DependentSchemasDependenciesWithEscapedCharacters1BoxedBoolean, DependentSchemasDependenciesWithEscapedCharacters1BoxedNumber, DependentSchemasDependenciesWithEscapedCharacters1BoxedString, DependentSchemasDependenciesWithEscapedCharacters1BoxedList, DependentSchemasDependenciesWithEscapedCharacters1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface DependentSchemasDependenciesWithEscapedCharacters1Boxed permits DependentSchemasDependenciesWithEscapedCharacters1BoxedVoid, DependentSchemasDependenciesWithEscapedCharacters1BoxedBoolean, DependentSchemasDependenciesWithEscapedCharacters1BoxedNumber, DependentSchemasDependenciesWithEscapedCharacters1BoxedString, DependentSchemasDependenciesWithEscapedCharacters1BoxedList, DependentSchemasDependenciesWithEscapedCharacters1BoxedMap { + @Nullable Object getData(); } - public static final class DependentSchemasDependenciesWithEscapedCharacters1BoxedVoid extends DependentSchemasDependenciesWithEscapedCharacters1Boxed { - public final Void data; - private DependentSchemasDependenciesWithEscapedCharacters1BoxedVoid(Void data) { - this.data = data; - } + public record DependentSchemasDependenciesWithEscapedCharacters1BoxedVoid(Void data) implements DependentSchemasDependenciesWithEscapedCharacters1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class DependentSchemasDependenciesWithEscapedCharacters1BoxedBoolean extends DependentSchemasDependenciesWithEscapedCharacters1Boxed { - public final boolean data; - private DependentSchemasDependenciesWithEscapedCharacters1BoxedBoolean(boolean data) { - this.data = data; - } + public record DependentSchemasDependenciesWithEscapedCharacters1BoxedBoolean(boolean data) implements DependentSchemasDependenciesWithEscapedCharacters1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class DependentSchemasDependenciesWithEscapedCharacters1BoxedNumber extends DependentSchemasDependenciesWithEscapedCharacters1Boxed { - public final Number data; - private DependentSchemasDependenciesWithEscapedCharacters1BoxedNumber(Number data) { - this.data = data; - } + public record DependentSchemasDependenciesWithEscapedCharacters1BoxedNumber(Number data) implements DependentSchemasDependenciesWithEscapedCharacters1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class DependentSchemasDependenciesWithEscapedCharacters1BoxedString extends DependentSchemasDependenciesWithEscapedCharacters1Boxed { - public final String data; - private DependentSchemasDependenciesWithEscapedCharacters1BoxedString(String data) { - this.data = data; - } + public record DependentSchemasDependenciesWithEscapedCharacters1BoxedString(String data) implements DependentSchemasDependenciesWithEscapedCharacters1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class DependentSchemasDependenciesWithEscapedCharacters1BoxedList extends DependentSchemasDependenciesWithEscapedCharacters1Boxed { - public final FrozenList<@Nullable Object> data; - private DependentSchemasDependenciesWithEscapedCharacters1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record DependentSchemasDependenciesWithEscapedCharacters1BoxedList(FrozenList<@Nullable Object> data) implements DependentSchemasDependenciesWithEscapedCharacters1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class DependentSchemasDependenciesWithEscapedCharacters1BoxedMap extends DependentSchemasDependenciesWithEscapedCharacters1Boxed { - public final FrozenMap<@Nullable Object> data; - private DependentSchemasDependenciesWithEscapedCharacters1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record DependentSchemasDependenciesWithEscapedCharacters1BoxedMap(FrozenMap<@Nullable Object> data) implements DependentSchemasDependenciesWithEscapedCharacters1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class DependentSchemasDependenciesWithEscapedCharacters1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, DependentSchemasDependenciesWithEscapedCharacters1BoxedList>, MapSchemaValidator, DependentSchemasDependenciesWithEscapedCharacters1BoxedMap> { + public static class DependentSchemasDependenciesWithEscapedCharacters1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, DependentSchemasDependenciesWithEscapedCharacters1BoxedList>, MapSchemaValidator, DependentSchemasDependenciesWithEscapedCharacters1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -912,11 +878,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -947,11 +913,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -1030,5 +996,24 @@ public DependentSchemasDependenciesWithEscapedCharacters1BoxedList validateAndBo public DependentSchemasDependenciesWithEscapedCharacters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new DependentSchemasDependenciesWithEscapedCharacters1BoxedMap(validate(arg, configuration)); } + @Override + public DependentSchemasDependenciesWithEscapedCharacters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DependentSchemasDependentSubschemaIncompatibleWithRoot.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DependentSchemasDependentSubschemaIncompatibleWithRoot.java index b2af3070d01..83c040554bf 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DependentSchemasDependentSubschemaIncompatibleWithRoot.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DependentSchemasDependentSubschemaIncompatibleWithRoot.java @@ -162,23 +162,19 @@ public FooMapBuilder1 getBuilderAfterBar(Map instance) } - public static abstract sealed class Foo1Boxed permits Foo1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Foo1Boxed permits Foo1BoxedMap { + @Nullable Object getData(); } - public static final class Foo1BoxedMap extends Foo1Boxed { - public final FooMap data; - private Foo1BoxedMap(FooMap data) { - this.data = data; - } + public record Foo1BoxedMap(FooMap data) implements Foo1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Foo1 extends JsonSchema implements MapSchemaValidator { + public static class Foo1 extends JsonSchema implements MapSchemaValidator { private static @Nullable Foo1 instance = null; protected Foo1() { @@ -209,11 +205,11 @@ public FooMap getNewInstance(Map arg, List pathToItem, PathToSchem List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -250,6 +246,13 @@ public FooMap validate(Map arg, SchemaConfiguration configuration) throws public Foo1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Foo1BoxedMap(validate(arg, configuration)); } + @Override + public Foo1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } @@ -372,78 +375,54 @@ public DependentSchemasDependentSubschemaIncompatibleWithRootMapBuilder getBuild } - public static abstract sealed class DependentSchemasDependentSubschemaIncompatibleWithRoot1Boxed permits DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedVoid, DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedBoolean, DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedNumber, DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedString, DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedList, DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface DependentSchemasDependentSubschemaIncompatibleWithRoot1Boxed permits DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedVoid, DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedBoolean, DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedNumber, DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedString, DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedList, DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedMap { + @Nullable Object getData(); } - public static final class DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedVoid extends DependentSchemasDependentSubschemaIncompatibleWithRoot1Boxed { - public final Void data; - private DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedVoid(Void data) { - this.data = data; - } + public record DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedVoid(Void data) implements DependentSchemasDependentSubschemaIncompatibleWithRoot1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedBoolean extends DependentSchemasDependentSubschemaIncompatibleWithRoot1Boxed { - public final boolean data; - private DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedBoolean(boolean data) { - this.data = data; - } + public record DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedBoolean(boolean data) implements DependentSchemasDependentSubschemaIncompatibleWithRoot1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedNumber extends DependentSchemasDependentSubschemaIncompatibleWithRoot1Boxed { - public final Number data; - private DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedNumber(Number data) { - this.data = data; - } + public record DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedNumber(Number data) implements DependentSchemasDependentSubschemaIncompatibleWithRoot1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedString extends DependentSchemasDependentSubschemaIncompatibleWithRoot1Boxed { - public final String data; - private DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedString(String data) { - this.data = data; - } + public record DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedString(String data) implements DependentSchemasDependentSubschemaIncompatibleWithRoot1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedList extends DependentSchemasDependentSubschemaIncompatibleWithRoot1Boxed { - public final FrozenList<@Nullable Object> data; - private DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedList(FrozenList<@Nullable Object> data) implements DependentSchemasDependentSubschemaIncompatibleWithRoot1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedMap extends DependentSchemasDependentSubschemaIncompatibleWithRoot1Boxed { - public final DependentSchemasDependentSubschemaIncompatibleWithRootMap data; - private DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedMap(DependentSchemasDependentSubschemaIncompatibleWithRootMap data) { - this.data = data; - } + public record DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedMap(DependentSchemasDependentSubschemaIncompatibleWithRootMap data) implements DependentSchemasDependentSubschemaIncompatibleWithRoot1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class DependentSchemasDependentSubschemaIncompatibleWithRoot1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedList>, MapSchemaValidator { + public static class DependentSchemasDependentSubschemaIncompatibleWithRoot1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedList>, MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -553,11 +532,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -588,11 +567,11 @@ public DependentSchemasDependentSubschemaIncompatibleWithRootMap getNewInstance( List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -671,5 +650,24 @@ public DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedList validate public DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new DependentSchemasDependentSubschemaIncompatibleWithRoot1BoxedMap(validate(arg, configuration)); } + @Override + public DependentSchemasDependentSubschemaIncompatibleWithRoot1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DependentSchemasSingleDependency.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DependentSchemasSingleDependency.java index 2456e34ff54..8ba4171811e 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DependentSchemasSingleDependency.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DependentSchemasSingleDependency.java @@ -188,78 +188,54 @@ public BarMapBuilder1 getBuilderAfterAdditionalProperty(Map data; - private BarBoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record BarBoxedList(FrozenList<@Nullable Object> data) implements BarBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class BarBoxedMap extends BarBoxed { - public final BarMap data; - private BarBoxedMap(BarMap data) { - this.data = data; - } + public record BarBoxedMap(BarMap data) implements BarBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Bar extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, BarBoxedList>, MapSchemaValidator { + public static class Bar extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, BarBoxedList>, MapSchemaValidator { private static @Nullable Bar instance = null; protected Bar() { @@ -361,11 +337,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -396,11 +372,11 @@ public BarMap getNewInstance(Map arg, List pathToItem, PathToSchem List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -479,80 +455,75 @@ public BarBoxedList validateAndBox(List arg, SchemaConfiguration configuratio public BarBoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new BarBoxedMap(validate(arg, configuration)); } + @Override + public BarBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class DependentSchemasSingleDependency1Boxed permits DependentSchemasSingleDependency1BoxedVoid, DependentSchemasSingleDependency1BoxedBoolean, DependentSchemasSingleDependency1BoxedNumber, DependentSchemasSingleDependency1BoxedString, DependentSchemasSingleDependency1BoxedList, DependentSchemasSingleDependency1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface DependentSchemasSingleDependency1Boxed permits DependentSchemasSingleDependency1BoxedVoid, DependentSchemasSingleDependency1BoxedBoolean, DependentSchemasSingleDependency1BoxedNumber, DependentSchemasSingleDependency1BoxedString, DependentSchemasSingleDependency1BoxedList, DependentSchemasSingleDependency1BoxedMap { + @Nullable Object getData(); } - public static final class DependentSchemasSingleDependency1BoxedVoid extends DependentSchemasSingleDependency1Boxed { - public final Void data; - private DependentSchemasSingleDependency1BoxedVoid(Void data) { - this.data = data; - } + public record DependentSchemasSingleDependency1BoxedVoid(Void data) implements DependentSchemasSingleDependency1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class DependentSchemasSingleDependency1BoxedBoolean extends DependentSchemasSingleDependency1Boxed { - public final boolean data; - private DependentSchemasSingleDependency1BoxedBoolean(boolean data) { - this.data = data; - } + public record DependentSchemasSingleDependency1BoxedBoolean(boolean data) implements DependentSchemasSingleDependency1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class DependentSchemasSingleDependency1BoxedNumber extends DependentSchemasSingleDependency1Boxed { - public final Number data; - private DependentSchemasSingleDependency1BoxedNumber(Number data) { - this.data = data; - } + public record DependentSchemasSingleDependency1BoxedNumber(Number data) implements DependentSchemasSingleDependency1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class DependentSchemasSingleDependency1BoxedString extends DependentSchemasSingleDependency1Boxed { - public final String data; - private DependentSchemasSingleDependency1BoxedString(String data) { - this.data = data; - } + public record DependentSchemasSingleDependency1BoxedString(String data) implements DependentSchemasSingleDependency1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class DependentSchemasSingleDependency1BoxedList extends DependentSchemasSingleDependency1Boxed { - public final FrozenList<@Nullable Object> data; - private DependentSchemasSingleDependency1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record DependentSchemasSingleDependency1BoxedList(FrozenList<@Nullable Object> data) implements DependentSchemasSingleDependency1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class DependentSchemasSingleDependency1BoxedMap extends DependentSchemasSingleDependency1Boxed { - public final FrozenMap<@Nullable Object> data; - private DependentSchemasSingleDependency1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record DependentSchemasSingleDependency1BoxedMap(FrozenMap<@Nullable Object> data) implements DependentSchemasSingleDependency1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class DependentSchemasSingleDependency1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, DependentSchemasSingleDependency1BoxedList>, MapSchemaValidator, DependentSchemasSingleDependency1BoxedMap> { + public static class DependentSchemasSingleDependency1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, DependentSchemasSingleDependency1BoxedList>, MapSchemaValidator, DependentSchemasSingleDependency1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -659,11 +630,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -694,11 +665,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -777,5 +748,24 @@ public DependentSchemasSingleDependency1BoxedList validateAndBox(List arg, Sc public DependentSchemasSingleDependency1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new DependentSchemasSingleDependency1BoxedMap(validate(arg, configuration)); } + @Override + public DependentSchemasSingleDependency1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DurationFormat.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DurationFormat.java index 79247c5b0c7..6cbb99d9a8c 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DurationFormat.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/DurationFormat.java @@ -35,78 +35,54 @@ public class DurationFormat { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class DurationFormat1Boxed permits DurationFormat1BoxedVoid, DurationFormat1BoxedBoolean, DurationFormat1BoxedNumber, DurationFormat1BoxedString, DurationFormat1BoxedList, DurationFormat1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface DurationFormat1Boxed permits DurationFormat1BoxedVoid, DurationFormat1BoxedBoolean, DurationFormat1BoxedNumber, DurationFormat1BoxedString, DurationFormat1BoxedList, DurationFormat1BoxedMap { + @Nullable Object getData(); } - public static final class DurationFormat1BoxedVoid extends DurationFormat1Boxed { - public final Void data; - private DurationFormat1BoxedVoid(Void data) { - this.data = data; - } + public record DurationFormat1BoxedVoid(Void data) implements DurationFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class DurationFormat1BoxedBoolean extends DurationFormat1Boxed { - public final boolean data; - private DurationFormat1BoxedBoolean(boolean data) { - this.data = data; - } + public record DurationFormat1BoxedBoolean(boolean data) implements DurationFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class DurationFormat1BoxedNumber extends DurationFormat1Boxed { - public final Number data; - private DurationFormat1BoxedNumber(Number data) { - this.data = data; - } + public record DurationFormat1BoxedNumber(Number data) implements DurationFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class DurationFormat1BoxedString extends DurationFormat1Boxed { - public final String data; - private DurationFormat1BoxedString(String data) { - this.data = data; - } + public record DurationFormat1BoxedString(String data) implements DurationFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class DurationFormat1BoxedList extends DurationFormat1Boxed { - public final FrozenList<@Nullable Object> data; - private DurationFormat1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record DurationFormat1BoxedList(FrozenList<@Nullable Object> data) implements DurationFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class DurationFormat1BoxedMap extends DurationFormat1Boxed { - public final FrozenMap<@Nullable Object> data; - private DurationFormat1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record DurationFormat1BoxedMap(FrozenMap<@Nullable Object> data) implements DurationFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class DurationFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, DurationFormat1BoxedList>, MapSchemaValidator, DurationFormat1BoxedMap> { + public static class DurationFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, DurationFormat1BoxedList>, MapSchemaValidator, DurationFormat1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -211,11 +187,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -246,11 +222,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -329,5 +305,24 @@ public DurationFormat1BoxedList validateAndBox(List arg, SchemaConfiguration public DurationFormat1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new DurationFormat1BoxedMap(validate(arg, configuration)); } + @Override + public DurationFormat1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EmailFormat.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EmailFormat.java index c2b5bddb5d4..97090800803 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EmailFormat.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EmailFormat.java @@ -35,78 +35,54 @@ public class EmailFormat { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class EmailFormat1Boxed permits EmailFormat1BoxedVoid, EmailFormat1BoxedBoolean, EmailFormat1BoxedNumber, EmailFormat1BoxedString, EmailFormat1BoxedList, EmailFormat1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface EmailFormat1Boxed permits EmailFormat1BoxedVoid, EmailFormat1BoxedBoolean, EmailFormat1BoxedNumber, EmailFormat1BoxedString, EmailFormat1BoxedList, EmailFormat1BoxedMap { + @Nullable Object getData(); } - public static final class EmailFormat1BoxedVoid extends EmailFormat1Boxed { - public final Void data; - private EmailFormat1BoxedVoid(Void data) { - this.data = data; - } + public record EmailFormat1BoxedVoid(Void data) implements EmailFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class EmailFormat1BoxedBoolean extends EmailFormat1Boxed { - public final boolean data; - private EmailFormat1BoxedBoolean(boolean data) { - this.data = data; - } + public record EmailFormat1BoxedBoolean(boolean data) implements EmailFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class EmailFormat1BoxedNumber extends EmailFormat1Boxed { - public final Number data; - private EmailFormat1BoxedNumber(Number data) { - this.data = data; - } + public record EmailFormat1BoxedNumber(Number data) implements EmailFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class EmailFormat1BoxedString extends EmailFormat1Boxed { - public final String data; - private EmailFormat1BoxedString(String data) { - this.data = data; - } + public record EmailFormat1BoxedString(String data) implements EmailFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class EmailFormat1BoxedList extends EmailFormat1Boxed { - public final FrozenList<@Nullable Object> data; - private EmailFormat1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record EmailFormat1BoxedList(FrozenList<@Nullable Object> data) implements EmailFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class EmailFormat1BoxedMap extends EmailFormat1Boxed { - public final FrozenMap<@Nullable Object> data; - private EmailFormat1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record EmailFormat1BoxedMap(FrozenMap<@Nullable Object> data) implements EmailFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class EmailFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, EmailFormat1BoxedList>, MapSchemaValidator, EmailFormat1BoxedMap> { + public static class EmailFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, EmailFormat1BoxedList>, MapSchemaValidator, EmailFormat1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -211,11 +187,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -246,11 +222,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -329,5 +305,24 @@ public EmailFormat1BoxedList validateAndBox(List arg, SchemaConfiguration con public EmailFormat1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new EmailFormat1BoxedMap(validate(arg, configuration)); } + @Override + public EmailFormat1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EmptyDependents.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EmptyDependents.java index efebb02cd78..8ab187d5d7d 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EmptyDependents.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EmptyDependents.java @@ -38,78 +38,54 @@ public class EmptyDependents { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class EmptyDependents1Boxed permits EmptyDependents1BoxedVoid, EmptyDependents1BoxedBoolean, EmptyDependents1BoxedNumber, EmptyDependents1BoxedString, EmptyDependents1BoxedList, EmptyDependents1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface EmptyDependents1Boxed permits EmptyDependents1BoxedVoid, EmptyDependents1BoxedBoolean, EmptyDependents1BoxedNumber, EmptyDependents1BoxedString, EmptyDependents1BoxedList, EmptyDependents1BoxedMap { + @Nullable Object getData(); } - public static final class EmptyDependents1BoxedVoid extends EmptyDependents1Boxed { - public final Void data; - private EmptyDependents1BoxedVoid(Void data) { - this.data = data; - } + public record EmptyDependents1BoxedVoid(Void data) implements EmptyDependents1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class EmptyDependents1BoxedBoolean extends EmptyDependents1Boxed { - public final boolean data; - private EmptyDependents1BoxedBoolean(boolean data) { - this.data = data; - } + public record EmptyDependents1BoxedBoolean(boolean data) implements EmptyDependents1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class EmptyDependents1BoxedNumber extends EmptyDependents1Boxed { - public final Number data; - private EmptyDependents1BoxedNumber(Number data) { - this.data = data; - } + public record EmptyDependents1BoxedNumber(Number data) implements EmptyDependents1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class EmptyDependents1BoxedString extends EmptyDependents1Boxed { - public final String data; - private EmptyDependents1BoxedString(String data) { - this.data = data; - } + public record EmptyDependents1BoxedString(String data) implements EmptyDependents1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class EmptyDependents1BoxedList extends EmptyDependents1Boxed { - public final FrozenList<@Nullable Object> data; - private EmptyDependents1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record EmptyDependents1BoxedList(FrozenList<@Nullable Object> data) implements EmptyDependents1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class EmptyDependents1BoxedMap extends EmptyDependents1Boxed { - public final FrozenMap<@Nullable Object> data; - private EmptyDependents1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record EmptyDependents1BoxedMap(FrozenMap<@Nullable Object> data) implements EmptyDependents1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class EmptyDependents1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, EmptyDependents1BoxedList>, MapSchemaValidator, EmptyDependents1BoxedMap> { + public static class EmptyDependents1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, EmptyDependents1BoxedList>, MapSchemaValidator, EmptyDependents1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -220,11 +196,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -255,11 +231,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -338,5 +314,24 @@ public EmptyDependents1BoxedList validateAndBox(List arg, SchemaConfiguration public EmptyDependents1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new EmptyDependents1BoxedMap(validate(arg, configuration)); } + @Override + public EmptyDependents1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWith0DoesNotMatchFalse.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWith0DoesNotMatchFalse.java index 4038bd2e7ed..925c8e678d9 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWith0DoesNotMatchFalse.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWith0DoesNotMatchFalse.java @@ -77,24 +77,20 @@ public double value() { } - public static abstract sealed class EnumWith0DoesNotMatchFalse1Boxed permits EnumWith0DoesNotMatchFalse1BoxedNumber { - public abstract @Nullable Object data(); + public sealed interface EnumWith0DoesNotMatchFalse1Boxed permits EnumWith0DoesNotMatchFalse1BoxedNumber { + @Nullable Object getData(); } - public static final class EnumWith0DoesNotMatchFalse1BoxedNumber extends EnumWith0DoesNotMatchFalse1Boxed { - public final Number data; - private EnumWith0DoesNotMatchFalse1BoxedNumber(Number data) { - this.data = data; - } + public record EnumWith0DoesNotMatchFalse1BoxedNumber(Number data) implements EnumWith0DoesNotMatchFalse1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class EnumWith0DoesNotMatchFalse1 extends JsonSchema implements IntegerEnumValidator, LongEnumValidator, FloatEnumValidator, DoubleEnumValidator, NumberSchemaValidator { + public static class EnumWith0DoesNotMatchFalse1 extends JsonSchema implements IntegerEnumValidator, LongEnumValidator, FloatEnumValidator, DoubleEnumValidator, NumberSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -189,5 +185,12 @@ public double validate(DoubleEnumWith0DoesNotMatchFalseEnums arg,SchemaConfigura public EnumWith0DoesNotMatchFalse1BoxedNumber validateAndBox(Number arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new EnumWith0DoesNotMatchFalse1BoxedNumber(validate(arg, configuration)); } + @Override + public EnumWith0DoesNotMatchFalse1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWith1DoesNotMatchTrue.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWith1DoesNotMatchTrue.java index caa23849d46..3fc1f77d7d0 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWith1DoesNotMatchTrue.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWith1DoesNotMatchTrue.java @@ -77,24 +77,20 @@ public double value() { } - public static abstract sealed class EnumWith1DoesNotMatchTrue1Boxed permits EnumWith1DoesNotMatchTrue1BoxedNumber { - public abstract @Nullable Object data(); + public sealed interface EnumWith1DoesNotMatchTrue1Boxed permits EnumWith1DoesNotMatchTrue1BoxedNumber { + @Nullable Object getData(); } - public static final class EnumWith1DoesNotMatchTrue1BoxedNumber extends EnumWith1DoesNotMatchTrue1Boxed { - public final Number data; - private EnumWith1DoesNotMatchTrue1BoxedNumber(Number data) { - this.data = data; - } + public record EnumWith1DoesNotMatchTrue1BoxedNumber(Number data) implements EnumWith1DoesNotMatchTrue1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class EnumWith1DoesNotMatchTrue1 extends JsonSchema implements IntegerEnumValidator, LongEnumValidator, FloatEnumValidator, DoubleEnumValidator, NumberSchemaValidator { + public static class EnumWith1DoesNotMatchTrue1 extends JsonSchema implements IntegerEnumValidator, LongEnumValidator, FloatEnumValidator, DoubleEnumValidator, NumberSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -189,5 +185,12 @@ public double validate(DoubleEnumWith1DoesNotMatchTrueEnums arg,SchemaConfigurat public EnumWith1DoesNotMatchTrue1BoxedNumber validateAndBox(Number arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new EnumWith1DoesNotMatchTrue1BoxedNumber(validate(arg, configuration)); } + @Override + public EnumWith1DoesNotMatchTrue1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWithEscapedCharacters.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWithEscapedCharacters.java index f10f7b3118b..d5dab170d98 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWithEscapedCharacters.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWithEscapedCharacters.java @@ -35,24 +35,20 @@ public String value() { } - public static abstract sealed class EnumWithEscapedCharacters1Boxed permits EnumWithEscapedCharacters1BoxedString { - public abstract @Nullable Object data(); + public sealed interface EnumWithEscapedCharacters1Boxed permits EnumWithEscapedCharacters1BoxedString { + @Nullable Object getData(); } - public static final class EnumWithEscapedCharacters1BoxedString extends EnumWithEscapedCharacters1Boxed { - public final String data; - private EnumWithEscapedCharacters1BoxedString(String data) { - this.data = data; - } + public record EnumWithEscapedCharacters1BoxedString(String data) implements EnumWithEscapedCharacters1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class EnumWithEscapedCharacters1 extends JsonSchema implements StringSchemaValidator, StringEnumValidator { + public static class EnumWithEscapedCharacters1 extends JsonSchema implements StringSchemaValidator, StringEnumValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -114,5 +110,12 @@ public String validate(StringEnumWithEscapedCharactersEnums arg,SchemaConfigurat public EnumWithEscapedCharacters1BoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new EnumWithEscapedCharacters1BoxedString(validate(arg, configuration)); } + @Override + public EnumWithEscapedCharacters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWithFalseDoesNotMatch0.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWithFalseDoesNotMatch0.java index 2562191b685..bfc0223b2f7 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWithFalseDoesNotMatch0.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWithFalseDoesNotMatch0.java @@ -34,24 +34,20 @@ public boolean value() { } - public static abstract sealed class EnumWithFalseDoesNotMatch01Boxed permits EnumWithFalseDoesNotMatch01BoxedBoolean { - public abstract @Nullable Object data(); + public sealed interface EnumWithFalseDoesNotMatch01Boxed permits EnumWithFalseDoesNotMatch01BoxedBoolean { + @Nullable Object getData(); } - public static final class EnumWithFalseDoesNotMatch01BoxedBoolean extends EnumWithFalseDoesNotMatch01Boxed { - public final boolean data; - private EnumWithFalseDoesNotMatch01BoxedBoolean(boolean data) { - this.data = data; - } + public record EnumWithFalseDoesNotMatch01BoxedBoolean(boolean data) implements EnumWithFalseDoesNotMatch01Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class EnumWithFalseDoesNotMatch01 extends JsonSchema implements BooleanSchemaValidator, BooleanEnumValidator { + public static class EnumWithFalseDoesNotMatch01 extends JsonSchema implements BooleanSchemaValidator, BooleanEnumValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -112,5 +108,13 @@ public boolean validate(BooleanEnumWithFalseDoesNotMatch0Enums arg,SchemaConfigu public EnumWithFalseDoesNotMatch01BoxedBoolean validateAndBox(boolean arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new EnumWithFalseDoesNotMatch01BoxedBoolean(validate(arg, configuration)); } + @Override + public EnumWithFalseDoesNotMatch01Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWithTrueDoesNotMatch1.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWithTrueDoesNotMatch1.java index 1f5b945b758..4581de4b395 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWithTrueDoesNotMatch1.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumWithTrueDoesNotMatch1.java @@ -34,24 +34,20 @@ public boolean value() { } - public static abstract sealed class EnumWithTrueDoesNotMatch11Boxed permits EnumWithTrueDoesNotMatch11BoxedBoolean { - public abstract @Nullable Object data(); + public sealed interface EnumWithTrueDoesNotMatch11Boxed permits EnumWithTrueDoesNotMatch11BoxedBoolean { + @Nullable Object getData(); } - public static final class EnumWithTrueDoesNotMatch11BoxedBoolean extends EnumWithTrueDoesNotMatch11Boxed { - public final boolean data; - private EnumWithTrueDoesNotMatch11BoxedBoolean(boolean data) { - this.data = data; - } + public record EnumWithTrueDoesNotMatch11BoxedBoolean(boolean data) implements EnumWithTrueDoesNotMatch11Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class EnumWithTrueDoesNotMatch11 extends JsonSchema implements BooleanSchemaValidator, BooleanEnumValidator { + public static class EnumWithTrueDoesNotMatch11 extends JsonSchema implements BooleanSchemaValidator, BooleanEnumValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -112,5 +108,13 @@ public boolean validate(BooleanEnumWithTrueDoesNotMatch1Enums arg,SchemaConfigur public EnumWithTrueDoesNotMatch11BoxedBoolean validateAndBox(boolean arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new EnumWithTrueDoesNotMatch11BoxedBoolean(validate(arg, configuration)); } + @Override + public EnumWithTrueDoesNotMatch11Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumsInProperties.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumsInProperties.java index a34b3eb5bd4..3822c82493e 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumsInProperties.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumsInProperties.java @@ -44,24 +44,20 @@ public String value() { } - public static abstract sealed class FooBoxed permits FooBoxedString { - public abstract @Nullable Object data(); + public sealed interface FooBoxed permits FooBoxedString { + @Nullable Object getData(); } - public static final class FooBoxedString extends FooBoxed { - public final String data; - private FooBoxedString(String data) { - this.data = data; - } + public record FooBoxedString(String data) implements FooBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Foo extends JsonSchema implements StringSchemaValidator, StringEnumValidator { + public static class Foo extends JsonSchema implements StringSchemaValidator, StringEnumValidator { private static @Nullable Foo instance = null; protected Foo() { @@ -116,6 +112,13 @@ public String validate(StringFooEnums arg,SchemaConfiguration configuration) thr public FooBoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new FooBoxedString(validate(arg, configuration)); } + @Override + public FooBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public enum StringBarEnums implements StringValueMethod { BAR("bar"); @@ -130,24 +133,20 @@ public String value() { } - public static abstract sealed class BarBoxed permits BarBoxedString { - public abstract @Nullable Object data(); + public sealed interface BarBoxed permits BarBoxedString { + @Nullable Object getData(); } - public static final class BarBoxedString extends BarBoxed { - public final String data; - private BarBoxedString(String data) { - this.data = data; - } + public record BarBoxedString(String data) implements BarBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Bar extends JsonSchema implements StringSchemaValidator, StringEnumValidator { + public static class Bar extends JsonSchema implements StringSchemaValidator, StringEnumValidator { private static @Nullable Bar instance = null; protected Bar() { @@ -202,6 +201,13 @@ public String validate(StringBarEnums arg,SchemaConfiguration configuration) thr public BarBoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new BarBoxedString(validate(arg, configuration)); } + @Override + public BarBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class EnumsInPropertiesMap extends FrozenMap<@Nullable Object> { @@ -317,23 +323,19 @@ public EnumsInPropertiesMap0Builder getBuilderAfterBar(Map { + public static class EnumsInProperties1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -373,11 +375,11 @@ public EnumsInPropertiesMap getNewInstance(Map arg, List pathToIte List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -414,6 +416,13 @@ public EnumsInPropertiesMap validate(Map arg, SchemaConfiguration configur public EnumsInProperties1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new EnumsInProperties1BoxedMap(validate(arg, configuration)); } + @Override + public EnumsInProperties1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ExclusivemaximumValidation.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ExclusivemaximumValidation.java index 19c7a72b11f..d4454126242 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ExclusivemaximumValidation.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ExclusivemaximumValidation.java @@ -35,78 +35,54 @@ public class ExclusivemaximumValidation { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class ExclusivemaximumValidation1Boxed permits ExclusivemaximumValidation1BoxedVoid, ExclusivemaximumValidation1BoxedBoolean, ExclusivemaximumValidation1BoxedNumber, ExclusivemaximumValidation1BoxedString, ExclusivemaximumValidation1BoxedList, ExclusivemaximumValidation1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface ExclusivemaximumValidation1Boxed permits ExclusivemaximumValidation1BoxedVoid, ExclusivemaximumValidation1BoxedBoolean, ExclusivemaximumValidation1BoxedNumber, ExclusivemaximumValidation1BoxedString, ExclusivemaximumValidation1BoxedList, ExclusivemaximumValidation1BoxedMap { + @Nullable Object getData(); } - public static final class ExclusivemaximumValidation1BoxedVoid extends ExclusivemaximumValidation1Boxed { - public final Void data; - private ExclusivemaximumValidation1BoxedVoid(Void data) { - this.data = data; - } + public record ExclusivemaximumValidation1BoxedVoid(Void data) implements ExclusivemaximumValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ExclusivemaximumValidation1BoxedBoolean extends ExclusivemaximumValidation1Boxed { - public final boolean data; - private ExclusivemaximumValidation1BoxedBoolean(boolean data) { - this.data = data; - } + public record ExclusivemaximumValidation1BoxedBoolean(boolean data) implements ExclusivemaximumValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ExclusivemaximumValidation1BoxedNumber extends ExclusivemaximumValidation1Boxed { - public final Number data; - private ExclusivemaximumValidation1BoxedNumber(Number data) { - this.data = data; - } + public record ExclusivemaximumValidation1BoxedNumber(Number data) implements ExclusivemaximumValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ExclusivemaximumValidation1BoxedString extends ExclusivemaximumValidation1Boxed { - public final String data; - private ExclusivemaximumValidation1BoxedString(String data) { - this.data = data; - } + public record ExclusivemaximumValidation1BoxedString(String data) implements ExclusivemaximumValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ExclusivemaximumValidation1BoxedList extends ExclusivemaximumValidation1Boxed { - public final FrozenList<@Nullable Object> data; - private ExclusivemaximumValidation1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record ExclusivemaximumValidation1BoxedList(FrozenList<@Nullable Object> data) implements ExclusivemaximumValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ExclusivemaximumValidation1BoxedMap extends ExclusivemaximumValidation1Boxed { - public final FrozenMap<@Nullable Object> data; - private ExclusivemaximumValidation1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record ExclusivemaximumValidation1BoxedMap(FrozenMap<@Nullable Object> data) implements ExclusivemaximumValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ExclusivemaximumValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ExclusivemaximumValidation1BoxedList>, MapSchemaValidator, ExclusivemaximumValidation1BoxedMap> { + public static class ExclusivemaximumValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ExclusivemaximumValidation1BoxedList>, MapSchemaValidator, ExclusivemaximumValidation1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -211,11 +187,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -246,11 +222,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -329,5 +305,24 @@ public ExclusivemaximumValidation1BoxedList validateAndBox(List arg, SchemaCo public ExclusivemaximumValidation1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ExclusivemaximumValidation1BoxedMap(validate(arg, configuration)); } + @Override + public ExclusivemaximumValidation1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ExclusiveminimumValidation.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ExclusiveminimumValidation.java index 6d4e3c2d69d..1da2ea949b2 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ExclusiveminimumValidation.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ExclusiveminimumValidation.java @@ -35,78 +35,54 @@ public class ExclusiveminimumValidation { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class ExclusiveminimumValidation1Boxed permits ExclusiveminimumValidation1BoxedVoid, ExclusiveminimumValidation1BoxedBoolean, ExclusiveminimumValidation1BoxedNumber, ExclusiveminimumValidation1BoxedString, ExclusiveminimumValidation1BoxedList, ExclusiveminimumValidation1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface ExclusiveminimumValidation1Boxed permits ExclusiveminimumValidation1BoxedVoid, ExclusiveminimumValidation1BoxedBoolean, ExclusiveminimumValidation1BoxedNumber, ExclusiveminimumValidation1BoxedString, ExclusiveminimumValidation1BoxedList, ExclusiveminimumValidation1BoxedMap { + @Nullable Object getData(); } - public static final class ExclusiveminimumValidation1BoxedVoid extends ExclusiveminimumValidation1Boxed { - public final Void data; - private ExclusiveminimumValidation1BoxedVoid(Void data) { - this.data = data; - } + public record ExclusiveminimumValidation1BoxedVoid(Void data) implements ExclusiveminimumValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ExclusiveminimumValidation1BoxedBoolean extends ExclusiveminimumValidation1Boxed { - public final boolean data; - private ExclusiveminimumValidation1BoxedBoolean(boolean data) { - this.data = data; - } + public record ExclusiveminimumValidation1BoxedBoolean(boolean data) implements ExclusiveminimumValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ExclusiveminimumValidation1BoxedNumber extends ExclusiveminimumValidation1Boxed { - public final Number data; - private ExclusiveminimumValidation1BoxedNumber(Number data) { - this.data = data; - } + public record ExclusiveminimumValidation1BoxedNumber(Number data) implements ExclusiveminimumValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ExclusiveminimumValidation1BoxedString extends ExclusiveminimumValidation1Boxed { - public final String data; - private ExclusiveminimumValidation1BoxedString(String data) { - this.data = data; - } + public record ExclusiveminimumValidation1BoxedString(String data) implements ExclusiveminimumValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ExclusiveminimumValidation1BoxedList extends ExclusiveminimumValidation1Boxed { - public final FrozenList<@Nullable Object> data; - private ExclusiveminimumValidation1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record ExclusiveminimumValidation1BoxedList(FrozenList<@Nullable Object> data) implements ExclusiveminimumValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ExclusiveminimumValidation1BoxedMap extends ExclusiveminimumValidation1Boxed { - public final FrozenMap<@Nullable Object> data; - private ExclusiveminimumValidation1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record ExclusiveminimumValidation1BoxedMap(FrozenMap<@Nullable Object> data) implements ExclusiveminimumValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ExclusiveminimumValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ExclusiveminimumValidation1BoxedList>, MapSchemaValidator, ExclusiveminimumValidation1BoxedMap> { + public static class ExclusiveminimumValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ExclusiveminimumValidation1BoxedList>, MapSchemaValidator, ExclusiveminimumValidation1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -211,11 +187,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -246,11 +222,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -329,5 +305,24 @@ public ExclusiveminimumValidation1BoxedList validateAndBox(List arg, SchemaCo public ExclusiveminimumValidation1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ExclusiveminimumValidation1BoxedMap(validate(arg, configuration)); } + @Override + public ExclusiveminimumValidation1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/FloatDivisionInf.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/FloatDivisionInf.java index e47d9a9d507..5b46639e358 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/FloatDivisionInf.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/FloatDivisionInf.java @@ -20,24 +20,20 @@ public class FloatDivisionInf { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class FloatDivisionInf1Boxed permits FloatDivisionInf1BoxedNumber { - public abstract @Nullable Object data(); + public sealed interface FloatDivisionInf1Boxed permits FloatDivisionInf1BoxedNumber { + @Nullable Object getData(); } - public static final class FloatDivisionInf1BoxedNumber extends FloatDivisionInf1Boxed { - public final Number data; - private FloatDivisionInf1BoxedNumber(Number data) { - this.data = data; - } + public record FloatDivisionInf1BoxedNumber(Number data) implements FloatDivisionInf1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class FloatDivisionInf1 extends JsonSchema implements NumberSchemaValidator { + public static class FloatDivisionInf1 extends JsonSchema implements NumberSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -111,5 +107,12 @@ public double validate(double arg, SchemaConfiguration configuration) throws Val public FloatDivisionInf1BoxedNumber validateAndBox(Number arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new FloatDivisionInf1BoxedNumber(validate(arg, configuration)); } + @Override + public FloatDivisionInf1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ForbiddenProperty.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ForbiddenProperty.java index fe290cc3b81..203112478de 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ForbiddenProperty.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ForbiddenProperty.java @@ -49,78 +49,54 @@ public static Not getInstance() { } - public static abstract sealed class FooBoxed permits FooBoxedVoid, FooBoxedBoolean, FooBoxedNumber, FooBoxedString, FooBoxedList, FooBoxedMap { - public abstract @Nullable Object data(); + public sealed interface FooBoxed permits FooBoxedVoid, FooBoxedBoolean, FooBoxedNumber, FooBoxedString, FooBoxedList, FooBoxedMap { + @Nullable Object getData(); } - public static final class FooBoxedVoid extends FooBoxed { - public final Void data; - private FooBoxedVoid(Void data) { - this.data = data; - } + public record FooBoxedVoid(Void data) implements FooBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class FooBoxedBoolean extends FooBoxed { - public final boolean data; - private FooBoxedBoolean(boolean data) { - this.data = data; - } + public record FooBoxedBoolean(boolean data) implements FooBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class FooBoxedNumber extends FooBoxed { - public final Number data; - private FooBoxedNumber(Number data) { - this.data = data; - } + public record FooBoxedNumber(Number data) implements FooBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class FooBoxedString extends FooBoxed { - public final String data; - private FooBoxedString(String data) { - this.data = data; - } + public record FooBoxedString(String data) implements FooBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class FooBoxedList extends FooBoxed { - public final FrozenList<@Nullable Object> data; - private FooBoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record FooBoxedList(FrozenList<@Nullable Object> data) implements FooBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class FooBoxedMap extends FooBoxed { - public final FrozenMap<@Nullable Object> data; - private FooBoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record FooBoxedMap(FrozenMap<@Nullable Object> data) implements FooBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Foo extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, FooBoxedList>, MapSchemaValidator, FooBoxedMap> { + public static class Foo extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, FooBoxedList>, MapSchemaValidator, FooBoxedMap> { private static @Nullable Foo instance = null; protected Foo() { @@ -219,11 +195,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -254,11 +230,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -337,6 +313,25 @@ public FooBoxedList validateAndBox(List arg, SchemaConfiguration configuratio public FooBoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new FooBoxedMap(validate(arg, configuration)); } + @Override + public FooBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class ForbiddenPropertyMap extends FrozenMap<@Nullable Object> { @@ -447,78 +442,54 @@ public ForbiddenPropertyMapBuilder getBuilderAfterAdditionalProperty(Map data; - private ForbiddenProperty1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record ForbiddenProperty1BoxedList(FrozenList<@Nullable Object> data) implements ForbiddenProperty1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ForbiddenProperty1BoxedMap extends ForbiddenProperty1Boxed { - public final ForbiddenPropertyMap data; - private ForbiddenProperty1BoxedMap(ForbiddenPropertyMap data) { - this.data = data; - } + public record ForbiddenProperty1BoxedMap(ForbiddenPropertyMap data) implements ForbiddenProperty1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ForbiddenProperty1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ForbiddenProperty1BoxedList>, MapSchemaValidator { + public static class ForbiddenProperty1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ForbiddenProperty1BoxedList>, MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -625,11 +596,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -660,11 +631,11 @@ public ForbiddenPropertyMap getNewInstance(Map arg, List pathToIte List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -743,5 +714,24 @@ public ForbiddenProperty1BoxedList validateAndBox(List arg, SchemaConfigurati public ForbiddenProperty1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ForbiddenProperty1BoxedMap(validate(arg, configuration)); } + @Override + public ForbiddenProperty1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/HostnameFormat.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/HostnameFormat.java index 6ec1cc93896..da84ef4c6ed 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/HostnameFormat.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/HostnameFormat.java @@ -35,78 +35,54 @@ public class HostnameFormat { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class HostnameFormat1Boxed permits HostnameFormat1BoxedVoid, HostnameFormat1BoxedBoolean, HostnameFormat1BoxedNumber, HostnameFormat1BoxedString, HostnameFormat1BoxedList, HostnameFormat1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface HostnameFormat1Boxed permits HostnameFormat1BoxedVoid, HostnameFormat1BoxedBoolean, HostnameFormat1BoxedNumber, HostnameFormat1BoxedString, HostnameFormat1BoxedList, HostnameFormat1BoxedMap { + @Nullable Object getData(); } - public static final class HostnameFormat1BoxedVoid extends HostnameFormat1Boxed { - public final Void data; - private HostnameFormat1BoxedVoid(Void data) { - this.data = data; - } + public record HostnameFormat1BoxedVoid(Void data) implements HostnameFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class HostnameFormat1BoxedBoolean extends HostnameFormat1Boxed { - public final boolean data; - private HostnameFormat1BoxedBoolean(boolean data) { - this.data = data; - } + public record HostnameFormat1BoxedBoolean(boolean data) implements HostnameFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class HostnameFormat1BoxedNumber extends HostnameFormat1Boxed { - public final Number data; - private HostnameFormat1BoxedNumber(Number data) { - this.data = data; - } + public record HostnameFormat1BoxedNumber(Number data) implements HostnameFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class HostnameFormat1BoxedString extends HostnameFormat1Boxed { - public final String data; - private HostnameFormat1BoxedString(String data) { - this.data = data; - } + public record HostnameFormat1BoxedString(String data) implements HostnameFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class HostnameFormat1BoxedList extends HostnameFormat1Boxed { - public final FrozenList<@Nullable Object> data; - private HostnameFormat1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record HostnameFormat1BoxedList(FrozenList<@Nullable Object> data) implements HostnameFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class HostnameFormat1BoxedMap extends HostnameFormat1Boxed { - public final FrozenMap<@Nullable Object> data; - private HostnameFormat1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record HostnameFormat1BoxedMap(FrozenMap<@Nullable Object> data) implements HostnameFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class HostnameFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, HostnameFormat1BoxedList>, MapSchemaValidator, HostnameFormat1BoxedMap> { + public static class HostnameFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, HostnameFormat1BoxedList>, MapSchemaValidator, HostnameFormat1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -211,11 +187,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -246,11 +222,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -329,5 +305,24 @@ public HostnameFormat1BoxedList validateAndBox(List arg, SchemaConfiguration public HostnameFormat1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new HostnameFormat1BoxedMap(validate(arg, configuration)); } + @Override + public HostnameFormat1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/IdnEmailFormat.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/IdnEmailFormat.java index 235707ac583..1264c17e8a3 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/IdnEmailFormat.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/IdnEmailFormat.java @@ -35,78 +35,54 @@ public class IdnEmailFormat { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class IdnEmailFormat1Boxed permits IdnEmailFormat1BoxedVoid, IdnEmailFormat1BoxedBoolean, IdnEmailFormat1BoxedNumber, IdnEmailFormat1BoxedString, IdnEmailFormat1BoxedList, IdnEmailFormat1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface IdnEmailFormat1Boxed permits IdnEmailFormat1BoxedVoid, IdnEmailFormat1BoxedBoolean, IdnEmailFormat1BoxedNumber, IdnEmailFormat1BoxedString, IdnEmailFormat1BoxedList, IdnEmailFormat1BoxedMap { + @Nullable Object getData(); } - public static final class IdnEmailFormat1BoxedVoid extends IdnEmailFormat1Boxed { - public final Void data; - private IdnEmailFormat1BoxedVoid(Void data) { - this.data = data; - } + public record IdnEmailFormat1BoxedVoid(Void data) implements IdnEmailFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IdnEmailFormat1BoxedBoolean extends IdnEmailFormat1Boxed { - public final boolean data; - private IdnEmailFormat1BoxedBoolean(boolean data) { - this.data = data; - } + public record IdnEmailFormat1BoxedBoolean(boolean data) implements IdnEmailFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IdnEmailFormat1BoxedNumber extends IdnEmailFormat1Boxed { - public final Number data; - private IdnEmailFormat1BoxedNumber(Number data) { - this.data = data; - } + public record IdnEmailFormat1BoxedNumber(Number data) implements IdnEmailFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IdnEmailFormat1BoxedString extends IdnEmailFormat1Boxed { - public final String data; - private IdnEmailFormat1BoxedString(String data) { - this.data = data; - } + public record IdnEmailFormat1BoxedString(String data) implements IdnEmailFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IdnEmailFormat1BoxedList extends IdnEmailFormat1Boxed { - public final FrozenList<@Nullable Object> data; - private IdnEmailFormat1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record IdnEmailFormat1BoxedList(FrozenList<@Nullable Object> data) implements IdnEmailFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IdnEmailFormat1BoxedMap extends IdnEmailFormat1Boxed { - public final FrozenMap<@Nullable Object> data; - private IdnEmailFormat1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record IdnEmailFormat1BoxedMap(FrozenMap<@Nullable Object> data) implements IdnEmailFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class IdnEmailFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, IdnEmailFormat1BoxedList>, MapSchemaValidator, IdnEmailFormat1BoxedMap> { + public static class IdnEmailFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, IdnEmailFormat1BoxedList>, MapSchemaValidator, IdnEmailFormat1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -211,11 +187,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -246,11 +222,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -329,5 +305,24 @@ public IdnEmailFormat1BoxedList validateAndBox(List arg, SchemaConfiguration public IdnEmailFormat1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new IdnEmailFormat1BoxedMap(validate(arg, configuration)); } + @Override + public IdnEmailFormat1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/IdnHostnameFormat.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/IdnHostnameFormat.java index 96390573a45..54319cb6f3a 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/IdnHostnameFormat.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/IdnHostnameFormat.java @@ -35,78 +35,54 @@ public class IdnHostnameFormat { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class IdnHostnameFormat1Boxed permits IdnHostnameFormat1BoxedVoid, IdnHostnameFormat1BoxedBoolean, IdnHostnameFormat1BoxedNumber, IdnHostnameFormat1BoxedString, IdnHostnameFormat1BoxedList, IdnHostnameFormat1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface IdnHostnameFormat1Boxed permits IdnHostnameFormat1BoxedVoid, IdnHostnameFormat1BoxedBoolean, IdnHostnameFormat1BoxedNumber, IdnHostnameFormat1BoxedString, IdnHostnameFormat1BoxedList, IdnHostnameFormat1BoxedMap { + @Nullable Object getData(); } - public static final class IdnHostnameFormat1BoxedVoid extends IdnHostnameFormat1Boxed { - public final Void data; - private IdnHostnameFormat1BoxedVoid(Void data) { - this.data = data; - } + public record IdnHostnameFormat1BoxedVoid(Void data) implements IdnHostnameFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IdnHostnameFormat1BoxedBoolean extends IdnHostnameFormat1Boxed { - public final boolean data; - private IdnHostnameFormat1BoxedBoolean(boolean data) { - this.data = data; - } + public record IdnHostnameFormat1BoxedBoolean(boolean data) implements IdnHostnameFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IdnHostnameFormat1BoxedNumber extends IdnHostnameFormat1Boxed { - public final Number data; - private IdnHostnameFormat1BoxedNumber(Number data) { - this.data = data; - } + public record IdnHostnameFormat1BoxedNumber(Number data) implements IdnHostnameFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IdnHostnameFormat1BoxedString extends IdnHostnameFormat1Boxed { - public final String data; - private IdnHostnameFormat1BoxedString(String data) { - this.data = data; - } + public record IdnHostnameFormat1BoxedString(String data) implements IdnHostnameFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IdnHostnameFormat1BoxedList extends IdnHostnameFormat1Boxed { - public final FrozenList<@Nullable Object> data; - private IdnHostnameFormat1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record IdnHostnameFormat1BoxedList(FrozenList<@Nullable Object> data) implements IdnHostnameFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IdnHostnameFormat1BoxedMap extends IdnHostnameFormat1Boxed { - public final FrozenMap<@Nullable Object> data; - private IdnHostnameFormat1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record IdnHostnameFormat1BoxedMap(FrozenMap<@Nullable Object> data) implements IdnHostnameFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class IdnHostnameFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, IdnHostnameFormat1BoxedList>, MapSchemaValidator, IdnHostnameFormat1BoxedMap> { + public static class IdnHostnameFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, IdnHostnameFormat1BoxedList>, MapSchemaValidator, IdnHostnameFormat1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -211,11 +187,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -246,11 +222,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -329,5 +305,24 @@ public IdnHostnameFormat1BoxedList validateAndBox(List arg, SchemaConfigurati public IdnHostnameFormat1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new IdnHostnameFormat1BoxedMap(validate(arg, configuration)); } + @Override + public IdnHostnameFormat1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/IfAndElseWithoutThen.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/IfAndElseWithoutThen.java index a884ea2b6bb..9c02b645f10 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/IfAndElseWithoutThen.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/IfAndElseWithoutThen.java @@ -36,78 +36,54 @@ public class IfAndElseWithoutThen { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class ElseSchemaBoxed permits ElseSchemaBoxedVoid, ElseSchemaBoxedBoolean, ElseSchemaBoxedNumber, ElseSchemaBoxedString, ElseSchemaBoxedList, ElseSchemaBoxedMap { - public abstract @Nullable Object data(); + public sealed interface ElseSchemaBoxed permits ElseSchemaBoxedVoid, ElseSchemaBoxedBoolean, ElseSchemaBoxedNumber, ElseSchemaBoxedString, ElseSchemaBoxedList, ElseSchemaBoxedMap { + @Nullable Object getData(); } - public static final class ElseSchemaBoxedVoid extends ElseSchemaBoxed { - public final Void data; - private ElseSchemaBoxedVoid(Void data) { - this.data = data; - } + public record ElseSchemaBoxedVoid(Void data) implements ElseSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ElseSchemaBoxedBoolean extends ElseSchemaBoxed { - public final boolean data; - private ElseSchemaBoxedBoolean(boolean data) { - this.data = data; - } + public record ElseSchemaBoxedBoolean(boolean data) implements ElseSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ElseSchemaBoxedNumber extends ElseSchemaBoxed { - public final Number data; - private ElseSchemaBoxedNumber(Number data) { - this.data = data; - } + public record ElseSchemaBoxedNumber(Number data) implements ElseSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ElseSchemaBoxedString extends ElseSchemaBoxed { - public final String data; - private ElseSchemaBoxedString(String data) { - this.data = data; - } + public record ElseSchemaBoxedString(String data) implements ElseSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ElseSchemaBoxedList extends ElseSchemaBoxed { - public final FrozenList<@Nullable Object> data; - private ElseSchemaBoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record ElseSchemaBoxedList(FrozenList<@Nullable Object> data) implements ElseSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ElseSchemaBoxedMap extends ElseSchemaBoxed { - public final FrozenMap<@Nullable Object> data; - private ElseSchemaBoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record ElseSchemaBoxedMap(FrozenMap<@Nullable Object> data) implements ElseSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ElseSchema extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ElseSchemaBoxedList>, MapSchemaValidator, ElseSchemaBoxedMap> { + public static class ElseSchema extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ElseSchemaBoxedList>, MapSchemaValidator, ElseSchemaBoxedMap> { private static @Nullable ElseSchema instance = null; protected ElseSchema() { @@ -206,11 +182,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -241,11 +217,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -324,80 +300,75 @@ public ElseSchemaBoxedList validateAndBox(List arg, SchemaConfiguration confi public ElseSchemaBoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ElseSchemaBoxedMap(validate(arg, configuration)); } + @Override + public ElseSchemaBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class IfSchemaBoxed permits IfSchemaBoxedVoid, IfSchemaBoxedBoolean, IfSchemaBoxedNumber, IfSchemaBoxedString, IfSchemaBoxedList, IfSchemaBoxedMap { - public abstract @Nullable Object data(); + public sealed interface IfSchemaBoxed permits IfSchemaBoxedVoid, IfSchemaBoxedBoolean, IfSchemaBoxedNumber, IfSchemaBoxedString, IfSchemaBoxedList, IfSchemaBoxedMap { + @Nullable Object getData(); } - public static final class IfSchemaBoxedVoid extends IfSchemaBoxed { - public final Void data; - private IfSchemaBoxedVoid(Void data) { - this.data = data; - } + public record IfSchemaBoxedVoid(Void data) implements IfSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IfSchemaBoxedBoolean extends IfSchemaBoxed { - public final boolean data; - private IfSchemaBoxedBoolean(boolean data) { - this.data = data; - } + public record IfSchemaBoxedBoolean(boolean data) implements IfSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IfSchemaBoxedNumber extends IfSchemaBoxed { - public final Number data; - private IfSchemaBoxedNumber(Number data) { - this.data = data; - } + public record IfSchemaBoxedNumber(Number data) implements IfSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IfSchemaBoxedString extends IfSchemaBoxed { - public final String data; - private IfSchemaBoxedString(String data) { - this.data = data; - } + public record IfSchemaBoxedString(String data) implements IfSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IfSchemaBoxedList extends IfSchemaBoxed { - public final FrozenList<@Nullable Object> data; - private IfSchemaBoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record IfSchemaBoxedList(FrozenList<@Nullable Object> data) implements IfSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IfSchemaBoxedMap extends IfSchemaBoxed { - public final FrozenMap<@Nullable Object> data; - private IfSchemaBoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record IfSchemaBoxedMap(FrozenMap<@Nullable Object> data) implements IfSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class IfSchema extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, IfSchemaBoxedList>, MapSchemaValidator, IfSchemaBoxedMap> { + public static class IfSchema extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, IfSchemaBoxedList>, MapSchemaValidator, IfSchemaBoxedMap> { private static @Nullable IfSchema instance = null; protected IfSchema() { @@ -496,11 +467,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -531,11 +502,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -614,80 +585,75 @@ public IfSchemaBoxedList validateAndBox(List arg, SchemaConfiguration configu public IfSchemaBoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new IfSchemaBoxedMap(validate(arg, configuration)); } + @Override + public IfSchemaBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class IfAndElseWithoutThen1Boxed permits IfAndElseWithoutThen1BoxedVoid, IfAndElseWithoutThen1BoxedBoolean, IfAndElseWithoutThen1BoxedNumber, IfAndElseWithoutThen1BoxedString, IfAndElseWithoutThen1BoxedList, IfAndElseWithoutThen1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface IfAndElseWithoutThen1Boxed permits IfAndElseWithoutThen1BoxedVoid, IfAndElseWithoutThen1BoxedBoolean, IfAndElseWithoutThen1BoxedNumber, IfAndElseWithoutThen1BoxedString, IfAndElseWithoutThen1BoxedList, IfAndElseWithoutThen1BoxedMap { + @Nullable Object getData(); } - public static final class IfAndElseWithoutThen1BoxedVoid extends IfAndElseWithoutThen1Boxed { - public final Void data; - private IfAndElseWithoutThen1BoxedVoid(Void data) { - this.data = data; - } + public record IfAndElseWithoutThen1BoxedVoid(Void data) implements IfAndElseWithoutThen1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IfAndElseWithoutThen1BoxedBoolean extends IfAndElseWithoutThen1Boxed { - public final boolean data; - private IfAndElseWithoutThen1BoxedBoolean(boolean data) { - this.data = data; - } + public record IfAndElseWithoutThen1BoxedBoolean(boolean data) implements IfAndElseWithoutThen1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IfAndElseWithoutThen1BoxedNumber extends IfAndElseWithoutThen1Boxed { - public final Number data; - private IfAndElseWithoutThen1BoxedNumber(Number data) { - this.data = data; - } + public record IfAndElseWithoutThen1BoxedNumber(Number data) implements IfAndElseWithoutThen1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IfAndElseWithoutThen1BoxedString extends IfAndElseWithoutThen1Boxed { - public final String data; - private IfAndElseWithoutThen1BoxedString(String data) { - this.data = data; - } + public record IfAndElseWithoutThen1BoxedString(String data) implements IfAndElseWithoutThen1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IfAndElseWithoutThen1BoxedList extends IfAndElseWithoutThen1Boxed { - public final FrozenList<@Nullable Object> data; - private IfAndElseWithoutThen1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record IfAndElseWithoutThen1BoxedList(FrozenList<@Nullable Object> data) implements IfAndElseWithoutThen1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IfAndElseWithoutThen1BoxedMap extends IfAndElseWithoutThen1Boxed { - public final FrozenMap<@Nullable Object> data; - private IfAndElseWithoutThen1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record IfAndElseWithoutThen1BoxedMap(FrozenMap<@Nullable Object> data) implements IfAndElseWithoutThen1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class IfAndElseWithoutThen1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, IfAndElseWithoutThen1BoxedList>, MapSchemaValidator, IfAndElseWithoutThen1BoxedMap> { + public static class IfAndElseWithoutThen1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, IfAndElseWithoutThen1BoxedList>, MapSchemaValidator, IfAndElseWithoutThen1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -793,11 +759,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -828,11 +794,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -911,5 +877,24 @@ public IfAndElseWithoutThen1BoxedList validateAndBox(List arg, SchemaConfigur public IfAndElseWithoutThen1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new IfAndElseWithoutThen1BoxedMap(validate(arg, configuration)); } + @Override + public IfAndElseWithoutThen1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/IfAndThenWithoutElse.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/IfAndThenWithoutElse.java index 3e2b1d25634..c46a8099bd1 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/IfAndThenWithoutElse.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/IfAndThenWithoutElse.java @@ -35,78 +35,54 @@ public class IfAndThenWithoutElse { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class IfSchemaBoxed permits IfSchemaBoxedVoid, IfSchemaBoxedBoolean, IfSchemaBoxedNumber, IfSchemaBoxedString, IfSchemaBoxedList, IfSchemaBoxedMap { - public abstract @Nullable Object data(); + public sealed interface IfSchemaBoxed permits IfSchemaBoxedVoid, IfSchemaBoxedBoolean, IfSchemaBoxedNumber, IfSchemaBoxedString, IfSchemaBoxedList, IfSchemaBoxedMap { + @Nullable Object getData(); } - public static final class IfSchemaBoxedVoid extends IfSchemaBoxed { - public final Void data; - private IfSchemaBoxedVoid(Void data) { - this.data = data; - } + public record IfSchemaBoxedVoid(Void data) implements IfSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IfSchemaBoxedBoolean extends IfSchemaBoxed { - public final boolean data; - private IfSchemaBoxedBoolean(boolean data) { - this.data = data; - } + public record IfSchemaBoxedBoolean(boolean data) implements IfSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IfSchemaBoxedNumber extends IfSchemaBoxed { - public final Number data; - private IfSchemaBoxedNumber(Number data) { - this.data = data; - } + public record IfSchemaBoxedNumber(Number data) implements IfSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IfSchemaBoxedString extends IfSchemaBoxed { - public final String data; - private IfSchemaBoxedString(String data) { - this.data = data; - } + public record IfSchemaBoxedString(String data) implements IfSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IfSchemaBoxedList extends IfSchemaBoxed { - public final FrozenList<@Nullable Object> data; - private IfSchemaBoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record IfSchemaBoxedList(FrozenList<@Nullable Object> data) implements IfSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IfSchemaBoxedMap extends IfSchemaBoxed { - public final FrozenMap<@Nullable Object> data; - private IfSchemaBoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record IfSchemaBoxedMap(FrozenMap<@Nullable Object> data) implements IfSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class IfSchema extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, IfSchemaBoxedList>, MapSchemaValidator, IfSchemaBoxedMap> { + public static class IfSchema extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, IfSchemaBoxedList>, MapSchemaValidator, IfSchemaBoxedMap> { private static @Nullable IfSchema instance = null; protected IfSchema() { @@ -205,11 +181,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -240,11 +216,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -323,80 +299,75 @@ public IfSchemaBoxedList validateAndBox(List arg, SchemaConfiguration configu public IfSchemaBoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new IfSchemaBoxedMap(validate(arg, configuration)); } + @Override + public IfSchemaBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class ThenBoxed permits ThenBoxedVoid, ThenBoxedBoolean, ThenBoxedNumber, ThenBoxedString, ThenBoxedList, ThenBoxedMap { - public abstract @Nullable Object data(); + public sealed interface ThenBoxed permits ThenBoxedVoid, ThenBoxedBoolean, ThenBoxedNumber, ThenBoxedString, ThenBoxedList, ThenBoxedMap { + @Nullable Object getData(); } - public static final class ThenBoxedVoid extends ThenBoxed { - public final Void data; - private ThenBoxedVoid(Void data) { - this.data = data; - } + public record ThenBoxedVoid(Void data) implements ThenBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ThenBoxedBoolean extends ThenBoxed { - public final boolean data; - private ThenBoxedBoolean(boolean data) { - this.data = data; - } + public record ThenBoxedBoolean(boolean data) implements ThenBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ThenBoxedNumber extends ThenBoxed { - public final Number data; - private ThenBoxedNumber(Number data) { - this.data = data; - } + public record ThenBoxedNumber(Number data) implements ThenBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ThenBoxedString extends ThenBoxed { - public final String data; - private ThenBoxedString(String data) { - this.data = data; - } + public record ThenBoxedString(String data) implements ThenBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ThenBoxedList extends ThenBoxed { - public final FrozenList<@Nullable Object> data; - private ThenBoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record ThenBoxedList(FrozenList<@Nullable Object> data) implements ThenBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ThenBoxedMap extends ThenBoxed { - public final FrozenMap<@Nullable Object> data; - private ThenBoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record ThenBoxedMap(FrozenMap<@Nullable Object> data) implements ThenBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Then extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ThenBoxedList>, MapSchemaValidator, ThenBoxedMap> { + public static class Then extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ThenBoxedList>, MapSchemaValidator, ThenBoxedMap> { private static @Nullable Then instance = null; protected Then() { @@ -495,11 +466,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -530,11 +501,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -613,80 +584,75 @@ public ThenBoxedList validateAndBox(List arg, SchemaConfiguration configurati public ThenBoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ThenBoxedMap(validate(arg, configuration)); } + @Override + public ThenBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class IfAndThenWithoutElse1Boxed permits IfAndThenWithoutElse1BoxedVoid, IfAndThenWithoutElse1BoxedBoolean, IfAndThenWithoutElse1BoxedNumber, IfAndThenWithoutElse1BoxedString, IfAndThenWithoutElse1BoxedList, IfAndThenWithoutElse1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface IfAndThenWithoutElse1Boxed permits IfAndThenWithoutElse1BoxedVoid, IfAndThenWithoutElse1BoxedBoolean, IfAndThenWithoutElse1BoxedNumber, IfAndThenWithoutElse1BoxedString, IfAndThenWithoutElse1BoxedList, IfAndThenWithoutElse1BoxedMap { + @Nullable Object getData(); } - public static final class IfAndThenWithoutElse1BoxedVoid extends IfAndThenWithoutElse1Boxed { - public final Void data; - private IfAndThenWithoutElse1BoxedVoid(Void data) { - this.data = data; - } + public record IfAndThenWithoutElse1BoxedVoid(Void data) implements IfAndThenWithoutElse1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IfAndThenWithoutElse1BoxedBoolean extends IfAndThenWithoutElse1Boxed { - public final boolean data; - private IfAndThenWithoutElse1BoxedBoolean(boolean data) { - this.data = data; - } + public record IfAndThenWithoutElse1BoxedBoolean(boolean data) implements IfAndThenWithoutElse1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IfAndThenWithoutElse1BoxedNumber extends IfAndThenWithoutElse1Boxed { - public final Number data; - private IfAndThenWithoutElse1BoxedNumber(Number data) { - this.data = data; - } + public record IfAndThenWithoutElse1BoxedNumber(Number data) implements IfAndThenWithoutElse1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IfAndThenWithoutElse1BoxedString extends IfAndThenWithoutElse1Boxed { - public final String data; - private IfAndThenWithoutElse1BoxedString(String data) { - this.data = data; - } + public record IfAndThenWithoutElse1BoxedString(String data) implements IfAndThenWithoutElse1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IfAndThenWithoutElse1BoxedList extends IfAndThenWithoutElse1Boxed { - public final FrozenList<@Nullable Object> data; - private IfAndThenWithoutElse1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record IfAndThenWithoutElse1BoxedList(FrozenList<@Nullable Object> data) implements IfAndThenWithoutElse1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IfAndThenWithoutElse1BoxedMap extends IfAndThenWithoutElse1Boxed { - public final FrozenMap<@Nullable Object> data; - private IfAndThenWithoutElse1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record IfAndThenWithoutElse1BoxedMap(FrozenMap<@Nullable Object> data) implements IfAndThenWithoutElse1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class IfAndThenWithoutElse1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, IfAndThenWithoutElse1BoxedList>, MapSchemaValidator, IfAndThenWithoutElse1BoxedMap> { + public static class IfAndThenWithoutElse1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, IfAndThenWithoutElse1BoxedList>, MapSchemaValidator, IfAndThenWithoutElse1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -792,11 +758,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -827,11 +793,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -910,5 +876,24 @@ public IfAndThenWithoutElse1BoxedList validateAndBox(List arg, SchemaConfigur public IfAndThenWithoutElse1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new IfAndThenWithoutElse1BoxedMap(validate(arg, configuration)); } + @Override + public IfAndThenWithoutElse1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence.java index ece6ac65a5a..301de72323d 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence.java @@ -49,78 +49,54 @@ public String value() { } - public static abstract sealed class ElseSchemaBoxed permits ElseSchemaBoxedVoid, ElseSchemaBoxedBoolean, ElseSchemaBoxedNumber, ElseSchemaBoxedString, ElseSchemaBoxedList, ElseSchemaBoxedMap { - public abstract @Nullable Object data(); + public sealed interface ElseSchemaBoxed permits ElseSchemaBoxedVoid, ElseSchemaBoxedBoolean, ElseSchemaBoxedNumber, ElseSchemaBoxedString, ElseSchemaBoxedList, ElseSchemaBoxedMap { + @Nullable Object getData(); } - public static final class ElseSchemaBoxedVoid extends ElseSchemaBoxed { - public final Void data; - private ElseSchemaBoxedVoid(Void data) { - this.data = data; - } + public record ElseSchemaBoxedVoid(Void data) implements ElseSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ElseSchemaBoxedBoolean extends ElseSchemaBoxed { - public final boolean data; - private ElseSchemaBoxedBoolean(boolean data) { - this.data = data; - } + public record ElseSchemaBoxedBoolean(boolean data) implements ElseSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ElseSchemaBoxedNumber extends ElseSchemaBoxed { - public final Number data; - private ElseSchemaBoxedNumber(Number data) { - this.data = data; - } + public record ElseSchemaBoxedNumber(Number data) implements ElseSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ElseSchemaBoxedString extends ElseSchemaBoxed { - public final String data; - private ElseSchemaBoxedString(String data) { - this.data = data; - } + public record ElseSchemaBoxedString(String data) implements ElseSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ElseSchemaBoxedList extends ElseSchemaBoxed { - public final FrozenList<@Nullable Object> data; - private ElseSchemaBoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record ElseSchemaBoxedList(FrozenList<@Nullable Object> data) implements ElseSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ElseSchemaBoxedMap extends ElseSchemaBoxed { - public final FrozenMap<@Nullable Object> data; - private ElseSchemaBoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record ElseSchemaBoxedMap(FrozenMap<@Nullable Object> data) implements ElseSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ElseSchema extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ElseSchemaBoxedList>, MapSchemaValidator, ElseSchemaBoxedMap> { + public static class ElseSchema extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ElseSchemaBoxedList>, MapSchemaValidator, ElseSchemaBoxedMap> { private static @Nullable ElseSchema instance = null; protected ElseSchema() { @@ -219,11 +195,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -254,11 +230,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -337,80 +313,75 @@ public ElseSchemaBoxedList validateAndBox(List arg, SchemaConfiguration confi public ElseSchemaBoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ElseSchemaBoxedMap(validate(arg, configuration)); } + @Override + public ElseSchemaBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class IfSchemaBoxed permits IfSchemaBoxedVoid, IfSchemaBoxedBoolean, IfSchemaBoxedNumber, IfSchemaBoxedString, IfSchemaBoxedList, IfSchemaBoxedMap { - public abstract @Nullable Object data(); + public sealed interface IfSchemaBoxed permits IfSchemaBoxedVoid, IfSchemaBoxedBoolean, IfSchemaBoxedNumber, IfSchemaBoxedString, IfSchemaBoxedList, IfSchemaBoxedMap { + @Nullable Object getData(); } - public static final class IfSchemaBoxedVoid extends IfSchemaBoxed { - public final Void data; - private IfSchemaBoxedVoid(Void data) { - this.data = data; - } + public record IfSchemaBoxedVoid(Void data) implements IfSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IfSchemaBoxedBoolean extends IfSchemaBoxed { - public final boolean data; - private IfSchemaBoxedBoolean(boolean data) { - this.data = data; - } + public record IfSchemaBoxedBoolean(boolean data) implements IfSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IfSchemaBoxedNumber extends IfSchemaBoxed { - public final Number data; - private IfSchemaBoxedNumber(Number data) { - this.data = data; - } + public record IfSchemaBoxedNumber(Number data) implements IfSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IfSchemaBoxedString extends IfSchemaBoxed { - public final String data; - private IfSchemaBoxedString(String data) { - this.data = data; - } + public record IfSchemaBoxedString(String data) implements IfSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IfSchemaBoxedList extends IfSchemaBoxed { - public final FrozenList<@Nullable Object> data; - private IfSchemaBoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record IfSchemaBoxedList(FrozenList<@Nullable Object> data) implements IfSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IfSchemaBoxedMap extends IfSchemaBoxed { - public final FrozenMap<@Nullable Object> data; - private IfSchemaBoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record IfSchemaBoxedMap(FrozenMap<@Nullable Object> data) implements IfSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class IfSchema extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, IfSchemaBoxedList>, MapSchemaValidator, IfSchemaBoxedMap> { + public static class IfSchema extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, IfSchemaBoxedList>, MapSchemaValidator, IfSchemaBoxedMap> { private static @Nullable IfSchema instance = null; protected IfSchema() { @@ -509,11 +480,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -544,11 +515,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -627,6 +598,25 @@ public IfSchemaBoxedList validateAndBox(List arg, SchemaConfiguration configu public IfSchemaBoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new IfSchemaBoxedMap(validate(arg, configuration)); } + @Override + public IfSchemaBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public enum StringThenConst implements StringValueMethod { YES("yes"); @@ -641,78 +631,54 @@ public String value() { } - public static abstract sealed class ThenBoxed permits ThenBoxedVoid, ThenBoxedBoolean, ThenBoxedNumber, ThenBoxedString, ThenBoxedList, ThenBoxedMap { - public abstract @Nullable Object data(); + public sealed interface ThenBoxed permits ThenBoxedVoid, ThenBoxedBoolean, ThenBoxedNumber, ThenBoxedString, ThenBoxedList, ThenBoxedMap { + @Nullable Object getData(); } - public static final class ThenBoxedVoid extends ThenBoxed { - public final Void data; - private ThenBoxedVoid(Void data) { - this.data = data; - } + public record ThenBoxedVoid(Void data) implements ThenBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ThenBoxedBoolean extends ThenBoxed { - public final boolean data; - private ThenBoxedBoolean(boolean data) { - this.data = data; - } + public record ThenBoxedBoolean(boolean data) implements ThenBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ThenBoxedNumber extends ThenBoxed { - public final Number data; - private ThenBoxedNumber(Number data) { - this.data = data; - } + public record ThenBoxedNumber(Number data) implements ThenBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ThenBoxedString extends ThenBoxed { - public final String data; - private ThenBoxedString(String data) { - this.data = data; - } + public record ThenBoxedString(String data) implements ThenBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ThenBoxedList extends ThenBoxed { - public final FrozenList<@Nullable Object> data; - private ThenBoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record ThenBoxedList(FrozenList<@Nullable Object> data) implements ThenBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ThenBoxedMap extends ThenBoxed { - public final FrozenMap<@Nullable Object> data; - private ThenBoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record ThenBoxedMap(FrozenMap<@Nullable Object> data) implements ThenBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Then extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ThenBoxedList>, MapSchemaValidator, ThenBoxedMap> { + public static class Then extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ThenBoxedList>, MapSchemaValidator, ThenBoxedMap> { private static @Nullable Then instance = null; protected Then() { @@ -811,11 +777,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -846,11 +812,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -929,80 +895,75 @@ public ThenBoxedList validateAndBox(List arg, SchemaConfiguration configurati public ThenBoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ThenBoxedMap(validate(arg, configuration)); } + @Override + public ThenBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1Boxed permits IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedVoid, IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedBoolean, IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedNumber, IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedString, IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedList, IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1Boxed permits IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedVoid, IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedBoolean, IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedNumber, IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedString, IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedList, IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedMap { + @Nullable Object getData(); } - public static final class IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedVoid extends IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1Boxed { - public final Void data; - private IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedVoid(Void data) { - this.data = data; - } + public record IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedVoid(Void data) implements IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedBoolean extends IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1Boxed { - public final boolean data; - private IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedBoolean(boolean data) { - this.data = data; - } + public record IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedBoolean(boolean data) implements IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedNumber extends IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1Boxed { - public final Number data; - private IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedNumber(Number data) { - this.data = data; - } + public record IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedNumber(Number data) implements IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedString extends IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1Boxed { - public final String data; - private IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedString(String data) { - this.data = data; - } + public record IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedString(String data) implements IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedList extends IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1Boxed { - public final FrozenList<@Nullable Object> data; - private IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedList(FrozenList<@Nullable Object> data) implements IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedMap extends IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1Boxed { - public final FrozenMap<@Nullable Object> data; - private IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedMap(FrozenMap<@Nullable Object> data) implements IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedList>, MapSchemaValidator, IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedMap> { + public static class IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedList>, MapSchemaValidator, IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -1109,11 +1070,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -1144,11 +1105,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -1227,5 +1188,24 @@ public IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedList valida public IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1BoxedMap(validate(arg, configuration)); } + @Override + public IfAppearsAtTheEndWhenSerializedKeywordProcessingSequence1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/IgnoreElseWithoutIf.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/IgnoreElseWithoutIf.java index 3eb0a723452..0cbc81ef544 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/IgnoreElseWithoutIf.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/IgnoreElseWithoutIf.java @@ -49,78 +49,54 @@ public String value() { } - public static abstract sealed class ElseSchemaBoxed permits ElseSchemaBoxedVoid, ElseSchemaBoxedBoolean, ElseSchemaBoxedNumber, ElseSchemaBoxedString, ElseSchemaBoxedList, ElseSchemaBoxedMap { - public abstract @Nullable Object data(); + public sealed interface ElseSchemaBoxed permits ElseSchemaBoxedVoid, ElseSchemaBoxedBoolean, ElseSchemaBoxedNumber, ElseSchemaBoxedString, ElseSchemaBoxedList, ElseSchemaBoxedMap { + @Nullable Object getData(); } - public static final class ElseSchemaBoxedVoid extends ElseSchemaBoxed { - public final Void data; - private ElseSchemaBoxedVoid(Void data) { - this.data = data; - } + public record ElseSchemaBoxedVoid(Void data) implements ElseSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ElseSchemaBoxedBoolean extends ElseSchemaBoxed { - public final boolean data; - private ElseSchemaBoxedBoolean(boolean data) { - this.data = data; - } + public record ElseSchemaBoxedBoolean(boolean data) implements ElseSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ElseSchemaBoxedNumber extends ElseSchemaBoxed { - public final Number data; - private ElseSchemaBoxedNumber(Number data) { - this.data = data; - } + public record ElseSchemaBoxedNumber(Number data) implements ElseSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ElseSchemaBoxedString extends ElseSchemaBoxed { - public final String data; - private ElseSchemaBoxedString(String data) { - this.data = data; - } + public record ElseSchemaBoxedString(String data) implements ElseSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ElseSchemaBoxedList extends ElseSchemaBoxed { - public final FrozenList<@Nullable Object> data; - private ElseSchemaBoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record ElseSchemaBoxedList(FrozenList<@Nullable Object> data) implements ElseSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ElseSchemaBoxedMap extends ElseSchemaBoxed { - public final FrozenMap<@Nullable Object> data; - private ElseSchemaBoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record ElseSchemaBoxedMap(FrozenMap<@Nullable Object> data) implements ElseSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ElseSchema extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ElseSchemaBoxedList>, MapSchemaValidator, ElseSchemaBoxedMap> { + public static class ElseSchema extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ElseSchemaBoxedList>, MapSchemaValidator, ElseSchemaBoxedMap> { private static @Nullable ElseSchema instance = null; protected ElseSchema() { @@ -219,11 +195,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -254,11 +230,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -337,80 +313,75 @@ public ElseSchemaBoxedList validateAndBox(List arg, SchemaConfiguration confi public ElseSchemaBoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ElseSchemaBoxedMap(validate(arg, configuration)); } + @Override + public ElseSchemaBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class IgnoreElseWithoutIf1Boxed permits IgnoreElseWithoutIf1BoxedVoid, IgnoreElseWithoutIf1BoxedBoolean, IgnoreElseWithoutIf1BoxedNumber, IgnoreElseWithoutIf1BoxedString, IgnoreElseWithoutIf1BoxedList, IgnoreElseWithoutIf1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface IgnoreElseWithoutIf1Boxed permits IgnoreElseWithoutIf1BoxedVoid, IgnoreElseWithoutIf1BoxedBoolean, IgnoreElseWithoutIf1BoxedNumber, IgnoreElseWithoutIf1BoxedString, IgnoreElseWithoutIf1BoxedList, IgnoreElseWithoutIf1BoxedMap { + @Nullable Object getData(); } - public static final class IgnoreElseWithoutIf1BoxedVoid extends IgnoreElseWithoutIf1Boxed { - public final Void data; - private IgnoreElseWithoutIf1BoxedVoid(Void data) { - this.data = data; - } + public record IgnoreElseWithoutIf1BoxedVoid(Void data) implements IgnoreElseWithoutIf1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IgnoreElseWithoutIf1BoxedBoolean extends IgnoreElseWithoutIf1Boxed { - public final boolean data; - private IgnoreElseWithoutIf1BoxedBoolean(boolean data) { - this.data = data; - } + public record IgnoreElseWithoutIf1BoxedBoolean(boolean data) implements IgnoreElseWithoutIf1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IgnoreElseWithoutIf1BoxedNumber extends IgnoreElseWithoutIf1Boxed { - public final Number data; - private IgnoreElseWithoutIf1BoxedNumber(Number data) { - this.data = data; - } + public record IgnoreElseWithoutIf1BoxedNumber(Number data) implements IgnoreElseWithoutIf1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IgnoreElseWithoutIf1BoxedString extends IgnoreElseWithoutIf1Boxed { - public final String data; - private IgnoreElseWithoutIf1BoxedString(String data) { - this.data = data; - } + public record IgnoreElseWithoutIf1BoxedString(String data) implements IgnoreElseWithoutIf1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IgnoreElseWithoutIf1BoxedList extends IgnoreElseWithoutIf1Boxed { - public final FrozenList<@Nullable Object> data; - private IgnoreElseWithoutIf1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record IgnoreElseWithoutIf1BoxedList(FrozenList<@Nullable Object> data) implements IgnoreElseWithoutIf1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IgnoreElseWithoutIf1BoxedMap extends IgnoreElseWithoutIf1Boxed { - public final FrozenMap<@Nullable Object> data; - private IgnoreElseWithoutIf1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record IgnoreElseWithoutIf1BoxedMap(FrozenMap<@Nullable Object> data) implements IgnoreElseWithoutIf1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class IgnoreElseWithoutIf1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, IgnoreElseWithoutIf1BoxedList>, MapSchemaValidator, IgnoreElseWithoutIf1BoxedMap> { + public static class IgnoreElseWithoutIf1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, IgnoreElseWithoutIf1BoxedList>, MapSchemaValidator, IgnoreElseWithoutIf1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -515,11 +486,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -550,11 +521,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -633,5 +604,24 @@ public IgnoreElseWithoutIf1BoxedList validateAndBox(List arg, SchemaConfigura public IgnoreElseWithoutIf1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new IgnoreElseWithoutIf1BoxedMap(validate(arg, configuration)); } + @Override + public IgnoreElseWithoutIf1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/IgnoreIfWithoutThenOrElse.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/IgnoreIfWithoutThenOrElse.java index 3d76e4f54c9..6bbdcfddf62 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/IgnoreIfWithoutThenOrElse.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/IgnoreIfWithoutThenOrElse.java @@ -49,78 +49,54 @@ public String value() { } - public static abstract sealed class IfSchemaBoxed permits IfSchemaBoxedVoid, IfSchemaBoxedBoolean, IfSchemaBoxedNumber, IfSchemaBoxedString, IfSchemaBoxedList, IfSchemaBoxedMap { - public abstract @Nullable Object data(); + public sealed interface IfSchemaBoxed permits IfSchemaBoxedVoid, IfSchemaBoxedBoolean, IfSchemaBoxedNumber, IfSchemaBoxedString, IfSchemaBoxedList, IfSchemaBoxedMap { + @Nullable Object getData(); } - public static final class IfSchemaBoxedVoid extends IfSchemaBoxed { - public final Void data; - private IfSchemaBoxedVoid(Void data) { - this.data = data; - } + public record IfSchemaBoxedVoid(Void data) implements IfSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IfSchemaBoxedBoolean extends IfSchemaBoxed { - public final boolean data; - private IfSchemaBoxedBoolean(boolean data) { - this.data = data; - } + public record IfSchemaBoxedBoolean(boolean data) implements IfSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IfSchemaBoxedNumber extends IfSchemaBoxed { - public final Number data; - private IfSchemaBoxedNumber(Number data) { - this.data = data; - } + public record IfSchemaBoxedNumber(Number data) implements IfSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IfSchemaBoxedString extends IfSchemaBoxed { - public final String data; - private IfSchemaBoxedString(String data) { - this.data = data; - } + public record IfSchemaBoxedString(String data) implements IfSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IfSchemaBoxedList extends IfSchemaBoxed { - public final FrozenList<@Nullable Object> data; - private IfSchemaBoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record IfSchemaBoxedList(FrozenList<@Nullable Object> data) implements IfSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IfSchemaBoxedMap extends IfSchemaBoxed { - public final FrozenMap<@Nullable Object> data; - private IfSchemaBoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record IfSchemaBoxedMap(FrozenMap<@Nullable Object> data) implements IfSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class IfSchema extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, IfSchemaBoxedList>, MapSchemaValidator, IfSchemaBoxedMap> { + public static class IfSchema extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, IfSchemaBoxedList>, MapSchemaValidator, IfSchemaBoxedMap> { private static @Nullable IfSchema instance = null; protected IfSchema() { @@ -219,11 +195,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -254,11 +230,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -337,80 +313,75 @@ public IfSchemaBoxedList validateAndBox(List arg, SchemaConfiguration configu public IfSchemaBoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new IfSchemaBoxedMap(validate(arg, configuration)); } + @Override + public IfSchemaBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class IgnoreIfWithoutThenOrElse1Boxed permits IgnoreIfWithoutThenOrElse1BoxedVoid, IgnoreIfWithoutThenOrElse1BoxedBoolean, IgnoreIfWithoutThenOrElse1BoxedNumber, IgnoreIfWithoutThenOrElse1BoxedString, IgnoreIfWithoutThenOrElse1BoxedList, IgnoreIfWithoutThenOrElse1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface IgnoreIfWithoutThenOrElse1Boxed permits IgnoreIfWithoutThenOrElse1BoxedVoid, IgnoreIfWithoutThenOrElse1BoxedBoolean, IgnoreIfWithoutThenOrElse1BoxedNumber, IgnoreIfWithoutThenOrElse1BoxedString, IgnoreIfWithoutThenOrElse1BoxedList, IgnoreIfWithoutThenOrElse1BoxedMap { + @Nullable Object getData(); } - public static final class IgnoreIfWithoutThenOrElse1BoxedVoid extends IgnoreIfWithoutThenOrElse1Boxed { - public final Void data; - private IgnoreIfWithoutThenOrElse1BoxedVoid(Void data) { - this.data = data; - } + public record IgnoreIfWithoutThenOrElse1BoxedVoid(Void data) implements IgnoreIfWithoutThenOrElse1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IgnoreIfWithoutThenOrElse1BoxedBoolean extends IgnoreIfWithoutThenOrElse1Boxed { - public final boolean data; - private IgnoreIfWithoutThenOrElse1BoxedBoolean(boolean data) { - this.data = data; - } + public record IgnoreIfWithoutThenOrElse1BoxedBoolean(boolean data) implements IgnoreIfWithoutThenOrElse1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IgnoreIfWithoutThenOrElse1BoxedNumber extends IgnoreIfWithoutThenOrElse1Boxed { - public final Number data; - private IgnoreIfWithoutThenOrElse1BoxedNumber(Number data) { - this.data = data; - } + public record IgnoreIfWithoutThenOrElse1BoxedNumber(Number data) implements IgnoreIfWithoutThenOrElse1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IgnoreIfWithoutThenOrElse1BoxedString extends IgnoreIfWithoutThenOrElse1Boxed { - public final String data; - private IgnoreIfWithoutThenOrElse1BoxedString(String data) { - this.data = data; - } + public record IgnoreIfWithoutThenOrElse1BoxedString(String data) implements IgnoreIfWithoutThenOrElse1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IgnoreIfWithoutThenOrElse1BoxedList extends IgnoreIfWithoutThenOrElse1Boxed { - public final FrozenList<@Nullable Object> data; - private IgnoreIfWithoutThenOrElse1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record IgnoreIfWithoutThenOrElse1BoxedList(FrozenList<@Nullable Object> data) implements IgnoreIfWithoutThenOrElse1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IgnoreIfWithoutThenOrElse1BoxedMap extends IgnoreIfWithoutThenOrElse1Boxed { - public final FrozenMap<@Nullable Object> data; - private IgnoreIfWithoutThenOrElse1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record IgnoreIfWithoutThenOrElse1BoxedMap(FrozenMap<@Nullable Object> data) implements IgnoreIfWithoutThenOrElse1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class IgnoreIfWithoutThenOrElse1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, IgnoreIfWithoutThenOrElse1BoxedList>, MapSchemaValidator, IgnoreIfWithoutThenOrElse1BoxedMap> { + public static class IgnoreIfWithoutThenOrElse1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, IgnoreIfWithoutThenOrElse1BoxedList>, MapSchemaValidator, IgnoreIfWithoutThenOrElse1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -515,11 +486,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -550,11 +521,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -633,5 +604,24 @@ public IgnoreIfWithoutThenOrElse1BoxedList validateAndBox(List arg, SchemaCon public IgnoreIfWithoutThenOrElse1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new IgnoreIfWithoutThenOrElse1BoxedMap(validate(arg, configuration)); } + @Override + public IgnoreIfWithoutThenOrElse1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/IgnoreThenWithoutIf.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/IgnoreThenWithoutIf.java index d0f255a67f4..abcecbb52ff 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/IgnoreThenWithoutIf.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/IgnoreThenWithoutIf.java @@ -49,78 +49,54 @@ public String value() { } - public static abstract sealed class ThenBoxed permits ThenBoxedVoid, ThenBoxedBoolean, ThenBoxedNumber, ThenBoxedString, ThenBoxedList, ThenBoxedMap { - public abstract @Nullable Object data(); + public sealed interface ThenBoxed permits ThenBoxedVoid, ThenBoxedBoolean, ThenBoxedNumber, ThenBoxedString, ThenBoxedList, ThenBoxedMap { + @Nullable Object getData(); } - public static final class ThenBoxedVoid extends ThenBoxed { - public final Void data; - private ThenBoxedVoid(Void data) { - this.data = data; - } + public record ThenBoxedVoid(Void data) implements ThenBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ThenBoxedBoolean extends ThenBoxed { - public final boolean data; - private ThenBoxedBoolean(boolean data) { - this.data = data; - } + public record ThenBoxedBoolean(boolean data) implements ThenBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ThenBoxedNumber extends ThenBoxed { - public final Number data; - private ThenBoxedNumber(Number data) { - this.data = data; - } + public record ThenBoxedNumber(Number data) implements ThenBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ThenBoxedString extends ThenBoxed { - public final String data; - private ThenBoxedString(String data) { - this.data = data; - } + public record ThenBoxedString(String data) implements ThenBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ThenBoxedList extends ThenBoxed { - public final FrozenList<@Nullable Object> data; - private ThenBoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record ThenBoxedList(FrozenList<@Nullable Object> data) implements ThenBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ThenBoxedMap extends ThenBoxed { - public final FrozenMap<@Nullable Object> data; - private ThenBoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record ThenBoxedMap(FrozenMap<@Nullable Object> data) implements ThenBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Then extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ThenBoxedList>, MapSchemaValidator, ThenBoxedMap> { + public static class Then extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ThenBoxedList>, MapSchemaValidator, ThenBoxedMap> { private static @Nullable Then instance = null; protected Then() { @@ -219,11 +195,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -254,11 +230,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -337,80 +313,75 @@ public ThenBoxedList validateAndBox(List arg, SchemaConfiguration configurati public ThenBoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ThenBoxedMap(validate(arg, configuration)); } + @Override + public ThenBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class IgnoreThenWithoutIf1Boxed permits IgnoreThenWithoutIf1BoxedVoid, IgnoreThenWithoutIf1BoxedBoolean, IgnoreThenWithoutIf1BoxedNumber, IgnoreThenWithoutIf1BoxedString, IgnoreThenWithoutIf1BoxedList, IgnoreThenWithoutIf1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface IgnoreThenWithoutIf1Boxed permits IgnoreThenWithoutIf1BoxedVoid, IgnoreThenWithoutIf1BoxedBoolean, IgnoreThenWithoutIf1BoxedNumber, IgnoreThenWithoutIf1BoxedString, IgnoreThenWithoutIf1BoxedList, IgnoreThenWithoutIf1BoxedMap { + @Nullable Object getData(); } - public static final class IgnoreThenWithoutIf1BoxedVoid extends IgnoreThenWithoutIf1Boxed { - public final Void data; - private IgnoreThenWithoutIf1BoxedVoid(Void data) { - this.data = data; - } + public record IgnoreThenWithoutIf1BoxedVoid(Void data) implements IgnoreThenWithoutIf1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IgnoreThenWithoutIf1BoxedBoolean extends IgnoreThenWithoutIf1Boxed { - public final boolean data; - private IgnoreThenWithoutIf1BoxedBoolean(boolean data) { - this.data = data; - } + public record IgnoreThenWithoutIf1BoxedBoolean(boolean data) implements IgnoreThenWithoutIf1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IgnoreThenWithoutIf1BoxedNumber extends IgnoreThenWithoutIf1Boxed { - public final Number data; - private IgnoreThenWithoutIf1BoxedNumber(Number data) { - this.data = data; - } + public record IgnoreThenWithoutIf1BoxedNumber(Number data) implements IgnoreThenWithoutIf1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IgnoreThenWithoutIf1BoxedString extends IgnoreThenWithoutIf1Boxed { - public final String data; - private IgnoreThenWithoutIf1BoxedString(String data) { - this.data = data; - } + public record IgnoreThenWithoutIf1BoxedString(String data) implements IgnoreThenWithoutIf1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IgnoreThenWithoutIf1BoxedList extends IgnoreThenWithoutIf1Boxed { - public final FrozenList<@Nullable Object> data; - private IgnoreThenWithoutIf1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record IgnoreThenWithoutIf1BoxedList(FrozenList<@Nullable Object> data) implements IgnoreThenWithoutIf1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IgnoreThenWithoutIf1BoxedMap extends IgnoreThenWithoutIf1Boxed { - public final FrozenMap<@Nullable Object> data; - private IgnoreThenWithoutIf1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record IgnoreThenWithoutIf1BoxedMap(FrozenMap<@Nullable Object> data) implements IgnoreThenWithoutIf1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class IgnoreThenWithoutIf1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, IgnoreThenWithoutIf1BoxedList>, MapSchemaValidator, IgnoreThenWithoutIf1BoxedMap> { + public static class IgnoreThenWithoutIf1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, IgnoreThenWithoutIf1BoxedList>, MapSchemaValidator, IgnoreThenWithoutIf1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -515,11 +486,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -550,11 +521,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -633,5 +604,24 @@ public IgnoreThenWithoutIf1BoxedList validateAndBox(List arg, SchemaConfigura public IgnoreThenWithoutIf1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new IgnoreThenWithoutIf1BoxedMap(validate(arg, configuration)); } + @Override + public IgnoreThenWithoutIf1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv4Format.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv4Format.java index d891e096c49..9db27444b5d 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv4Format.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv4Format.java @@ -35,78 +35,54 @@ public class Ipv4Format { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class Ipv4Format1Boxed permits Ipv4Format1BoxedVoid, Ipv4Format1BoxedBoolean, Ipv4Format1BoxedNumber, Ipv4Format1BoxedString, Ipv4Format1BoxedList, Ipv4Format1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Ipv4Format1Boxed permits Ipv4Format1BoxedVoid, Ipv4Format1BoxedBoolean, Ipv4Format1BoxedNumber, Ipv4Format1BoxedString, Ipv4Format1BoxedList, Ipv4Format1BoxedMap { + @Nullable Object getData(); } - public static final class Ipv4Format1BoxedVoid extends Ipv4Format1Boxed { - public final Void data; - private Ipv4Format1BoxedVoid(Void data) { - this.data = data; - } + public record Ipv4Format1BoxedVoid(Void data) implements Ipv4Format1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Ipv4Format1BoxedBoolean extends Ipv4Format1Boxed { - public final boolean data; - private Ipv4Format1BoxedBoolean(boolean data) { - this.data = data; - } + public record Ipv4Format1BoxedBoolean(boolean data) implements Ipv4Format1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Ipv4Format1BoxedNumber extends Ipv4Format1Boxed { - public final Number data; - private Ipv4Format1BoxedNumber(Number data) { - this.data = data; - } + public record Ipv4Format1BoxedNumber(Number data) implements Ipv4Format1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Ipv4Format1BoxedString extends Ipv4Format1Boxed { - public final String data; - private Ipv4Format1BoxedString(String data) { - this.data = data; - } + public record Ipv4Format1BoxedString(String data) implements Ipv4Format1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Ipv4Format1BoxedList extends Ipv4Format1Boxed { - public final FrozenList<@Nullable Object> data; - private Ipv4Format1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Ipv4Format1BoxedList(FrozenList<@Nullable Object> data) implements Ipv4Format1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Ipv4Format1BoxedMap extends Ipv4Format1Boxed { - public final FrozenMap<@Nullable Object> data; - private Ipv4Format1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record Ipv4Format1BoxedMap(FrozenMap<@Nullable Object> data) implements Ipv4Format1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Ipv4Format1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Ipv4Format1BoxedList>, MapSchemaValidator, Ipv4Format1BoxedMap> { + public static class Ipv4Format1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Ipv4Format1BoxedList>, MapSchemaValidator, Ipv4Format1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -211,11 +187,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -246,11 +222,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -329,5 +305,24 @@ public Ipv4Format1BoxedList validateAndBox(List arg, SchemaConfiguration conf public Ipv4Format1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Ipv4Format1BoxedMap(validate(arg, configuration)); } + @Override + public Ipv4Format1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv6Format.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv6Format.java index a951cba8480..f52011acf83 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv6Format.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Ipv6Format.java @@ -35,78 +35,54 @@ public class Ipv6Format { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class Ipv6Format1Boxed permits Ipv6Format1BoxedVoid, Ipv6Format1BoxedBoolean, Ipv6Format1BoxedNumber, Ipv6Format1BoxedString, Ipv6Format1BoxedList, Ipv6Format1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Ipv6Format1Boxed permits Ipv6Format1BoxedVoid, Ipv6Format1BoxedBoolean, Ipv6Format1BoxedNumber, Ipv6Format1BoxedString, Ipv6Format1BoxedList, Ipv6Format1BoxedMap { + @Nullable Object getData(); } - public static final class Ipv6Format1BoxedVoid extends Ipv6Format1Boxed { - public final Void data; - private Ipv6Format1BoxedVoid(Void data) { - this.data = data; - } + public record Ipv6Format1BoxedVoid(Void data) implements Ipv6Format1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Ipv6Format1BoxedBoolean extends Ipv6Format1Boxed { - public final boolean data; - private Ipv6Format1BoxedBoolean(boolean data) { - this.data = data; - } + public record Ipv6Format1BoxedBoolean(boolean data) implements Ipv6Format1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Ipv6Format1BoxedNumber extends Ipv6Format1Boxed { - public final Number data; - private Ipv6Format1BoxedNumber(Number data) { - this.data = data; - } + public record Ipv6Format1BoxedNumber(Number data) implements Ipv6Format1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Ipv6Format1BoxedString extends Ipv6Format1Boxed { - public final String data; - private Ipv6Format1BoxedString(String data) { - this.data = data; - } + public record Ipv6Format1BoxedString(String data) implements Ipv6Format1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Ipv6Format1BoxedList extends Ipv6Format1Boxed { - public final FrozenList<@Nullable Object> data; - private Ipv6Format1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Ipv6Format1BoxedList(FrozenList<@Nullable Object> data) implements Ipv6Format1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Ipv6Format1BoxedMap extends Ipv6Format1Boxed { - public final FrozenMap<@Nullable Object> data; - private Ipv6Format1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record Ipv6Format1BoxedMap(FrozenMap<@Nullable Object> data) implements Ipv6Format1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Ipv6Format1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Ipv6Format1BoxedList>, MapSchemaValidator, Ipv6Format1BoxedMap> { + public static class Ipv6Format1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Ipv6Format1BoxedList>, MapSchemaValidator, Ipv6Format1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -211,11 +187,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -246,11 +222,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -329,5 +305,24 @@ public Ipv6Format1BoxedList validateAndBox(List arg, SchemaConfiguration conf public Ipv6Format1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Ipv6Format1BoxedMap(validate(arg, configuration)); } + @Override + public Ipv6Format1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/IriFormat.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/IriFormat.java index 84213229cb7..b1482c09cfd 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/IriFormat.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/IriFormat.java @@ -35,78 +35,54 @@ public class IriFormat { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class IriFormat1Boxed permits IriFormat1BoxedVoid, IriFormat1BoxedBoolean, IriFormat1BoxedNumber, IriFormat1BoxedString, IriFormat1BoxedList, IriFormat1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface IriFormat1Boxed permits IriFormat1BoxedVoid, IriFormat1BoxedBoolean, IriFormat1BoxedNumber, IriFormat1BoxedString, IriFormat1BoxedList, IriFormat1BoxedMap { + @Nullable Object getData(); } - public static final class IriFormat1BoxedVoid extends IriFormat1Boxed { - public final Void data; - private IriFormat1BoxedVoid(Void data) { - this.data = data; - } + public record IriFormat1BoxedVoid(Void data) implements IriFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IriFormat1BoxedBoolean extends IriFormat1Boxed { - public final boolean data; - private IriFormat1BoxedBoolean(boolean data) { - this.data = data; - } + public record IriFormat1BoxedBoolean(boolean data) implements IriFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IriFormat1BoxedNumber extends IriFormat1Boxed { - public final Number data; - private IriFormat1BoxedNumber(Number data) { - this.data = data; - } + public record IriFormat1BoxedNumber(Number data) implements IriFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IriFormat1BoxedString extends IriFormat1Boxed { - public final String data; - private IriFormat1BoxedString(String data) { - this.data = data; - } + public record IriFormat1BoxedString(String data) implements IriFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IriFormat1BoxedList extends IriFormat1Boxed { - public final FrozenList<@Nullable Object> data; - private IriFormat1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record IriFormat1BoxedList(FrozenList<@Nullable Object> data) implements IriFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IriFormat1BoxedMap extends IriFormat1Boxed { - public final FrozenMap<@Nullable Object> data; - private IriFormat1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record IriFormat1BoxedMap(FrozenMap<@Nullable Object> data) implements IriFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class IriFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, IriFormat1BoxedList>, MapSchemaValidator, IriFormat1BoxedMap> { + public static class IriFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, IriFormat1BoxedList>, MapSchemaValidator, IriFormat1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -211,11 +187,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -246,11 +222,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -329,5 +305,24 @@ public IriFormat1BoxedList validateAndBox(List arg, SchemaConfiguration confi public IriFormat1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new IriFormat1BoxedMap(validate(arg, configuration)); } + @Override + public IriFormat1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/IriReferenceFormat.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/IriReferenceFormat.java index 4af8f299df4..121084c5602 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/IriReferenceFormat.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/IriReferenceFormat.java @@ -35,78 +35,54 @@ public class IriReferenceFormat { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class IriReferenceFormat1Boxed permits IriReferenceFormat1BoxedVoid, IriReferenceFormat1BoxedBoolean, IriReferenceFormat1BoxedNumber, IriReferenceFormat1BoxedString, IriReferenceFormat1BoxedList, IriReferenceFormat1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface IriReferenceFormat1Boxed permits IriReferenceFormat1BoxedVoid, IriReferenceFormat1BoxedBoolean, IriReferenceFormat1BoxedNumber, IriReferenceFormat1BoxedString, IriReferenceFormat1BoxedList, IriReferenceFormat1BoxedMap { + @Nullable Object getData(); } - public static final class IriReferenceFormat1BoxedVoid extends IriReferenceFormat1Boxed { - public final Void data; - private IriReferenceFormat1BoxedVoid(Void data) { - this.data = data; - } + public record IriReferenceFormat1BoxedVoid(Void data) implements IriReferenceFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IriReferenceFormat1BoxedBoolean extends IriReferenceFormat1Boxed { - public final boolean data; - private IriReferenceFormat1BoxedBoolean(boolean data) { - this.data = data; - } + public record IriReferenceFormat1BoxedBoolean(boolean data) implements IriReferenceFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IriReferenceFormat1BoxedNumber extends IriReferenceFormat1Boxed { - public final Number data; - private IriReferenceFormat1BoxedNumber(Number data) { - this.data = data; - } + public record IriReferenceFormat1BoxedNumber(Number data) implements IriReferenceFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IriReferenceFormat1BoxedString extends IriReferenceFormat1Boxed { - public final String data; - private IriReferenceFormat1BoxedString(String data) { - this.data = data; - } + public record IriReferenceFormat1BoxedString(String data) implements IriReferenceFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IriReferenceFormat1BoxedList extends IriReferenceFormat1Boxed { - public final FrozenList<@Nullable Object> data; - private IriReferenceFormat1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record IriReferenceFormat1BoxedList(FrozenList<@Nullable Object> data) implements IriReferenceFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IriReferenceFormat1BoxedMap extends IriReferenceFormat1Boxed { - public final FrozenMap<@Nullable Object> data; - private IriReferenceFormat1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record IriReferenceFormat1BoxedMap(FrozenMap<@Nullable Object> data) implements IriReferenceFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class IriReferenceFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, IriReferenceFormat1BoxedList>, MapSchemaValidator, IriReferenceFormat1BoxedMap> { + public static class IriReferenceFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, IriReferenceFormat1BoxedList>, MapSchemaValidator, IriReferenceFormat1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -211,11 +187,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -246,11 +222,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -329,5 +305,24 @@ public IriReferenceFormat1BoxedList validateAndBox(List arg, SchemaConfigurat public IriReferenceFormat1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new IriReferenceFormat1BoxedMap(validate(arg, configuration)); } + @Override + public IriReferenceFormat1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ItemsContains.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ItemsContains.java index bb03a69bebe..e385e5dd4c0 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ItemsContains.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ItemsContains.java @@ -36,78 +36,54 @@ public class ItemsContains { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class ContainsBoxed permits ContainsBoxedVoid, ContainsBoxedBoolean, ContainsBoxedNumber, ContainsBoxedString, ContainsBoxedList, ContainsBoxedMap { - public abstract @Nullable Object data(); + public sealed interface ContainsBoxed permits ContainsBoxedVoid, ContainsBoxedBoolean, ContainsBoxedNumber, ContainsBoxedString, ContainsBoxedList, ContainsBoxedMap { + @Nullable Object getData(); } - public static final class ContainsBoxedVoid extends ContainsBoxed { - public final Void data; - private ContainsBoxedVoid(Void data) { - this.data = data; - } + public record ContainsBoxedVoid(Void data) implements ContainsBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ContainsBoxedBoolean extends ContainsBoxed { - public final boolean data; - private ContainsBoxedBoolean(boolean data) { - this.data = data; - } + public record ContainsBoxedBoolean(boolean data) implements ContainsBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ContainsBoxedNumber extends ContainsBoxed { - public final Number data; - private ContainsBoxedNumber(Number data) { - this.data = data; - } + public record ContainsBoxedNumber(Number data) implements ContainsBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ContainsBoxedString extends ContainsBoxed { - public final String data; - private ContainsBoxedString(String data) { - this.data = data; - } + public record ContainsBoxedString(String data) implements ContainsBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ContainsBoxedList extends ContainsBoxed { - public final FrozenList<@Nullable Object> data; - private ContainsBoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record ContainsBoxedList(FrozenList<@Nullable Object> data) implements ContainsBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ContainsBoxedMap extends ContainsBoxed { - public final FrozenMap<@Nullable Object> data; - private ContainsBoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record ContainsBoxedMap(FrozenMap<@Nullable Object> data) implements ContainsBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Contains extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ContainsBoxedList>, MapSchemaValidator, ContainsBoxedMap> { + public static class Contains extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ContainsBoxedList>, MapSchemaValidator, ContainsBoxedMap> { private static @Nullable Contains instance = null; protected Contains() { @@ -206,11 +182,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -241,11 +217,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -324,80 +300,75 @@ public ContainsBoxedList validateAndBox(List arg, SchemaConfiguration configu public ContainsBoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ContainsBoxedMap(validate(arg, configuration)); } + @Override + public ContainsBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class ItemsBoxed permits ItemsBoxedVoid, ItemsBoxedBoolean, ItemsBoxedNumber, ItemsBoxedString, ItemsBoxedList, ItemsBoxedMap { - public abstract @Nullable Object data(); + public sealed interface ItemsBoxed permits ItemsBoxedVoid, ItemsBoxedBoolean, ItemsBoxedNumber, ItemsBoxedString, ItemsBoxedList, ItemsBoxedMap { + @Nullable Object getData(); } - public static final class ItemsBoxedVoid extends ItemsBoxed { - public final Void data; - private ItemsBoxedVoid(Void data) { - this.data = data; - } + public record ItemsBoxedVoid(Void data) implements ItemsBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ItemsBoxedBoolean extends ItemsBoxed { - public final boolean data; - private ItemsBoxedBoolean(boolean data) { - this.data = data; - } + public record ItemsBoxedBoolean(boolean data) implements ItemsBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ItemsBoxedNumber extends ItemsBoxed { - public final Number data; - private ItemsBoxedNumber(Number data) { - this.data = data; - } + public record ItemsBoxedNumber(Number data) implements ItemsBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ItemsBoxedString extends ItemsBoxed { - public final String data; - private ItemsBoxedString(String data) { - this.data = data; - } + public record ItemsBoxedString(String data) implements ItemsBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ItemsBoxedList extends ItemsBoxed { - public final FrozenList<@Nullable Object> data; - private ItemsBoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record ItemsBoxedList(FrozenList<@Nullable Object> data) implements ItemsBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ItemsBoxedMap extends ItemsBoxed { - public final FrozenMap<@Nullable Object> data; - private ItemsBoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record ItemsBoxedMap(FrozenMap<@Nullable Object> data) implements ItemsBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Items extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ItemsBoxedList>, MapSchemaValidator, ItemsBoxedMap> { + public static class Items extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ItemsBoxedList>, MapSchemaValidator, ItemsBoxedMap> { private static @Nullable Items instance = null; protected Items() { @@ -496,11 +467,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -531,11 +502,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -614,6 +585,25 @@ public ItemsBoxedList validateAndBox(List arg, SchemaConfiguration configurat public ItemsBoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ItemsBoxedMap(validate(arg, configuration)); } + @Override + public ItemsBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class ItemsContainsList extends FrozenList<@Nullable Object> { @@ -688,24 +678,20 @@ public ItemsContainsListBuilder add(Map item) { } - public static abstract sealed class ItemsContains1Boxed permits ItemsContains1BoxedList { - public abstract @Nullable Object data(); + public sealed interface ItemsContains1Boxed permits ItemsContains1BoxedList { + @Nullable Object getData(); } - public static final class ItemsContains1BoxedList extends ItemsContains1Boxed { - public final ItemsContainsList data; - private ItemsContains1BoxedList(ItemsContainsList data) { - this.data = data; - } + public record ItemsContains1BoxedList(ItemsContainsList data) implements ItemsContains1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ItemsContains1 extends JsonSchema implements ListSchemaValidator { + public static class ItemsContains1 extends JsonSchema implements ListSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -736,11 +722,11 @@ public ItemsContainsList getNewInstance(List arg, List pathToItem, Pa for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -777,5 +763,12 @@ public ItemsContainsList validate(List arg, SchemaConfiguration configuration public ItemsContains1BoxedList validateAndBox(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ItemsContains1BoxedList(validate(arg, configuration)); } + @Override + public ItemsContains1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ItemsDoesNotLookInApplicatorsValidCase.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ItemsDoesNotLookInApplicatorsValidCase.java index 1004bdddb55..f5abd8a53f1 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ItemsDoesNotLookInApplicatorsValidCase.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ItemsDoesNotLookInApplicatorsValidCase.java @@ -35,78 +35,54 @@ public class ItemsDoesNotLookInApplicatorsValidCase { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class ItemsBoxed permits ItemsBoxedVoid, ItemsBoxedBoolean, ItemsBoxedNumber, ItemsBoxedString, ItemsBoxedList, ItemsBoxedMap { - public abstract @Nullable Object data(); + public sealed interface ItemsBoxed permits ItemsBoxedVoid, ItemsBoxedBoolean, ItemsBoxedNumber, ItemsBoxedString, ItemsBoxedList, ItemsBoxedMap { + @Nullable Object getData(); } - public static final class ItemsBoxedVoid extends ItemsBoxed { - public final Void data; - private ItemsBoxedVoid(Void data) { - this.data = data; - } + public record ItemsBoxedVoid(Void data) implements ItemsBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ItemsBoxedBoolean extends ItemsBoxed { - public final boolean data; - private ItemsBoxedBoolean(boolean data) { - this.data = data; - } + public record ItemsBoxedBoolean(boolean data) implements ItemsBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ItemsBoxedNumber extends ItemsBoxed { - public final Number data; - private ItemsBoxedNumber(Number data) { - this.data = data; - } + public record ItemsBoxedNumber(Number data) implements ItemsBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ItemsBoxedString extends ItemsBoxed { - public final String data; - private ItemsBoxedString(String data) { - this.data = data; - } + public record ItemsBoxedString(String data) implements ItemsBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ItemsBoxedList extends ItemsBoxed { - public final FrozenList<@Nullable Object> data; - private ItemsBoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record ItemsBoxedList(FrozenList<@Nullable Object> data) implements ItemsBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ItemsBoxedMap extends ItemsBoxed { - public final FrozenMap<@Nullable Object> data; - private ItemsBoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record ItemsBoxedMap(FrozenMap<@Nullable Object> data) implements ItemsBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Items extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ItemsBoxedList>, MapSchemaValidator, ItemsBoxedMap> { + public static class Items extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ItemsBoxedList>, MapSchemaValidator, ItemsBoxedMap> { private static @Nullable Items instance = null; protected Items() { @@ -205,11 +181,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -240,11 +216,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -323,6 +299,25 @@ public ItemsBoxedList validateAndBox(List arg, SchemaConfiguration configurat public ItemsBoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ItemsBoxedMap(validate(arg, configuration)); } + @Override + public ItemsBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class ItemsDoesNotLookInApplicatorsValidCaseList extends FrozenList<@Nullable Object> { @@ -397,24 +392,20 @@ public ItemsDoesNotLookInApplicatorsValidCaseListBuilder add(Map item } - public static abstract sealed class ItemsDoesNotLookInApplicatorsValidCase1Boxed permits ItemsDoesNotLookInApplicatorsValidCase1BoxedList { - public abstract @Nullable Object data(); + public sealed interface ItemsDoesNotLookInApplicatorsValidCase1Boxed permits ItemsDoesNotLookInApplicatorsValidCase1BoxedList { + @Nullable Object getData(); } - public static final class ItemsDoesNotLookInApplicatorsValidCase1BoxedList extends ItemsDoesNotLookInApplicatorsValidCase1Boxed { - public final ItemsDoesNotLookInApplicatorsValidCaseList data; - private ItemsDoesNotLookInApplicatorsValidCase1BoxedList(ItemsDoesNotLookInApplicatorsValidCaseList data) { - this.data = data; - } + public record ItemsDoesNotLookInApplicatorsValidCase1BoxedList(ItemsDoesNotLookInApplicatorsValidCaseList data) implements ItemsDoesNotLookInApplicatorsValidCase1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ItemsDoesNotLookInApplicatorsValidCase1 extends JsonSchema implements ListSchemaValidator { + public static class ItemsDoesNotLookInApplicatorsValidCase1 extends JsonSchema implements ListSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -444,11 +435,11 @@ public ItemsDoesNotLookInApplicatorsValidCaseList getNewInstance(List arg, Li for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -485,5 +476,12 @@ public ItemsDoesNotLookInApplicatorsValidCaseList validate(List arg, SchemaCo public ItemsDoesNotLookInApplicatorsValidCase1BoxedList validateAndBox(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ItemsDoesNotLookInApplicatorsValidCase1BoxedList(validate(arg, configuration)); } + @Override + public ItemsDoesNotLookInApplicatorsValidCase1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ItemsWithNullInstanceElements.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ItemsWithNullInstanceElements.java index 8421fe70827..7803e3e960a 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ItemsWithNullInstanceElements.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ItemsWithNullInstanceElements.java @@ -66,24 +66,20 @@ public List build() { } - public static abstract sealed class ItemsWithNullInstanceElements1Boxed permits ItemsWithNullInstanceElements1BoxedList { - public abstract @Nullable Object data(); + public sealed interface ItemsWithNullInstanceElements1Boxed permits ItemsWithNullInstanceElements1BoxedList { + @Nullable Object getData(); } - public static final class ItemsWithNullInstanceElements1BoxedList extends ItemsWithNullInstanceElements1Boxed { - public final ItemsWithNullInstanceElementsList data; - private ItemsWithNullInstanceElements1BoxedList(ItemsWithNullInstanceElementsList data) { - this.data = data; - } + public record ItemsWithNullInstanceElements1BoxedList(ItemsWithNullInstanceElementsList data) implements ItemsWithNullInstanceElements1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ItemsWithNullInstanceElements1 extends JsonSchema implements ListSchemaValidator { + public static class ItemsWithNullInstanceElements1 extends JsonSchema implements ListSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -113,11 +109,11 @@ public ItemsWithNullInstanceElementsList getNewInstance(List arg, List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance == null || itemInstance instanceof Void)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -157,5 +153,12 @@ public ItemsWithNullInstanceElementsList validate(List arg, SchemaConfigurati public ItemsWithNullInstanceElements1BoxedList validateAndBox(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ItemsWithNullInstanceElements1BoxedList(validate(arg, configuration)); } + @Override + public ItemsWithNullInstanceElements1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/JsonPointerFormat.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/JsonPointerFormat.java index 2699ff60012..fce4b261f1d 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/JsonPointerFormat.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/JsonPointerFormat.java @@ -35,78 +35,54 @@ public class JsonPointerFormat { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class JsonPointerFormat1Boxed permits JsonPointerFormat1BoxedVoid, JsonPointerFormat1BoxedBoolean, JsonPointerFormat1BoxedNumber, JsonPointerFormat1BoxedString, JsonPointerFormat1BoxedList, JsonPointerFormat1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface JsonPointerFormat1Boxed permits JsonPointerFormat1BoxedVoid, JsonPointerFormat1BoxedBoolean, JsonPointerFormat1BoxedNumber, JsonPointerFormat1BoxedString, JsonPointerFormat1BoxedList, JsonPointerFormat1BoxedMap { + @Nullable Object getData(); } - public static final class JsonPointerFormat1BoxedVoid extends JsonPointerFormat1Boxed { - public final Void data; - private JsonPointerFormat1BoxedVoid(Void data) { - this.data = data; - } + public record JsonPointerFormat1BoxedVoid(Void data) implements JsonPointerFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class JsonPointerFormat1BoxedBoolean extends JsonPointerFormat1Boxed { - public final boolean data; - private JsonPointerFormat1BoxedBoolean(boolean data) { - this.data = data; - } + public record JsonPointerFormat1BoxedBoolean(boolean data) implements JsonPointerFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class JsonPointerFormat1BoxedNumber extends JsonPointerFormat1Boxed { - public final Number data; - private JsonPointerFormat1BoxedNumber(Number data) { - this.data = data; - } + public record JsonPointerFormat1BoxedNumber(Number data) implements JsonPointerFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class JsonPointerFormat1BoxedString extends JsonPointerFormat1Boxed { - public final String data; - private JsonPointerFormat1BoxedString(String data) { - this.data = data; - } + public record JsonPointerFormat1BoxedString(String data) implements JsonPointerFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class JsonPointerFormat1BoxedList extends JsonPointerFormat1Boxed { - public final FrozenList<@Nullable Object> data; - private JsonPointerFormat1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record JsonPointerFormat1BoxedList(FrozenList<@Nullable Object> data) implements JsonPointerFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class JsonPointerFormat1BoxedMap extends JsonPointerFormat1Boxed { - public final FrozenMap<@Nullable Object> data; - private JsonPointerFormat1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record JsonPointerFormat1BoxedMap(FrozenMap<@Nullable Object> data) implements JsonPointerFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class JsonPointerFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, JsonPointerFormat1BoxedList>, MapSchemaValidator, JsonPointerFormat1BoxedMap> { + public static class JsonPointerFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, JsonPointerFormat1BoxedList>, MapSchemaValidator, JsonPointerFormat1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -211,11 +187,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -246,11 +222,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -329,5 +305,24 @@ public JsonPointerFormat1BoxedList validateAndBox(List arg, SchemaConfigurati public JsonPointerFormat1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new JsonPointerFormat1BoxedMap(validate(arg, configuration)); } + @Override + public JsonPointerFormat1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxcontainsWithoutContainsIsIgnored.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxcontainsWithoutContainsIsIgnored.java index 14adc065248..a3da96fbffa 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxcontainsWithoutContainsIsIgnored.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxcontainsWithoutContainsIsIgnored.java @@ -35,78 +35,54 @@ public class MaxcontainsWithoutContainsIsIgnored { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class MaxcontainsWithoutContainsIsIgnored1Boxed permits MaxcontainsWithoutContainsIsIgnored1BoxedVoid, MaxcontainsWithoutContainsIsIgnored1BoxedBoolean, MaxcontainsWithoutContainsIsIgnored1BoxedNumber, MaxcontainsWithoutContainsIsIgnored1BoxedString, MaxcontainsWithoutContainsIsIgnored1BoxedList, MaxcontainsWithoutContainsIsIgnored1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface MaxcontainsWithoutContainsIsIgnored1Boxed permits MaxcontainsWithoutContainsIsIgnored1BoxedVoid, MaxcontainsWithoutContainsIsIgnored1BoxedBoolean, MaxcontainsWithoutContainsIsIgnored1BoxedNumber, MaxcontainsWithoutContainsIsIgnored1BoxedString, MaxcontainsWithoutContainsIsIgnored1BoxedList, MaxcontainsWithoutContainsIsIgnored1BoxedMap { + @Nullable Object getData(); } - public static final class MaxcontainsWithoutContainsIsIgnored1BoxedVoid extends MaxcontainsWithoutContainsIsIgnored1Boxed { - public final Void data; - private MaxcontainsWithoutContainsIsIgnored1BoxedVoid(Void data) { - this.data = data; - } + public record MaxcontainsWithoutContainsIsIgnored1BoxedVoid(Void data) implements MaxcontainsWithoutContainsIsIgnored1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MaxcontainsWithoutContainsIsIgnored1BoxedBoolean extends MaxcontainsWithoutContainsIsIgnored1Boxed { - public final boolean data; - private MaxcontainsWithoutContainsIsIgnored1BoxedBoolean(boolean data) { - this.data = data; - } + public record MaxcontainsWithoutContainsIsIgnored1BoxedBoolean(boolean data) implements MaxcontainsWithoutContainsIsIgnored1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MaxcontainsWithoutContainsIsIgnored1BoxedNumber extends MaxcontainsWithoutContainsIsIgnored1Boxed { - public final Number data; - private MaxcontainsWithoutContainsIsIgnored1BoxedNumber(Number data) { - this.data = data; - } + public record MaxcontainsWithoutContainsIsIgnored1BoxedNumber(Number data) implements MaxcontainsWithoutContainsIsIgnored1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MaxcontainsWithoutContainsIsIgnored1BoxedString extends MaxcontainsWithoutContainsIsIgnored1Boxed { - public final String data; - private MaxcontainsWithoutContainsIsIgnored1BoxedString(String data) { - this.data = data; - } + public record MaxcontainsWithoutContainsIsIgnored1BoxedString(String data) implements MaxcontainsWithoutContainsIsIgnored1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MaxcontainsWithoutContainsIsIgnored1BoxedList extends MaxcontainsWithoutContainsIsIgnored1Boxed { - public final FrozenList<@Nullable Object> data; - private MaxcontainsWithoutContainsIsIgnored1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record MaxcontainsWithoutContainsIsIgnored1BoxedList(FrozenList<@Nullable Object> data) implements MaxcontainsWithoutContainsIsIgnored1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MaxcontainsWithoutContainsIsIgnored1BoxedMap extends MaxcontainsWithoutContainsIsIgnored1Boxed { - public final FrozenMap<@Nullable Object> data; - private MaxcontainsWithoutContainsIsIgnored1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record MaxcontainsWithoutContainsIsIgnored1BoxedMap(FrozenMap<@Nullable Object> data) implements MaxcontainsWithoutContainsIsIgnored1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class MaxcontainsWithoutContainsIsIgnored1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, MaxcontainsWithoutContainsIsIgnored1BoxedList>, MapSchemaValidator, MaxcontainsWithoutContainsIsIgnored1BoxedMap> { + public static class MaxcontainsWithoutContainsIsIgnored1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, MaxcontainsWithoutContainsIsIgnored1BoxedList>, MapSchemaValidator, MaxcontainsWithoutContainsIsIgnored1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -211,11 +187,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -246,11 +222,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -329,5 +305,24 @@ public MaxcontainsWithoutContainsIsIgnored1BoxedList validateAndBox(List arg, public MaxcontainsWithoutContainsIsIgnored1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new MaxcontainsWithoutContainsIsIgnored1BoxedMap(validate(arg, configuration)); } + @Override + public MaxcontainsWithoutContainsIsIgnored1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidation.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidation.java index 7c10873848d..ff2f9aec232 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidation.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidation.java @@ -35,78 +35,54 @@ public class MaximumValidation { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class MaximumValidation1Boxed permits MaximumValidation1BoxedVoid, MaximumValidation1BoxedBoolean, MaximumValidation1BoxedNumber, MaximumValidation1BoxedString, MaximumValidation1BoxedList, MaximumValidation1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface MaximumValidation1Boxed permits MaximumValidation1BoxedVoid, MaximumValidation1BoxedBoolean, MaximumValidation1BoxedNumber, MaximumValidation1BoxedString, MaximumValidation1BoxedList, MaximumValidation1BoxedMap { + @Nullable Object getData(); } - public static final class MaximumValidation1BoxedVoid extends MaximumValidation1Boxed { - public final Void data; - private MaximumValidation1BoxedVoid(Void data) { - this.data = data; - } + public record MaximumValidation1BoxedVoid(Void data) implements MaximumValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MaximumValidation1BoxedBoolean extends MaximumValidation1Boxed { - public final boolean data; - private MaximumValidation1BoxedBoolean(boolean data) { - this.data = data; - } + public record MaximumValidation1BoxedBoolean(boolean data) implements MaximumValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MaximumValidation1BoxedNumber extends MaximumValidation1Boxed { - public final Number data; - private MaximumValidation1BoxedNumber(Number data) { - this.data = data; - } + public record MaximumValidation1BoxedNumber(Number data) implements MaximumValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MaximumValidation1BoxedString extends MaximumValidation1Boxed { - public final String data; - private MaximumValidation1BoxedString(String data) { - this.data = data; - } + public record MaximumValidation1BoxedString(String data) implements MaximumValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MaximumValidation1BoxedList extends MaximumValidation1Boxed { - public final FrozenList<@Nullable Object> data; - private MaximumValidation1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record MaximumValidation1BoxedList(FrozenList<@Nullable Object> data) implements MaximumValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MaximumValidation1BoxedMap extends MaximumValidation1Boxed { - public final FrozenMap<@Nullable Object> data; - private MaximumValidation1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record MaximumValidation1BoxedMap(FrozenMap<@Nullable Object> data) implements MaximumValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class MaximumValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, MaximumValidation1BoxedList>, MapSchemaValidator, MaximumValidation1BoxedMap> { + public static class MaximumValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, MaximumValidation1BoxedList>, MapSchemaValidator, MaximumValidation1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -211,11 +187,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -246,11 +222,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -329,5 +305,24 @@ public MaximumValidation1BoxedList validateAndBox(List arg, SchemaConfigurati public MaximumValidation1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new MaximumValidation1BoxedMap(validate(arg, configuration)); } + @Override + public MaximumValidation1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidationWithUnsignedInteger.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidationWithUnsignedInteger.java index 0eebe36727c..9f2eefdd7cd 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidationWithUnsignedInteger.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaximumValidationWithUnsignedInteger.java @@ -35,78 +35,54 @@ public class MaximumValidationWithUnsignedInteger { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class MaximumValidationWithUnsignedInteger1Boxed permits MaximumValidationWithUnsignedInteger1BoxedVoid, MaximumValidationWithUnsignedInteger1BoxedBoolean, MaximumValidationWithUnsignedInteger1BoxedNumber, MaximumValidationWithUnsignedInteger1BoxedString, MaximumValidationWithUnsignedInteger1BoxedList, MaximumValidationWithUnsignedInteger1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface MaximumValidationWithUnsignedInteger1Boxed permits MaximumValidationWithUnsignedInteger1BoxedVoid, MaximumValidationWithUnsignedInteger1BoxedBoolean, MaximumValidationWithUnsignedInteger1BoxedNumber, MaximumValidationWithUnsignedInteger1BoxedString, MaximumValidationWithUnsignedInteger1BoxedList, MaximumValidationWithUnsignedInteger1BoxedMap { + @Nullable Object getData(); } - public static final class MaximumValidationWithUnsignedInteger1BoxedVoid extends MaximumValidationWithUnsignedInteger1Boxed { - public final Void data; - private MaximumValidationWithUnsignedInteger1BoxedVoid(Void data) { - this.data = data; - } + public record MaximumValidationWithUnsignedInteger1BoxedVoid(Void data) implements MaximumValidationWithUnsignedInteger1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MaximumValidationWithUnsignedInteger1BoxedBoolean extends MaximumValidationWithUnsignedInteger1Boxed { - public final boolean data; - private MaximumValidationWithUnsignedInteger1BoxedBoolean(boolean data) { - this.data = data; - } + public record MaximumValidationWithUnsignedInteger1BoxedBoolean(boolean data) implements MaximumValidationWithUnsignedInteger1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MaximumValidationWithUnsignedInteger1BoxedNumber extends MaximumValidationWithUnsignedInteger1Boxed { - public final Number data; - private MaximumValidationWithUnsignedInteger1BoxedNumber(Number data) { - this.data = data; - } + public record MaximumValidationWithUnsignedInteger1BoxedNumber(Number data) implements MaximumValidationWithUnsignedInteger1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MaximumValidationWithUnsignedInteger1BoxedString extends MaximumValidationWithUnsignedInteger1Boxed { - public final String data; - private MaximumValidationWithUnsignedInteger1BoxedString(String data) { - this.data = data; - } + public record MaximumValidationWithUnsignedInteger1BoxedString(String data) implements MaximumValidationWithUnsignedInteger1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MaximumValidationWithUnsignedInteger1BoxedList extends MaximumValidationWithUnsignedInteger1Boxed { - public final FrozenList<@Nullable Object> data; - private MaximumValidationWithUnsignedInteger1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record MaximumValidationWithUnsignedInteger1BoxedList(FrozenList<@Nullable Object> data) implements MaximumValidationWithUnsignedInteger1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MaximumValidationWithUnsignedInteger1BoxedMap extends MaximumValidationWithUnsignedInteger1Boxed { - public final FrozenMap<@Nullable Object> data; - private MaximumValidationWithUnsignedInteger1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record MaximumValidationWithUnsignedInteger1BoxedMap(FrozenMap<@Nullable Object> data) implements MaximumValidationWithUnsignedInteger1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class MaximumValidationWithUnsignedInteger1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, MaximumValidationWithUnsignedInteger1BoxedList>, MapSchemaValidator, MaximumValidationWithUnsignedInteger1BoxedMap> { + public static class MaximumValidationWithUnsignedInteger1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, MaximumValidationWithUnsignedInteger1BoxedList>, MapSchemaValidator, MaximumValidationWithUnsignedInteger1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -211,11 +187,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -246,11 +222,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -329,5 +305,24 @@ public MaximumValidationWithUnsignedInteger1BoxedList validateAndBox(List arg public MaximumValidationWithUnsignedInteger1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new MaximumValidationWithUnsignedInteger1BoxedMap(validate(arg, configuration)); } + @Override + public MaximumValidationWithUnsignedInteger1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxitemsValidation.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxitemsValidation.java index 3cfd11b3d5e..dfbadbb5e68 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxitemsValidation.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxitemsValidation.java @@ -35,78 +35,54 @@ public class MaxitemsValidation { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class MaxitemsValidation1Boxed permits MaxitemsValidation1BoxedVoid, MaxitemsValidation1BoxedBoolean, MaxitemsValidation1BoxedNumber, MaxitemsValidation1BoxedString, MaxitemsValidation1BoxedList, MaxitemsValidation1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface MaxitemsValidation1Boxed permits MaxitemsValidation1BoxedVoid, MaxitemsValidation1BoxedBoolean, MaxitemsValidation1BoxedNumber, MaxitemsValidation1BoxedString, MaxitemsValidation1BoxedList, MaxitemsValidation1BoxedMap { + @Nullable Object getData(); } - public static final class MaxitemsValidation1BoxedVoid extends MaxitemsValidation1Boxed { - public final Void data; - private MaxitemsValidation1BoxedVoid(Void data) { - this.data = data; - } + public record MaxitemsValidation1BoxedVoid(Void data) implements MaxitemsValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MaxitemsValidation1BoxedBoolean extends MaxitemsValidation1Boxed { - public final boolean data; - private MaxitemsValidation1BoxedBoolean(boolean data) { - this.data = data; - } + public record MaxitemsValidation1BoxedBoolean(boolean data) implements MaxitemsValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MaxitemsValidation1BoxedNumber extends MaxitemsValidation1Boxed { - public final Number data; - private MaxitemsValidation1BoxedNumber(Number data) { - this.data = data; - } + public record MaxitemsValidation1BoxedNumber(Number data) implements MaxitemsValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MaxitemsValidation1BoxedString extends MaxitemsValidation1Boxed { - public final String data; - private MaxitemsValidation1BoxedString(String data) { - this.data = data; - } + public record MaxitemsValidation1BoxedString(String data) implements MaxitemsValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MaxitemsValidation1BoxedList extends MaxitemsValidation1Boxed { - public final FrozenList<@Nullable Object> data; - private MaxitemsValidation1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record MaxitemsValidation1BoxedList(FrozenList<@Nullable Object> data) implements MaxitemsValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MaxitemsValidation1BoxedMap extends MaxitemsValidation1Boxed { - public final FrozenMap<@Nullable Object> data; - private MaxitemsValidation1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record MaxitemsValidation1BoxedMap(FrozenMap<@Nullable Object> data) implements MaxitemsValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class MaxitemsValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, MaxitemsValidation1BoxedList>, MapSchemaValidator, MaxitemsValidation1BoxedMap> { + public static class MaxitemsValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, MaxitemsValidation1BoxedList>, MapSchemaValidator, MaxitemsValidation1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -211,11 +187,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -246,11 +222,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -329,5 +305,24 @@ public MaxitemsValidation1BoxedList validateAndBox(List arg, SchemaConfigurat public MaxitemsValidation1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new MaxitemsValidation1BoxedMap(validate(arg, configuration)); } + @Override + public MaxitemsValidation1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxlengthValidation.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxlengthValidation.java index 31119d1840d..02d41b936b7 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxlengthValidation.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxlengthValidation.java @@ -35,78 +35,54 @@ public class MaxlengthValidation { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class MaxlengthValidation1Boxed permits MaxlengthValidation1BoxedVoid, MaxlengthValidation1BoxedBoolean, MaxlengthValidation1BoxedNumber, MaxlengthValidation1BoxedString, MaxlengthValidation1BoxedList, MaxlengthValidation1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface MaxlengthValidation1Boxed permits MaxlengthValidation1BoxedVoid, MaxlengthValidation1BoxedBoolean, MaxlengthValidation1BoxedNumber, MaxlengthValidation1BoxedString, MaxlengthValidation1BoxedList, MaxlengthValidation1BoxedMap { + @Nullable Object getData(); } - public static final class MaxlengthValidation1BoxedVoid extends MaxlengthValidation1Boxed { - public final Void data; - private MaxlengthValidation1BoxedVoid(Void data) { - this.data = data; - } + public record MaxlengthValidation1BoxedVoid(Void data) implements MaxlengthValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MaxlengthValidation1BoxedBoolean extends MaxlengthValidation1Boxed { - public final boolean data; - private MaxlengthValidation1BoxedBoolean(boolean data) { - this.data = data; - } + public record MaxlengthValidation1BoxedBoolean(boolean data) implements MaxlengthValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MaxlengthValidation1BoxedNumber extends MaxlengthValidation1Boxed { - public final Number data; - private MaxlengthValidation1BoxedNumber(Number data) { - this.data = data; - } + public record MaxlengthValidation1BoxedNumber(Number data) implements MaxlengthValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MaxlengthValidation1BoxedString extends MaxlengthValidation1Boxed { - public final String data; - private MaxlengthValidation1BoxedString(String data) { - this.data = data; - } + public record MaxlengthValidation1BoxedString(String data) implements MaxlengthValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MaxlengthValidation1BoxedList extends MaxlengthValidation1Boxed { - public final FrozenList<@Nullable Object> data; - private MaxlengthValidation1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record MaxlengthValidation1BoxedList(FrozenList<@Nullable Object> data) implements MaxlengthValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MaxlengthValidation1BoxedMap extends MaxlengthValidation1Boxed { - public final FrozenMap<@Nullable Object> data; - private MaxlengthValidation1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record MaxlengthValidation1BoxedMap(FrozenMap<@Nullable Object> data) implements MaxlengthValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class MaxlengthValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, MaxlengthValidation1BoxedList>, MapSchemaValidator, MaxlengthValidation1BoxedMap> { + public static class MaxlengthValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, MaxlengthValidation1BoxedList>, MapSchemaValidator, MaxlengthValidation1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -211,11 +187,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -246,11 +222,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -329,5 +305,24 @@ public MaxlengthValidation1BoxedList validateAndBox(List arg, SchemaConfigura public MaxlengthValidation1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new MaxlengthValidation1BoxedMap(validate(arg, configuration)); } + @Override + public MaxlengthValidation1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Maxproperties0MeansTheObjectIsEmpty.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Maxproperties0MeansTheObjectIsEmpty.java index 7f83ee503d6..c71474bd82f 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Maxproperties0MeansTheObjectIsEmpty.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Maxproperties0MeansTheObjectIsEmpty.java @@ -35,78 +35,54 @@ public class Maxproperties0MeansTheObjectIsEmpty { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class Maxproperties0MeansTheObjectIsEmpty1Boxed permits Maxproperties0MeansTheObjectIsEmpty1BoxedVoid, Maxproperties0MeansTheObjectIsEmpty1BoxedBoolean, Maxproperties0MeansTheObjectIsEmpty1BoxedNumber, Maxproperties0MeansTheObjectIsEmpty1BoxedString, Maxproperties0MeansTheObjectIsEmpty1BoxedList, Maxproperties0MeansTheObjectIsEmpty1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Maxproperties0MeansTheObjectIsEmpty1Boxed permits Maxproperties0MeansTheObjectIsEmpty1BoxedVoid, Maxproperties0MeansTheObjectIsEmpty1BoxedBoolean, Maxproperties0MeansTheObjectIsEmpty1BoxedNumber, Maxproperties0MeansTheObjectIsEmpty1BoxedString, Maxproperties0MeansTheObjectIsEmpty1BoxedList, Maxproperties0MeansTheObjectIsEmpty1BoxedMap { + @Nullable Object getData(); } - public static final class Maxproperties0MeansTheObjectIsEmpty1BoxedVoid extends Maxproperties0MeansTheObjectIsEmpty1Boxed { - public final Void data; - private Maxproperties0MeansTheObjectIsEmpty1BoxedVoid(Void data) { - this.data = data; - } + public record Maxproperties0MeansTheObjectIsEmpty1BoxedVoid(Void data) implements Maxproperties0MeansTheObjectIsEmpty1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Maxproperties0MeansTheObjectIsEmpty1BoxedBoolean extends Maxproperties0MeansTheObjectIsEmpty1Boxed { - public final boolean data; - private Maxproperties0MeansTheObjectIsEmpty1BoxedBoolean(boolean data) { - this.data = data; - } + public record Maxproperties0MeansTheObjectIsEmpty1BoxedBoolean(boolean data) implements Maxproperties0MeansTheObjectIsEmpty1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Maxproperties0MeansTheObjectIsEmpty1BoxedNumber extends Maxproperties0MeansTheObjectIsEmpty1Boxed { - public final Number data; - private Maxproperties0MeansTheObjectIsEmpty1BoxedNumber(Number data) { - this.data = data; - } + public record Maxproperties0MeansTheObjectIsEmpty1BoxedNumber(Number data) implements Maxproperties0MeansTheObjectIsEmpty1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Maxproperties0MeansTheObjectIsEmpty1BoxedString extends Maxproperties0MeansTheObjectIsEmpty1Boxed { - public final String data; - private Maxproperties0MeansTheObjectIsEmpty1BoxedString(String data) { - this.data = data; - } + public record Maxproperties0MeansTheObjectIsEmpty1BoxedString(String data) implements Maxproperties0MeansTheObjectIsEmpty1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Maxproperties0MeansTheObjectIsEmpty1BoxedList extends Maxproperties0MeansTheObjectIsEmpty1Boxed { - public final FrozenList<@Nullable Object> data; - private Maxproperties0MeansTheObjectIsEmpty1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Maxproperties0MeansTheObjectIsEmpty1BoxedList(FrozenList<@Nullable Object> data) implements Maxproperties0MeansTheObjectIsEmpty1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Maxproperties0MeansTheObjectIsEmpty1BoxedMap extends Maxproperties0MeansTheObjectIsEmpty1Boxed { - public final FrozenMap<@Nullable Object> data; - private Maxproperties0MeansTheObjectIsEmpty1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record Maxproperties0MeansTheObjectIsEmpty1BoxedMap(FrozenMap<@Nullable Object> data) implements Maxproperties0MeansTheObjectIsEmpty1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Maxproperties0MeansTheObjectIsEmpty1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Maxproperties0MeansTheObjectIsEmpty1BoxedList>, MapSchemaValidator, Maxproperties0MeansTheObjectIsEmpty1BoxedMap> { + public static class Maxproperties0MeansTheObjectIsEmpty1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Maxproperties0MeansTheObjectIsEmpty1BoxedList>, MapSchemaValidator, Maxproperties0MeansTheObjectIsEmpty1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -211,11 +187,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -246,11 +222,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -329,5 +305,24 @@ public Maxproperties0MeansTheObjectIsEmpty1BoxedList validateAndBox(List arg, public Maxproperties0MeansTheObjectIsEmpty1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Maxproperties0MeansTheObjectIsEmpty1BoxedMap(validate(arg, configuration)); } + @Override + public Maxproperties0MeansTheObjectIsEmpty1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxpropertiesValidation.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxpropertiesValidation.java index c70a020af26..5386164471a 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxpropertiesValidation.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MaxpropertiesValidation.java @@ -35,78 +35,54 @@ public class MaxpropertiesValidation { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class MaxpropertiesValidation1Boxed permits MaxpropertiesValidation1BoxedVoid, MaxpropertiesValidation1BoxedBoolean, MaxpropertiesValidation1BoxedNumber, MaxpropertiesValidation1BoxedString, MaxpropertiesValidation1BoxedList, MaxpropertiesValidation1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface MaxpropertiesValidation1Boxed permits MaxpropertiesValidation1BoxedVoid, MaxpropertiesValidation1BoxedBoolean, MaxpropertiesValidation1BoxedNumber, MaxpropertiesValidation1BoxedString, MaxpropertiesValidation1BoxedList, MaxpropertiesValidation1BoxedMap { + @Nullable Object getData(); } - public static final class MaxpropertiesValidation1BoxedVoid extends MaxpropertiesValidation1Boxed { - public final Void data; - private MaxpropertiesValidation1BoxedVoid(Void data) { - this.data = data; - } + public record MaxpropertiesValidation1BoxedVoid(Void data) implements MaxpropertiesValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MaxpropertiesValidation1BoxedBoolean extends MaxpropertiesValidation1Boxed { - public final boolean data; - private MaxpropertiesValidation1BoxedBoolean(boolean data) { - this.data = data; - } + public record MaxpropertiesValidation1BoxedBoolean(boolean data) implements MaxpropertiesValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MaxpropertiesValidation1BoxedNumber extends MaxpropertiesValidation1Boxed { - public final Number data; - private MaxpropertiesValidation1BoxedNumber(Number data) { - this.data = data; - } + public record MaxpropertiesValidation1BoxedNumber(Number data) implements MaxpropertiesValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MaxpropertiesValidation1BoxedString extends MaxpropertiesValidation1Boxed { - public final String data; - private MaxpropertiesValidation1BoxedString(String data) { - this.data = data; - } + public record MaxpropertiesValidation1BoxedString(String data) implements MaxpropertiesValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MaxpropertiesValidation1BoxedList extends MaxpropertiesValidation1Boxed { - public final FrozenList<@Nullable Object> data; - private MaxpropertiesValidation1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record MaxpropertiesValidation1BoxedList(FrozenList<@Nullable Object> data) implements MaxpropertiesValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MaxpropertiesValidation1BoxedMap extends MaxpropertiesValidation1Boxed { - public final FrozenMap<@Nullable Object> data; - private MaxpropertiesValidation1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record MaxpropertiesValidation1BoxedMap(FrozenMap<@Nullable Object> data) implements MaxpropertiesValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class MaxpropertiesValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, MaxpropertiesValidation1BoxedList>, MapSchemaValidator, MaxpropertiesValidation1BoxedMap> { + public static class MaxpropertiesValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, MaxpropertiesValidation1BoxedList>, MapSchemaValidator, MaxpropertiesValidation1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -211,11 +187,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -246,11 +222,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -329,5 +305,24 @@ public MaxpropertiesValidation1BoxedList validateAndBox(List arg, SchemaConfi public MaxpropertiesValidation1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new MaxpropertiesValidation1BoxedMap(validate(arg, configuration)); } + @Override + public MaxpropertiesValidation1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MincontainsWithoutContainsIsIgnored.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MincontainsWithoutContainsIsIgnored.java index d0ac8197835..a7fe9ba9db4 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MincontainsWithoutContainsIsIgnored.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MincontainsWithoutContainsIsIgnored.java @@ -35,78 +35,54 @@ public class MincontainsWithoutContainsIsIgnored { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class MincontainsWithoutContainsIsIgnored1Boxed permits MincontainsWithoutContainsIsIgnored1BoxedVoid, MincontainsWithoutContainsIsIgnored1BoxedBoolean, MincontainsWithoutContainsIsIgnored1BoxedNumber, MincontainsWithoutContainsIsIgnored1BoxedString, MincontainsWithoutContainsIsIgnored1BoxedList, MincontainsWithoutContainsIsIgnored1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface MincontainsWithoutContainsIsIgnored1Boxed permits MincontainsWithoutContainsIsIgnored1BoxedVoid, MincontainsWithoutContainsIsIgnored1BoxedBoolean, MincontainsWithoutContainsIsIgnored1BoxedNumber, MincontainsWithoutContainsIsIgnored1BoxedString, MincontainsWithoutContainsIsIgnored1BoxedList, MincontainsWithoutContainsIsIgnored1BoxedMap { + @Nullable Object getData(); } - public static final class MincontainsWithoutContainsIsIgnored1BoxedVoid extends MincontainsWithoutContainsIsIgnored1Boxed { - public final Void data; - private MincontainsWithoutContainsIsIgnored1BoxedVoid(Void data) { - this.data = data; - } + public record MincontainsWithoutContainsIsIgnored1BoxedVoid(Void data) implements MincontainsWithoutContainsIsIgnored1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MincontainsWithoutContainsIsIgnored1BoxedBoolean extends MincontainsWithoutContainsIsIgnored1Boxed { - public final boolean data; - private MincontainsWithoutContainsIsIgnored1BoxedBoolean(boolean data) { - this.data = data; - } + public record MincontainsWithoutContainsIsIgnored1BoxedBoolean(boolean data) implements MincontainsWithoutContainsIsIgnored1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MincontainsWithoutContainsIsIgnored1BoxedNumber extends MincontainsWithoutContainsIsIgnored1Boxed { - public final Number data; - private MincontainsWithoutContainsIsIgnored1BoxedNumber(Number data) { - this.data = data; - } + public record MincontainsWithoutContainsIsIgnored1BoxedNumber(Number data) implements MincontainsWithoutContainsIsIgnored1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MincontainsWithoutContainsIsIgnored1BoxedString extends MincontainsWithoutContainsIsIgnored1Boxed { - public final String data; - private MincontainsWithoutContainsIsIgnored1BoxedString(String data) { - this.data = data; - } + public record MincontainsWithoutContainsIsIgnored1BoxedString(String data) implements MincontainsWithoutContainsIsIgnored1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MincontainsWithoutContainsIsIgnored1BoxedList extends MincontainsWithoutContainsIsIgnored1Boxed { - public final FrozenList<@Nullable Object> data; - private MincontainsWithoutContainsIsIgnored1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record MincontainsWithoutContainsIsIgnored1BoxedList(FrozenList<@Nullable Object> data) implements MincontainsWithoutContainsIsIgnored1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MincontainsWithoutContainsIsIgnored1BoxedMap extends MincontainsWithoutContainsIsIgnored1Boxed { - public final FrozenMap<@Nullable Object> data; - private MincontainsWithoutContainsIsIgnored1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record MincontainsWithoutContainsIsIgnored1BoxedMap(FrozenMap<@Nullable Object> data) implements MincontainsWithoutContainsIsIgnored1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class MincontainsWithoutContainsIsIgnored1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, MincontainsWithoutContainsIsIgnored1BoxedList>, MapSchemaValidator, MincontainsWithoutContainsIsIgnored1BoxedMap> { + public static class MincontainsWithoutContainsIsIgnored1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, MincontainsWithoutContainsIsIgnored1BoxedList>, MapSchemaValidator, MincontainsWithoutContainsIsIgnored1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -211,11 +187,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -246,11 +222,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -329,5 +305,24 @@ public MincontainsWithoutContainsIsIgnored1BoxedList validateAndBox(List arg, public MincontainsWithoutContainsIsIgnored1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new MincontainsWithoutContainsIsIgnored1BoxedMap(validate(arg, configuration)); } + @Override + public MincontainsWithoutContainsIsIgnored1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidation.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidation.java index b27eb1b8c5c..29325be0f63 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidation.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidation.java @@ -35,78 +35,54 @@ public class MinimumValidation { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class MinimumValidation1Boxed permits MinimumValidation1BoxedVoid, MinimumValidation1BoxedBoolean, MinimumValidation1BoxedNumber, MinimumValidation1BoxedString, MinimumValidation1BoxedList, MinimumValidation1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface MinimumValidation1Boxed permits MinimumValidation1BoxedVoid, MinimumValidation1BoxedBoolean, MinimumValidation1BoxedNumber, MinimumValidation1BoxedString, MinimumValidation1BoxedList, MinimumValidation1BoxedMap { + @Nullable Object getData(); } - public static final class MinimumValidation1BoxedVoid extends MinimumValidation1Boxed { - public final Void data; - private MinimumValidation1BoxedVoid(Void data) { - this.data = data; - } + public record MinimumValidation1BoxedVoid(Void data) implements MinimumValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MinimumValidation1BoxedBoolean extends MinimumValidation1Boxed { - public final boolean data; - private MinimumValidation1BoxedBoolean(boolean data) { - this.data = data; - } + public record MinimumValidation1BoxedBoolean(boolean data) implements MinimumValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MinimumValidation1BoxedNumber extends MinimumValidation1Boxed { - public final Number data; - private MinimumValidation1BoxedNumber(Number data) { - this.data = data; - } + public record MinimumValidation1BoxedNumber(Number data) implements MinimumValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MinimumValidation1BoxedString extends MinimumValidation1Boxed { - public final String data; - private MinimumValidation1BoxedString(String data) { - this.data = data; - } + public record MinimumValidation1BoxedString(String data) implements MinimumValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MinimumValidation1BoxedList extends MinimumValidation1Boxed { - public final FrozenList<@Nullable Object> data; - private MinimumValidation1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record MinimumValidation1BoxedList(FrozenList<@Nullable Object> data) implements MinimumValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MinimumValidation1BoxedMap extends MinimumValidation1Boxed { - public final FrozenMap<@Nullable Object> data; - private MinimumValidation1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record MinimumValidation1BoxedMap(FrozenMap<@Nullable Object> data) implements MinimumValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class MinimumValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, MinimumValidation1BoxedList>, MapSchemaValidator, MinimumValidation1BoxedMap> { + public static class MinimumValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, MinimumValidation1BoxedList>, MapSchemaValidator, MinimumValidation1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -211,11 +187,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -246,11 +222,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -329,5 +305,24 @@ public MinimumValidation1BoxedList validateAndBox(List arg, SchemaConfigurati public MinimumValidation1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new MinimumValidation1BoxedMap(validate(arg, configuration)); } + @Override + public MinimumValidation1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidationWithSignedInteger.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidationWithSignedInteger.java index e22e2b223a8..531298768ff 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidationWithSignedInteger.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinimumValidationWithSignedInteger.java @@ -35,78 +35,54 @@ public class MinimumValidationWithSignedInteger { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class MinimumValidationWithSignedInteger1Boxed permits MinimumValidationWithSignedInteger1BoxedVoid, MinimumValidationWithSignedInteger1BoxedBoolean, MinimumValidationWithSignedInteger1BoxedNumber, MinimumValidationWithSignedInteger1BoxedString, MinimumValidationWithSignedInteger1BoxedList, MinimumValidationWithSignedInteger1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface MinimumValidationWithSignedInteger1Boxed permits MinimumValidationWithSignedInteger1BoxedVoid, MinimumValidationWithSignedInteger1BoxedBoolean, MinimumValidationWithSignedInteger1BoxedNumber, MinimumValidationWithSignedInteger1BoxedString, MinimumValidationWithSignedInteger1BoxedList, MinimumValidationWithSignedInteger1BoxedMap { + @Nullable Object getData(); } - public static final class MinimumValidationWithSignedInteger1BoxedVoid extends MinimumValidationWithSignedInteger1Boxed { - public final Void data; - private MinimumValidationWithSignedInteger1BoxedVoid(Void data) { - this.data = data; - } + public record MinimumValidationWithSignedInteger1BoxedVoid(Void data) implements MinimumValidationWithSignedInteger1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MinimumValidationWithSignedInteger1BoxedBoolean extends MinimumValidationWithSignedInteger1Boxed { - public final boolean data; - private MinimumValidationWithSignedInteger1BoxedBoolean(boolean data) { - this.data = data; - } + public record MinimumValidationWithSignedInteger1BoxedBoolean(boolean data) implements MinimumValidationWithSignedInteger1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MinimumValidationWithSignedInteger1BoxedNumber extends MinimumValidationWithSignedInteger1Boxed { - public final Number data; - private MinimumValidationWithSignedInteger1BoxedNumber(Number data) { - this.data = data; - } + public record MinimumValidationWithSignedInteger1BoxedNumber(Number data) implements MinimumValidationWithSignedInteger1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MinimumValidationWithSignedInteger1BoxedString extends MinimumValidationWithSignedInteger1Boxed { - public final String data; - private MinimumValidationWithSignedInteger1BoxedString(String data) { - this.data = data; - } + public record MinimumValidationWithSignedInteger1BoxedString(String data) implements MinimumValidationWithSignedInteger1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MinimumValidationWithSignedInteger1BoxedList extends MinimumValidationWithSignedInteger1Boxed { - public final FrozenList<@Nullable Object> data; - private MinimumValidationWithSignedInteger1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record MinimumValidationWithSignedInteger1BoxedList(FrozenList<@Nullable Object> data) implements MinimumValidationWithSignedInteger1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MinimumValidationWithSignedInteger1BoxedMap extends MinimumValidationWithSignedInteger1Boxed { - public final FrozenMap<@Nullable Object> data; - private MinimumValidationWithSignedInteger1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record MinimumValidationWithSignedInteger1BoxedMap(FrozenMap<@Nullable Object> data) implements MinimumValidationWithSignedInteger1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class MinimumValidationWithSignedInteger1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, MinimumValidationWithSignedInteger1BoxedList>, MapSchemaValidator, MinimumValidationWithSignedInteger1BoxedMap> { + public static class MinimumValidationWithSignedInteger1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, MinimumValidationWithSignedInteger1BoxedList>, MapSchemaValidator, MinimumValidationWithSignedInteger1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -211,11 +187,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -246,11 +222,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -329,5 +305,24 @@ public MinimumValidationWithSignedInteger1BoxedList validateAndBox(List arg, public MinimumValidationWithSignedInteger1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new MinimumValidationWithSignedInteger1BoxedMap(validate(arg, configuration)); } + @Override + public MinimumValidationWithSignedInteger1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinitemsValidation.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinitemsValidation.java index c936275b7b5..13a669101d6 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinitemsValidation.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinitemsValidation.java @@ -35,78 +35,54 @@ public class MinitemsValidation { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class MinitemsValidation1Boxed permits MinitemsValidation1BoxedVoid, MinitemsValidation1BoxedBoolean, MinitemsValidation1BoxedNumber, MinitemsValidation1BoxedString, MinitemsValidation1BoxedList, MinitemsValidation1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface MinitemsValidation1Boxed permits MinitemsValidation1BoxedVoid, MinitemsValidation1BoxedBoolean, MinitemsValidation1BoxedNumber, MinitemsValidation1BoxedString, MinitemsValidation1BoxedList, MinitemsValidation1BoxedMap { + @Nullable Object getData(); } - public static final class MinitemsValidation1BoxedVoid extends MinitemsValidation1Boxed { - public final Void data; - private MinitemsValidation1BoxedVoid(Void data) { - this.data = data; - } + public record MinitemsValidation1BoxedVoid(Void data) implements MinitemsValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MinitemsValidation1BoxedBoolean extends MinitemsValidation1Boxed { - public final boolean data; - private MinitemsValidation1BoxedBoolean(boolean data) { - this.data = data; - } + public record MinitemsValidation1BoxedBoolean(boolean data) implements MinitemsValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MinitemsValidation1BoxedNumber extends MinitemsValidation1Boxed { - public final Number data; - private MinitemsValidation1BoxedNumber(Number data) { - this.data = data; - } + public record MinitemsValidation1BoxedNumber(Number data) implements MinitemsValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MinitemsValidation1BoxedString extends MinitemsValidation1Boxed { - public final String data; - private MinitemsValidation1BoxedString(String data) { - this.data = data; - } + public record MinitemsValidation1BoxedString(String data) implements MinitemsValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MinitemsValidation1BoxedList extends MinitemsValidation1Boxed { - public final FrozenList<@Nullable Object> data; - private MinitemsValidation1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record MinitemsValidation1BoxedList(FrozenList<@Nullable Object> data) implements MinitemsValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MinitemsValidation1BoxedMap extends MinitemsValidation1Boxed { - public final FrozenMap<@Nullable Object> data; - private MinitemsValidation1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record MinitemsValidation1BoxedMap(FrozenMap<@Nullable Object> data) implements MinitemsValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class MinitemsValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, MinitemsValidation1BoxedList>, MapSchemaValidator, MinitemsValidation1BoxedMap> { + public static class MinitemsValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, MinitemsValidation1BoxedList>, MapSchemaValidator, MinitemsValidation1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -211,11 +187,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -246,11 +222,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -329,5 +305,24 @@ public MinitemsValidation1BoxedList validateAndBox(List arg, SchemaConfigurat public MinitemsValidation1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new MinitemsValidation1BoxedMap(validate(arg, configuration)); } + @Override + public MinitemsValidation1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinlengthValidation.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinlengthValidation.java index 2ab8aacdd70..835bdc24f37 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinlengthValidation.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinlengthValidation.java @@ -35,78 +35,54 @@ public class MinlengthValidation { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class MinlengthValidation1Boxed permits MinlengthValidation1BoxedVoid, MinlengthValidation1BoxedBoolean, MinlengthValidation1BoxedNumber, MinlengthValidation1BoxedString, MinlengthValidation1BoxedList, MinlengthValidation1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface MinlengthValidation1Boxed permits MinlengthValidation1BoxedVoid, MinlengthValidation1BoxedBoolean, MinlengthValidation1BoxedNumber, MinlengthValidation1BoxedString, MinlengthValidation1BoxedList, MinlengthValidation1BoxedMap { + @Nullable Object getData(); } - public static final class MinlengthValidation1BoxedVoid extends MinlengthValidation1Boxed { - public final Void data; - private MinlengthValidation1BoxedVoid(Void data) { - this.data = data; - } + public record MinlengthValidation1BoxedVoid(Void data) implements MinlengthValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MinlengthValidation1BoxedBoolean extends MinlengthValidation1Boxed { - public final boolean data; - private MinlengthValidation1BoxedBoolean(boolean data) { - this.data = data; - } + public record MinlengthValidation1BoxedBoolean(boolean data) implements MinlengthValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MinlengthValidation1BoxedNumber extends MinlengthValidation1Boxed { - public final Number data; - private MinlengthValidation1BoxedNumber(Number data) { - this.data = data; - } + public record MinlengthValidation1BoxedNumber(Number data) implements MinlengthValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MinlengthValidation1BoxedString extends MinlengthValidation1Boxed { - public final String data; - private MinlengthValidation1BoxedString(String data) { - this.data = data; - } + public record MinlengthValidation1BoxedString(String data) implements MinlengthValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MinlengthValidation1BoxedList extends MinlengthValidation1Boxed { - public final FrozenList<@Nullable Object> data; - private MinlengthValidation1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record MinlengthValidation1BoxedList(FrozenList<@Nullable Object> data) implements MinlengthValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MinlengthValidation1BoxedMap extends MinlengthValidation1Boxed { - public final FrozenMap<@Nullable Object> data; - private MinlengthValidation1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record MinlengthValidation1BoxedMap(FrozenMap<@Nullable Object> data) implements MinlengthValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class MinlengthValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, MinlengthValidation1BoxedList>, MapSchemaValidator, MinlengthValidation1BoxedMap> { + public static class MinlengthValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, MinlengthValidation1BoxedList>, MapSchemaValidator, MinlengthValidation1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -211,11 +187,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -246,11 +222,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -329,5 +305,24 @@ public MinlengthValidation1BoxedList validateAndBox(List arg, SchemaConfigura public MinlengthValidation1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new MinlengthValidation1BoxedMap(validate(arg, configuration)); } + @Override + public MinlengthValidation1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinpropertiesValidation.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinpropertiesValidation.java index 23d772b6a6a..1802917d267 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinpropertiesValidation.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MinpropertiesValidation.java @@ -35,78 +35,54 @@ public class MinpropertiesValidation { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class MinpropertiesValidation1Boxed permits MinpropertiesValidation1BoxedVoid, MinpropertiesValidation1BoxedBoolean, MinpropertiesValidation1BoxedNumber, MinpropertiesValidation1BoxedString, MinpropertiesValidation1BoxedList, MinpropertiesValidation1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface MinpropertiesValidation1Boxed permits MinpropertiesValidation1BoxedVoid, MinpropertiesValidation1BoxedBoolean, MinpropertiesValidation1BoxedNumber, MinpropertiesValidation1BoxedString, MinpropertiesValidation1BoxedList, MinpropertiesValidation1BoxedMap { + @Nullable Object getData(); } - public static final class MinpropertiesValidation1BoxedVoid extends MinpropertiesValidation1Boxed { - public final Void data; - private MinpropertiesValidation1BoxedVoid(Void data) { - this.data = data; - } + public record MinpropertiesValidation1BoxedVoid(Void data) implements MinpropertiesValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MinpropertiesValidation1BoxedBoolean extends MinpropertiesValidation1Boxed { - public final boolean data; - private MinpropertiesValidation1BoxedBoolean(boolean data) { - this.data = data; - } + public record MinpropertiesValidation1BoxedBoolean(boolean data) implements MinpropertiesValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MinpropertiesValidation1BoxedNumber extends MinpropertiesValidation1Boxed { - public final Number data; - private MinpropertiesValidation1BoxedNumber(Number data) { - this.data = data; - } + public record MinpropertiesValidation1BoxedNumber(Number data) implements MinpropertiesValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MinpropertiesValidation1BoxedString extends MinpropertiesValidation1Boxed { - public final String data; - private MinpropertiesValidation1BoxedString(String data) { - this.data = data; - } + public record MinpropertiesValidation1BoxedString(String data) implements MinpropertiesValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MinpropertiesValidation1BoxedList extends MinpropertiesValidation1Boxed { - public final FrozenList<@Nullable Object> data; - private MinpropertiesValidation1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record MinpropertiesValidation1BoxedList(FrozenList<@Nullable Object> data) implements MinpropertiesValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MinpropertiesValidation1BoxedMap extends MinpropertiesValidation1Boxed { - public final FrozenMap<@Nullable Object> data; - private MinpropertiesValidation1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record MinpropertiesValidation1BoxedMap(FrozenMap<@Nullable Object> data) implements MinpropertiesValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class MinpropertiesValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, MinpropertiesValidation1BoxedList>, MapSchemaValidator, MinpropertiesValidation1BoxedMap> { + public static class MinpropertiesValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, MinpropertiesValidation1BoxedList>, MapSchemaValidator, MinpropertiesValidation1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -211,11 +187,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -246,11 +222,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -329,5 +305,24 @@ public MinpropertiesValidation1BoxedList validateAndBox(List arg, SchemaConfi public MinpropertiesValidation1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new MinpropertiesValidation1BoxedMap(validate(arg, configuration)); } + @Override + public MinpropertiesValidation1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MultipleDependentsRequired.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MultipleDependentsRequired.java index 7a76fe1b06a..8f0ecd29ca8 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MultipleDependentsRequired.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MultipleDependentsRequired.java @@ -38,78 +38,54 @@ public class MultipleDependentsRequired { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class MultipleDependentsRequired1Boxed permits MultipleDependentsRequired1BoxedVoid, MultipleDependentsRequired1BoxedBoolean, MultipleDependentsRequired1BoxedNumber, MultipleDependentsRequired1BoxedString, MultipleDependentsRequired1BoxedList, MultipleDependentsRequired1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface MultipleDependentsRequired1Boxed permits MultipleDependentsRequired1BoxedVoid, MultipleDependentsRequired1BoxedBoolean, MultipleDependentsRequired1BoxedNumber, MultipleDependentsRequired1BoxedString, MultipleDependentsRequired1BoxedList, MultipleDependentsRequired1BoxedMap { + @Nullable Object getData(); } - public static final class MultipleDependentsRequired1BoxedVoid extends MultipleDependentsRequired1Boxed { - public final Void data; - private MultipleDependentsRequired1BoxedVoid(Void data) { - this.data = data; - } + public record MultipleDependentsRequired1BoxedVoid(Void data) implements MultipleDependentsRequired1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MultipleDependentsRequired1BoxedBoolean extends MultipleDependentsRequired1Boxed { - public final boolean data; - private MultipleDependentsRequired1BoxedBoolean(boolean data) { - this.data = data; - } + public record MultipleDependentsRequired1BoxedBoolean(boolean data) implements MultipleDependentsRequired1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MultipleDependentsRequired1BoxedNumber extends MultipleDependentsRequired1Boxed { - public final Number data; - private MultipleDependentsRequired1BoxedNumber(Number data) { - this.data = data; - } + public record MultipleDependentsRequired1BoxedNumber(Number data) implements MultipleDependentsRequired1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MultipleDependentsRequired1BoxedString extends MultipleDependentsRequired1Boxed { - public final String data; - private MultipleDependentsRequired1BoxedString(String data) { - this.data = data; - } + public record MultipleDependentsRequired1BoxedString(String data) implements MultipleDependentsRequired1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MultipleDependentsRequired1BoxedList extends MultipleDependentsRequired1Boxed { - public final FrozenList<@Nullable Object> data; - private MultipleDependentsRequired1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record MultipleDependentsRequired1BoxedList(FrozenList<@Nullable Object> data) implements MultipleDependentsRequired1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MultipleDependentsRequired1BoxedMap extends MultipleDependentsRequired1Boxed { - public final FrozenMap<@Nullable Object> data; - private MultipleDependentsRequired1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record MultipleDependentsRequired1BoxedMap(FrozenMap<@Nullable Object> data) implements MultipleDependentsRequired1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class MultipleDependentsRequired1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, MultipleDependentsRequired1BoxedList>, MapSchemaValidator, MultipleDependentsRequired1BoxedMap> { + public static class MultipleDependentsRequired1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, MultipleDependentsRequired1BoxedList>, MapSchemaValidator, MultipleDependentsRequired1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -222,11 +198,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -257,11 +233,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -340,5 +316,24 @@ public MultipleDependentsRequired1BoxedList validateAndBox(List arg, SchemaCo public MultipleDependentsRequired1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new MultipleDependentsRequired1BoxedMap(validate(arg, configuration)); } + @Override + public MultipleDependentsRequired1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MultipleSimultaneousPatternpropertiesAreValidated.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MultipleSimultaneousPatternpropertiesAreValidated.java index eced97b84a1..4214bb19e2d 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MultipleSimultaneousPatternpropertiesAreValidated.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MultipleSimultaneousPatternpropertiesAreValidated.java @@ -49,78 +49,54 @@ public static A getInstance() { } - public static abstract sealed class AaaBoxed permits AaaBoxedVoid, AaaBoxedBoolean, AaaBoxedNumber, AaaBoxedString, AaaBoxedList, AaaBoxedMap { - public abstract @Nullable Object data(); + public sealed interface AaaBoxed permits AaaBoxedVoid, AaaBoxedBoolean, AaaBoxedNumber, AaaBoxedString, AaaBoxedList, AaaBoxedMap { + @Nullable Object getData(); } - public static final class AaaBoxedVoid extends AaaBoxed { - public final Void data; - private AaaBoxedVoid(Void data) { - this.data = data; - } + public record AaaBoxedVoid(Void data) implements AaaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AaaBoxedBoolean extends AaaBoxed { - public final boolean data; - private AaaBoxedBoolean(boolean data) { - this.data = data; - } + public record AaaBoxedBoolean(boolean data) implements AaaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AaaBoxedNumber extends AaaBoxed { - public final Number data; - private AaaBoxedNumber(Number data) { - this.data = data; - } + public record AaaBoxedNumber(Number data) implements AaaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AaaBoxedString extends AaaBoxed { - public final String data; - private AaaBoxedString(String data) { - this.data = data; - } + public record AaaBoxedString(String data) implements AaaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AaaBoxedList extends AaaBoxed { - public final FrozenList<@Nullable Object> data; - private AaaBoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record AaaBoxedList(FrozenList<@Nullable Object> data) implements AaaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AaaBoxedMap extends AaaBoxed { - public final FrozenMap<@Nullable Object> data; - private AaaBoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record AaaBoxedMap(FrozenMap<@Nullable Object> data) implements AaaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Aaa extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, AaaBoxedList>, MapSchemaValidator, AaaBoxedMap> { + public static class Aaa extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, AaaBoxedList>, MapSchemaValidator, AaaBoxedMap> { private static @Nullable Aaa instance = null; protected Aaa() { @@ -219,11 +195,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -254,11 +230,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -337,80 +313,75 @@ public AaaBoxedList validateAndBox(List arg, SchemaConfiguration configuratio public AaaBoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new AaaBoxedMap(validate(arg, configuration)); } + @Override + public AaaBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class MultipleSimultaneousPatternpropertiesAreValidated1Boxed permits MultipleSimultaneousPatternpropertiesAreValidated1BoxedVoid, MultipleSimultaneousPatternpropertiesAreValidated1BoxedBoolean, MultipleSimultaneousPatternpropertiesAreValidated1BoxedNumber, MultipleSimultaneousPatternpropertiesAreValidated1BoxedString, MultipleSimultaneousPatternpropertiesAreValidated1BoxedList, MultipleSimultaneousPatternpropertiesAreValidated1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface MultipleSimultaneousPatternpropertiesAreValidated1Boxed permits MultipleSimultaneousPatternpropertiesAreValidated1BoxedVoid, MultipleSimultaneousPatternpropertiesAreValidated1BoxedBoolean, MultipleSimultaneousPatternpropertiesAreValidated1BoxedNumber, MultipleSimultaneousPatternpropertiesAreValidated1BoxedString, MultipleSimultaneousPatternpropertiesAreValidated1BoxedList, MultipleSimultaneousPatternpropertiesAreValidated1BoxedMap { + @Nullable Object getData(); } - public static final class MultipleSimultaneousPatternpropertiesAreValidated1BoxedVoid extends MultipleSimultaneousPatternpropertiesAreValidated1Boxed { - public final Void data; - private MultipleSimultaneousPatternpropertiesAreValidated1BoxedVoid(Void data) { - this.data = data; - } + public record MultipleSimultaneousPatternpropertiesAreValidated1BoxedVoid(Void data) implements MultipleSimultaneousPatternpropertiesAreValidated1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MultipleSimultaneousPatternpropertiesAreValidated1BoxedBoolean extends MultipleSimultaneousPatternpropertiesAreValidated1Boxed { - public final boolean data; - private MultipleSimultaneousPatternpropertiesAreValidated1BoxedBoolean(boolean data) { - this.data = data; - } + public record MultipleSimultaneousPatternpropertiesAreValidated1BoxedBoolean(boolean data) implements MultipleSimultaneousPatternpropertiesAreValidated1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MultipleSimultaneousPatternpropertiesAreValidated1BoxedNumber extends MultipleSimultaneousPatternpropertiesAreValidated1Boxed { - public final Number data; - private MultipleSimultaneousPatternpropertiesAreValidated1BoxedNumber(Number data) { - this.data = data; - } + public record MultipleSimultaneousPatternpropertiesAreValidated1BoxedNumber(Number data) implements MultipleSimultaneousPatternpropertiesAreValidated1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MultipleSimultaneousPatternpropertiesAreValidated1BoxedString extends MultipleSimultaneousPatternpropertiesAreValidated1Boxed { - public final String data; - private MultipleSimultaneousPatternpropertiesAreValidated1BoxedString(String data) { - this.data = data; - } + public record MultipleSimultaneousPatternpropertiesAreValidated1BoxedString(String data) implements MultipleSimultaneousPatternpropertiesAreValidated1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MultipleSimultaneousPatternpropertiesAreValidated1BoxedList extends MultipleSimultaneousPatternpropertiesAreValidated1Boxed { - public final FrozenList<@Nullable Object> data; - private MultipleSimultaneousPatternpropertiesAreValidated1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record MultipleSimultaneousPatternpropertiesAreValidated1BoxedList(FrozenList<@Nullable Object> data) implements MultipleSimultaneousPatternpropertiesAreValidated1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MultipleSimultaneousPatternpropertiesAreValidated1BoxedMap extends MultipleSimultaneousPatternpropertiesAreValidated1Boxed { - public final FrozenMap<@Nullable Object> data; - private MultipleSimultaneousPatternpropertiesAreValidated1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record MultipleSimultaneousPatternpropertiesAreValidated1BoxedMap(FrozenMap<@Nullable Object> data) implements MultipleSimultaneousPatternpropertiesAreValidated1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class MultipleSimultaneousPatternpropertiesAreValidated1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, MultipleSimultaneousPatternpropertiesAreValidated1BoxedList>, MapSchemaValidator, MultipleSimultaneousPatternpropertiesAreValidated1BoxedMap> { + public static class MultipleSimultaneousPatternpropertiesAreValidated1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, MultipleSimultaneousPatternpropertiesAreValidated1BoxedList>, MapSchemaValidator, MultipleSimultaneousPatternpropertiesAreValidated1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -518,11 +489,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -553,11 +524,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -636,5 +607,24 @@ public MultipleSimultaneousPatternpropertiesAreValidated1BoxedList validateAndBo public MultipleSimultaneousPatternpropertiesAreValidated1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new MultipleSimultaneousPatternpropertiesAreValidated1BoxedMap(validate(arg, configuration)); } + @Override + public MultipleSimultaneousPatternpropertiesAreValidated1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MultipleTypesCanBeSpecifiedInAnArray.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MultipleTypesCanBeSpecifiedInAnArray.java index 9a40ec9183e..9a4a8a513ee 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MultipleTypesCanBeSpecifiedInAnArray.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/MultipleTypesCanBeSpecifiedInAnArray.java @@ -21,35 +21,27 @@ public class MultipleTypesCanBeSpecifiedInAnArray { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class MultipleTypesCanBeSpecifiedInAnArray1Boxed permits MultipleTypesCanBeSpecifiedInAnArray1BoxedNumber, MultipleTypesCanBeSpecifiedInAnArray1BoxedString { - public abstract @Nullable Object data(); + public sealed interface MultipleTypesCanBeSpecifiedInAnArray1Boxed permits MultipleTypesCanBeSpecifiedInAnArray1BoxedNumber, MultipleTypesCanBeSpecifiedInAnArray1BoxedString { + @Nullable Object getData(); } - public static final class MultipleTypesCanBeSpecifiedInAnArray1BoxedNumber extends MultipleTypesCanBeSpecifiedInAnArray1Boxed { - public final Number data; - private MultipleTypesCanBeSpecifiedInAnArray1BoxedNumber(Number data) { - this.data = data; - } + public record MultipleTypesCanBeSpecifiedInAnArray1BoxedNumber(Number data) implements MultipleTypesCanBeSpecifiedInAnArray1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MultipleTypesCanBeSpecifiedInAnArray1BoxedString extends MultipleTypesCanBeSpecifiedInAnArray1Boxed { - public final String data; - private MultipleTypesCanBeSpecifiedInAnArray1BoxedString(String data) { - this.data = data; - } + public record MultipleTypesCanBeSpecifiedInAnArray1BoxedString(String data) implements MultipleTypesCanBeSpecifiedInAnArray1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class MultipleTypesCanBeSpecifiedInAnArray1 extends JsonSchema implements NumberSchemaValidator, StringSchemaValidator { + public static class MultipleTypesCanBeSpecifiedInAnArray1 extends JsonSchema implements NumberSchemaValidator, StringSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -142,5 +134,14 @@ public MultipleTypesCanBeSpecifiedInAnArray1BoxedNumber validateAndBox(Number ar public MultipleTypesCanBeSpecifiedInAnArray1BoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new MultipleTypesCanBeSpecifiedInAnArray1BoxedString(validate(arg, configuration)); } + @Override + public MultipleTypesCanBeSpecifiedInAnArray1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAllofToCheckValidationSemantics.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAllofToCheckValidationSemantics.java index 87939b8db33..b7648383ba2 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAllofToCheckValidationSemantics.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAllofToCheckValidationSemantics.java @@ -47,78 +47,54 @@ public static Schema01 getInstance() { } - public static abstract sealed class Schema0Boxed permits Schema0BoxedVoid, Schema0BoxedBoolean, Schema0BoxedNumber, Schema0BoxedString, Schema0BoxedList, Schema0BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Schema0Boxed permits Schema0BoxedVoid, Schema0BoxedBoolean, Schema0BoxedNumber, Schema0BoxedString, Schema0BoxedList, Schema0BoxedMap { + @Nullable Object getData(); } - public static final class Schema0BoxedVoid extends Schema0Boxed { - public final Void data; - private Schema0BoxedVoid(Void data) { - this.data = data; - } + public record Schema0BoxedVoid(Void data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedBoolean extends Schema0Boxed { - public final boolean data; - private Schema0BoxedBoolean(boolean data) { - this.data = data; - } + public record Schema0BoxedBoolean(boolean data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedNumber extends Schema0Boxed { - public final Number data; - private Schema0BoxedNumber(Number data) { - this.data = data; - } + public record Schema0BoxedNumber(Number data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedString extends Schema0Boxed { - public final String data; - private Schema0BoxedString(String data) { - this.data = data; - } + public record Schema0BoxedString(String data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedList extends Schema0Boxed { - public final FrozenList<@Nullable Object> data; - private Schema0BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Schema0BoxedList(FrozenList<@Nullable Object> data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedMap extends Schema0Boxed { - public final FrozenMap<@Nullable Object> data; - private Schema0BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record Schema0BoxedMap(FrozenMap<@Nullable Object> data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema0BoxedList>, MapSchemaValidator, Schema0BoxedMap> { + public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema0BoxedList>, MapSchemaValidator, Schema0BoxedMap> { private static @Nullable Schema0 instance = null; protected Schema0() { @@ -219,11 +195,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -254,11 +230,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -337,80 +313,75 @@ public Schema0BoxedList validateAndBox(List arg, SchemaConfiguration configur public Schema0BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema0BoxedMap(validate(arg, configuration)); } + @Override + public Schema0Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class NestedAllofToCheckValidationSemantics1Boxed permits NestedAllofToCheckValidationSemantics1BoxedVoid, NestedAllofToCheckValidationSemantics1BoxedBoolean, NestedAllofToCheckValidationSemantics1BoxedNumber, NestedAllofToCheckValidationSemantics1BoxedString, NestedAllofToCheckValidationSemantics1BoxedList, NestedAllofToCheckValidationSemantics1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface NestedAllofToCheckValidationSemantics1Boxed permits NestedAllofToCheckValidationSemantics1BoxedVoid, NestedAllofToCheckValidationSemantics1BoxedBoolean, NestedAllofToCheckValidationSemantics1BoxedNumber, NestedAllofToCheckValidationSemantics1BoxedString, NestedAllofToCheckValidationSemantics1BoxedList, NestedAllofToCheckValidationSemantics1BoxedMap { + @Nullable Object getData(); } - public static final class NestedAllofToCheckValidationSemantics1BoxedVoid extends NestedAllofToCheckValidationSemantics1Boxed { - public final Void data; - private NestedAllofToCheckValidationSemantics1BoxedVoid(Void data) { - this.data = data; - } + public record NestedAllofToCheckValidationSemantics1BoxedVoid(Void data) implements NestedAllofToCheckValidationSemantics1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NestedAllofToCheckValidationSemantics1BoxedBoolean extends NestedAllofToCheckValidationSemantics1Boxed { - public final boolean data; - private NestedAllofToCheckValidationSemantics1BoxedBoolean(boolean data) { - this.data = data; - } + public record NestedAllofToCheckValidationSemantics1BoxedBoolean(boolean data) implements NestedAllofToCheckValidationSemantics1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NestedAllofToCheckValidationSemantics1BoxedNumber extends NestedAllofToCheckValidationSemantics1Boxed { - public final Number data; - private NestedAllofToCheckValidationSemantics1BoxedNumber(Number data) { - this.data = data; - } + public record NestedAllofToCheckValidationSemantics1BoxedNumber(Number data) implements NestedAllofToCheckValidationSemantics1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NestedAllofToCheckValidationSemantics1BoxedString extends NestedAllofToCheckValidationSemantics1Boxed { - public final String data; - private NestedAllofToCheckValidationSemantics1BoxedString(String data) { - this.data = data; - } + public record NestedAllofToCheckValidationSemantics1BoxedString(String data) implements NestedAllofToCheckValidationSemantics1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NestedAllofToCheckValidationSemantics1BoxedList extends NestedAllofToCheckValidationSemantics1Boxed { - public final FrozenList<@Nullable Object> data; - private NestedAllofToCheckValidationSemantics1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record NestedAllofToCheckValidationSemantics1BoxedList(FrozenList<@Nullable Object> data) implements NestedAllofToCheckValidationSemantics1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NestedAllofToCheckValidationSemantics1BoxedMap extends NestedAllofToCheckValidationSemantics1Boxed { - public final FrozenMap<@Nullable Object> data; - private NestedAllofToCheckValidationSemantics1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record NestedAllofToCheckValidationSemantics1BoxedMap(FrozenMap<@Nullable Object> data) implements NestedAllofToCheckValidationSemantics1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class NestedAllofToCheckValidationSemantics1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, NestedAllofToCheckValidationSemantics1BoxedList>, MapSchemaValidator, NestedAllofToCheckValidationSemantics1BoxedMap> { + public static class NestedAllofToCheckValidationSemantics1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, NestedAllofToCheckValidationSemantics1BoxedList>, MapSchemaValidator, NestedAllofToCheckValidationSemantics1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -517,11 +488,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -552,11 +523,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -635,5 +606,24 @@ public NestedAllofToCheckValidationSemantics1BoxedList validateAndBox(List ar public NestedAllofToCheckValidationSemantics1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new NestedAllofToCheckValidationSemantics1BoxedMap(validate(arg, configuration)); } + @Override + public NestedAllofToCheckValidationSemantics1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAnyofToCheckValidationSemantics.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAnyofToCheckValidationSemantics.java index aae4e9d3cf6..7709bbbf75c 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAnyofToCheckValidationSemantics.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedAnyofToCheckValidationSemantics.java @@ -47,78 +47,54 @@ public static Schema01 getInstance() { } - public static abstract sealed class Schema0Boxed permits Schema0BoxedVoid, Schema0BoxedBoolean, Schema0BoxedNumber, Schema0BoxedString, Schema0BoxedList, Schema0BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Schema0Boxed permits Schema0BoxedVoid, Schema0BoxedBoolean, Schema0BoxedNumber, Schema0BoxedString, Schema0BoxedList, Schema0BoxedMap { + @Nullable Object getData(); } - public static final class Schema0BoxedVoid extends Schema0Boxed { - public final Void data; - private Schema0BoxedVoid(Void data) { - this.data = data; - } + public record Schema0BoxedVoid(Void data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedBoolean extends Schema0Boxed { - public final boolean data; - private Schema0BoxedBoolean(boolean data) { - this.data = data; - } + public record Schema0BoxedBoolean(boolean data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedNumber extends Schema0Boxed { - public final Number data; - private Schema0BoxedNumber(Number data) { - this.data = data; - } + public record Schema0BoxedNumber(Number data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedString extends Schema0Boxed { - public final String data; - private Schema0BoxedString(String data) { - this.data = data; - } + public record Schema0BoxedString(String data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedList extends Schema0Boxed { - public final FrozenList<@Nullable Object> data; - private Schema0BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Schema0BoxedList(FrozenList<@Nullable Object> data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedMap extends Schema0Boxed { - public final FrozenMap<@Nullable Object> data; - private Schema0BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record Schema0BoxedMap(FrozenMap<@Nullable Object> data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema0BoxedList>, MapSchemaValidator, Schema0BoxedMap> { + public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema0BoxedList>, MapSchemaValidator, Schema0BoxedMap> { private static @Nullable Schema0 instance = null; protected Schema0() { @@ -219,11 +195,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -254,11 +230,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -337,80 +313,75 @@ public Schema0BoxedList validateAndBox(List arg, SchemaConfiguration configur public Schema0BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema0BoxedMap(validate(arg, configuration)); } + @Override + public Schema0Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class NestedAnyofToCheckValidationSemantics1Boxed permits NestedAnyofToCheckValidationSemantics1BoxedVoid, NestedAnyofToCheckValidationSemantics1BoxedBoolean, NestedAnyofToCheckValidationSemantics1BoxedNumber, NestedAnyofToCheckValidationSemantics1BoxedString, NestedAnyofToCheckValidationSemantics1BoxedList, NestedAnyofToCheckValidationSemantics1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface NestedAnyofToCheckValidationSemantics1Boxed permits NestedAnyofToCheckValidationSemantics1BoxedVoid, NestedAnyofToCheckValidationSemantics1BoxedBoolean, NestedAnyofToCheckValidationSemantics1BoxedNumber, NestedAnyofToCheckValidationSemantics1BoxedString, NestedAnyofToCheckValidationSemantics1BoxedList, NestedAnyofToCheckValidationSemantics1BoxedMap { + @Nullable Object getData(); } - public static final class NestedAnyofToCheckValidationSemantics1BoxedVoid extends NestedAnyofToCheckValidationSemantics1Boxed { - public final Void data; - private NestedAnyofToCheckValidationSemantics1BoxedVoid(Void data) { - this.data = data; - } + public record NestedAnyofToCheckValidationSemantics1BoxedVoid(Void data) implements NestedAnyofToCheckValidationSemantics1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NestedAnyofToCheckValidationSemantics1BoxedBoolean extends NestedAnyofToCheckValidationSemantics1Boxed { - public final boolean data; - private NestedAnyofToCheckValidationSemantics1BoxedBoolean(boolean data) { - this.data = data; - } + public record NestedAnyofToCheckValidationSemantics1BoxedBoolean(boolean data) implements NestedAnyofToCheckValidationSemantics1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NestedAnyofToCheckValidationSemantics1BoxedNumber extends NestedAnyofToCheckValidationSemantics1Boxed { - public final Number data; - private NestedAnyofToCheckValidationSemantics1BoxedNumber(Number data) { - this.data = data; - } + public record NestedAnyofToCheckValidationSemantics1BoxedNumber(Number data) implements NestedAnyofToCheckValidationSemantics1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NestedAnyofToCheckValidationSemantics1BoxedString extends NestedAnyofToCheckValidationSemantics1Boxed { - public final String data; - private NestedAnyofToCheckValidationSemantics1BoxedString(String data) { - this.data = data; - } + public record NestedAnyofToCheckValidationSemantics1BoxedString(String data) implements NestedAnyofToCheckValidationSemantics1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NestedAnyofToCheckValidationSemantics1BoxedList extends NestedAnyofToCheckValidationSemantics1Boxed { - public final FrozenList<@Nullable Object> data; - private NestedAnyofToCheckValidationSemantics1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record NestedAnyofToCheckValidationSemantics1BoxedList(FrozenList<@Nullable Object> data) implements NestedAnyofToCheckValidationSemantics1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NestedAnyofToCheckValidationSemantics1BoxedMap extends NestedAnyofToCheckValidationSemantics1Boxed { - public final FrozenMap<@Nullable Object> data; - private NestedAnyofToCheckValidationSemantics1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record NestedAnyofToCheckValidationSemantics1BoxedMap(FrozenMap<@Nullable Object> data) implements NestedAnyofToCheckValidationSemantics1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class NestedAnyofToCheckValidationSemantics1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, NestedAnyofToCheckValidationSemantics1BoxedList>, MapSchemaValidator, NestedAnyofToCheckValidationSemantics1BoxedMap> { + public static class NestedAnyofToCheckValidationSemantics1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, NestedAnyofToCheckValidationSemantics1BoxedList>, MapSchemaValidator, NestedAnyofToCheckValidationSemantics1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -517,11 +488,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -552,11 +523,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -635,5 +606,24 @@ public NestedAnyofToCheckValidationSemantics1BoxedList validateAndBox(List ar public NestedAnyofToCheckValidationSemantics1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new NestedAnyofToCheckValidationSemantics1BoxedMap(validate(arg, configuration)); } + @Override + public NestedAnyofToCheckValidationSemantics1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedItems.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedItems.java index 0219796a2e7..9e6928c1b4c 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedItems.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedItems.java @@ -81,24 +81,20 @@ public List build() { } - public static abstract sealed class Items2Boxed permits Items2BoxedList { - public abstract @Nullable Object data(); + public sealed interface Items2Boxed permits Items2BoxedList { + @Nullable Object getData(); } - public static final class Items2BoxedList extends Items2Boxed { - public final ItemsList data; - private Items2BoxedList(ItemsList data) { - this.data = data; - } + public record Items2BoxedList(ItemsList data) implements Items2Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Items2 extends JsonSchema implements ListSchemaValidator { + public static class Items2 extends JsonSchema implements ListSchemaValidator { private static @Nullable Items2 instance = null; protected Items2() { @@ -122,11 +118,11 @@ public ItemsList getNewInstance(List arg, List pathToItem, PathToSche for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Number)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -166,6 +162,13 @@ public ItemsList validate(List arg, SchemaConfiguration configuration) throws public Items2BoxedList validateAndBox(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Items2BoxedList(validate(arg, configuration)); } + @Override + public Items2Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class ItemsList1 extends FrozenList { @@ -200,24 +203,20 @@ public List> build() { } - public static abstract sealed class Items1Boxed permits Items1BoxedList { - public abstract @Nullable Object data(); + public sealed interface Items1Boxed permits Items1BoxedList { + @Nullable Object getData(); } - public static final class Items1BoxedList extends Items1Boxed { - public final ItemsList1 data; - private Items1BoxedList(ItemsList1 data) { - this.data = data; - } + public record Items1BoxedList(ItemsList1 data) implements Items1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Items1 extends JsonSchema implements ListSchemaValidator { + public static class Items1 extends JsonSchema implements ListSchemaValidator { private static @Nullable Items1 instance = null; protected Items1() { @@ -241,11 +240,11 @@ public ItemsList1 getNewInstance(List arg, List pathToItem, PathToSch for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof ItemsList)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -285,6 +284,13 @@ public ItemsList1 validate(List arg, SchemaConfiguration configuration) throw public Items1BoxedList validateAndBox(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Items1BoxedList(validate(arg, configuration)); } + @Override + public Items1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class ItemsList2 extends FrozenList { @@ -319,24 +325,20 @@ public List>> build() { } - public static abstract sealed class ItemsBoxed permits ItemsBoxedList { - public abstract @Nullable Object data(); + public sealed interface ItemsBoxed permits ItemsBoxedList { + @Nullable Object getData(); } - public static final class ItemsBoxedList extends ItemsBoxed { - public final ItemsList2 data; - private ItemsBoxedList(ItemsList2 data) { - this.data = data; - } + public record ItemsBoxedList(ItemsList2 data) implements ItemsBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Items extends JsonSchema implements ListSchemaValidator { + public static class Items extends JsonSchema implements ListSchemaValidator { private static @Nullable Items instance = null; protected Items() { @@ -360,11 +362,11 @@ public ItemsList2 getNewInstance(List arg, List pathToItem, PathToSch for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof ItemsList1)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -404,6 +406,13 @@ public ItemsList2 validate(List arg, SchemaConfiguration configuration) throw public ItemsBoxedList validateAndBox(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ItemsBoxedList(validate(arg, configuration)); } + @Override + public ItemsBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class NestedItemsList extends FrozenList { @@ -438,24 +447,20 @@ public List>>> build() { } - public static abstract sealed class NestedItems1Boxed permits NestedItems1BoxedList { - public abstract @Nullable Object data(); + public sealed interface NestedItems1Boxed permits NestedItems1BoxedList { + @Nullable Object getData(); } - public static final class NestedItems1BoxedList extends NestedItems1Boxed { - public final NestedItemsList data; - private NestedItems1BoxedList(NestedItemsList data) { - this.data = data; - } + public record NestedItems1BoxedList(NestedItemsList data) implements NestedItems1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class NestedItems1 extends JsonSchema implements ListSchemaValidator { + public static class NestedItems1 extends JsonSchema implements ListSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -485,11 +490,11 @@ public NestedItemsList getNewInstance(List arg, List pathToItem, Path for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof ItemsList2)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -529,5 +534,12 @@ public NestedItemsList validate(List arg, SchemaConfiguration configuration) public NestedItems1BoxedList validateAndBox(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new NestedItems1BoxedList(validate(arg, configuration)); } + @Override + public NestedItems1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedOneofToCheckValidationSemantics.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedOneofToCheckValidationSemantics.java index b4e576c997f..e75084fe04d 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedOneofToCheckValidationSemantics.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NestedOneofToCheckValidationSemantics.java @@ -47,78 +47,54 @@ public static Schema01 getInstance() { } - public static abstract sealed class Schema0Boxed permits Schema0BoxedVoid, Schema0BoxedBoolean, Schema0BoxedNumber, Schema0BoxedString, Schema0BoxedList, Schema0BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Schema0Boxed permits Schema0BoxedVoid, Schema0BoxedBoolean, Schema0BoxedNumber, Schema0BoxedString, Schema0BoxedList, Schema0BoxedMap { + @Nullable Object getData(); } - public static final class Schema0BoxedVoid extends Schema0Boxed { - public final Void data; - private Schema0BoxedVoid(Void data) { - this.data = data; - } + public record Schema0BoxedVoid(Void data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedBoolean extends Schema0Boxed { - public final boolean data; - private Schema0BoxedBoolean(boolean data) { - this.data = data; - } + public record Schema0BoxedBoolean(boolean data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedNumber extends Schema0Boxed { - public final Number data; - private Schema0BoxedNumber(Number data) { - this.data = data; - } + public record Schema0BoxedNumber(Number data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedString extends Schema0Boxed { - public final String data; - private Schema0BoxedString(String data) { - this.data = data; - } + public record Schema0BoxedString(String data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedList extends Schema0Boxed { - public final FrozenList<@Nullable Object> data; - private Schema0BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Schema0BoxedList(FrozenList<@Nullable Object> data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedMap extends Schema0Boxed { - public final FrozenMap<@Nullable Object> data; - private Schema0BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record Schema0BoxedMap(FrozenMap<@Nullable Object> data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema0BoxedList>, MapSchemaValidator, Schema0BoxedMap> { + public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema0BoxedList>, MapSchemaValidator, Schema0BoxedMap> { private static @Nullable Schema0 instance = null; protected Schema0() { @@ -219,11 +195,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -254,11 +230,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -337,80 +313,75 @@ public Schema0BoxedList validateAndBox(List arg, SchemaConfiguration configur public Schema0BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema0BoxedMap(validate(arg, configuration)); } + @Override + public Schema0Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class NestedOneofToCheckValidationSemantics1Boxed permits NestedOneofToCheckValidationSemantics1BoxedVoid, NestedOneofToCheckValidationSemantics1BoxedBoolean, NestedOneofToCheckValidationSemantics1BoxedNumber, NestedOneofToCheckValidationSemantics1BoxedString, NestedOneofToCheckValidationSemantics1BoxedList, NestedOneofToCheckValidationSemantics1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface NestedOneofToCheckValidationSemantics1Boxed permits NestedOneofToCheckValidationSemantics1BoxedVoid, NestedOneofToCheckValidationSemantics1BoxedBoolean, NestedOneofToCheckValidationSemantics1BoxedNumber, NestedOneofToCheckValidationSemantics1BoxedString, NestedOneofToCheckValidationSemantics1BoxedList, NestedOneofToCheckValidationSemantics1BoxedMap { + @Nullable Object getData(); } - public static final class NestedOneofToCheckValidationSemantics1BoxedVoid extends NestedOneofToCheckValidationSemantics1Boxed { - public final Void data; - private NestedOneofToCheckValidationSemantics1BoxedVoid(Void data) { - this.data = data; - } + public record NestedOneofToCheckValidationSemantics1BoxedVoid(Void data) implements NestedOneofToCheckValidationSemantics1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NestedOneofToCheckValidationSemantics1BoxedBoolean extends NestedOneofToCheckValidationSemantics1Boxed { - public final boolean data; - private NestedOneofToCheckValidationSemantics1BoxedBoolean(boolean data) { - this.data = data; - } + public record NestedOneofToCheckValidationSemantics1BoxedBoolean(boolean data) implements NestedOneofToCheckValidationSemantics1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NestedOneofToCheckValidationSemantics1BoxedNumber extends NestedOneofToCheckValidationSemantics1Boxed { - public final Number data; - private NestedOneofToCheckValidationSemantics1BoxedNumber(Number data) { - this.data = data; - } + public record NestedOneofToCheckValidationSemantics1BoxedNumber(Number data) implements NestedOneofToCheckValidationSemantics1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NestedOneofToCheckValidationSemantics1BoxedString extends NestedOneofToCheckValidationSemantics1Boxed { - public final String data; - private NestedOneofToCheckValidationSemantics1BoxedString(String data) { - this.data = data; - } + public record NestedOneofToCheckValidationSemantics1BoxedString(String data) implements NestedOneofToCheckValidationSemantics1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NestedOneofToCheckValidationSemantics1BoxedList extends NestedOneofToCheckValidationSemantics1Boxed { - public final FrozenList<@Nullable Object> data; - private NestedOneofToCheckValidationSemantics1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record NestedOneofToCheckValidationSemantics1BoxedList(FrozenList<@Nullable Object> data) implements NestedOneofToCheckValidationSemantics1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NestedOneofToCheckValidationSemantics1BoxedMap extends NestedOneofToCheckValidationSemantics1Boxed { - public final FrozenMap<@Nullable Object> data; - private NestedOneofToCheckValidationSemantics1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record NestedOneofToCheckValidationSemantics1BoxedMap(FrozenMap<@Nullable Object> data) implements NestedOneofToCheckValidationSemantics1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class NestedOneofToCheckValidationSemantics1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, NestedOneofToCheckValidationSemantics1BoxedList>, MapSchemaValidator, NestedOneofToCheckValidationSemantics1BoxedMap> { + public static class NestedOneofToCheckValidationSemantics1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, NestedOneofToCheckValidationSemantics1BoxedList>, MapSchemaValidator, NestedOneofToCheckValidationSemantics1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -517,11 +488,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -552,11 +523,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -635,5 +606,24 @@ public NestedOneofToCheckValidationSemantics1BoxedList validateAndBox(List ar public NestedOneofToCheckValidationSemantics1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new NestedOneofToCheckValidationSemantics1BoxedMap(validate(arg, configuration)); } + @Override + public NestedOneofToCheckValidationSemantics1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NonAsciiPatternWithAdditionalproperties.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NonAsciiPatternWithAdditionalproperties.java index ef222f143e2..0a3b69df087 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NonAsciiPatternWithAdditionalproperties.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NonAsciiPatternWithAdditionalproperties.java @@ -79,23 +79,19 @@ public NonAsciiPatternWithAdditionalpropertiesMapBuilder() { } - public static abstract sealed class NonAsciiPatternWithAdditionalproperties1Boxed permits NonAsciiPatternWithAdditionalproperties1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface NonAsciiPatternWithAdditionalproperties1Boxed permits NonAsciiPatternWithAdditionalproperties1BoxedMap { + @Nullable Object getData(); } - public static final class NonAsciiPatternWithAdditionalproperties1BoxedMap extends NonAsciiPatternWithAdditionalproperties1Boxed { - public final NonAsciiPatternWithAdditionalpropertiesMap data; - private NonAsciiPatternWithAdditionalproperties1BoxedMap(NonAsciiPatternWithAdditionalpropertiesMap data) { - this.data = data; - } + public record NonAsciiPatternWithAdditionalproperties1BoxedMap(NonAsciiPatternWithAdditionalpropertiesMap data) implements NonAsciiPatternWithAdditionalproperties1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class NonAsciiPatternWithAdditionalproperties1 extends JsonSchema implements MapSchemaValidator { + public static class NonAsciiPatternWithAdditionalproperties1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -132,11 +128,11 @@ public NonAsciiPatternWithAdditionalpropertiesMap getNewInstance(Map arg, List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -173,6 +169,13 @@ public NonAsciiPatternWithAdditionalpropertiesMap validate(Map arg, Schema public NonAsciiPatternWithAdditionalproperties1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new NonAsciiPatternWithAdditionalproperties1BoxedMap(validate(arg, configuration)); } + @Override + public NonAsciiPatternWithAdditionalproperties1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NonInterferenceAcrossCombinedSchemas.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NonInterferenceAcrossCombinedSchemas.java index 02652d270b4..d106e1a35cc 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NonInterferenceAcrossCombinedSchemas.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NonInterferenceAcrossCombinedSchemas.java @@ -36,78 +36,54 @@ public class NonInterferenceAcrossCombinedSchemas { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class IfSchemaBoxed permits IfSchemaBoxedVoid, IfSchemaBoxedBoolean, IfSchemaBoxedNumber, IfSchemaBoxedString, IfSchemaBoxedList, IfSchemaBoxedMap { - public abstract @Nullable Object data(); + public sealed interface IfSchemaBoxed permits IfSchemaBoxedVoid, IfSchemaBoxedBoolean, IfSchemaBoxedNumber, IfSchemaBoxedString, IfSchemaBoxedList, IfSchemaBoxedMap { + @Nullable Object getData(); } - public static final class IfSchemaBoxedVoid extends IfSchemaBoxed { - public final Void data; - private IfSchemaBoxedVoid(Void data) { - this.data = data; - } + public record IfSchemaBoxedVoid(Void data) implements IfSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IfSchemaBoxedBoolean extends IfSchemaBoxed { - public final boolean data; - private IfSchemaBoxedBoolean(boolean data) { - this.data = data; - } + public record IfSchemaBoxedBoolean(boolean data) implements IfSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IfSchemaBoxedNumber extends IfSchemaBoxed { - public final Number data; - private IfSchemaBoxedNumber(Number data) { - this.data = data; - } + public record IfSchemaBoxedNumber(Number data) implements IfSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IfSchemaBoxedString extends IfSchemaBoxed { - public final String data; - private IfSchemaBoxedString(String data) { - this.data = data; - } + public record IfSchemaBoxedString(String data) implements IfSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IfSchemaBoxedList extends IfSchemaBoxed { - public final FrozenList<@Nullable Object> data; - private IfSchemaBoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record IfSchemaBoxedList(FrozenList<@Nullable Object> data) implements IfSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IfSchemaBoxedMap extends IfSchemaBoxed { - public final FrozenMap<@Nullable Object> data; - private IfSchemaBoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record IfSchemaBoxedMap(FrozenMap<@Nullable Object> data) implements IfSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class IfSchema extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, IfSchemaBoxedList>, MapSchemaValidator, IfSchemaBoxedMap> { + public static class IfSchema extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, IfSchemaBoxedList>, MapSchemaValidator, IfSchemaBoxedMap> { private static @Nullable IfSchema instance = null; protected IfSchema() { @@ -206,11 +182,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -241,11 +217,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -324,80 +300,75 @@ public IfSchemaBoxedList validateAndBox(List arg, SchemaConfiguration configu public IfSchemaBoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new IfSchemaBoxedMap(validate(arg, configuration)); } + @Override + public IfSchemaBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class Schema0Boxed permits Schema0BoxedVoid, Schema0BoxedBoolean, Schema0BoxedNumber, Schema0BoxedString, Schema0BoxedList, Schema0BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Schema0Boxed permits Schema0BoxedVoid, Schema0BoxedBoolean, Schema0BoxedNumber, Schema0BoxedString, Schema0BoxedList, Schema0BoxedMap { + @Nullable Object getData(); } - public static final class Schema0BoxedVoid extends Schema0Boxed { - public final Void data; - private Schema0BoxedVoid(Void data) { - this.data = data; - } + public record Schema0BoxedVoid(Void data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedBoolean extends Schema0Boxed { - public final boolean data; - private Schema0BoxedBoolean(boolean data) { - this.data = data; - } + public record Schema0BoxedBoolean(boolean data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedNumber extends Schema0Boxed { - public final Number data; - private Schema0BoxedNumber(Number data) { - this.data = data; - } + public record Schema0BoxedNumber(Number data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedString extends Schema0Boxed { - public final String data; - private Schema0BoxedString(String data) { - this.data = data; - } + public record Schema0BoxedString(String data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedList extends Schema0Boxed { - public final FrozenList<@Nullable Object> data; - private Schema0BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Schema0BoxedList(FrozenList<@Nullable Object> data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedMap extends Schema0Boxed { - public final FrozenMap<@Nullable Object> data; - private Schema0BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record Schema0BoxedMap(FrozenMap<@Nullable Object> data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema0BoxedList>, MapSchemaValidator, Schema0BoxedMap> { + public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema0BoxedList>, MapSchemaValidator, Schema0BoxedMap> { private static @Nullable Schema0 instance = null; protected Schema0() { @@ -496,11 +467,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -531,11 +502,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -614,80 +585,75 @@ public Schema0BoxedList validateAndBox(List arg, SchemaConfiguration configur public Schema0BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema0BoxedMap(validate(arg, configuration)); } + @Override + public Schema0Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class ThenBoxed permits ThenBoxedVoid, ThenBoxedBoolean, ThenBoxedNumber, ThenBoxedString, ThenBoxedList, ThenBoxedMap { - public abstract @Nullable Object data(); + public sealed interface ThenBoxed permits ThenBoxedVoid, ThenBoxedBoolean, ThenBoxedNumber, ThenBoxedString, ThenBoxedList, ThenBoxedMap { + @Nullable Object getData(); } - public static final class ThenBoxedVoid extends ThenBoxed { - public final Void data; - private ThenBoxedVoid(Void data) { - this.data = data; - } + public record ThenBoxedVoid(Void data) implements ThenBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ThenBoxedBoolean extends ThenBoxed { - public final boolean data; - private ThenBoxedBoolean(boolean data) { - this.data = data; - } + public record ThenBoxedBoolean(boolean data) implements ThenBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ThenBoxedNumber extends ThenBoxed { - public final Number data; - private ThenBoxedNumber(Number data) { - this.data = data; - } + public record ThenBoxedNumber(Number data) implements ThenBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ThenBoxedString extends ThenBoxed { - public final String data; - private ThenBoxedString(String data) { - this.data = data; - } + public record ThenBoxedString(String data) implements ThenBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ThenBoxedList extends ThenBoxed { - public final FrozenList<@Nullable Object> data; - private ThenBoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record ThenBoxedList(FrozenList<@Nullable Object> data) implements ThenBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ThenBoxedMap extends ThenBoxed { - public final FrozenMap<@Nullable Object> data; - private ThenBoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record ThenBoxedMap(FrozenMap<@Nullable Object> data) implements ThenBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Then extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ThenBoxedList>, MapSchemaValidator, ThenBoxedMap> { + public static class Then extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ThenBoxedList>, MapSchemaValidator, ThenBoxedMap> { private static @Nullable Then instance = null; protected Then() { @@ -786,11 +752,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -821,11 +787,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -904,80 +870,75 @@ public ThenBoxedList validateAndBox(List arg, SchemaConfiguration configurati public ThenBoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ThenBoxedMap(validate(arg, configuration)); } + @Override + public ThenBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class Schema1Boxed permits Schema1BoxedVoid, Schema1BoxedBoolean, Schema1BoxedNumber, Schema1BoxedString, Schema1BoxedList, Schema1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Schema1Boxed permits Schema1BoxedVoid, Schema1BoxedBoolean, Schema1BoxedNumber, Schema1BoxedString, Schema1BoxedList, Schema1BoxedMap { + @Nullable Object getData(); } - public static final class Schema1BoxedVoid extends Schema1Boxed { - public final Void data; - private Schema1BoxedVoid(Void data) { - this.data = data; - } + public record Schema1BoxedVoid(Void data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedBoolean extends Schema1Boxed { - public final boolean data; - private Schema1BoxedBoolean(boolean data) { - this.data = data; - } + public record Schema1BoxedBoolean(boolean data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedNumber extends Schema1Boxed { - public final Number data; - private Schema1BoxedNumber(Number data) { - this.data = data; - } + public record Schema1BoxedNumber(Number data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedString extends Schema1Boxed { - public final String data; - private Schema1BoxedString(String data) { - this.data = data; - } + public record Schema1BoxedString(String data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedList extends Schema1Boxed { - public final FrozenList<@Nullable Object> data; - private Schema1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Schema1BoxedList(FrozenList<@Nullable Object> data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedMap extends Schema1Boxed { - public final FrozenMap<@Nullable Object> data; - private Schema1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record Schema1BoxedMap(FrozenMap<@Nullable Object> data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema1BoxedList>, MapSchemaValidator, Schema1BoxedMap> { + public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema1BoxedList>, MapSchemaValidator, Schema1BoxedMap> { private static @Nullable Schema1 instance = null; protected Schema1() { @@ -1076,11 +1037,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -1111,11 +1072,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -1194,80 +1155,75 @@ public Schema1BoxedList validateAndBox(List arg, SchemaConfiguration configur public Schema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema1BoxedMap(validate(arg, configuration)); } + @Override + public Schema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class ElseSchemaBoxed permits ElseSchemaBoxedVoid, ElseSchemaBoxedBoolean, ElseSchemaBoxedNumber, ElseSchemaBoxedString, ElseSchemaBoxedList, ElseSchemaBoxedMap { - public abstract @Nullable Object data(); + public sealed interface ElseSchemaBoxed permits ElseSchemaBoxedVoid, ElseSchemaBoxedBoolean, ElseSchemaBoxedNumber, ElseSchemaBoxedString, ElseSchemaBoxedList, ElseSchemaBoxedMap { + @Nullable Object getData(); } - public static final class ElseSchemaBoxedVoid extends ElseSchemaBoxed { - public final Void data; - private ElseSchemaBoxedVoid(Void data) { - this.data = data; - } + public record ElseSchemaBoxedVoid(Void data) implements ElseSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ElseSchemaBoxedBoolean extends ElseSchemaBoxed { - public final boolean data; - private ElseSchemaBoxedBoolean(boolean data) { - this.data = data; - } + public record ElseSchemaBoxedBoolean(boolean data) implements ElseSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ElseSchemaBoxedNumber extends ElseSchemaBoxed { - public final Number data; - private ElseSchemaBoxedNumber(Number data) { - this.data = data; - } + public record ElseSchemaBoxedNumber(Number data) implements ElseSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ElseSchemaBoxedString extends ElseSchemaBoxed { - public final String data; - private ElseSchemaBoxedString(String data) { - this.data = data; - } + public record ElseSchemaBoxedString(String data) implements ElseSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ElseSchemaBoxedList extends ElseSchemaBoxed { - public final FrozenList<@Nullable Object> data; - private ElseSchemaBoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record ElseSchemaBoxedList(FrozenList<@Nullable Object> data) implements ElseSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ElseSchemaBoxedMap extends ElseSchemaBoxed { - public final FrozenMap<@Nullable Object> data; - private ElseSchemaBoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record ElseSchemaBoxedMap(FrozenMap<@Nullable Object> data) implements ElseSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ElseSchema extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ElseSchemaBoxedList>, MapSchemaValidator, ElseSchemaBoxedMap> { + public static class ElseSchema extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ElseSchemaBoxedList>, MapSchemaValidator, ElseSchemaBoxedMap> { private static @Nullable ElseSchema instance = null; protected ElseSchema() { @@ -1366,11 +1322,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -1401,11 +1357,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -1484,80 +1440,75 @@ public ElseSchemaBoxedList validateAndBox(List arg, SchemaConfiguration confi public ElseSchemaBoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ElseSchemaBoxedMap(validate(arg, configuration)); } + @Override + public ElseSchemaBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class Schema2Boxed permits Schema2BoxedVoid, Schema2BoxedBoolean, Schema2BoxedNumber, Schema2BoxedString, Schema2BoxedList, Schema2BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Schema2Boxed permits Schema2BoxedVoid, Schema2BoxedBoolean, Schema2BoxedNumber, Schema2BoxedString, Schema2BoxedList, Schema2BoxedMap { + @Nullable Object getData(); } - public static final class Schema2BoxedVoid extends Schema2Boxed { - public final Void data; - private Schema2BoxedVoid(Void data) { - this.data = data; - } + public record Schema2BoxedVoid(Void data) implements Schema2Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema2BoxedBoolean extends Schema2Boxed { - public final boolean data; - private Schema2BoxedBoolean(boolean data) { - this.data = data; - } + public record Schema2BoxedBoolean(boolean data) implements Schema2Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema2BoxedNumber extends Schema2Boxed { - public final Number data; - private Schema2BoxedNumber(Number data) { - this.data = data; - } + public record Schema2BoxedNumber(Number data) implements Schema2Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema2BoxedString extends Schema2Boxed { - public final String data; - private Schema2BoxedString(String data) { - this.data = data; - } + public record Schema2BoxedString(String data) implements Schema2Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema2BoxedList extends Schema2Boxed { - public final FrozenList<@Nullable Object> data; - private Schema2BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Schema2BoxedList(FrozenList<@Nullable Object> data) implements Schema2Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema2BoxedMap extends Schema2Boxed { - public final FrozenMap<@Nullable Object> data; - private Schema2BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record Schema2BoxedMap(FrozenMap<@Nullable Object> data) implements Schema2Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema2 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema2BoxedList>, MapSchemaValidator, Schema2BoxedMap> { + public static class Schema2 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema2BoxedList>, MapSchemaValidator, Schema2BoxedMap> { private static @Nullable Schema2 instance = null; protected Schema2() { @@ -1656,11 +1607,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -1691,11 +1642,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -1774,80 +1725,75 @@ public Schema2BoxedList validateAndBox(List arg, SchemaConfiguration configur public Schema2BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema2BoxedMap(validate(arg, configuration)); } + @Override + public Schema2Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class NonInterferenceAcrossCombinedSchemas1Boxed permits NonInterferenceAcrossCombinedSchemas1BoxedVoid, NonInterferenceAcrossCombinedSchemas1BoxedBoolean, NonInterferenceAcrossCombinedSchemas1BoxedNumber, NonInterferenceAcrossCombinedSchemas1BoxedString, NonInterferenceAcrossCombinedSchemas1BoxedList, NonInterferenceAcrossCombinedSchemas1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface NonInterferenceAcrossCombinedSchemas1Boxed permits NonInterferenceAcrossCombinedSchemas1BoxedVoid, NonInterferenceAcrossCombinedSchemas1BoxedBoolean, NonInterferenceAcrossCombinedSchemas1BoxedNumber, NonInterferenceAcrossCombinedSchemas1BoxedString, NonInterferenceAcrossCombinedSchemas1BoxedList, NonInterferenceAcrossCombinedSchemas1BoxedMap { + @Nullable Object getData(); } - public static final class NonInterferenceAcrossCombinedSchemas1BoxedVoid extends NonInterferenceAcrossCombinedSchemas1Boxed { - public final Void data; - private NonInterferenceAcrossCombinedSchemas1BoxedVoid(Void data) { - this.data = data; - } + public record NonInterferenceAcrossCombinedSchemas1BoxedVoid(Void data) implements NonInterferenceAcrossCombinedSchemas1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NonInterferenceAcrossCombinedSchemas1BoxedBoolean extends NonInterferenceAcrossCombinedSchemas1Boxed { - public final boolean data; - private NonInterferenceAcrossCombinedSchemas1BoxedBoolean(boolean data) { - this.data = data; - } + public record NonInterferenceAcrossCombinedSchemas1BoxedBoolean(boolean data) implements NonInterferenceAcrossCombinedSchemas1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NonInterferenceAcrossCombinedSchemas1BoxedNumber extends NonInterferenceAcrossCombinedSchemas1Boxed { - public final Number data; - private NonInterferenceAcrossCombinedSchemas1BoxedNumber(Number data) { - this.data = data; - } + public record NonInterferenceAcrossCombinedSchemas1BoxedNumber(Number data) implements NonInterferenceAcrossCombinedSchemas1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NonInterferenceAcrossCombinedSchemas1BoxedString extends NonInterferenceAcrossCombinedSchemas1Boxed { - public final String data; - private NonInterferenceAcrossCombinedSchemas1BoxedString(String data) { - this.data = data; - } + public record NonInterferenceAcrossCombinedSchemas1BoxedString(String data) implements NonInterferenceAcrossCombinedSchemas1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NonInterferenceAcrossCombinedSchemas1BoxedList extends NonInterferenceAcrossCombinedSchemas1Boxed { - public final FrozenList<@Nullable Object> data; - private NonInterferenceAcrossCombinedSchemas1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record NonInterferenceAcrossCombinedSchemas1BoxedList(FrozenList<@Nullable Object> data) implements NonInterferenceAcrossCombinedSchemas1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NonInterferenceAcrossCombinedSchemas1BoxedMap extends NonInterferenceAcrossCombinedSchemas1Boxed { - public final FrozenMap<@Nullable Object> data; - private NonInterferenceAcrossCombinedSchemas1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record NonInterferenceAcrossCombinedSchemas1BoxedMap(FrozenMap<@Nullable Object> data) implements NonInterferenceAcrossCombinedSchemas1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class NonInterferenceAcrossCombinedSchemas1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, NonInterferenceAcrossCombinedSchemas1BoxedList>, MapSchemaValidator, NonInterferenceAcrossCombinedSchemas1BoxedMap> { + public static class NonInterferenceAcrossCombinedSchemas1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, NonInterferenceAcrossCombinedSchemas1BoxedList>, MapSchemaValidator, NonInterferenceAcrossCombinedSchemas1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -1956,11 +1902,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -1991,11 +1937,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -2074,5 +2020,24 @@ public NonInterferenceAcrossCombinedSchemas1BoxedList validateAndBox(List arg public NonInterferenceAcrossCombinedSchemas1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new NonInterferenceAcrossCombinedSchemas1BoxedMap(validate(arg, configuration)); } + @Override + public NonInterferenceAcrossCombinedSchemas1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Not.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Not.java index ea255f3c1e1..98514e1cbff 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Not.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Not.java @@ -47,78 +47,54 @@ public static Not2 getInstance() { } - public static abstract sealed class Not1Boxed permits Not1BoxedVoid, Not1BoxedBoolean, Not1BoxedNumber, Not1BoxedString, Not1BoxedList, Not1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Not1Boxed permits Not1BoxedVoid, Not1BoxedBoolean, Not1BoxedNumber, Not1BoxedString, Not1BoxedList, Not1BoxedMap { + @Nullable Object getData(); } - public static final class Not1BoxedVoid extends Not1Boxed { - public final Void data; - private Not1BoxedVoid(Void data) { - this.data = data; - } + public record Not1BoxedVoid(Void data) implements Not1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Not1BoxedBoolean extends Not1Boxed { - public final boolean data; - private Not1BoxedBoolean(boolean data) { - this.data = data; - } + public record Not1BoxedBoolean(boolean data) implements Not1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Not1BoxedNumber extends Not1Boxed { - public final Number data; - private Not1BoxedNumber(Number data) { - this.data = data; - } + public record Not1BoxedNumber(Number data) implements Not1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Not1BoxedString extends Not1Boxed { - public final String data; - private Not1BoxedString(String data) { - this.data = data; - } + public record Not1BoxedString(String data) implements Not1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Not1BoxedList extends Not1Boxed { - public final FrozenList<@Nullable Object> data; - private Not1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Not1BoxedList(FrozenList<@Nullable Object> data) implements Not1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Not1BoxedMap extends Not1Boxed { - public final FrozenMap<@Nullable Object> data; - private Not1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record Not1BoxedMap(FrozenMap<@Nullable Object> data) implements Not1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Not1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Not1BoxedList>, MapSchemaValidator, Not1BoxedMap> { + public static class Not1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Not1BoxedList>, MapSchemaValidator, Not1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -223,11 +199,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -258,11 +234,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -341,5 +317,24 @@ public Not1BoxedList validateAndBox(List arg, SchemaConfiguration configurati public Not1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Not1BoxedMap(validate(arg, configuration)); } + @Override + public Not1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMoreComplexSchema.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMoreComplexSchema.java index 245812f4415..0e92dc9eac8 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMoreComplexSchema.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMoreComplexSchema.java @@ -115,23 +115,19 @@ public NotMapBuilder getBuilderAfterAdditionalProperty(Map { + public static class Not extends JsonSchema implements MapSchemaValidator { private static @Nullable Not instance = null; protected Not() { @@ -161,11 +157,11 @@ public NotMap getNewInstance(Map arg, List pathToItem, PathToSchem List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -202,81 +198,64 @@ public NotMap validate(Map arg, SchemaConfiguration configuration) throws public NotBoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new NotBoxedMap(validate(arg, configuration)); } + @Override + public NotBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class NotMoreComplexSchema1Boxed permits NotMoreComplexSchema1BoxedVoid, NotMoreComplexSchema1BoxedBoolean, NotMoreComplexSchema1BoxedNumber, NotMoreComplexSchema1BoxedString, NotMoreComplexSchema1BoxedList, NotMoreComplexSchema1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface NotMoreComplexSchema1Boxed permits NotMoreComplexSchema1BoxedVoid, NotMoreComplexSchema1BoxedBoolean, NotMoreComplexSchema1BoxedNumber, NotMoreComplexSchema1BoxedString, NotMoreComplexSchema1BoxedList, NotMoreComplexSchema1BoxedMap { + @Nullable Object getData(); } - public static final class NotMoreComplexSchema1BoxedVoid extends NotMoreComplexSchema1Boxed { - public final Void data; - private NotMoreComplexSchema1BoxedVoid(Void data) { - this.data = data; - } + public record NotMoreComplexSchema1BoxedVoid(Void data) implements NotMoreComplexSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NotMoreComplexSchema1BoxedBoolean extends NotMoreComplexSchema1Boxed { - public final boolean data; - private NotMoreComplexSchema1BoxedBoolean(boolean data) { - this.data = data; - } + public record NotMoreComplexSchema1BoxedBoolean(boolean data) implements NotMoreComplexSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NotMoreComplexSchema1BoxedNumber extends NotMoreComplexSchema1Boxed { - public final Number data; - private NotMoreComplexSchema1BoxedNumber(Number data) { - this.data = data; - } + public record NotMoreComplexSchema1BoxedNumber(Number data) implements NotMoreComplexSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NotMoreComplexSchema1BoxedString extends NotMoreComplexSchema1Boxed { - public final String data; - private NotMoreComplexSchema1BoxedString(String data) { - this.data = data; - } + public record NotMoreComplexSchema1BoxedString(String data) implements NotMoreComplexSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NotMoreComplexSchema1BoxedList extends NotMoreComplexSchema1Boxed { - public final FrozenList<@Nullable Object> data; - private NotMoreComplexSchema1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record NotMoreComplexSchema1BoxedList(FrozenList<@Nullable Object> data) implements NotMoreComplexSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NotMoreComplexSchema1BoxedMap extends NotMoreComplexSchema1Boxed { - public final FrozenMap<@Nullable Object> data; - private NotMoreComplexSchema1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record NotMoreComplexSchema1BoxedMap(FrozenMap<@Nullable Object> data) implements NotMoreComplexSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class NotMoreComplexSchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, NotMoreComplexSchema1BoxedList>, MapSchemaValidator, NotMoreComplexSchema1BoxedMap> { + public static class NotMoreComplexSchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, NotMoreComplexSchema1BoxedList>, MapSchemaValidator, NotMoreComplexSchema1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -381,11 +360,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -416,11 +395,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -499,5 +478,24 @@ public NotMoreComplexSchema1BoxedList validateAndBox(List arg, SchemaConfigur public NotMoreComplexSchema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new NotMoreComplexSchema1BoxedMap(validate(arg, configuration)); } + @Override + public NotMoreComplexSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMultipleTypes.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMultipleTypes.java index 81edb3e7bdc..04424f0d255 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMultipleTypes.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NotMultipleTypes.java @@ -35,35 +35,27 @@ public class NotMultipleTypes { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class NotBoxed permits NotBoxedNumber, NotBoxedBoolean { - public abstract @Nullable Object data(); + public sealed interface NotBoxed permits NotBoxedNumber, NotBoxedBoolean { + @Nullable Object getData(); } - public static final class NotBoxedNumber extends NotBoxed { - public final Number data; - private NotBoxedNumber(Number data) { - this.data = data; - } + public record NotBoxedNumber(Number data) implements NotBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NotBoxedBoolean extends NotBoxed { - public final boolean data; - private NotBoxedBoolean(boolean data) { - this.data = data; - } + public record NotBoxedBoolean(boolean data) implements NotBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Not extends JsonSchema implements NumberSchemaValidator, BooleanSchemaValidator { + public static class Not extends JsonSchema implements NumberSchemaValidator, BooleanSchemaValidator { private static @Nullable Not instance = null; protected Not() { @@ -152,80 +144,66 @@ public NotBoxedNumber validateAndBox(Number arg, SchemaConfiguration configurati public NotBoxedBoolean validateAndBox(boolean arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new NotBoxedBoolean(validate(arg, configuration)); } + @Override + public NotBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class NotMultipleTypes1Boxed permits NotMultipleTypes1BoxedVoid, NotMultipleTypes1BoxedBoolean, NotMultipleTypes1BoxedNumber, NotMultipleTypes1BoxedString, NotMultipleTypes1BoxedList, NotMultipleTypes1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface NotMultipleTypes1Boxed permits NotMultipleTypes1BoxedVoid, NotMultipleTypes1BoxedBoolean, NotMultipleTypes1BoxedNumber, NotMultipleTypes1BoxedString, NotMultipleTypes1BoxedList, NotMultipleTypes1BoxedMap { + @Nullable Object getData(); } - public static final class NotMultipleTypes1BoxedVoid extends NotMultipleTypes1Boxed { - public final Void data; - private NotMultipleTypes1BoxedVoid(Void data) { - this.data = data; - } + public record NotMultipleTypes1BoxedVoid(Void data) implements NotMultipleTypes1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NotMultipleTypes1BoxedBoolean extends NotMultipleTypes1Boxed { - public final boolean data; - private NotMultipleTypes1BoxedBoolean(boolean data) { - this.data = data; - } + public record NotMultipleTypes1BoxedBoolean(boolean data) implements NotMultipleTypes1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NotMultipleTypes1BoxedNumber extends NotMultipleTypes1Boxed { - public final Number data; - private NotMultipleTypes1BoxedNumber(Number data) { - this.data = data; - } + public record NotMultipleTypes1BoxedNumber(Number data) implements NotMultipleTypes1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NotMultipleTypes1BoxedString extends NotMultipleTypes1Boxed { - public final String data; - private NotMultipleTypes1BoxedString(String data) { - this.data = data; - } + public record NotMultipleTypes1BoxedString(String data) implements NotMultipleTypes1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NotMultipleTypes1BoxedList extends NotMultipleTypes1Boxed { - public final FrozenList<@Nullable Object> data; - private NotMultipleTypes1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record NotMultipleTypes1BoxedList(FrozenList<@Nullable Object> data) implements NotMultipleTypes1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NotMultipleTypes1BoxedMap extends NotMultipleTypes1Boxed { - public final FrozenMap<@Nullable Object> data; - private NotMultipleTypes1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record NotMultipleTypes1BoxedMap(FrozenMap<@Nullable Object> data) implements NotMultipleTypes1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class NotMultipleTypes1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, NotMultipleTypes1BoxedList>, MapSchemaValidator, NotMultipleTypes1BoxedMap> { + public static class NotMultipleTypes1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, NotMultipleTypes1BoxedList>, MapSchemaValidator, NotMultipleTypes1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -330,11 +308,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -365,11 +343,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -448,5 +426,24 @@ public NotMultipleTypes1BoxedList validateAndBox(List arg, SchemaConfiguratio public NotMultipleTypes1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new NotMultipleTypes1BoxedMap(validate(arg, configuration)); } + @Override + public NotMultipleTypes1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NulCharactersInStrings.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NulCharactersInStrings.java index 488e5aa4a93..cccbac4a8ff 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NulCharactersInStrings.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/NulCharactersInStrings.java @@ -34,24 +34,20 @@ public String value() { } - public static abstract sealed class NulCharactersInStrings1Boxed permits NulCharactersInStrings1BoxedString { - public abstract @Nullable Object data(); + public sealed interface NulCharactersInStrings1Boxed permits NulCharactersInStrings1BoxedString { + @Nullable Object getData(); } - public static final class NulCharactersInStrings1BoxedString extends NulCharactersInStrings1Boxed { - public final String data; - private NulCharactersInStrings1BoxedString(String data) { - this.data = data; - } + public record NulCharactersInStrings1BoxedString(String data) implements NulCharactersInStrings1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class NulCharactersInStrings1 extends JsonSchema implements StringSchemaValidator, StringEnumValidator { + public static class NulCharactersInStrings1 extends JsonSchema implements StringSchemaValidator, StringEnumValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -112,5 +108,12 @@ public String validate(StringNulCharactersInStringsEnums arg,SchemaConfiguration public NulCharactersInStrings1BoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new NulCharactersInStrings1BoxedString(validate(arg, configuration)); } + @Override + public NulCharactersInStrings1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java index 9637bde1419..01f7f868c52 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectPropertiesValidation.java @@ -171,78 +171,54 @@ public ObjectPropertiesValidationMapBuilder getBuilderAfterAdditionalProperty(Ma } - public static abstract sealed class ObjectPropertiesValidation1Boxed permits ObjectPropertiesValidation1BoxedVoid, ObjectPropertiesValidation1BoxedBoolean, ObjectPropertiesValidation1BoxedNumber, ObjectPropertiesValidation1BoxedString, ObjectPropertiesValidation1BoxedList, ObjectPropertiesValidation1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface ObjectPropertiesValidation1Boxed permits ObjectPropertiesValidation1BoxedVoid, ObjectPropertiesValidation1BoxedBoolean, ObjectPropertiesValidation1BoxedNumber, ObjectPropertiesValidation1BoxedString, ObjectPropertiesValidation1BoxedList, ObjectPropertiesValidation1BoxedMap { + @Nullable Object getData(); } - public static final class ObjectPropertiesValidation1BoxedVoid extends ObjectPropertiesValidation1Boxed { - public final Void data; - private ObjectPropertiesValidation1BoxedVoid(Void data) { - this.data = data; - } + public record ObjectPropertiesValidation1BoxedVoid(Void data) implements ObjectPropertiesValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ObjectPropertiesValidation1BoxedBoolean extends ObjectPropertiesValidation1Boxed { - public final boolean data; - private ObjectPropertiesValidation1BoxedBoolean(boolean data) { - this.data = data; - } + public record ObjectPropertiesValidation1BoxedBoolean(boolean data) implements ObjectPropertiesValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ObjectPropertiesValidation1BoxedNumber extends ObjectPropertiesValidation1Boxed { - public final Number data; - private ObjectPropertiesValidation1BoxedNumber(Number data) { - this.data = data; - } + public record ObjectPropertiesValidation1BoxedNumber(Number data) implements ObjectPropertiesValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ObjectPropertiesValidation1BoxedString extends ObjectPropertiesValidation1Boxed { - public final String data; - private ObjectPropertiesValidation1BoxedString(String data) { - this.data = data; - } + public record ObjectPropertiesValidation1BoxedString(String data) implements ObjectPropertiesValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ObjectPropertiesValidation1BoxedList extends ObjectPropertiesValidation1Boxed { - public final FrozenList<@Nullable Object> data; - private ObjectPropertiesValidation1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record ObjectPropertiesValidation1BoxedList(FrozenList<@Nullable Object> data) implements ObjectPropertiesValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ObjectPropertiesValidation1BoxedMap extends ObjectPropertiesValidation1Boxed { - public final ObjectPropertiesValidationMap data; - private ObjectPropertiesValidation1BoxedMap(ObjectPropertiesValidationMap data) { - this.data = data; - } + public record ObjectPropertiesValidation1BoxedMap(ObjectPropertiesValidationMap data) implements ObjectPropertiesValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ObjectPropertiesValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ObjectPropertiesValidation1BoxedList>, MapSchemaValidator { + public static class ObjectPropertiesValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ObjectPropertiesValidation1BoxedList>, MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -350,11 +326,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -385,11 +361,11 @@ public ObjectPropertiesValidationMap getNewInstance(Map arg, List List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -468,5 +444,24 @@ public ObjectPropertiesValidation1BoxedList validateAndBox(List arg, SchemaCo public ObjectPropertiesValidation1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ObjectPropertiesValidation1BoxedMap(validate(arg, configuration)); } + @Override + public ObjectPropertiesValidation1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Oneof.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Oneof.java index 3fb43ed1107..86951cf5e63 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Oneof.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/Oneof.java @@ -47,78 +47,54 @@ public static Schema0 getInstance() { } - public static abstract sealed class Schema1Boxed permits Schema1BoxedVoid, Schema1BoxedBoolean, Schema1BoxedNumber, Schema1BoxedString, Schema1BoxedList, Schema1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Schema1Boxed permits Schema1BoxedVoid, Schema1BoxedBoolean, Schema1BoxedNumber, Schema1BoxedString, Schema1BoxedList, Schema1BoxedMap { + @Nullable Object getData(); } - public static final class Schema1BoxedVoid extends Schema1Boxed { - public final Void data; - private Schema1BoxedVoid(Void data) { - this.data = data; - } + public record Schema1BoxedVoid(Void data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedBoolean extends Schema1Boxed { - public final boolean data; - private Schema1BoxedBoolean(boolean data) { - this.data = data; - } + public record Schema1BoxedBoolean(boolean data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedNumber extends Schema1Boxed { - public final Number data; - private Schema1BoxedNumber(Number data) { - this.data = data; - } + public record Schema1BoxedNumber(Number data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedString extends Schema1Boxed { - public final String data; - private Schema1BoxedString(String data) { - this.data = data; - } + public record Schema1BoxedString(String data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedList extends Schema1Boxed { - public final FrozenList<@Nullable Object> data; - private Schema1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Schema1BoxedList(FrozenList<@Nullable Object> data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedMap extends Schema1Boxed { - public final FrozenMap<@Nullable Object> data; - private Schema1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record Schema1BoxedMap(FrozenMap<@Nullable Object> data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema1BoxedList>, MapSchemaValidator, Schema1BoxedMap> { + public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema1BoxedList>, MapSchemaValidator, Schema1BoxedMap> { private static @Nullable Schema1 instance = null; protected Schema1() { @@ -217,11 +193,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -252,11 +228,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -335,80 +311,75 @@ public Schema1BoxedList validateAndBox(List arg, SchemaConfiguration configur public Schema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema1BoxedMap(validate(arg, configuration)); } + @Override + public Schema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class Oneof1Boxed permits Oneof1BoxedVoid, Oneof1BoxedBoolean, Oneof1BoxedNumber, Oneof1BoxedString, Oneof1BoxedList, Oneof1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Oneof1Boxed permits Oneof1BoxedVoid, Oneof1BoxedBoolean, Oneof1BoxedNumber, Oneof1BoxedString, Oneof1BoxedList, Oneof1BoxedMap { + @Nullable Object getData(); } - public static final class Oneof1BoxedVoid extends Oneof1Boxed { - public final Void data; - private Oneof1BoxedVoid(Void data) { - this.data = data; - } + public record Oneof1BoxedVoid(Void data) implements Oneof1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Oneof1BoxedBoolean extends Oneof1Boxed { - public final boolean data; - private Oneof1BoxedBoolean(boolean data) { - this.data = data; - } + public record Oneof1BoxedBoolean(boolean data) implements Oneof1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Oneof1BoxedNumber extends Oneof1Boxed { - public final Number data; - private Oneof1BoxedNumber(Number data) { - this.data = data; - } + public record Oneof1BoxedNumber(Number data) implements Oneof1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Oneof1BoxedString extends Oneof1Boxed { - public final String data; - private Oneof1BoxedString(String data) { - this.data = data; - } + public record Oneof1BoxedString(String data) implements Oneof1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Oneof1BoxedList extends Oneof1Boxed { - public final FrozenList<@Nullable Object> data; - private Oneof1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Oneof1BoxedList(FrozenList<@Nullable Object> data) implements Oneof1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Oneof1BoxedMap extends Oneof1Boxed { - public final FrozenMap<@Nullable Object> data; - private Oneof1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record Oneof1BoxedMap(FrozenMap<@Nullable Object> data) implements Oneof1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Oneof1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Oneof1BoxedList>, MapSchemaValidator, Oneof1BoxedMap> { + public static class Oneof1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Oneof1BoxedList>, MapSchemaValidator, Oneof1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -516,11 +487,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -551,11 +522,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -634,5 +605,24 @@ public Oneof1BoxedList validateAndBox(List arg, SchemaConfiguration configura public Oneof1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Oneof1BoxedMap(validate(arg, configuration)); } + @Override + public Oneof1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java index 84d62dcd36a..ee1966faee0 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofComplexTypes.java @@ -142,78 +142,54 @@ public Schema0Map0Builder getBuilderAfterBar(Map insta } - public static abstract sealed class Schema0Boxed permits Schema0BoxedVoid, Schema0BoxedBoolean, Schema0BoxedNumber, Schema0BoxedString, Schema0BoxedList, Schema0BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Schema0Boxed permits Schema0BoxedVoid, Schema0BoxedBoolean, Schema0BoxedNumber, Schema0BoxedString, Schema0BoxedList, Schema0BoxedMap { + @Nullable Object getData(); } - public static final class Schema0BoxedVoid extends Schema0Boxed { - public final Void data; - private Schema0BoxedVoid(Void data) { - this.data = data; - } + public record Schema0BoxedVoid(Void data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedBoolean extends Schema0Boxed { - public final boolean data; - private Schema0BoxedBoolean(boolean data) { - this.data = data; - } + public record Schema0BoxedBoolean(boolean data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedNumber extends Schema0Boxed { - public final Number data; - private Schema0BoxedNumber(Number data) { - this.data = data; - } + public record Schema0BoxedNumber(Number data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedString extends Schema0Boxed { - public final String data; - private Schema0BoxedString(String data) { - this.data = data; - } + public record Schema0BoxedString(String data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedList extends Schema0Boxed { - public final FrozenList<@Nullable Object> data; - private Schema0BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Schema0BoxedList(FrozenList<@Nullable Object> data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedMap extends Schema0Boxed { - public final Schema0Map data; - private Schema0BoxedMap(Schema0Map data) { - this.data = data; - } + public record Schema0BoxedMap(Schema0Map data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema0BoxedList>, MapSchemaValidator { + public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema0BoxedList>, MapSchemaValidator { private static @Nullable Schema0 instance = null; protected Schema0() { @@ -317,11 +293,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -352,11 +328,11 @@ public Schema0Map getNewInstance(Map arg, List pathToItem, PathToS List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -435,6 +411,25 @@ public Schema0BoxedList validateAndBox(List arg, SchemaConfiguration configur public Schema0BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema0BoxedMap(validate(arg, configuration)); } + @Override + public Schema0Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class Foo extends StringJsonSchema.StringJsonSchema1 { @@ -522,78 +517,54 @@ public Schema1Map0Builder getBuilderAfterFoo(Map insta } - public static abstract sealed class Schema1Boxed permits Schema1BoxedVoid, Schema1BoxedBoolean, Schema1BoxedNumber, Schema1BoxedString, Schema1BoxedList, Schema1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Schema1Boxed permits Schema1BoxedVoid, Schema1BoxedBoolean, Schema1BoxedNumber, Schema1BoxedString, Schema1BoxedList, Schema1BoxedMap { + @Nullable Object getData(); } - public static final class Schema1BoxedVoid extends Schema1Boxed { - public final Void data; - private Schema1BoxedVoid(Void data) { - this.data = data; - } + public record Schema1BoxedVoid(Void data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedBoolean extends Schema1Boxed { - public final boolean data; - private Schema1BoxedBoolean(boolean data) { - this.data = data; - } + public record Schema1BoxedBoolean(boolean data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedNumber extends Schema1Boxed { - public final Number data; - private Schema1BoxedNumber(Number data) { - this.data = data; - } + public record Schema1BoxedNumber(Number data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedString extends Schema1Boxed { - public final String data; - private Schema1BoxedString(String data) { - this.data = data; - } + public record Schema1BoxedString(String data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedList extends Schema1Boxed { - public final FrozenList<@Nullable Object> data; - private Schema1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Schema1BoxedList(FrozenList<@Nullable Object> data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedMap extends Schema1Boxed { - public final Schema1Map data; - private Schema1BoxedMap(Schema1Map data) { - this.data = data; - } + public record Schema1BoxedMap(Schema1Map data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema1BoxedList>, MapSchemaValidator { + public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema1BoxedList>, MapSchemaValidator { private static @Nullable Schema1 instance = null; protected Schema1() { @@ -697,11 +668,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -732,11 +703,11 @@ public Schema1Map getNewInstance(Map arg, List pathToItem, PathToS List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -815,80 +786,75 @@ public Schema1BoxedList validateAndBox(List arg, SchemaConfiguration configur public Schema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema1BoxedMap(validate(arg, configuration)); } + @Override + public Schema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class OneofComplexTypes1Boxed permits OneofComplexTypes1BoxedVoid, OneofComplexTypes1BoxedBoolean, OneofComplexTypes1BoxedNumber, OneofComplexTypes1BoxedString, OneofComplexTypes1BoxedList, OneofComplexTypes1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface OneofComplexTypes1Boxed permits OneofComplexTypes1BoxedVoid, OneofComplexTypes1BoxedBoolean, OneofComplexTypes1BoxedNumber, OneofComplexTypes1BoxedString, OneofComplexTypes1BoxedList, OneofComplexTypes1BoxedMap { + @Nullable Object getData(); } - public static final class OneofComplexTypes1BoxedVoid extends OneofComplexTypes1Boxed { - public final Void data; - private OneofComplexTypes1BoxedVoid(Void data) { - this.data = data; - } + public record OneofComplexTypes1BoxedVoid(Void data) implements OneofComplexTypes1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class OneofComplexTypes1BoxedBoolean extends OneofComplexTypes1Boxed { - public final boolean data; - private OneofComplexTypes1BoxedBoolean(boolean data) { - this.data = data; - } + public record OneofComplexTypes1BoxedBoolean(boolean data) implements OneofComplexTypes1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class OneofComplexTypes1BoxedNumber extends OneofComplexTypes1Boxed { - public final Number data; - private OneofComplexTypes1BoxedNumber(Number data) { - this.data = data; - } + public record OneofComplexTypes1BoxedNumber(Number data) implements OneofComplexTypes1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class OneofComplexTypes1BoxedString extends OneofComplexTypes1Boxed { - public final String data; - private OneofComplexTypes1BoxedString(String data) { - this.data = data; - } + public record OneofComplexTypes1BoxedString(String data) implements OneofComplexTypes1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class OneofComplexTypes1BoxedList extends OneofComplexTypes1Boxed { - public final FrozenList<@Nullable Object> data; - private OneofComplexTypes1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record OneofComplexTypes1BoxedList(FrozenList<@Nullable Object> data) implements OneofComplexTypes1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class OneofComplexTypes1BoxedMap extends OneofComplexTypes1Boxed { - public final FrozenMap<@Nullable Object> data; - private OneofComplexTypes1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record OneofComplexTypes1BoxedMap(FrozenMap<@Nullable Object> data) implements OneofComplexTypes1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class OneofComplexTypes1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, OneofComplexTypes1BoxedList>, MapSchemaValidator, OneofComplexTypes1BoxedMap> { + public static class OneofComplexTypes1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, OneofComplexTypes1BoxedList>, MapSchemaValidator, OneofComplexTypes1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -996,11 +962,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -1031,11 +997,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -1114,5 +1080,24 @@ public OneofComplexTypes1BoxedList validateAndBox(List arg, SchemaConfigurati public OneofComplexTypes1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new OneofComplexTypes1BoxedMap(validate(arg, configuration)); } + @Override + public OneofComplexTypes1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithBaseSchema.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithBaseSchema.java index 6fdab1d7d35..e9d3f27028e 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithBaseSchema.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithBaseSchema.java @@ -35,78 +35,54 @@ public class OneofWithBaseSchema { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class Schema0Boxed permits Schema0BoxedVoid, Schema0BoxedBoolean, Schema0BoxedNumber, Schema0BoxedString, Schema0BoxedList, Schema0BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Schema0Boxed permits Schema0BoxedVoid, Schema0BoxedBoolean, Schema0BoxedNumber, Schema0BoxedString, Schema0BoxedList, Schema0BoxedMap { + @Nullable Object getData(); } - public static final class Schema0BoxedVoid extends Schema0Boxed { - public final Void data; - private Schema0BoxedVoid(Void data) { - this.data = data; - } + public record Schema0BoxedVoid(Void data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedBoolean extends Schema0Boxed { - public final boolean data; - private Schema0BoxedBoolean(boolean data) { - this.data = data; - } + public record Schema0BoxedBoolean(boolean data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedNumber extends Schema0Boxed { - public final Number data; - private Schema0BoxedNumber(Number data) { - this.data = data; - } + public record Schema0BoxedNumber(Number data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedString extends Schema0Boxed { - public final String data; - private Schema0BoxedString(String data) { - this.data = data; - } + public record Schema0BoxedString(String data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedList extends Schema0Boxed { - public final FrozenList<@Nullable Object> data; - private Schema0BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Schema0BoxedList(FrozenList<@Nullable Object> data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedMap extends Schema0Boxed { - public final FrozenMap<@Nullable Object> data; - private Schema0BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record Schema0BoxedMap(FrozenMap<@Nullable Object> data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema0BoxedList>, MapSchemaValidator, Schema0BoxedMap> { + public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema0BoxedList>, MapSchemaValidator, Schema0BoxedMap> { private static @Nullable Schema0 instance = null; protected Schema0() { @@ -205,11 +181,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -240,11 +216,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -323,80 +299,75 @@ public Schema0BoxedList validateAndBox(List arg, SchemaConfiguration configur public Schema0BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema0BoxedMap(validate(arg, configuration)); } + @Override + public Schema0Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class Schema1Boxed permits Schema1BoxedVoid, Schema1BoxedBoolean, Schema1BoxedNumber, Schema1BoxedString, Schema1BoxedList, Schema1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Schema1Boxed permits Schema1BoxedVoid, Schema1BoxedBoolean, Schema1BoxedNumber, Schema1BoxedString, Schema1BoxedList, Schema1BoxedMap { + @Nullable Object getData(); } - public static final class Schema1BoxedVoid extends Schema1Boxed { - public final Void data; - private Schema1BoxedVoid(Void data) { - this.data = data; - } + public record Schema1BoxedVoid(Void data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedBoolean extends Schema1Boxed { - public final boolean data; - private Schema1BoxedBoolean(boolean data) { - this.data = data; - } + public record Schema1BoxedBoolean(boolean data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedNumber extends Schema1Boxed { - public final Number data; - private Schema1BoxedNumber(Number data) { - this.data = data; - } + public record Schema1BoxedNumber(Number data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedString extends Schema1Boxed { - public final String data; - private Schema1BoxedString(String data) { - this.data = data; - } + public record Schema1BoxedString(String data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedList extends Schema1Boxed { - public final FrozenList<@Nullable Object> data; - private Schema1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Schema1BoxedList(FrozenList<@Nullable Object> data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedMap extends Schema1Boxed { - public final FrozenMap<@Nullable Object> data; - private Schema1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record Schema1BoxedMap(FrozenMap<@Nullable Object> data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema1BoxedList>, MapSchemaValidator, Schema1BoxedMap> { + public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema1BoxedList>, MapSchemaValidator, Schema1BoxedMap> { private static @Nullable Schema1 instance = null; protected Schema1() { @@ -495,11 +466,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -530,11 +501,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -613,26 +584,41 @@ public Schema1BoxedList validateAndBox(List arg, SchemaConfiguration configur public Schema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema1BoxedMap(validate(arg, configuration)); } + @Override + public Schema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class OneofWithBaseSchema1Boxed permits OneofWithBaseSchema1BoxedString { - public abstract @Nullable Object data(); + public sealed interface OneofWithBaseSchema1Boxed permits OneofWithBaseSchema1BoxedString { + @Nullable Object getData(); } - public static final class OneofWithBaseSchema1BoxedString extends OneofWithBaseSchema1Boxed { - public final String data; - private OneofWithBaseSchema1BoxedString(String data) { - this.data = data; - } + public record OneofWithBaseSchema1BoxedString(String data) implements OneofWithBaseSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class OneofWithBaseSchema1 extends JsonSchema implements StringSchemaValidator { + public static class OneofWithBaseSchema1 extends JsonSchema implements StringSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -689,5 +675,12 @@ public String validate(String arg, SchemaConfiguration configuration) throws Val public OneofWithBaseSchema1BoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new OneofWithBaseSchema1BoxedString(validate(arg, configuration)); } + @Override + public OneofWithBaseSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithEmptySchema.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithEmptySchema.java index 14094b8e686..96c4c68034b 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithEmptySchema.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithEmptySchema.java @@ -59,78 +59,54 @@ public static Schema1 getInstance() { } - public static abstract sealed class OneofWithEmptySchema1Boxed permits OneofWithEmptySchema1BoxedVoid, OneofWithEmptySchema1BoxedBoolean, OneofWithEmptySchema1BoxedNumber, OneofWithEmptySchema1BoxedString, OneofWithEmptySchema1BoxedList, OneofWithEmptySchema1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface OneofWithEmptySchema1Boxed permits OneofWithEmptySchema1BoxedVoid, OneofWithEmptySchema1BoxedBoolean, OneofWithEmptySchema1BoxedNumber, OneofWithEmptySchema1BoxedString, OneofWithEmptySchema1BoxedList, OneofWithEmptySchema1BoxedMap { + @Nullable Object getData(); } - public static final class OneofWithEmptySchema1BoxedVoid extends OneofWithEmptySchema1Boxed { - public final Void data; - private OneofWithEmptySchema1BoxedVoid(Void data) { - this.data = data; - } + public record OneofWithEmptySchema1BoxedVoid(Void data) implements OneofWithEmptySchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class OneofWithEmptySchema1BoxedBoolean extends OneofWithEmptySchema1Boxed { - public final boolean data; - private OneofWithEmptySchema1BoxedBoolean(boolean data) { - this.data = data; - } + public record OneofWithEmptySchema1BoxedBoolean(boolean data) implements OneofWithEmptySchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class OneofWithEmptySchema1BoxedNumber extends OneofWithEmptySchema1Boxed { - public final Number data; - private OneofWithEmptySchema1BoxedNumber(Number data) { - this.data = data; - } + public record OneofWithEmptySchema1BoxedNumber(Number data) implements OneofWithEmptySchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class OneofWithEmptySchema1BoxedString extends OneofWithEmptySchema1Boxed { - public final String data; - private OneofWithEmptySchema1BoxedString(String data) { - this.data = data; - } + public record OneofWithEmptySchema1BoxedString(String data) implements OneofWithEmptySchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class OneofWithEmptySchema1BoxedList extends OneofWithEmptySchema1Boxed { - public final FrozenList<@Nullable Object> data; - private OneofWithEmptySchema1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record OneofWithEmptySchema1BoxedList(FrozenList<@Nullable Object> data) implements OneofWithEmptySchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class OneofWithEmptySchema1BoxedMap extends OneofWithEmptySchema1Boxed { - public final FrozenMap<@Nullable Object> data; - private OneofWithEmptySchema1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record OneofWithEmptySchema1BoxedMap(FrozenMap<@Nullable Object> data) implements OneofWithEmptySchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class OneofWithEmptySchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, OneofWithEmptySchema1BoxedList>, MapSchemaValidator, OneofWithEmptySchema1BoxedMap> { + public static class OneofWithEmptySchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, OneofWithEmptySchema1BoxedList>, MapSchemaValidator, OneofWithEmptySchema1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -238,11 +214,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -273,11 +249,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -356,5 +332,24 @@ public OneofWithEmptySchema1BoxedList validateAndBox(List arg, SchemaConfigur public OneofWithEmptySchema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new OneofWithEmptySchema1BoxedMap(validate(arg, configuration)); } + @Override + public OneofWithEmptySchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithRequired.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithRequired.java index 98c0decd936..b62dc7bf97e 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithRequired.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/OneofWithRequired.java @@ -248,78 +248,54 @@ public Schema0Map10Builder getBuilderAfterFoo(Map inst } - public static abstract sealed class Schema0Boxed permits Schema0BoxedVoid, Schema0BoxedBoolean, Schema0BoxedNumber, Schema0BoxedString, Schema0BoxedList, Schema0BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Schema0Boxed permits Schema0BoxedVoid, Schema0BoxedBoolean, Schema0BoxedNumber, Schema0BoxedString, Schema0BoxedList, Schema0BoxedMap { + @Nullable Object getData(); } - public static final class Schema0BoxedVoid extends Schema0Boxed { - public final Void data; - private Schema0BoxedVoid(Void data) { - this.data = data; - } + public record Schema0BoxedVoid(Void data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedBoolean extends Schema0Boxed { - public final boolean data; - private Schema0BoxedBoolean(boolean data) { - this.data = data; - } + public record Schema0BoxedBoolean(boolean data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedNumber extends Schema0Boxed { - public final Number data; - private Schema0BoxedNumber(Number data) { - this.data = data; - } + public record Schema0BoxedNumber(Number data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedString extends Schema0Boxed { - public final String data; - private Schema0BoxedString(String data) { - this.data = data; - } + public record Schema0BoxedString(String data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedList extends Schema0Boxed { - public final FrozenList<@Nullable Object> data; - private Schema0BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Schema0BoxedList(FrozenList<@Nullable Object> data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedMap extends Schema0Boxed { - public final Schema0Map data; - private Schema0BoxedMap(Schema0Map data) { - this.data = data; - } + public record Schema0BoxedMap(Schema0Map data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema0BoxedList>, MapSchemaValidator { + public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema0BoxedList>, MapSchemaValidator { private static @Nullable Schema0 instance = null; protected Schema0() { @@ -421,11 +397,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -456,11 +432,11 @@ public Schema0Map getNewInstance(Map arg, List pathToItem, PathToS List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -539,6 +515,25 @@ public Schema0BoxedList validateAndBox(List arg, SchemaConfiguration configur public Schema0BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema0BoxedMap(validate(arg, configuration)); } + @Override + public Schema0Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class Schema1Map extends FrozenMap<@Nullable Object> { @@ -753,78 +748,54 @@ public Schema1Map10Builder getBuilderAfterFoo1(Map ins } - public static abstract sealed class Schema1Boxed permits Schema1BoxedVoid, Schema1BoxedBoolean, Schema1BoxedNumber, Schema1BoxedString, Schema1BoxedList, Schema1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Schema1Boxed permits Schema1BoxedVoid, Schema1BoxedBoolean, Schema1BoxedNumber, Schema1BoxedString, Schema1BoxedList, Schema1BoxedMap { + @Nullable Object getData(); } - public static final class Schema1BoxedVoid extends Schema1Boxed { - public final Void data; - private Schema1BoxedVoid(Void data) { - this.data = data; - } + public record Schema1BoxedVoid(Void data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedBoolean extends Schema1Boxed { - public final boolean data; - private Schema1BoxedBoolean(boolean data) { - this.data = data; - } + public record Schema1BoxedBoolean(boolean data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedNumber extends Schema1Boxed { - public final Number data; - private Schema1BoxedNumber(Number data) { - this.data = data; - } + public record Schema1BoxedNumber(Number data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedString extends Schema1Boxed { - public final String data; - private Schema1BoxedString(String data) { - this.data = data; - } + public record Schema1BoxedString(String data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedList extends Schema1Boxed { - public final FrozenList<@Nullable Object> data; - private Schema1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Schema1BoxedList(FrozenList<@Nullable Object> data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedMap extends Schema1Boxed { - public final Schema1Map data; - private Schema1BoxedMap(Schema1Map data) { - this.data = data; - } + public record Schema1BoxedMap(Schema1Map data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema1BoxedList>, MapSchemaValidator { + public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema1BoxedList>, MapSchemaValidator { private static @Nullable Schema1 instance = null; protected Schema1() { @@ -926,11 +897,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -961,11 +932,11 @@ public Schema1Map getNewInstance(Map arg, List pathToItem, PathToS List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -1044,25 +1015,40 @@ public Schema1BoxedList validateAndBox(List arg, SchemaConfiguration configur public Schema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema1BoxedMap(validate(arg, configuration)); } + @Override + public Schema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class OneofWithRequired1Boxed permits OneofWithRequired1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface OneofWithRequired1Boxed permits OneofWithRequired1BoxedMap { + @Nullable Object getData(); } - public static final class OneofWithRequired1BoxedMap extends OneofWithRequired1Boxed { - public final FrozenMap<@Nullable Object> data; - private OneofWithRequired1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record OneofWithRequired1BoxedMap(FrozenMap<@Nullable Object> data) implements OneofWithRequired1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class OneofWithRequired1 extends JsonSchema implements MapSchemaValidator, OneofWithRequired1BoxedMap> { + public static class OneofWithRequired1 extends JsonSchema implements MapSchemaValidator, OneofWithRequired1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -1099,11 +1085,11 @@ public static OneofWithRequired1 getInstance() { List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -1140,6 +1126,13 @@ public static OneofWithRequired1 getInstance() { public OneofWithRequired1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new OneofWithRequired1BoxedMap(validate(arg, configuration)); } + @Override + public OneofWithRequired1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternIsNotAnchored.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternIsNotAnchored.java index 01e0392657e..49d4017ae06 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternIsNotAnchored.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternIsNotAnchored.java @@ -36,78 +36,54 @@ public class PatternIsNotAnchored { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class PatternIsNotAnchored1Boxed permits PatternIsNotAnchored1BoxedVoid, PatternIsNotAnchored1BoxedBoolean, PatternIsNotAnchored1BoxedNumber, PatternIsNotAnchored1BoxedString, PatternIsNotAnchored1BoxedList, PatternIsNotAnchored1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface PatternIsNotAnchored1Boxed permits PatternIsNotAnchored1BoxedVoid, PatternIsNotAnchored1BoxedBoolean, PatternIsNotAnchored1BoxedNumber, PatternIsNotAnchored1BoxedString, PatternIsNotAnchored1BoxedList, PatternIsNotAnchored1BoxedMap { + @Nullable Object getData(); } - public static final class PatternIsNotAnchored1BoxedVoid extends PatternIsNotAnchored1Boxed { - public final Void data; - private PatternIsNotAnchored1BoxedVoid(Void data) { - this.data = data; - } + public record PatternIsNotAnchored1BoxedVoid(Void data) implements PatternIsNotAnchored1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class PatternIsNotAnchored1BoxedBoolean extends PatternIsNotAnchored1Boxed { - public final boolean data; - private PatternIsNotAnchored1BoxedBoolean(boolean data) { - this.data = data; - } + public record PatternIsNotAnchored1BoxedBoolean(boolean data) implements PatternIsNotAnchored1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class PatternIsNotAnchored1BoxedNumber extends PatternIsNotAnchored1Boxed { - public final Number data; - private PatternIsNotAnchored1BoxedNumber(Number data) { - this.data = data; - } + public record PatternIsNotAnchored1BoxedNumber(Number data) implements PatternIsNotAnchored1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class PatternIsNotAnchored1BoxedString extends PatternIsNotAnchored1Boxed { - public final String data; - private PatternIsNotAnchored1BoxedString(String data) { - this.data = data; - } + public record PatternIsNotAnchored1BoxedString(String data) implements PatternIsNotAnchored1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class PatternIsNotAnchored1BoxedList extends PatternIsNotAnchored1Boxed { - public final FrozenList<@Nullable Object> data; - private PatternIsNotAnchored1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record PatternIsNotAnchored1BoxedList(FrozenList<@Nullable Object> data) implements PatternIsNotAnchored1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class PatternIsNotAnchored1BoxedMap extends PatternIsNotAnchored1Boxed { - public final FrozenMap<@Nullable Object> data; - private PatternIsNotAnchored1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record PatternIsNotAnchored1BoxedMap(FrozenMap<@Nullable Object> data) implements PatternIsNotAnchored1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class PatternIsNotAnchored1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, PatternIsNotAnchored1BoxedList>, MapSchemaValidator, PatternIsNotAnchored1BoxedMap> { + public static class PatternIsNotAnchored1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, PatternIsNotAnchored1BoxedList>, MapSchemaValidator, PatternIsNotAnchored1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -214,11 +190,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -249,11 +225,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -332,5 +308,24 @@ public PatternIsNotAnchored1BoxedList validateAndBox(List arg, SchemaConfigur public PatternIsNotAnchored1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new PatternIsNotAnchored1BoxedMap(validate(arg, configuration)); } + @Override + public PatternIsNotAnchored1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternValidation.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternValidation.java index 1493b20852c..7e0ffabd596 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternValidation.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternValidation.java @@ -36,78 +36,54 @@ public class PatternValidation { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class PatternValidation1Boxed permits PatternValidation1BoxedVoid, PatternValidation1BoxedBoolean, PatternValidation1BoxedNumber, PatternValidation1BoxedString, PatternValidation1BoxedList, PatternValidation1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface PatternValidation1Boxed permits PatternValidation1BoxedVoid, PatternValidation1BoxedBoolean, PatternValidation1BoxedNumber, PatternValidation1BoxedString, PatternValidation1BoxedList, PatternValidation1BoxedMap { + @Nullable Object getData(); } - public static final class PatternValidation1BoxedVoid extends PatternValidation1Boxed { - public final Void data; - private PatternValidation1BoxedVoid(Void data) { - this.data = data; - } + public record PatternValidation1BoxedVoid(Void data) implements PatternValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class PatternValidation1BoxedBoolean extends PatternValidation1Boxed { - public final boolean data; - private PatternValidation1BoxedBoolean(boolean data) { - this.data = data; - } + public record PatternValidation1BoxedBoolean(boolean data) implements PatternValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class PatternValidation1BoxedNumber extends PatternValidation1Boxed { - public final Number data; - private PatternValidation1BoxedNumber(Number data) { - this.data = data; - } + public record PatternValidation1BoxedNumber(Number data) implements PatternValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class PatternValidation1BoxedString extends PatternValidation1Boxed { - public final String data; - private PatternValidation1BoxedString(String data) { - this.data = data; - } + public record PatternValidation1BoxedString(String data) implements PatternValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class PatternValidation1BoxedList extends PatternValidation1Boxed { - public final FrozenList<@Nullable Object> data; - private PatternValidation1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record PatternValidation1BoxedList(FrozenList<@Nullable Object> data) implements PatternValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class PatternValidation1BoxedMap extends PatternValidation1Boxed { - public final FrozenMap<@Nullable Object> data; - private PatternValidation1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record PatternValidation1BoxedMap(FrozenMap<@Nullable Object> data) implements PatternValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class PatternValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, PatternValidation1BoxedList>, MapSchemaValidator, PatternValidation1BoxedMap> { + public static class PatternValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, PatternValidation1BoxedList>, MapSchemaValidator, PatternValidation1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -214,11 +190,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -249,11 +225,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -332,5 +308,24 @@ public PatternValidation1BoxedList validateAndBox(List arg, SchemaConfigurati public PatternValidation1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new PatternValidation1BoxedMap(validate(arg, configuration)); } + @Override + public PatternValidation1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternpropertiesValidatesPropertiesMatchingARegex.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternpropertiesValidatesPropertiesMatchingARegex.java index c27817f84a7..50e1a0e927b 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternpropertiesValidatesPropertiesMatchingARegex.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternpropertiesValidatesPropertiesMatchingARegex.java @@ -49,78 +49,54 @@ public static Fo getInstance() { } - public static abstract sealed class PatternpropertiesValidatesPropertiesMatchingARegex1Boxed permits PatternpropertiesValidatesPropertiesMatchingARegex1BoxedVoid, PatternpropertiesValidatesPropertiesMatchingARegex1BoxedBoolean, PatternpropertiesValidatesPropertiesMatchingARegex1BoxedNumber, PatternpropertiesValidatesPropertiesMatchingARegex1BoxedString, PatternpropertiesValidatesPropertiesMatchingARegex1BoxedList, PatternpropertiesValidatesPropertiesMatchingARegex1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface PatternpropertiesValidatesPropertiesMatchingARegex1Boxed permits PatternpropertiesValidatesPropertiesMatchingARegex1BoxedVoid, PatternpropertiesValidatesPropertiesMatchingARegex1BoxedBoolean, PatternpropertiesValidatesPropertiesMatchingARegex1BoxedNumber, PatternpropertiesValidatesPropertiesMatchingARegex1BoxedString, PatternpropertiesValidatesPropertiesMatchingARegex1BoxedList, PatternpropertiesValidatesPropertiesMatchingARegex1BoxedMap { + @Nullable Object getData(); } - public static final class PatternpropertiesValidatesPropertiesMatchingARegex1BoxedVoid extends PatternpropertiesValidatesPropertiesMatchingARegex1Boxed { - public final Void data; - private PatternpropertiesValidatesPropertiesMatchingARegex1BoxedVoid(Void data) { - this.data = data; - } + public record PatternpropertiesValidatesPropertiesMatchingARegex1BoxedVoid(Void data) implements PatternpropertiesValidatesPropertiesMatchingARegex1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class PatternpropertiesValidatesPropertiesMatchingARegex1BoxedBoolean extends PatternpropertiesValidatesPropertiesMatchingARegex1Boxed { - public final boolean data; - private PatternpropertiesValidatesPropertiesMatchingARegex1BoxedBoolean(boolean data) { - this.data = data; - } + public record PatternpropertiesValidatesPropertiesMatchingARegex1BoxedBoolean(boolean data) implements PatternpropertiesValidatesPropertiesMatchingARegex1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class PatternpropertiesValidatesPropertiesMatchingARegex1BoxedNumber extends PatternpropertiesValidatesPropertiesMatchingARegex1Boxed { - public final Number data; - private PatternpropertiesValidatesPropertiesMatchingARegex1BoxedNumber(Number data) { - this.data = data; - } + public record PatternpropertiesValidatesPropertiesMatchingARegex1BoxedNumber(Number data) implements PatternpropertiesValidatesPropertiesMatchingARegex1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class PatternpropertiesValidatesPropertiesMatchingARegex1BoxedString extends PatternpropertiesValidatesPropertiesMatchingARegex1Boxed { - public final String data; - private PatternpropertiesValidatesPropertiesMatchingARegex1BoxedString(String data) { - this.data = data; - } + public record PatternpropertiesValidatesPropertiesMatchingARegex1BoxedString(String data) implements PatternpropertiesValidatesPropertiesMatchingARegex1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class PatternpropertiesValidatesPropertiesMatchingARegex1BoxedList extends PatternpropertiesValidatesPropertiesMatchingARegex1Boxed { - public final FrozenList<@Nullable Object> data; - private PatternpropertiesValidatesPropertiesMatchingARegex1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record PatternpropertiesValidatesPropertiesMatchingARegex1BoxedList(FrozenList<@Nullable Object> data) implements PatternpropertiesValidatesPropertiesMatchingARegex1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class PatternpropertiesValidatesPropertiesMatchingARegex1BoxedMap extends PatternpropertiesValidatesPropertiesMatchingARegex1Boxed { - public final FrozenMap<@Nullable Object> data; - private PatternpropertiesValidatesPropertiesMatchingARegex1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record PatternpropertiesValidatesPropertiesMatchingARegex1BoxedMap(FrozenMap<@Nullable Object> data) implements PatternpropertiesValidatesPropertiesMatchingARegex1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class PatternpropertiesValidatesPropertiesMatchingARegex1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, PatternpropertiesValidatesPropertiesMatchingARegex1BoxedList>, MapSchemaValidator, PatternpropertiesValidatesPropertiesMatchingARegex1BoxedMap> { + public static class PatternpropertiesValidatesPropertiesMatchingARegex1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, PatternpropertiesValidatesPropertiesMatchingARegex1BoxedList>, MapSchemaValidator, PatternpropertiesValidatesPropertiesMatchingARegex1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -227,11 +203,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -262,11 +238,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -345,5 +321,24 @@ public PatternpropertiesValidatesPropertiesMatchingARegex1BoxedList validateAndB public PatternpropertiesValidatesPropertiesMatchingARegex1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new PatternpropertiesValidatesPropertiesMatchingARegex1BoxedMap(validate(arg, configuration)); } + @Override + public PatternpropertiesValidatesPropertiesMatchingARegex1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternpropertiesWithNullValuedInstanceProperties.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternpropertiesWithNullValuedInstanceProperties.java index 1f4e7679b56..03c1bff09ce 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternpropertiesWithNullValuedInstanceProperties.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PatternpropertiesWithNullValuedInstanceProperties.java @@ -49,78 +49,54 @@ public static Bar getInstance() { } - public static abstract sealed class PatternpropertiesWithNullValuedInstanceProperties1Boxed permits PatternpropertiesWithNullValuedInstanceProperties1BoxedVoid, PatternpropertiesWithNullValuedInstanceProperties1BoxedBoolean, PatternpropertiesWithNullValuedInstanceProperties1BoxedNumber, PatternpropertiesWithNullValuedInstanceProperties1BoxedString, PatternpropertiesWithNullValuedInstanceProperties1BoxedList, PatternpropertiesWithNullValuedInstanceProperties1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface PatternpropertiesWithNullValuedInstanceProperties1Boxed permits PatternpropertiesWithNullValuedInstanceProperties1BoxedVoid, PatternpropertiesWithNullValuedInstanceProperties1BoxedBoolean, PatternpropertiesWithNullValuedInstanceProperties1BoxedNumber, PatternpropertiesWithNullValuedInstanceProperties1BoxedString, PatternpropertiesWithNullValuedInstanceProperties1BoxedList, PatternpropertiesWithNullValuedInstanceProperties1BoxedMap { + @Nullable Object getData(); } - public static final class PatternpropertiesWithNullValuedInstanceProperties1BoxedVoid extends PatternpropertiesWithNullValuedInstanceProperties1Boxed { - public final Void data; - private PatternpropertiesWithNullValuedInstanceProperties1BoxedVoid(Void data) { - this.data = data; - } + public record PatternpropertiesWithNullValuedInstanceProperties1BoxedVoid(Void data) implements PatternpropertiesWithNullValuedInstanceProperties1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class PatternpropertiesWithNullValuedInstanceProperties1BoxedBoolean extends PatternpropertiesWithNullValuedInstanceProperties1Boxed { - public final boolean data; - private PatternpropertiesWithNullValuedInstanceProperties1BoxedBoolean(boolean data) { - this.data = data; - } + public record PatternpropertiesWithNullValuedInstanceProperties1BoxedBoolean(boolean data) implements PatternpropertiesWithNullValuedInstanceProperties1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class PatternpropertiesWithNullValuedInstanceProperties1BoxedNumber extends PatternpropertiesWithNullValuedInstanceProperties1Boxed { - public final Number data; - private PatternpropertiesWithNullValuedInstanceProperties1BoxedNumber(Number data) { - this.data = data; - } + public record PatternpropertiesWithNullValuedInstanceProperties1BoxedNumber(Number data) implements PatternpropertiesWithNullValuedInstanceProperties1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class PatternpropertiesWithNullValuedInstanceProperties1BoxedString extends PatternpropertiesWithNullValuedInstanceProperties1Boxed { - public final String data; - private PatternpropertiesWithNullValuedInstanceProperties1BoxedString(String data) { - this.data = data; - } + public record PatternpropertiesWithNullValuedInstanceProperties1BoxedString(String data) implements PatternpropertiesWithNullValuedInstanceProperties1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class PatternpropertiesWithNullValuedInstanceProperties1BoxedList extends PatternpropertiesWithNullValuedInstanceProperties1Boxed { - public final FrozenList<@Nullable Object> data; - private PatternpropertiesWithNullValuedInstanceProperties1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record PatternpropertiesWithNullValuedInstanceProperties1BoxedList(FrozenList<@Nullable Object> data) implements PatternpropertiesWithNullValuedInstanceProperties1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class PatternpropertiesWithNullValuedInstanceProperties1BoxedMap extends PatternpropertiesWithNullValuedInstanceProperties1Boxed { - public final FrozenMap<@Nullable Object> data; - private PatternpropertiesWithNullValuedInstanceProperties1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record PatternpropertiesWithNullValuedInstanceProperties1BoxedMap(FrozenMap<@Nullable Object> data) implements PatternpropertiesWithNullValuedInstanceProperties1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class PatternpropertiesWithNullValuedInstanceProperties1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, PatternpropertiesWithNullValuedInstanceProperties1BoxedList>, MapSchemaValidator, PatternpropertiesWithNullValuedInstanceProperties1BoxedMap> { + public static class PatternpropertiesWithNullValuedInstanceProperties1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, PatternpropertiesWithNullValuedInstanceProperties1BoxedList>, MapSchemaValidator, PatternpropertiesWithNullValuedInstanceProperties1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -227,11 +203,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -262,11 +238,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -345,5 +321,24 @@ public PatternpropertiesWithNullValuedInstanceProperties1BoxedList validateAndBo public PatternpropertiesWithNullValuedInstanceProperties1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new PatternpropertiesWithNullValuedInstanceProperties1BoxedMap(validate(arg, configuration)); } + @Override + public PatternpropertiesWithNullValuedInstanceProperties1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PrefixitemsValidationAdjustsTheStartingIndexForItems.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PrefixitemsValidationAdjustsTheStartingIndexForItems.java index 9ad65a7f402..c7574319af8 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PrefixitemsValidationAdjustsTheStartingIndexForItems.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PrefixitemsValidationAdjustsTheStartingIndexForItems.java @@ -98,24 +98,20 @@ public static Schema0 getInstance() { } - public static abstract sealed class PrefixitemsValidationAdjustsTheStartingIndexForItems1Boxed permits PrefixitemsValidationAdjustsTheStartingIndexForItems1BoxedList { - public abstract @Nullable Object data(); + public sealed interface PrefixitemsValidationAdjustsTheStartingIndexForItems1Boxed permits PrefixitemsValidationAdjustsTheStartingIndexForItems1BoxedList { + @Nullable Object getData(); } - public static final class PrefixitemsValidationAdjustsTheStartingIndexForItems1BoxedList extends PrefixitemsValidationAdjustsTheStartingIndexForItems1Boxed { - public final PrefixitemsValidationAdjustsTheStartingIndexForItemsList data; - private PrefixitemsValidationAdjustsTheStartingIndexForItems1BoxedList(PrefixitemsValidationAdjustsTheStartingIndexForItemsList data) { - this.data = data; - } + public record PrefixitemsValidationAdjustsTheStartingIndexForItems1BoxedList(PrefixitemsValidationAdjustsTheStartingIndexForItemsList data) implements PrefixitemsValidationAdjustsTheStartingIndexForItems1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class PrefixitemsValidationAdjustsTheStartingIndexForItems1 extends JsonSchema implements ListSchemaValidator { + public static class PrefixitemsValidationAdjustsTheStartingIndexForItems1 extends JsonSchema implements ListSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -148,11 +144,11 @@ public PrefixitemsValidationAdjustsTheStartingIndexForItemsList getNewInstance(L for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -192,5 +188,12 @@ public PrefixitemsValidationAdjustsTheStartingIndexForItemsList validate(List public PrefixitemsValidationAdjustsTheStartingIndexForItems1BoxedList validateAndBox(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new PrefixitemsValidationAdjustsTheStartingIndexForItems1BoxedList(validate(arg, configuration)); } + @Override + public PrefixitemsValidationAdjustsTheStartingIndexForItems1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PrefixitemsWithNullInstanceElements.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PrefixitemsWithNullInstanceElements.java index b6b8e3c665b..07000cebd05 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PrefixitemsWithNullInstanceElements.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PrefixitemsWithNullInstanceElements.java @@ -119,78 +119,54 @@ public static Schema0 getInstance() { } - public static abstract sealed class PrefixitemsWithNullInstanceElements1Boxed permits PrefixitemsWithNullInstanceElements1BoxedVoid, PrefixitemsWithNullInstanceElements1BoxedBoolean, PrefixitemsWithNullInstanceElements1BoxedNumber, PrefixitemsWithNullInstanceElements1BoxedString, PrefixitemsWithNullInstanceElements1BoxedList, PrefixitemsWithNullInstanceElements1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface PrefixitemsWithNullInstanceElements1Boxed permits PrefixitemsWithNullInstanceElements1BoxedVoid, PrefixitemsWithNullInstanceElements1BoxedBoolean, PrefixitemsWithNullInstanceElements1BoxedNumber, PrefixitemsWithNullInstanceElements1BoxedString, PrefixitemsWithNullInstanceElements1BoxedList, PrefixitemsWithNullInstanceElements1BoxedMap { + @Nullable Object getData(); } - public static final class PrefixitemsWithNullInstanceElements1BoxedVoid extends PrefixitemsWithNullInstanceElements1Boxed { - public final Void data; - private PrefixitemsWithNullInstanceElements1BoxedVoid(Void data) { - this.data = data; - } + public record PrefixitemsWithNullInstanceElements1BoxedVoid(Void data) implements PrefixitemsWithNullInstanceElements1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class PrefixitemsWithNullInstanceElements1BoxedBoolean extends PrefixitemsWithNullInstanceElements1Boxed { - public final boolean data; - private PrefixitemsWithNullInstanceElements1BoxedBoolean(boolean data) { - this.data = data; - } + public record PrefixitemsWithNullInstanceElements1BoxedBoolean(boolean data) implements PrefixitemsWithNullInstanceElements1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class PrefixitemsWithNullInstanceElements1BoxedNumber extends PrefixitemsWithNullInstanceElements1Boxed { - public final Number data; - private PrefixitemsWithNullInstanceElements1BoxedNumber(Number data) { - this.data = data; - } + public record PrefixitemsWithNullInstanceElements1BoxedNumber(Number data) implements PrefixitemsWithNullInstanceElements1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class PrefixitemsWithNullInstanceElements1BoxedString extends PrefixitemsWithNullInstanceElements1Boxed { - public final String data; - private PrefixitemsWithNullInstanceElements1BoxedString(String data) { - this.data = data; - } + public record PrefixitemsWithNullInstanceElements1BoxedString(String data) implements PrefixitemsWithNullInstanceElements1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class PrefixitemsWithNullInstanceElements1BoxedList extends PrefixitemsWithNullInstanceElements1Boxed { - public final PrefixitemsWithNullInstanceElementsList data; - private PrefixitemsWithNullInstanceElements1BoxedList(PrefixitemsWithNullInstanceElementsList data) { - this.data = data; - } + public record PrefixitemsWithNullInstanceElements1BoxedList(PrefixitemsWithNullInstanceElementsList data) implements PrefixitemsWithNullInstanceElements1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class PrefixitemsWithNullInstanceElements1BoxedMap extends PrefixitemsWithNullInstanceElements1Boxed { - public final FrozenMap<@Nullable Object> data; - private PrefixitemsWithNullInstanceElements1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record PrefixitemsWithNullInstanceElements1BoxedMap(FrozenMap<@Nullable Object> data) implements PrefixitemsWithNullInstanceElements1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class PrefixitemsWithNullInstanceElements1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, MapSchemaValidator, PrefixitemsWithNullInstanceElements1BoxedMap> { + public static class PrefixitemsWithNullInstanceElements1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, MapSchemaValidator, PrefixitemsWithNullInstanceElements1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -297,11 +273,11 @@ public PrefixitemsWithNullInstanceElementsList getNewInstance(List arg, List< for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -332,11 +308,11 @@ public PrefixitemsWithNullInstanceElementsList validate(List arg, SchemaConfi List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -415,5 +391,24 @@ public PrefixitemsWithNullInstanceElements1BoxedList validateAndBox(List arg, public PrefixitemsWithNullInstanceElements1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new PrefixitemsWithNullInstanceElements1BoxedMap(validate(arg, configuration)); } + @Override + public PrefixitemsWithNullInstanceElements1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesPatternpropertiesAdditionalpropertiesInteraction.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesPatternpropertiesAdditionalpropertiesInteraction.java index f48570ae223..503c22b688e 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesPatternpropertiesAdditionalpropertiesInteraction.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesPatternpropertiesAdditionalpropertiesInteraction.java @@ -53,78 +53,54 @@ public static AdditionalProperties getInstance() { } - public static abstract sealed class FoBoxed permits FoBoxedVoid, FoBoxedBoolean, FoBoxedNumber, FoBoxedString, FoBoxedList, FoBoxedMap { - public abstract @Nullable Object data(); + public sealed interface FoBoxed permits FoBoxedVoid, FoBoxedBoolean, FoBoxedNumber, FoBoxedString, FoBoxedList, FoBoxedMap { + @Nullable Object getData(); } - public static final class FoBoxedVoid extends FoBoxed { - public final Void data; - private FoBoxedVoid(Void data) { - this.data = data; - } + public record FoBoxedVoid(Void data) implements FoBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class FoBoxedBoolean extends FoBoxed { - public final boolean data; - private FoBoxedBoolean(boolean data) { - this.data = data; - } + public record FoBoxedBoolean(boolean data) implements FoBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class FoBoxedNumber extends FoBoxed { - public final Number data; - private FoBoxedNumber(Number data) { - this.data = data; - } + public record FoBoxedNumber(Number data) implements FoBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class FoBoxedString extends FoBoxed { - public final String data; - private FoBoxedString(String data) { - this.data = data; - } + public record FoBoxedString(String data) implements FoBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class FoBoxedList extends FoBoxed { - public final FrozenList<@Nullable Object> data; - private FoBoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record FoBoxedList(FrozenList<@Nullable Object> data) implements FoBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class FoBoxedMap extends FoBoxed { - public final FrozenMap<@Nullable Object> data; - private FoBoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record FoBoxedMap(FrozenMap<@Nullable Object> data) implements FoBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Fo extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, FoBoxedList>, MapSchemaValidator, FoBoxedMap> { + public static class Fo extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, FoBoxedList>, MapSchemaValidator, FoBoxedMap> { private static @Nullable Fo instance = null; protected Fo() { @@ -223,11 +199,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -258,11 +234,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -341,26 +317,41 @@ public FoBoxedList validateAndBox(List arg, SchemaConfiguration configuration public FoBoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new FoBoxedMap(validate(arg, configuration)); } + @Override + public FoBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class FooBoxed permits FooBoxedList { - public abstract @Nullable Object data(); + public sealed interface FooBoxed permits FooBoxedList { + @Nullable Object getData(); } - public static final class FooBoxedList extends FooBoxed { - public final FrozenList<@Nullable Object> data; - private FooBoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record FooBoxedList(FrozenList<@Nullable Object> data) implements FooBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Foo extends JsonSchema implements ListSchemaValidator, FooBoxedList> { + public static class Foo extends JsonSchema implements ListSchemaValidator, FooBoxedList> { private static @Nullable Foo instance = null; protected Foo() { @@ -384,11 +375,11 @@ public static Foo getInstance() { for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -425,6 +416,13 @@ public static Foo getInstance() { public FooBoxedList validateAndBox(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new FooBoxedList(validate(arg, configuration)); } + @Override + public FooBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class Bar extends ListJsonSchema.ListJsonSchema1 { @@ -567,23 +565,19 @@ public PropertiesPatternpropertiesAdditionalpropertiesInteractionMapBuilder getB } - public static abstract sealed class PropertiesPatternpropertiesAdditionalpropertiesInteraction1Boxed permits PropertiesPatternpropertiesAdditionalpropertiesInteraction1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface PropertiesPatternpropertiesAdditionalpropertiesInteraction1Boxed permits PropertiesPatternpropertiesAdditionalpropertiesInteraction1BoxedMap { + @Nullable Object getData(); } - public static final class PropertiesPatternpropertiesAdditionalpropertiesInteraction1BoxedMap extends PropertiesPatternpropertiesAdditionalpropertiesInteraction1Boxed { - public final PropertiesPatternpropertiesAdditionalpropertiesInteractionMap data; - private PropertiesPatternpropertiesAdditionalpropertiesInteraction1BoxedMap(PropertiesPatternpropertiesAdditionalpropertiesInteractionMap data) { - this.data = data; - } + public record PropertiesPatternpropertiesAdditionalpropertiesInteraction1BoxedMap(PropertiesPatternpropertiesAdditionalpropertiesInteractionMap data) implements PropertiesPatternpropertiesAdditionalpropertiesInteraction1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class PropertiesPatternpropertiesAdditionalpropertiesInteraction1 extends JsonSchema implements MapSchemaValidator { + public static class PropertiesPatternpropertiesAdditionalpropertiesInteraction1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -624,11 +618,11 @@ public PropertiesPatternpropertiesAdditionalpropertiesInteractionMap getNewInsta List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -668,6 +662,13 @@ public PropertiesPatternpropertiesAdditionalpropertiesInteractionMap validate(Ma public PropertiesPatternpropertiesAdditionalpropertiesInteraction1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new PropertiesPatternpropertiesAdditionalpropertiesInteraction1BoxedMap(validate(arg, configuration)); } + @Override + public PropertiesPatternpropertiesAdditionalpropertiesInteraction1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesWhoseNamesAreJavascriptObjectPropertyNames.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesWhoseNamesAreJavascriptObjectPropertyNames.java index 23ac2a5bd3f..f727766a051 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesWhoseNamesAreJavascriptObjectPropertyNames.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesWhoseNamesAreJavascriptObjectPropertyNames.java @@ -127,78 +127,54 @@ public ToStringMapBuilder getBuilderAfterAdditionalProperty(Map data; - private ToStringSchemaBoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record ToStringSchemaBoxedList(FrozenList<@Nullable Object> data) implements ToStringSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ToStringSchemaBoxedMap extends ToStringSchemaBoxed { - public final ToStringMap data; - private ToStringSchemaBoxedMap(ToStringMap data) { - this.data = data; - } + public record ToStringSchemaBoxedMap(ToStringMap data) implements ToStringSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ToStringSchema extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ToStringSchemaBoxedList>, MapSchemaValidator { + public static class ToStringSchema extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ToStringSchemaBoxedList>, MapSchemaValidator { private static @Nullable ToStringSchema instance = null; protected ToStringSchema() { @@ -299,11 +275,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -334,11 +310,11 @@ public ToStringMap getNewInstance(Map arg, List pathToItem, PathTo List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -417,6 +393,25 @@ public ToStringSchemaBoxedList validateAndBox(List arg, SchemaConfiguration c public ToStringSchemaBoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ToStringSchemaBoxedMap(validate(arg, configuration)); } + @Override + public ToStringSchemaBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class Constructor extends NumberJsonSchema.NumberJsonSchema1 { @@ -612,78 +607,54 @@ public PropertiesWhoseNamesAreJavascriptObjectPropertyNamesMapBuilder getBuilder } - public static abstract sealed class PropertiesWhoseNamesAreJavascriptObjectPropertyNames1Boxed permits PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedVoid, PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedBoolean, PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedNumber, PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedString, PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedList, PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface PropertiesWhoseNamesAreJavascriptObjectPropertyNames1Boxed permits PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedVoid, PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedBoolean, PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedNumber, PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedString, PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedList, PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedMap { + @Nullable Object getData(); } - public static final class PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedVoid extends PropertiesWhoseNamesAreJavascriptObjectPropertyNames1Boxed { - public final Void data; - private PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedVoid(Void data) { - this.data = data; - } + public record PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedVoid(Void data) implements PropertiesWhoseNamesAreJavascriptObjectPropertyNames1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedBoolean extends PropertiesWhoseNamesAreJavascriptObjectPropertyNames1Boxed { - public final boolean data; - private PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedBoolean(boolean data) { - this.data = data; - } + public record PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedBoolean(boolean data) implements PropertiesWhoseNamesAreJavascriptObjectPropertyNames1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedNumber extends PropertiesWhoseNamesAreJavascriptObjectPropertyNames1Boxed { - public final Number data; - private PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedNumber(Number data) { - this.data = data; - } + public record PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedNumber(Number data) implements PropertiesWhoseNamesAreJavascriptObjectPropertyNames1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedString extends PropertiesWhoseNamesAreJavascriptObjectPropertyNames1Boxed { - public final String data; - private PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedString(String data) { - this.data = data; - } + public record PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedString(String data) implements PropertiesWhoseNamesAreJavascriptObjectPropertyNames1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedList extends PropertiesWhoseNamesAreJavascriptObjectPropertyNames1Boxed { - public final FrozenList<@Nullable Object> data; - private PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedList(FrozenList<@Nullable Object> data) implements PropertiesWhoseNamesAreJavascriptObjectPropertyNames1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedMap extends PropertiesWhoseNamesAreJavascriptObjectPropertyNames1Boxed { - public final PropertiesWhoseNamesAreJavascriptObjectPropertyNamesMap data; - private PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedMap(PropertiesWhoseNamesAreJavascriptObjectPropertyNamesMap data) { - this.data = data; - } + public record PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedMap(PropertiesWhoseNamesAreJavascriptObjectPropertyNamesMap data) implements PropertiesWhoseNamesAreJavascriptObjectPropertyNames1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class PropertiesWhoseNamesAreJavascriptObjectPropertyNames1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedList>, MapSchemaValidator { + public static class PropertiesWhoseNamesAreJavascriptObjectPropertyNames1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedList>, MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -792,11 +763,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -827,11 +798,11 @@ public PropertiesWhoseNamesAreJavascriptObjectPropertyNamesMap getNewInstance(Ma List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -910,5 +881,24 @@ public PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedList validateAn public PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new PropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedMap(validate(arg, configuration)); } + @Override + public PropertiesWhoseNamesAreJavascriptObjectPropertyNames1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesWithEscapedCharacters.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesWithEscapedCharacters.java index 5c68c3db422..9fec0c66360 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesWithEscapedCharacters.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesWithEscapedCharacters.java @@ -348,78 +348,54 @@ public PropertiesWithEscapedCharactersMapBuilder getBuilderAfterAdditionalProper } - public static abstract sealed class PropertiesWithEscapedCharacters1Boxed permits PropertiesWithEscapedCharacters1BoxedVoid, PropertiesWithEscapedCharacters1BoxedBoolean, PropertiesWithEscapedCharacters1BoxedNumber, PropertiesWithEscapedCharacters1BoxedString, PropertiesWithEscapedCharacters1BoxedList, PropertiesWithEscapedCharacters1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface PropertiesWithEscapedCharacters1Boxed permits PropertiesWithEscapedCharacters1BoxedVoid, PropertiesWithEscapedCharacters1BoxedBoolean, PropertiesWithEscapedCharacters1BoxedNumber, PropertiesWithEscapedCharacters1BoxedString, PropertiesWithEscapedCharacters1BoxedList, PropertiesWithEscapedCharacters1BoxedMap { + @Nullable Object getData(); } - public static final class PropertiesWithEscapedCharacters1BoxedVoid extends PropertiesWithEscapedCharacters1Boxed { - public final Void data; - private PropertiesWithEscapedCharacters1BoxedVoid(Void data) { - this.data = data; - } + public record PropertiesWithEscapedCharacters1BoxedVoid(Void data) implements PropertiesWithEscapedCharacters1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class PropertiesWithEscapedCharacters1BoxedBoolean extends PropertiesWithEscapedCharacters1Boxed { - public final boolean data; - private PropertiesWithEscapedCharacters1BoxedBoolean(boolean data) { - this.data = data; - } + public record PropertiesWithEscapedCharacters1BoxedBoolean(boolean data) implements PropertiesWithEscapedCharacters1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class PropertiesWithEscapedCharacters1BoxedNumber extends PropertiesWithEscapedCharacters1Boxed { - public final Number data; - private PropertiesWithEscapedCharacters1BoxedNumber(Number data) { - this.data = data; - } + public record PropertiesWithEscapedCharacters1BoxedNumber(Number data) implements PropertiesWithEscapedCharacters1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class PropertiesWithEscapedCharacters1BoxedString extends PropertiesWithEscapedCharacters1Boxed { - public final String data; - private PropertiesWithEscapedCharacters1BoxedString(String data) { - this.data = data; - } + public record PropertiesWithEscapedCharacters1BoxedString(String data) implements PropertiesWithEscapedCharacters1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class PropertiesWithEscapedCharacters1BoxedList extends PropertiesWithEscapedCharacters1Boxed { - public final FrozenList<@Nullable Object> data; - private PropertiesWithEscapedCharacters1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record PropertiesWithEscapedCharacters1BoxedList(FrozenList<@Nullable Object> data) implements PropertiesWithEscapedCharacters1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class PropertiesWithEscapedCharacters1BoxedMap extends PropertiesWithEscapedCharacters1Boxed { - public final PropertiesWithEscapedCharactersMap data; - private PropertiesWithEscapedCharacters1BoxedMap(PropertiesWithEscapedCharactersMap data) { - this.data = data; - } + public record PropertiesWithEscapedCharacters1BoxedMap(PropertiesWithEscapedCharactersMap data) implements PropertiesWithEscapedCharacters1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class PropertiesWithEscapedCharacters1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, PropertiesWithEscapedCharacters1BoxedList>, MapSchemaValidator { + public static class PropertiesWithEscapedCharacters1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, PropertiesWithEscapedCharacters1BoxedList>, MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -531,11 +507,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -566,11 +542,11 @@ public PropertiesWithEscapedCharactersMap getNewInstance(Map arg, List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -649,5 +625,24 @@ public PropertiesWithEscapedCharacters1BoxedList validateAndBox(List arg, Sch public PropertiesWithEscapedCharacters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new PropertiesWithEscapedCharacters1BoxedMap(validate(arg, configuration)); } + @Override + public PropertiesWithEscapedCharacters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesWithNullValuedInstanceProperties.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesWithNullValuedInstanceProperties.java index 0fcbec119fe..4ebca7f490d 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesWithNullValuedInstanceProperties.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertiesWithNullValuedInstanceProperties.java @@ -115,78 +115,54 @@ public PropertiesWithNullValuedInstancePropertiesMapBuilder getBuilderAfterAddit } - public static abstract sealed class PropertiesWithNullValuedInstanceProperties1Boxed permits PropertiesWithNullValuedInstanceProperties1BoxedVoid, PropertiesWithNullValuedInstanceProperties1BoxedBoolean, PropertiesWithNullValuedInstanceProperties1BoxedNumber, PropertiesWithNullValuedInstanceProperties1BoxedString, PropertiesWithNullValuedInstanceProperties1BoxedList, PropertiesWithNullValuedInstanceProperties1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface PropertiesWithNullValuedInstanceProperties1Boxed permits PropertiesWithNullValuedInstanceProperties1BoxedVoid, PropertiesWithNullValuedInstanceProperties1BoxedBoolean, PropertiesWithNullValuedInstanceProperties1BoxedNumber, PropertiesWithNullValuedInstanceProperties1BoxedString, PropertiesWithNullValuedInstanceProperties1BoxedList, PropertiesWithNullValuedInstanceProperties1BoxedMap { + @Nullable Object getData(); } - public static final class PropertiesWithNullValuedInstanceProperties1BoxedVoid extends PropertiesWithNullValuedInstanceProperties1Boxed { - public final Void data; - private PropertiesWithNullValuedInstanceProperties1BoxedVoid(Void data) { - this.data = data; - } + public record PropertiesWithNullValuedInstanceProperties1BoxedVoid(Void data) implements PropertiesWithNullValuedInstanceProperties1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class PropertiesWithNullValuedInstanceProperties1BoxedBoolean extends PropertiesWithNullValuedInstanceProperties1Boxed { - public final boolean data; - private PropertiesWithNullValuedInstanceProperties1BoxedBoolean(boolean data) { - this.data = data; - } + public record PropertiesWithNullValuedInstanceProperties1BoxedBoolean(boolean data) implements PropertiesWithNullValuedInstanceProperties1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class PropertiesWithNullValuedInstanceProperties1BoxedNumber extends PropertiesWithNullValuedInstanceProperties1Boxed { - public final Number data; - private PropertiesWithNullValuedInstanceProperties1BoxedNumber(Number data) { - this.data = data; - } + public record PropertiesWithNullValuedInstanceProperties1BoxedNumber(Number data) implements PropertiesWithNullValuedInstanceProperties1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class PropertiesWithNullValuedInstanceProperties1BoxedString extends PropertiesWithNullValuedInstanceProperties1Boxed { - public final String data; - private PropertiesWithNullValuedInstanceProperties1BoxedString(String data) { - this.data = data; - } + public record PropertiesWithNullValuedInstanceProperties1BoxedString(String data) implements PropertiesWithNullValuedInstanceProperties1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class PropertiesWithNullValuedInstanceProperties1BoxedList extends PropertiesWithNullValuedInstanceProperties1Boxed { - public final FrozenList<@Nullable Object> data; - private PropertiesWithNullValuedInstanceProperties1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record PropertiesWithNullValuedInstanceProperties1BoxedList(FrozenList<@Nullable Object> data) implements PropertiesWithNullValuedInstanceProperties1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class PropertiesWithNullValuedInstanceProperties1BoxedMap extends PropertiesWithNullValuedInstanceProperties1Boxed { - public final PropertiesWithNullValuedInstancePropertiesMap data; - private PropertiesWithNullValuedInstanceProperties1BoxedMap(PropertiesWithNullValuedInstancePropertiesMap data) { - this.data = data; - } + public record PropertiesWithNullValuedInstanceProperties1BoxedMap(PropertiesWithNullValuedInstancePropertiesMap data) implements PropertiesWithNullValuedInstanceProperties1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class PropertiesWithNullValuedInstanceProperties1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, PropertiesWithNullValuedInstanceProperties1BoxedList>, MapSchemaValidator { + public static class PropertiesWithNullValuedInstanceProperties1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, PropertiesWithNullValuedInstanceProperties1BoxedList>, MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -293,11 +269,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -328,11 +304,11 @@ public PropertiesWithNullValuedInstancePropertiesMap getNewInstance(Map ar List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -411,5 +387,24 @@ public PropertiesWithNullValuedInstanceProperties1BoxedList validateAndBox(List< public PropertiesWithNullValuedInstanceProperties1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new PropertiesWithNullValuedInstanceProperties1BoxedMap(validate(arg, configuration)); } + @Override + public PropertiesWithNullValuedInstanceProperties1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertyNamedRefThatIsNotAReference.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertyNamedRefThatIsNotAReference.java index 4f5b39e6deb..559e0f4fe6f 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertyNamedRefThatIsNotAReference.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertyNamedRefThatIsNotAReference.java @@ -105,78 +105,54 @@ public PropertyNamedRefThatIsNotAReferenceMapBuilder getBuilderAfterAdditionalPr } - public static abstract sealed class PropertyNamedRefThatIsNotAReference1Boxed permits PropertyNamedRefThatIsNotAReference1BoxedVoid, PropertyNamedRefThatIsNotAReference1BoxedBoolean, PropertyNamedRefThatIsNotAReference1BoxedNumber, PropertyNamedRefThatIsNotAReference1BoxedString, PropertyNamedRefThatIsNotAReference1BoxedList, PropertyNamedRefThatIsNotAReference1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface PropertyNamedRefThatIsNotAReference1Boxed permits PropertyNamedRefThatIsNotAReference1BoxedVoid, PropertyNamedRefThatIsNotAReference1BoxedBoolean, PropertyNamedRefThatIsNotAReference1BoxedNumber, PropertyNamedRefThatIsNotAReference1BoxedString, PropertyNamedRefThatIsNotAReference1BoxedList, PropertyNamedRefThatIsNotAReference1BoxedMap { + @Nullable Object getData(); } - public static final class PropertyNamedRefThatIsNotAReference1BoxedVoid extends PropertyNamedRefThatIsNotAReference1Boxed { - public final Void data; - private PropertyNamedRefThatIsNotAReference1BoxedVoid(Void data) { - this.data = data; - } + public record PropertyNamedRefThatIsNotAReference1BoxedVoid(Void data) implements PropertyNamedRefThatIsNotAReference1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class PropertyNamedRefThatIsNotAReference1BoxedBoolean extends PropertyNamedRefThatIsNotAReference1Boxed { - public final boolean data; - private PropertyNamedRefThatIsNotAReference1BoxedBoolean(boolean data) { - this.data = data; - } + public record PropertyNamedRefThatIsNotAReference1BoxedBoolean(boolean data) implements PropertyNamedRefThatIsNotAReference1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class PropertyNamedRefThatIsNotAReference1BoxedNumber extends PropertyNamedRefThatIsNotAReference1Boxed { - public final Number data; - private PropertyNamedRefThatIsNotAReference1BoxedNumber(Number data) { - this.data = data; - } + public record PropertyNamedRefThatIsNotAReference1BoxedNumber(Number data) implements PropertyNamedRefThatIsNotAReference1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class PropertyNamedRefThatIsNotAReference1BoxedString extends PropertyNamedRefThatIsNotAReference1Boxed { - public final String data; - private PropertyNamedRefThatIsNotAReference1BoxedString(String data) { - this.data = data; - } + public record PropertyNamedRefThatIsNotAReference1BoxedString(String data) implements PropertyNamedRefThatIsNotAReference1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class PropertyNamedRefThatIsNotAReference1BoxedList extends PropertyNamedRefThatIsNotAReference1Boxed { - public final FrozenList<@Nullable Object> data; - private PropertyNamedRefThatIsNotAReference1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record PropertyNamedRefThatIsNotAReference1BoxedList(FrozenList<@Nullable Object> data) implements PropertyNamedRefThatIsNotAReference1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class PropertyNamedRefThatIsNotAReference1BoxedMap extends PropertyNamedRefThatIsNotAReference1Boxed { - public final PropertyNamedRefThatIsNotAReferenceMap data; - private PropertyNamedRefThatIsNotAReference1BoxedMap(PropertyNamedRefThatIsNotAReferenceMap data) { - this.data = data; - } + public record PropertyNamedRefThatIsNotAReference1BoxedMap(PropertyNamedRefThatIsNotAReferenceMap data) implements PropertyNamedRefThatIsNotAReference1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class PropertyNamedRefThatIsNotAReference1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, PropertyNamedRefThatIsNotAReference1BoxedList>, MapSchemaValidator { + public static class PropertyNamedRefThatIsNotAReference1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, PropertyNamedRefThatIsNotAReference1BoxedList>, MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -283,11 +259,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -318,11 +294,11 @@ public PropertyNamedRefThatIsNotAReferenceMap getNewInstance(Map arg, List List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -401,5 +377,24 @@ public PropertyNamedRefThatIsNotAReference1BoxedList validateAndBox(List arg, public PropertyNamedRefThatIsNotAReference1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new PropertyNamedRefThatIsNotAReference1BoxedMap(validate(arg, configuration)); } + @Override + public PropertyNamedRefThatIsNotAReference1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertynamesValidation.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertynamesValidation.java index 7f243d22802..15cb89341c1 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertynamesValidation.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/PropertynamesValidation.java @@ -35,24 +35,20 @@ public class PropertynamesValidation { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class PropertyNamesBoxed permits PropertyNamesBoxedString { - public abstract @Nullable Object data(); + public sealed interface PropertyNamesBoxed permits PropertyNamesBoxedString { + @Nullable Object getData(); } - public static final class PropertyNamesBoxedString extends PropertyNamesBoxed { - public final String data; - private PropertyNamesBoxedString(String data) { - this.data = data; - } + public record PropertyNamesBoxedString(String data) implements PropertyNamesBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class PropertyNames extends JsonSchema implements StringSchemaValidator { + public static class PropertyNames extends JsonSchema implements StringSchemaValidator { private static @Nullable PropertyNames instance = null; protected PropertyNames() { @@ -100,80 +96,63 @@ public String validate(String arg, SchemaConfiguration configuration) throws Val public PropertyNamesBoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new PropertyNamesBoxedString(validate(arg, configuration)); } + @Override + public PropertyNamesBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class PropertynamesValidation1Boxed permits PropertynamesValidation1BoxedVoid, PropertynamesValidation1BoxedBoolean, PropertynamesValidation1BoxedNumber, PropertynamesValidation1BoxedString, PropertynamesValidation1BoxedList, PropertynamesValidation1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface PropertynamesValidation1Boxed permits PropertynamesValidation1BoxedVoid, PropertynamesValidation1BoxedBoolean, PropertynamesValidation1BoxedNumber, PropertynamesValidation1BoxedString, PropertynamesValidation1BoxedList, PropertynamesValidation1BoxedMap { + @Nullable Object getData(); } - public static final class PropertynamesValidation1BoxedVoid extends PropertynamesValidation1Boxed { - public final Void data; - private PropertynamesValidation1BoxedVoid(Void data) { - this.data = data; - } + public record PropertynamesValidation1BoxedVoid(Void data) implements PropertynamesValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class PropertynamesValidation1BoxedBoolean extends PropertynamesValidation1Boxed { - public final boolean data; - private PropertynamesValidation1BoxedBoolean(boolean data) { - this.data = data; - } + public record PropertynamesValidation1BoxedBoolean(boolean data) implements PropertynamesValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class PropertynamesValidation1BoxedNumber extends PropertynamesValidation1Boxed { - public final Number data; - private PropertynamesValidation1BoxedNumber(Number data) { - this.data = data; - } + public record PropertynamesValidation1BoxedNumber(Number data) implements PropertynamesValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class PropertynamesValidation1BoxedString extends PropertynamesValidation1Boxed { - public final String data; - private PropertynamesValidation1BoxedString(String data) { - this.data = data; - } + public record PropertynamesValidation1BoxedString(String data) implements PropertynamesValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class PropertynamesValidation1BoxedList extends PropertynamesValidation1Boxed { - public final FrozenList<@Nullable Object> data; - private PropertynamesValidation1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record PropertynamesValidation1BoxedList(FrozenList<@Nullable Object> data) implements PropertynamesValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class PropertynamesValidation1BoxedMap extends PropertynamesValidation1Boxed { - public final FrozenMap<@Nullable Object> data; - private PropertynamesValidation1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record PropertynamesValidation1BoxedMap(FrozenMap<@Nullable Object> data) implements PropertynamesValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class PropertynamesValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, PropertynamesValidation1BoxedList>, MapSchemaValidator, PropertynamesValidation1BoxedMap> { + public static class PropertynamesValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, PropertynamesValidation1BoxedList>, MapSchemaValidator, PropertynamesValidation1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -278,11 +257,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -313,11 +292,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -396,5 +375,24 @@ public PropertynamesValidation1BoxedList validateAndBox(List arg, SchemaConfi public PropertynamesValidation1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new PropertynamesValidation1BoxedMap(validate(arg, configuration)); } + @Override + public PropertynamesValidation1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RegexFormat.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RegexFormat.java index c015ccc8d17..cd8b8320ee6 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RegexFormat.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RegexFormat.java @@ -35,78 +35,54 @@ public class RegexFormat { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class RegexFormat1Boxed permits RegexFormat1BoxedVoid, RegexFormat1BoxedBoolean, RegexFormat1BoxedNumber, RegexFormat1BoxedString, RegexFormat1BoxedList, RegexFormat1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface RegexFormat1Boxed permits RegexFormat1BoxedVoid, RegexFormat1BoxedBoolean, RegexFormat1BoxedNumber, RegexFormat1BoxedString, RegexFormat1BoxedList, RegexFormat1BoxedMap { + @Nullable Object getData(); } - public static final class RegexFormat1BoxedVoid extends RegexFormat1Boxed { - public final Void data; - private RegexFormat1BoxedVoid(Void data) { - this.data = data; - } + public record RegexFormat1BoxedVoid(Void data) implements RegexFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class RegexFormat1BoxedBoolean extends RegexFormat1Boxed { - public final boolean data; - private RegexFormat1BoxedBoolean(boolean data) { - this.data = data; - } + public record RegexFormat1BoxedBoolean(boolean data) implements RegexFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class RegexFormat1BoxedNumber extends RegexFormat1Boxed { - public final Number data; - private RegexFormat1BoxedNumber(Number data) { - this.data = data; - } + public record RegexFormat1BoxedNumber(Number data) implements RegexFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class RegexFormat1BoxedString extends RegexFormat1Boxed { - public final String data; - private RegexFormat1BoxedString(String data) { - this.data = data; - } + public record RegexFormat1BoxedString(String data) implements RegexFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class RegexFormat1BoxedList extends RegexFormat1Boxed { - public final FrozenList<@Nullable Object> data; - private RegexFormat1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record RegexFormat1BoxedList(FrozenList<@Nullable Object> data) implements RegexFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class RegexFormat1BoxedMap extends RegexFormat1Boxed { - public final FrozenMap<@Nullable Object> data; - private RegexFormat1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record RegexFormat1BoxedMap(FrozenMap<@Nullable Object> data) implements RegexFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class RegexFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, RegexFormat1BoxedList>, MapSchemaValidator, RegexFormat1BoxedMap> { + public static class RegexFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, RegexFormat1BoxedList>, MapSchemaValidator, RegexFormat1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -211,11 +187,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -246,11 +222,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -329,5 +305,24 @@ public RegexFormat1BoxedList validateAndBox(List arg, SchemaConfiguration con public RegexFormat1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new RegexFormat1BoxedMap(validate(arg, configuration)); } + @Override + public RegexFormat1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RegexesAreNotAnchoredByDefaultAndAreCaseSensitive.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RegexesAreNotAnchoredByDefaultAndAreCaseSensitive.java index c990b4994b3..a8f1b0e7078 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RegexesAreNotAnchoredByDefaultAndAreCaseSensitive.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RegexesAreNotAnchoredByDefaultAndAreCaseSensitive.java @@ -61,78 +61,54 @@ public static X getInstance() { } - public static abstract sealed class RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1Boxed permits RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedVoid, RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedBoolean, RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedNumber, RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedString, RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedList, RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1Boxed permits RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedVoid, RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedBoolean, RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedNumber, RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedString, RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedList, RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedMap { + @Nullable Object getData(); } - public static final class RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedVoid extends RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1Boxed { - public final Void data; - private RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedVoid(Void data) { - this.data = data; - } + public record RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedVoid(Void data) implements RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedBoolean extends RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1Boxed { - public final boolean data; - private RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedBoolean(boolean data) { - this.data = data; - } + public record RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedBoolean(boolean data) implements RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedNumber extends RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1Boxed { - public final Number data; - private RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedNumber(Number data) { - this.data = data; - } + public record RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedNumber(Number data) implements RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedString extends RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1Boxed { - public final String data; - private RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedString(String data) { - this.data = data; - } + public record RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedString(String data) implements RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedList extends RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1Boxed { - public final FrozenList<@Nullable Object> data; - private RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedList(FrozenList<@Nullable Object> data) implements RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedMap extends RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1Boxed { - public final FrozenMap<@Nullable Object> data; - private RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedMap(FrozenMap<@Nullable Object> data) implements RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedList>, MapSchemaValidator, RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedMap> { + public static class RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedList>, MapSchemaValidator, RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -240,11 +216,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -275,11 +251,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -358,5 +334,24 @@ public RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedList validateAndBo public RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1BoxedMap(validate(arg, configuration)); } + @Override + public RegexesAreNotAnchoredByDefaultAndAreCaseSensitive1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RelativeJsonPointerFormat.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RelativeJsonPointerFormat.java index 35892ce241a..f919b948fe2 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RelativeJsonPointerFormat.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RelativeJsonPointerFormat.java @@ -35,78 +35,54 @@ public class RelativeJsonPointerFormat { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class RelativeJsonPointerFormat1Boxed permits RelativeJsonPointerFormat1BoxedVoid, RelativeJsonPointerFormat1BoxedBoolean, RelativeJsonPointerFormat1BoxedNumber, RelativeJsonPointerFormat1BoxedString, RelativeJsonPointerFormat1BoxedList, RelativeJsonPointerFormat1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface RelativeJsonPointerFormat1Boxed permits RelativeJsonPointerFormat1BoxedVoid, RelativeJsonPointerFormat1BoxedBoolean, RelativeJsonPointerFormat1BoxedNumber, RelativeJsonPointerFormat1BoxedString, RelativeJsonPointerFormat1BoxedList, RelativeJsonPointerFormat1BoxedMap { + @Nullable Object getData(); } - public static final class RelativeJsonPointerFormat1BoxedVoid extends RelativeJsonPointerFormat1Boxed { - public final Void data; - private RelativeJsonPointerFormat1BoxedVoid(Void data) { - this.data = data; - } + public record RelativeJsonPointerFormat1BoxedVoid(Void data) implements RelativeJsonPointerFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class RelativeJsonPointerFormat1BoxedBoolean extends RelativeJsonPointerFormat1Boxed { - public final boolean data; - private RelativeJsonPointerFormat1BoxedBoolean(boolean data) { - this.data = data; - } + public record RelativeJsonPointerFormat1BoxedBoolean(boolean data) implements RelativeJsonPointerFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class RelativeJsonPointerFormat1BoxedNumber extends RelativeJsonPointerFormat1Boxed { - public final Number data; - private RelativeJsonPointerFormat1BoxedNumber(Number data) { - this.data = data; - } + public record RelativeJsonPointerFormat1BoxedNumber(Number data) implements RelativeJsonPointerFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class RelativeJsonPointerFormat1BoxedString extends RelativeJsonPointerFormat1Boxed { - public final String data; - private RelativeJsonPointerFormat1BoxedString(String data) { - this.data = data; - } + public record RelativeJsonPointerFormat1BoxedString(String data) implements RelativeJsonPointerFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class RelativeJsonPointerFormat1BoxedList extends RelativeJsonPointerFormat1Boxed { - public final FrozenList<@Nullable Object> data; - private RelativeJsonPointerFormat1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record RelativeJsonPointerFormat1BoxedList(FrozenList<@Nullable Object> data) implements RelativeJsonPointerFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class RelativeJsonPointerFormat1BoxedMap extends RelativeJsonPointerFormat1Boxed { - public final FrozenMap<@Nullable Object> data; - private RelativeJsonPointerFormat1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record RelativeJsonPointerFormat1BoxedMap(FrozenMap<@Nullable Object> data) implements RelativeJsonPointerFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class RelativeJsonPointerFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, RelativeJsonPointerFormat1BoxedList>, MapSchemaValidator, RelativeJsonPointerFormat1BoxedMap> { + public static class RelativeJsonPointerFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, RelativeJsonPointerFormat1BoxedList>, MapSchemaValidator, RelativeJsonPointerFormat1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -211,11 +187,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -246,11 +222,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -329,5 +305,24 @@ public RelativeJsonPointerFormat1BoxedList validateAndBox(List arg, SchemaCon public RelativeJsonPointerFormat1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new RelativeJsonPointerFormat1BoxedMap(validate(arg, configuration)); } + @Override + public RelativeJsonPointerFormat1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredDefaultValidation.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredDefaultValidation.java index 3ec1cb0e025..8be0cb10a2a 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredDefaultValidation.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredDefaultValidation.java @@ -157,78 +157,54 @@ public RequiredDefaultValidationMapBuilder getBuilderAfterAdditionalProperty(Map } - public static abstract sealed class RequiredDefaultValidation1Boxed permits RequiredDefaultValidation1BoxedVoid, RequiredDefaultValidation1BoxedBoolean, RequiredDefaultValidation1BoxedNumber, RequiredDefaultValidation1BoxedString, RequiredDefaultValidation1BoxedList, RequiredDefaultValidation1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface RequiredDefaultValidation1Boxed permits RequiredDefaultValidation1BoxedVoid, RequiredDefaultValidation1BoxedBoolean, RequiredDefaultValidation1BoxedNumber, RequiredDefaultValidation1BoxedString, RequiredDefaultValidation1BoxedList, RequiredDefaultValidation1BoxedMap { + @Nullable Object getData(); } - public static final class RequiredDefaultValidation1BoxedVoid extends RequiredDefaultValidation1Boxed { - public final Void data; - private RequiredDefaultValidation1BoxedVoid(Void data) { - this.data = data; - } + public record RequiredDefaultValidation1BoxedVoid(Void data) implements RequiredDefaultValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class RequiredDefaultValidation1BoxedBoolean extends RequiredDefaultValidation1Boxed { - public final boolean data; - private RequiredDefaultValidation1BoxedBoolean(boolean data) { - this.data = data; - } + public record RequiredDefaultValidation1BoxedBoolean(boolean data) implements RequiredDefaultValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class RequiredDefaultValidation1BoxedNumber extends RequiredDefaultValidation1Boxed { - public final Number data; - private RequiredDefaultValidation1BoxedNumber(Number data) { - this.data = data; - } + public record RequiredDefaultValidation1BoxedNumber(Number data) implements RequiredDefaultValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class RequiredDefaultValidation1BoxedString extends RequiredDefaultValidation1Boxed { - public final String data; - private RequiredDefaultValidation1BoxedString(String data) { - this.data = data; - } + public record RequiredDefaultValidation1BoxedString(String data) implements RequiredDefaultValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class RequiredDefaultValidation1BoxedList extends RequiredDefaultValidation1Boxed { - public final FrozenList<@Nullable Object> data; - private RequiredDefaultValidation1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record RequiredDefaultValidation1BoxedList(FrozenList<@Nullable Object> data) implements RequiredDefaultValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class RequiredDefaultValidation1BoxedMap extends RequiredDefaultValidation1Boxed { - public final RequiredDefaultValidationMap data; - private RequiredDefaultValidation1BoxedMap(RequiredDefaultValidationMap data) { - this.data = data; - } + public record RequiredDefaultValidation1BoxedMap(RequiredDefaultValidationMap data) implements RequiredDefaultValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class RequiredDefaultValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, RequiredDefaultValidation1BoxedList>, MapSchemaValidator { + public static class RequiredDefaultValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, RequiredDefaultValidation1BoxedList>, MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -335,11 +311,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -370,11 +346,11 @@ public RequiredDefaultValidationMap getNewInstance(Map arg, List p List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -453,5 +429,24 @@ public RequiredDefaultValidation1BoxedList validateAndBox(List arg, SchemaCon public RequiredDefaultValidation1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new RequiredDefaultValidation1BoxedMap(validate(arg, configuration)); } + @Override + public RequiredDefaultValidation1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames.java index 2ae49db2d06..cba00121cd8 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames.java @@ -369,78 +369,54 @@ public RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNamesMap110Builder } - public static abstract sealed class RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1Boxed permits RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedVoid, RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedBoolean, RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedNumber, RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedString, RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedList, RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1Boxed permits RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedVoid, RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedBoolean, RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedNumber, RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedString, RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedList, RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedMap { + @Nullable Object getData(); } - public static final class RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedVoid extends RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1Boxed { - public final Void data; - private RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedVoid(Void data) { - this.data = data; - } + public record RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedVoid(Void data) implements RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedBoolean extends RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1Boxed { - public final boolean data; - private RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedBoolean(boolean data) { - this.data = data; - } + public record RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedBoolean(boolean data) implements RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedNumber extends RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1Boxed { - public final Number data; - private RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedNumber(Number data) { - this.data = data; - } + public record RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedNumber(Number data) implements RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedString extends RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1Boxed { - public final String data; - private RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedString(String data) { - this.data = data; - } + public record RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedString(String data) implements RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedList extends RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1Boxed { - public final FrozenList<@Nullable Object> data; - private RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedList(FrozenList<@Nullable Object> data) implements RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedMap extends RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1Boxed { - public final RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNamesMap data; - private RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedMap(RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNamesMap data) { - this.data = data; - } + public record RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedMap(RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNamesMap data) implements RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedList>, MapSchemaValidator { + public static class RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedList>, MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -549,11 +525,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -584,11 +560,11 @@ public RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNamesMap getNewIns List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -667,5 +643,24 @@ public RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedList va public RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1BoxedMap(validate(arg, configuration)); } + @Override + public RequiredPropertiesWhoseNamesAreJavascriptObjectPropertyNames1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredValidation.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredValidation.java index f2fcafbdf13..aeaff53e4dd 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredValidation.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredValidation.java @@ -247,78 +247,54 @@ public RequiredValidationMap0Builder getBuilderAfterFoo(Map data; - private RequiredValidation1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record RequiredValidation1BoxedList(FrozenList<@Nullable Object> data) implements RequiredValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class RequiredValidation1BoxedMap extends RequiredValidation1Boxed { - public final RequiredValidationMap data; - private RequiredValidation1BoxedMap(RequiredValidationMap data) { - this.data = data; - } + public record RequiredValidation1BoxedMap(RequiredValidationMap data) implements RequiredValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class RequiredValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, RequiredValidation1BoxedList>, MapSchemaValidator { + public static class RequiredValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, RequiredValidation1BoxedList>, MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -429,11 +405,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -464,11 +440,11 @@ public RequiredValidationMap getNewInstance(Map arg, List pathToIt List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -547,5 +523,24 @@ public RequiredValidation1BoxedList validateAndBox(List arg, SchemaConfigurat public RequiredValidation1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new RequiredValidation1BoxedMap(validate(arg, configuration)); } + @Override + public RequiredValidation1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEmptyArray.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEmptyArray.java index 65683b78a83..8f3fb5dbb03 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEmptyArray.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEmptyArray.java @@ -157,78 +157,54 @@ public RequiredWithEmptyArrayMapBuilder getBuilderAfterAdditionalProperty(Map data; - private RequiredWithEmptyArray1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record RequiredWithEmptyArray1BoxedList(FrozenList<@Nullable Object> data) implements RequiredWithEmptyArray1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class RequiredWithEmptyArray1BoxedMap extends RequiredWithEmptyArray1Boxed { - public final RequiredWithEmptyArrayMap data; - private RequiredWithEmptyArray1BoxedMap(RequiredWithEmptyArrayMap data) { - this.data = data; - } + public record RequiredWithEmptyArray1BoxedMap(RequiredWithEmptyArrayMap data) implements RequiredWithEmptyArray1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class RequiredWithEmptyArray1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, RequiredWithEmptyArray1BoxedList>, MapSchemaValidator { + public static class RequiredWithEmptyArray1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, RequiredWithEmptyArray1BoxedList>, MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -335,11 +311,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -370,11 +346,11 @@ public RequiredWithEmptyArrayMap getNewInstance(Map arg, List path List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -453,5 +429,24 @@ public RequiredWithEmptyArray1BoxedList validateAndBox(List arg, SchemaConfig public RequiredWithEmptyArray1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new RequiredWithEmptyArray1BoxedMap(validate(arg, configuration)); } + @Override + public RequiredWithEmptyArray1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEscapedCharacters.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEscapedCharacters.java index aa00cfb41ab..d6afadd7b34 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEscapedCharacters.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/RequiredWithEscapedCharacters.java @@ -1648,78 +1648,54 @@ public RequiredWithEscapedCharactersMap111110Builder getBuilderAfterFoobar1(Map< } - public static abstract sealed class RequiredWithEscapedCharacters1Boxed permits RequiredWithEscapedCharacters1BoxedVoid, RequiredWithEscapedCharacters1BoxedBoolean, RequiredWithEscapedCharacters1BoxedNumber, RequiredWithEscapedCharacters1BoxedString, RequiredWithEscapedCharacters1BoxedList, RequiredWithEscapedCharacters1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface RequiredWithEscapedCharacters1Boxed permits RequiredWithEscapedCharacters1BoxedVoid, RequiredWithEscapedCharacters1BoxedBoolean, RequiredWithEscapedCharacters1BoxedNumber, RequiredWithEscapedCharacters1BoxedString, RequiredWithEscapedCharacters1BoxedList, RequiredWithEscapedCharacters1BoxedMap { + @Nullable Object getData(); } - public static final class RequiredWithEscapedCharacters1BoxedVoid extends RequiredWithEscapedCharacters1Boxed { - public final Void data; - private RequiredWithEscapedCharacters1BoxedVoid(Void data) { - this.data = data; - } + public record RequiredWithEscapedCharacters1BoxedVoid(Void data) implements RequiredWithEscapedCharacters1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class RequiredWithEscapedCharacters1BoxedBoolean extends RequiredWithEscapedCharacters1Boxed { - public final boolean data; - private RequiredWithEscapedCharacters1BoxedBoolean(boolean data) { - this.data = data; - } + public record RequiredWithEscapedCharacters1BoxedBoolean(boolean data) implements RequiredWithEscapedCharacters1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class RequiredWithEscapedCharacters1BoxedNumber extends RequiredWithEscapedCharacters1Boxed { - public final Number data; - private RequiredWithEscapedCharacters1BoxedNumber(Number data) { - this.data = data; - } + public record RequiredWithEscapedCharacters1BoxedNumber(Number data) implements RequiredWithEscapedCharacters1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class RequiredWithEscapedCharacters1BoxedString extends RequiredWithEscapedCharacters1Boxed { - public final String data; - private RequiredWithEscapedCharacters1BoxedString(String data) { - this.data = data; - } + public record RequiredWithEscapedCharacters1BoxedString(String data) implements RequiredWithEscapedCharacters1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class RequiredWithEscapedCharacters1BoxedList extends RequiredWithEscapedCharacters1Boxed { - public final FrozenList<@Nullable Object> data; - private RequiredWithEscapedCharacters1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record RequiredWithEscapedCharacters1BoxedList(FrozenList<@Nullable Object> data) implements RequiredWithEscapedCharacters1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class RequiredWithEscapedCharacters1BoxedMap extends RequiredWithEscapedCharacters1Boxed { - public final RequiredWithEscapedCharactersMap data; - private RequiredWithEscapedCharacters1BoxedMap(RequiredWithEscapedCharactersMap data) { - this.data = data; - } + public record RequiredWithEscapedCharacters1BoxedMap(RequiredWithEscapedCharactersMap data) implements RequiredWithEscapedCharacters1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class RequiredWithEscapedCharacters1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, RequiredWithEscapedCharacters1BoxedList>, MapSchemaValidator { + public static class RequiredWithEscapedCharacters1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, RequiredWithEscapedCharacters1BoxedList>, MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -1831,11 +1807,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -1866,11 +1842,11 @@ public RequiredWithEscapedCharactersMap getNewInstance(Map arg, List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -1949,5 +1925,24 @@ public RequiredWithEscapedCharacters1BoxedList validateAndBox(List arg, Schem public RequiredWithEscapedCharacters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new RequiredWithEscapedCharacters1BoxedMap(validate(arg, configuration)); } + @Override + public RequiredWithEscapedCharacters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/SimpleEnumValidation.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/SimpleEnumValidation.java index 1007dda3a7c..9234455603c 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/SimpleEnumValidation.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/SimpleEnumValidation.java @@ -85,24 +85,20 @@ public double value() { } - public static abstract sealed class SimpleEnumValidation1Boxed permits SimpleEnumValidation1BoxedNumber { - public abstract @Nullable Object data(); + public sealed interface SimpleEnumValidation1Boxed permits SimpleEnumValidation1BoxedNumber { + @Nullable Object getData(); } - public static final class SimpleEnumValidation1BoxedNumber extends SimpleEnumValidation1Boxed { - public final Number data; - private SimpleEnumValidation1BoxedNumber(Number data) { - this.data = data; - } + public record SimpleEnumValidation1BoxedNumber(Number data) implements SimpleEnumValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class SimpleEnumValidation1 extends JsonSchema implements IntegerEnumValidator, LongEnumValidator, FloatEnumValidator, DoubleEnumValidator, NumberSchemaValidator { + public static class SimpleEnumValidation1 extends JsonSchema implements IntegerEnumValidator, LongEnumValidator, FloatEnumValidator, DoubleEnumValidator, NumberSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -199,5 +195,12 @@ public double validate(DoubleSimpleEnumValidationEnums arg,SchemaConfiguration c public SimpleEnumValidation1BoxedNumber validateAndBox(Number arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new SimpleEnumValidation1BoxedNumber(validate(arg, configuration)); } + @Override + public SimpleEnumValidation1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/SingleDependency.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/SingleDependency.java index 155f93e2ea3..86d60b1a92f 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/SingleDependency.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/SingleDependency.java @@ -38,78 +38,54 @@ public class SingleDependency { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class SingleDependency1Boxed permits SingleDependency1BoxedVoid, SingleDependency1BoxedBoolean, SingleDependency1BoxedNumber, SingleDependency1BoxedString, SingleDependency1BoxedList, SingleDependency1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface SingleDependency1Boxed permits SingleDependency1BoxedVoid, SingleDependency1BoxedBoolean, SingleDependency1BoxedNumber, SingleDependency1BoxedString, SingleDependency1BoxedList, SingleDependency1BoxedMap { + @Nullable Object getData(); } - public static final class SingleDependency1BoxedVoid extends SingleDependency1Boxed { - public final Void data; - private SingleDependency1BoxedVoid(Void data) { - this.data = data; - } + public record SingleDependency1BoxedVoid(Void data) implements SingleDependency1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class SingleDependency1BoxedBoolean extends SingleDependency1Boxed { - public final boolean data; - private SingleDependency1BoxedBoolean(boolean data) { - this.data = data; - } + public record SingleDependency1BoxedBoolean(boolean data) implements SingleDependency1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class SingleDependency1BoxedNumber extends SingleDependency1Boxed { - public final Number data; - private SingleDependency1BoxedNumber(Number data) { - this.data = data; - } + public record SingleDependency1BoxedNumber(Number data) implements SingleDependency1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class SingleDependency1BoxedString extends SingleDependency1Boxed { - public final String data; - private SingleDependency1BoxedString(String data) { - this.data = data; - } + public record SingleDependency1BoxedString(String data) implements SingleDependency1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class SingleDependency1BoxedList extends SingleDependency1Boxed { - public final FrozenList<@Nullable Object> data; - private SingleDependency1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record SingleDependency1BoxedList(FrozenList<@Nullable Object> data) implements SingleDependency1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class SingleDependency1BoxedMap extends SingleDependency1Boxed { - public final FrozenMap<@Nullable Object> data; - private SingleDependency1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record SingleDependency1BoxedMap(FrozenMap<@Nullable Object> data) implements SingleDependency1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class SingleDependency1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, SingleDependency1BoxedList>, MapSchemaValidator, SingleDependency1BoxedMap> { + public static class SingleDependency1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, SingleDependency1BoxedList>, MapSchemaValidator, SingleDependency1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -221,11 +197,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -256,11 +232,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -339,5 +315,24 @@ public SingleDependency1BoxedList validateAndBox(List arg, SchemaConfiguratio public SingleDependency1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new SingleDependency1BoxedMap(validate(arg, configuration)); } + @Override + public SingleDependency1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/SmallMultipleOfLargeInteger.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/SmallMultipleOfLargeInteger.java index ee2882293ad..b58e1485c35 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/SmallMultipleOfLargeInteger.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/SmallMultipleOfLargeInteger.java @@ -20,24 +20,20 @@ public class SmallMultipleOfLargeInteger { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class SmallMultipleOfLargeInteger1Boxed permits SmallMultipleOfLargeInteger1BoxedNumber { - public abstract @Nullable Object data(); + public sealed interface SmallMultipleOfLargeInteger1Boxed permits SmallMultipleOfLargeInteger1BoxedNumber { + @Nullable Object getData(); } - public static final class SmallMultipleOfLargeInteger1BoxedNumber extends SmallMultipleOfLargeInteger1Boxed { - public final Number data; - private SmallMultipleOfLargeInteger1BoxedNumber(Number data) { - this.data = data; - } + public record SmallMultipleOfLargeInteger1BoxedNumber(Number data) implements SmallMultipleOfLargeInteger1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class SmallMultipleOfLargeInteger1 extends JsonSchema implements NumberSchemaValidator { + public static class SmallMultipleOfLargeInteger1 extends JsonSchema implements NumberSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -111,5 +107,12 @@ public double validate(double arg, SchemaConfiguration configuration) throws Val public SmallMultipleOfLargeInteger1BoxedNumber validateAndBox(Number arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new SmallMultipleOfLargeInteger1BoxedNumber(validate(arg, configuration)); } + @Override + public SmallMultipleOfLargeInteger1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/TimeFormat.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/TimeFormat.java index ac561e09b5a..63242646ef3 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/TimeFormat.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/TimeFormat.java @@ -35,78 +35,54 @@ public class TimeFormat { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class TimeFormat1Boxed permits TimeFormat1BoxedVoid, TimeFormat1BoxedBoolean, TimeFormat1BoxedNumber, TimeFormat1BoxedString, TimeFormat1BoxedList, TimeFormat1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface TimeFormat1Boxed permits TimeFormat1BoxedVoid, TimeFormat1BoxedBoolean, TimeFormat1BoxedNumber, TimeFormat1BoxedString, TimeFormat1BoxedList, TimeFormat1BoxedMap { + @Nullable Object getData(); } - public static final class TimeFormat1BoxedVoid extends TimeFormat1Boxed { - public final Void data; - private TimeFormat1BoxedVoid(Void data) { - this.data = data; - } + public record TimeFormat1BoxedVoid(Void data) implements TimeFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class TimeFormat1BoxedBoolean extends TimeFormat1Boxed { - public final boolean data; - private TimeFormat1BoxedBoolean(boolean data) { - this.data = data; - } + public record TimeFormat1BoxedBoolean(boolean data) implements TimeFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class TimeFormat1BoxedNumber extends TimeFormat1Boxed { - public final Number data; - private TimeFormat1BoxedNumber(Number data) { - this.data = data; - } + public record TimeFormat1BoxedNumber(Number data) implements TimeFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class TimeFormat1BoxedString extends TimeFormat1Boxed { - public final String data; - private TimeFormat1BoxedString(String data) { - this.data = data; - } + public record TimeFormat1BoxedString(String data) implements TimeFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class TimeFormat1BoxedList extends TimeFormat1Boxed { - public final FrozenList<@Nullable Object> data; - private TimeFormat1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record TimeFormat1BoxedList(FrozenList<@Nullable Object> data) implements TimeFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class TimeFormat1BoxedMap extends TimeFormat1Boxed { - public final FrozenMap<@Nullable Object> data; - private TimeFormat1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record TimeFormat1BoxedMap(FrozenMap<@Nullable Object> data) implements TimeFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class TimeFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, TimeFormat1BoxedList>, MapSchemaValidator, TimeFormat1BoxedMap> { + public static class TimeFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, TimeFormat1BoxedList>, MapSchemaValidator, TimeFormat1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -211,11 +187,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -246,11 +222,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -329,5 +305,24 @@ public TimeFormat1BoxedList validateAndBox(List arg, SchemaConfiguration conf public TimeFormat1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new TimeFormat1BoxedMap(validate(arg, configuration)); } + @Override + public TimeFormat1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/TypeArrayObjectOrNull.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/TypeArrayObjectOrNull.java index f8915edede2..67c76fd1ca7 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/TypeArrayObjectOrNull.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/TypeArrayObjectOrNull.java @@ -29,45 +29,33 @@ public class TypeArrayObjectOrNull { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class TypeArrayObjectOrNull1Boxed permits TypeArrayObjectOrNull1BoxedList, TypeArrayObjectOrNull1BoxedMap, TypeArrayObjectOrNull1BoxedVoid { - public abstract @Nullable Object data(); + public sealed interface TypeArrayObjectOrNull1Boxed permits TypeArrayObjectOrNull1BoxedList, TypeArrayObjectOrNull1BoxedMap, TypeArrayObjectOrNull1BoxedVoid { + @Nullable Object getData(); } - public static final class TypeArrayObjectOrNull1BoxedList extends TypeArrayObjectOrNull1Boxed { - public final FrozenList<@Nullable Object> data; - private TypeArrayObjectOrNull1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record TypeArrayObjectOrNull1BoxedList(FrozenList<@Nullable Object> data) implements TypeArrayObjectOrNull1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class TypeArrayObjectOrNull1BoxedMap extends TypeArrayObjectOrNull1Boxed { - public final FrozenMap<@Nullable Object> data; - private TypeArrayObjectOrNull1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record TypeArrayObjectOrNull1BoxedMap(FrozenMap<@Nullable Object> data) implements TypeArrayObjectOrNull1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class TypeArrayObjectOrNull1BoxedVoid extends TypeArrayObjectOrNull1Boxed { - public final Void data; - private TypeArrayObjectOrNull1BoxedVoid(Void data) { - this.data = data; - } + public record TypeArrayObjectOrNull1BoxedVoid(Void data) implements TypeArrayObjectOrNull1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class TypeArrayObjectOrNull1 extends JsonSchema implements ListSchemaValidator, TypeArrayObjectOrNull1BoxedList>, MapSchemaValidator, TypeArrayObjectOrNull1BoxedMap>, NullSchemaValidator { + public static class TypeArrayObjectOrNull1 extends JsonSchema implements ListSchemaValidator, TypeArrayObjectOrNull1BoxedList>, MapSchemaValidator, TypeArrayObjectOrNull1BoxedMap>, NullSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -100,11 +88,11 @@ public static TypeArrayObjectOrNull1 getInstance() { for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -134,11 +122,11 @@ public static TypeArrayObjectOrNull1 getInstance() { List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -202,5 +190,17 @@ public TypeArrayObjectOrNull1BoxedMap validateAndBox(Map arg, SchemaConfig public TypeArrayObjectOrNull1BoxedVoid validateAndBox(Void arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new TypeArrayObjectOrNull1BoxedVoid(validate(arg, configuration)); } + @Override + public TypeArrayObjectOrNull1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } else if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/TypeArrayOrObject.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/TypeArrayOrObject.java index 34b35d5020d..257deb56122 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/TypeArrayOrObject.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/TypeArrayOrObject.java @@ -28,34 +28,26 @@ public class TypeArrayOrObject { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class TypeArrayOrObject1Boxed permits TypeArrayOrObject1BoxedList, TypeArrayOrObject1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface TypeArrayOrObject1Boxed permits TypeArrayOrObject1BoxedList, TypeArrayOrObject1BoxedMap { + @Nullable Object getData(); } - public static final class TypeArrayOrObject1BoxedList extends TypeArrayOrObject1Boxed { - public final FrozenList<@Nullable Object> data; - private TypeArrayOrObject1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record TypeArrayOrObject1BoxedList(FrozenList<@Nullable Object> data) implements TypeArrayOrObject1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class TypeArrayOrObject1BoxedMap extends TypeArrayOrObject1Boxed { - public final FrozenMap<@Nullable Object> data; - private TypeArrayOrObject1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record TypeArrayOrObject1BoxedMap(FrozenMap<@Nullable Object> data) implements TypeArrayOrObject1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class TypeArrayOrObject1 extends JsonSchema implements ListSchemaValidator, TypeArrayOrObject1BoxedList>, MapSchemaValidator, TypeArrayOrObject1BoxedMap> { + public static class TypeArrayOrObject1 extends JsonSchema implements ListSchemaValidator, TypeArrayOrObject1BoxedList>, MapSchemaValidator, TypeArrayOrObject1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -87,11 +79,11 @@ public static TypeArrayOrObject1 getInstance() { for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -121,11 +113,11 @@ public static TypeArrayOrObject1 getInstance() { List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -170,5 +162,14 @@ public TypeArrayOrObject1BoxedList validateAndBox(List arg, SchemaConfigurati public TypeArrayOrObject1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new TypeArrayOrObject1BoxedMap(validate(arg, configuration)); } + @Override + public TypeArrayOrObject1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UnevaluateditemsAsSchema.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UnevaluateditemsAsSchema.java index d5a5ae23cb2..da598e74bd5 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UnevaluateditemsAsSchema.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UnevaluateditemsAsSchema.java @@ -47,78 +47,54 @@ public static UnevaluatedItems getInstance() { } - public static abstract sealed class UnevaluateditemsAsSchema1Boxed permits UnevaluateditemsAsSchema1BoxedVoid, UnevaluateditemsAsSchema1BoxedBoolean, UnevaluateditemsAsSchema1BoxedNumber, UnevaluateditemsAsSchema1BoxedString, UnevaluateditemsAsSchema1BoxedList, UnevaluateditemsAsSchema1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface UnevaluateditemsAsSchema1Boxed permits UnevaluateditemsAsSchema1BoxedVoid, UnevaluateditemsAsSchema1BoxedBoolean, UnevaluateditemsAsSchema1BoxedNumber, UnevaluateditemsAsSchema1BoxedString, UnevaluateditemsAsSchema1BoxedList, UnevaluateditemsAsSchema1BoxedMap { + @Nullable Object getData(); } - public static final class UnevaluateditemsAsSchema1BoxedVoid extends UnevaluateditemsAsSchema1Boxed { - public final Void data; - private UnevaluateditemsAsSchema1BoxedVoid(Void data) { - this.data = data; - } + public record UnevaluateditemsAsSchema1BoxedVoid(Void data) implements UnevaluateditemsAsSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UnevaluateditemsAsSchema1BoxedBoolean extends UnevaluateditemsAsSchema1Boxed { - public final boolean data; - private UnevaluateditemsAsSchema1BoxedBoolean(boolean data) { - this.data = data; - } + public record UnevaluateditemsAsSchema1BoxedBoolean(boolean data) implements UnevaluateditemsAsSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UnevaluateditemsAsSchema1BoxedNumber extends UnevaluateditemsAsSchema1Boxed { - public final Number data; - private UnevaluateditemsAsSchema1BoxedNumber(Number data) { - this.data = data; - } + public record UnevaluateditemsAsSchema1BoxedNumber(Number data) implements UnevaluateditemsAsSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UnevaluateditemsAsSchema1BoxedString extends UnevaluateditemsAsSchema1Boxed { - public final String data; - private UnevaluateditemsAsSchema1BoxedString(String data) { - this.data = data; - } + public record UnevaluateditemsAsSchema1BoxedString(String data) implements UnevaluateditemsAsSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UnevaluateditemsAsSchema1BoxedList extends UnevaluateditemsAsSchema1Boxed { - public final FrozenList<@Nullable Object> data; - private UnevaluateditemsAsSchema1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record UnevaluateditemsAsSchema1BoxedList(FrozenList<@Nullable Object> data) implements UnevaluateditemsAsSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UnevaluateditemsAsSchema1BoxedMap extends UnevaluateditemsAsSchema1Boxed { - public final FrozenMap<@Nullable Object> data; - private UnevaluateditemsAsSchema1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record UnevaluateditemsAsSchema1BoxedMap(FrozenMap<@Nullable Object> data) implements UnevaluateditemsAsSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class UnevaluateditemsAsSchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, UnevaluateditemsAsSchema1BoxedList>, MapSchemaValidator, UnevaluateditemsAsSchema1BoxedMap> { + public static class UnevaluateditemsAsSchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, UnevaluateditemsAsSchema1BoxedList>, MapSchemaValidator, UnevaluateditemsAsSchema1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -223,11 +199,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -258,11 +234,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -341,5 +317,24 @@ public UnevaluateditemsAsSchema1BoxedList validateAndBox(List arg, SchemaConf public UnevaluateditemsAsSchema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new UnevaluateditemsAsSchema1BoxedMap(validate(arg, configuration)); } + @Override + public UnevaluateditemsAsSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UnevaluateditemsDependsOnMultipleNestedContains.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UnevaluateditemsDependsOnMultipleNestedContains.java index ba2e06ba6f3..c217d3c4b19 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UnevaluateditemsDependsOnMultipleNestedContains.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UnevaluateditemsDependsOnMultipleNestedContains.java @@ -36,78 +36,54 @@ public class UnevaluateditemsDependsOnMultipleNestedContains { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class ContainsBoxed permits ContainsBoxedVoid, ContainsBoxedBoolean, ContainsBoxedNumber, ContainsBoxedString, ContainsBoxedList, ContainsBoxedMap { - public abstract @Nullable Object data(); + public sealed interface ContainsBoxed permits ContainsBoxedVoid, ContainsBoxedBoolean, ContainsBoxedNumber, ContainsBoxedString, ContainsBoxedList, ContainsBoxedMap { + @Nullable Object getData(); } - public static final class ContainsBoxedVoid extends ContainsBoxed { - public final Void data; - private ContainsBoxedVoid(Void data) { - this.data = data; - } + public record ContainsBoxedVoid(Void data) implements ContainsBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ContainsBoxedBoolean extends ContainsBoxed { - public final boolean data; - private ContainsBoxedBoolean(boolean data) { - this.data = data; - } + public record ContainsBoxedBoolean(boolean data) implements ContainsBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ContainsBoxedNumber extends ContainsBoxed { - public final Number data; - private ContainsBoxedNumber(Number data) { - this.data = data; - } + public record ContainsBoxedNumber(Number data) implements ContainsBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ContainsBoxedString extends ContainsBoxed { - public final String data; - private ContainsBoxedString(String data) { - this.data = data; - } + public record ContainsBoxedString(String data) implements ContainsBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ContainsBoxedList extends ContainsBoxed { - public final FrozenList<@Nullable Object> data; - private ContainsBoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record ContainsBoxedList(FrozenList<@Nullable Object> data) implements ContainsBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ContainsBoxedMap extends ContainsBoxed { - public final FrozenMap<@Nullable Object> data; - private ContainsBoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record ContainsBoxedMap(FrozenMap<@Nullable Object> data) implements ContainsBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Contains extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ContainsBoxedList>, MapSchemaValidator, ContainsBoxedMap> { + public static class Contains extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ContainsBoxedList>, MapSchemaValidator, ContainsBoxedMap> { private static @Nullable Contains instance = null; protected Contains() { @@ -206,11 +182,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -241,11 +217,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -324,80 +300,75 @@ public ContainsBoxedList validateAndBox(List arg, SchemaConfiguration configu public ContainsBoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ContainsBoxedMap(validate(arg, configuration)); } + @Override + public ContainsBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class Schema0Boxed permits Schema0BoxedVoid, Schema0BoxedBoolean, Schema0BoxedNumber, Schema0BoxedString, Schema0BoxedList, Schema0BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Schema0Boxed permits Schema0BoxedVoid, Schema0BoxedBoolean, Schema0BoxedNumber, Schema0BoxedString, Schema0BoxedList, Schema0BoxedMap { + @Nullable Object getData(); } - public static final class Schema0BoxedVoid extends Schema0Boxed { - public final Void data; - private Schema0BoxedVoid(Void data) { - this.data = data; - } + public record Schema0BoxedVoid(Void data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedBoolean extends Schema0Boxed { - public final boolean data; - private Schema0BoxedBoolean(boolean data) { - this.data = data; - } + public record Schema0BoxedBoolean(boolean data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedNumber extends Schema0Boxed { - public final Number data; - private Schema0BoxedNumber(Number data) { - this.data = data; - } + public record Schema0BoxedNumber(Number data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedString extends Schema0Boxed { - public final String data; - private Schema0BoxedString(String data) { - this.data = data; - } + public record Schema0BoxedString(String data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedList extends Schema0Boxed { - public final FrozenList<@Nullable Object> data; - private Schema0BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Schema0BoxedList(FrozenList<@Nullable Object> data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema0BoxedMap extends Schema0Boxed { - public final FrozenMap<@Nullable Object> data; - private Schema0BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record Schema0BoxedMap(FrozenMap<@Nullable Object> data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema0BoxedList>, MapSchemaValidator, Schema0BoxedMap> { + public static class Schema0 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema0BoxedList>, MapSchemaValidator, Schema0BoxedMap> { private static @Nullable Schema0 instance = null; protected Schema0() { @@ -496,11 +467,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -531,11 +502,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -614,80 +585,75 @@ public Schema0BoxedList validateAndBox(List arg, SchemaConfiguration configur public Schema0BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema0BoxedMap(validate(arg, configuration)); } + @Override + public Schema0Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class Contains1Boxed permits Contains1BoxedVoid, Contains1BoxedBoolean, Contains1BoxedNumber, Contains1BoxedString, Contains1BoxedList, Contains1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Contains1Boxed permits Contains1BoxedVoid, Contains1BoxedBoolean, Contains1BoxedNumber, Contains1BoxedString, Contains1BoxedList, Contains1BoxedMap { + @Nullable Object getData(); } - public static final class Contains1BoxedVoid extends Contains1Boxed { - public final Void data; - private Contains1BoxedVoid(Void data) { - this.data = data; - } + public record Contains1BoxedVoid(Void data) implements Contains1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Contains1BoxedBoolean extends Contains1Boxed { - public final boolean data; - private Contains1BoxedBoolean(boolean data) { - this.data = data; - } + public record Contains1BoxedBoolean(boolean data) implements Contains1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Contains1BoxedNumber extends Contains1Boxed { - public final Number data; - private Contains1BoxedNumber(Number data) { - this.data = data; - } + public record Contains1BoxedNumber(Number data) implements Contains1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Contains1BoxedString extends Contains1Boxed { - public final String data; - private Contains1BoxedString(String data) { - this.data = data; - } + public record Contains1BoxedString(String data) implements Contains1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Contains1BoxedList extends Contains1Boxed { - public final FrozenList<@Nullable Object> data; - private Contains1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Contains1BoxedList(FrozenList<@Nullable Object> data) implements Contains1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Contains1BoxedMap extends Contains1Boxed { - public final FrozenMap<@Nullable Object> data; - private Contains1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record Contains1BoxedMap(FrozenMap<@Nullable Object> data) implements Contains1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Contains1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Contains1BoxedList>, MapSchemaValidator, Contains1BoxedMap> { + public static class Contains1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Contains1BoxedList>, MapSchemaValidator, Contains1BoxedMap> { private static @Nullable Contains1 instance = null; protected Contains1() { @@ -786,11 +752,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -821,11 +787,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -904,80 +870,75 @@ public Contains1BoxedList validateAndBox(List arg, SchemaConfiguration config public Contains1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Contains1BoxedMap(validate(arg, configuration)); } + @Override + public Contains1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class Schema1Boxed permits Schema1BoxedVoid, Schema1BoxedBoolean, Schema1BoxedNumber, Schema1BoxedString, Schema1BoxedList, Schema1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Schema1Boxed permits Schema1BoxedVoid, Schema1BoxedBoolean, Schema1BoxedNumber, Schema1BoxedString, Schema1BoxedList, Schema1BoxedMap { + @Nullable Object getData(); } - public static final class Schema1BoxedVoid extends Schema1Boxed { - public final Void data; - private Schema1BoxedVoid(Void data) { - this.data = data; - } + public record Schema1BoxedVoid(Void data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedBoolean extends Schema1Boxed { - public final boolean data; - private Schema1BoxedBoolean(boolean data) { - this.data = data; - } + public record Schema1BoxedBoolean(boolean data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedNumber extends Schema1Boxed { - public final Number data; - private Schema1BoxedNumber(Number data) { - this.data = data; - } + public record Schema1BoxedNumber(Number data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedString extends Schema1Boxed { - public final String data; - private Schema1BoxedString(String data) { - this.data = data; - } + public record Schema1BoxedString(String data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedList extends Schema1Boxed { - public final FrozenList<@Nullable Object> data; - private Schema1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Schema1BoxedList(FrozenList<@Nullable Object> data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema1BoxedMap extends Schema1Boxed { - public final FrozenMap<@Nullable Object> data; - private Schema1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record Schema1BoxedMap(FrozenMap<@Nullable Object> data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema1BoxedList>, MapSchemaValidator, Schema1BoxedMap> { + public static class Schema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema1BoxedList>, MapSchemaValidator, Schema1BoxedMap> { private static @Nullable Schema1 instance = null; protected Schema1() { @@ -1076,11 +1037,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -1111,11 +1072,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -1194,80 +1155,75 @@ public Schema1BoxedList validateAndBox(List arg, SchemaConfiguration configur public Schema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema1BoxedMap(validate(arg, configuration)); } + @Override + public Schema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class UnevaluatedItemsBoxed permits UnevaluatedItemsBoxedVoid, UnevaluatedItemsBoxedBoolean, UnevaluatedItemsBoxedNumber, UnevaluatedItemsBoxedString, UnevaluatedItemsBoxedList, UnevaluatedItemsBoxedMap { - public abstract @Nullable Object data(); + public sealed interface UnevaluatedItemsBoxed permits UnevaluatedItemsBoxedVoid, UnevaluatedItemsBoxedBoolean, UnevaluatedItemsBoxedNumber, UnevaluatedItemsBoxedString, UnevaluatedItemsBoxedList, UnevaluatedItemsBoxedMap { + @Nullable Object getData(); } - public static final class UnevaluatedItemsBoxedVoid extends UnevaluatedItemsBoxed { - public final Void data; - private UnevaluatedItemsBoxedVoid(Void data) { - this.data = data; - } + public record UnevaluatedItemsBoxedVoid(Void data) implements UnevaluatedItemsBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UnevaluatedItemsBoxedBoolean extends UnevaluatedItemsBoxed { - public final boolean data; - private UnevaluatedItemsBoxedBoolean(boolean data) { - this.data = data; - } + public record UnevaluatedItemsBoxedBoolean(boolean data) implements UnevaluatedItemsBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UnevaluatedItemsBoxedNumber extends UnevaluatedItemsBoxed { - public final Number data; - private UnevaluatedItemsBoxedNumber(Number data) { - this.data = data; - } + public record UnevaluatedItemsBoxedNumber(Number data) implements UnevaluatedItemsBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UnevaluatedItemsBoxedString extends UnevaluatedItemsBoxed { - public final String data; - private UnevaluatedItemsBoxedString(String data) { - this.data = data; - } + public record UnevaluatedItemsBoxedString(String data) implements UnevaluatedItemsBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UnevaluatedItemsBoxedList extends UnevaluatedItemsBoxed { - public final FrozenList<@Nullable Object> data; - private UnevaluatedItemsBoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record UnevaluatedItemsBoxedList(FrozenList<@Nullable Object> data) implements UnevaluatedItemsBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UnevaluatedItemsBoxedMap extends UnevaluatedItemsBoxed { - public final FrozenMap<@Nullable Object> data; - private UnevaluatedItemsBoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record UnevaluatedItemsBoxedMap(FrozenMap<@Nullable Object> data) implements UnevaluatedItemsBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class UnevaluatedItems extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, UnevaluatedItemsBoxedList>, MapSchemaValidator, UnevaluatedItemsBoxedMap> { + public static class UnevaluatedItems extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, UnevaluatedItemsBoxedList>, MapSchemaValidator, UnevaluatedItemsBoxedMap> { private static @Nullable UnevaluatedItems instance = null; protected UnevaluatedItems() { @@ -1366,11 +1322,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -1401,11 +1357,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -1484,80 +1440,75 @@ public UnevaluatedItemsBoxedList validateAndBox(List arg, SchemaConfiguration public UnevaluatedItemsBoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new UnevaluatedItemsBoxedMap(validate(arg, configuration)); } + @Override + public UnevaluatedItemsBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class UnevaluateditemsDependsOnMultipleNestedContains1Boxed permits UnevaluateditemsDependsOnMultipleNestedContains1BoxedVoid, UnevaluateditemsDependsOnMultipleNestedContains1BoxedBoolean, UnevaluateditemsDependsOnMultipleNestedContains1BoxedNumber, UnevaluateditemsDependsOnMultipleNestedContains1BoxedString, UnevaluateditemsDependsOnMultipleNestedContains1BoxedList, UnevaluateditemsDependsOnMultipleNestedContains1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface UnevaluateditemsDependsOnMultipleNestedContains1Boxed permits UnevaluateditemsDependsOnMultipleNestedContains1BoxedVoid, UnevaluateditemsDependsOnMultipleNestedContains1BoxedBoolean, UnevaluateditemsDependsOnMultipleNestedContains1BoxedNumber, UnevaluateditemsDependsOnMultipleNestedContains1BoxedString, UnevaluateditemsDependsOnMultipleNestedContains1BoxedList, UnevaluateditemsDependsOnMultipleNestedContains1BoxedMap { + @Nullable Object getData(); } - public static final class UnevaluateditemsDependsOnMultipleNestedContains1BoxedVoid extends UnevaluateditemsDependsOnMultipleNestedContains1Boxed { - public final Void data; - private UnevaluateditemsDependsOnMultipleNestedContains1BoxedVoid(Void data) { - this.data = data; - } + public record UnevaluateditemsDependsOnMultipleNestedContains1BoxedVoid(Void data) implements UnevaluateditemsDependsOnMultipleNestedContains1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UnevaluateditemsDependsOnMultipleNestedContains1BoxedBoolean extends UnevaluateditemsDependsOnMultipleNestedContains1Boxed { - public final boolean data; - private UnevaluateditemsDependsOnMultipleNestedContains1BoxedBoolean(boolean data) { - this.data = data; - } + public record UnevaluateditemsDependsOnMultipleNestedContains1BoxedBoolean(boolean data) implements UnevaluateditemsDependsOnMultipleNestedContains1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UnevaluateditemsDependsOnMultipleNestedContains1BoxedNumber extends UnevaluateditemsDependsOnMultipleNestedContains1Boxed { - public final Number data; - private UnevaluateditemsDependsOnMultipleNestedContains1BoxedNumber(Number data) { - this.data = data; - } + public record UnevaluateditemsDependsOnMultipleNestedContains1BoxedNumber(Number data) implements UnevaluateditemsDependsOnMultipleNestedContains1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UnevaluateditemsDependsOnMultipleNestedContains1BoxedString extends UnevaluateditemsDependsOnMultipleNestedContains1Boxed { - public final String data; - private UnevaluateditemsDependsOnMultipleNestedContains1BoxedString(String data) { - this.data = data; - } + public record UnevaluateditemsDependsOnMultipleNestedContains1BoxedString(String data) implements UnevaluateditemsDependsOnMultipleNestedContains1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UnevaluateditemsDependsOnMultipleNestedContains1BoxedList extends UnevaluateditemsDependsOnMultipleNestedContains1Boxed { - public final FrozenList<@Nullable Object> data; - private UnevaluateditemsDependsOnMultipleNestedContains1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record UnevaluateditemsDependsOnMultipleNestedContains1BoxedList(FrozenList<@Nullable Object> data) implements UnevaluateditemsDependsOnMultipleNestedContains1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UnevaluateditemsDependsOnMultipleNestedContains1BoxedMap extends UnevaluateditemsDependsOnMultipleNestedContains1Boxed { - public final FrozenMap<@Nullable Object> data; - private UnevaluateditemsDependsOnMultipleNestedContains1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record UnevaluateditemsDependsOnMultipleNestedContains1BoxedMap(FrozenMap<@Nullable Object> data) implements UnevaluateditemsDependsOnMultipleNestedContains1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class UnevaluateditemsDependsOnMultipleNestedContains1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, UnevaluateditemsDependsOnMultipleNestedContains1BoxedList>, MapSchemaValidator, UnevaluateditemsDependsOnMultipleNestedContains1BoxedMap> { + public static class UnevaluateditemsDependsOnMultipleNestedContains1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, UnevaluateditemsDependsOnMultipleNestedContains1BoxedList>, MapSchemaValidator, UnevaluateditemsDependsOnMultipleNestedContains1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -1666,11 +1617,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -1701,11 +1652,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -1784,5 +1735,24 @@ public UnevaluateditemsDependsOnMultipleNestedContains1BoxedList validateAndBox( public UnevaluateditemsDependsOnMultipleNestedContains1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new UnevaluateditemsDependsOnMultipleNestedContains1BoxedMap(validate(arg, configuration)); } + @Override + public UnevaluateditemsDependsOnMultipleNestedContains1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UnevaluateditemsWithItems.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UnevaluateditemsWithItems.java index 481c6e51fca..99d330e3bd4 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UnevaluateditemsWithItems.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UnevaluateditemsWithItems.java @@ -93,24 +93,20 @@ public static UnevaluatedItems getInstance() { } - public static abstract sealed class UnevaluateditemsWithItems1Boxed permits UnevaluateditemsWithItems1BoxedList { - public abstract @Nullable Object data(); + public sealed interface UnevaluateditemsWithItems1Boxed permits UnevaluateditemsWithItems1BoxedList { + @Nullable Object getData(); } - public static final class UnevaluateditemsWithItems1BoxedList extends UnevaluateditemsWithItems1Boxed { - public final UnevaluateditemsWithItemsList data; - private UnevaluateditemsWithItems1BoxedList(UnevaluateditemsWithItemsList data) { - this.data = data; - } + public record UnevaluateditemsWithItems1BoxedList(UnevaluateditemsWithItemsList data) implements UnevaluateditemsWithItems1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class UnevaluateditemsWithItems1 extends JsonSchema implements ListSchemaValidator { + public static class UnevaluateditemsWithItems1 extends JsonSchema implements ListSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -141,11 +137,11 @@ public UnevaluateditemsWithItemsList getNewInstance(List arg, List pa for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Number)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -185,5 +181,12 @@ public UnevaluateditemsWithItemsList validate(List arg, SchemaConfiguration c public UnevaluateditemsWithItems1BoxedList validateAndBox(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new UnevaluateditemsWithItems1BoxedList(validate(arg, configuration)); } + @Override + public UnevaluateditemsWithItems1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UnevaluateditemsWithNullInstanceElements.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UnevaluateditemsWithNullInstanceElements.java index 71a5b33cf78..9956b7ba3b4 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UnevaluateditemsWithNullInstanceElements.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UnevaluateditemsWithNullInstanceElements.java @@ -47,78 +47,54 @@ public static UnevaluatedItems getInstance() { } - public static abstract sealed class UnevaluateditemsWithNullInstanceElements1Boxed permits UnevaluateditemsWithNullInstanceElements1BoxedVoid, UnevaluateditemsWithNullInstanceElements1BoxedBoolean, UnevaluateditemsWithNullInstanceElements1BoxedNumber, UnevaluateditemsWithNullInstanceElements1BoxedString, UnevaluateditemsWithNullInstanceElements1BoxedList, UnevaluateditemsWithNullInstanceElements1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface UnevaluateditemsWithNullInstanceElements1Boxed permits UnevaluateditemsWithNullInstanceElements1BoxedVoid, UnevaluateditemsWithNullInstanceElements1BoxedBoolean, UnevaluateditemsWithNullInstanceElements1BoxedNumber, UnevaluateditemsWithNullInstanceElements1BoxedString, UnevaluateditemsWithNullInstanceElements1BoxedList, UnevaluateditemsWithNullInstanceElements1BoxedMap { + @Nullable Object getData(); } - public static final class UnevaluateditemsWithNullInstanceElements1BoxedVoid extends UnevaluateditemsWithNullInstanceElements1Boxed { - public final Void data; - private UnevaluateditemsWithNullInstanceElements1BoxedVoid(Void data) { - this.data = data; - } + public record UnevaluateditemsWithNullInstanceElements1BoxedVoid(Void data) implements UnevaluateditemsWithNullInstanceElements1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UnevaluateditemsWithNullInstanceElements1BoxedBoolean extends UnevaluateditemsWithNullInstanceElements1Boxed { - public final boolean data; - private UnevaluateditemsWithNullInstanceElements1BoxedBoolean(boolean data) { - this.data = data; - } + public record UnevaluateditemsWithNullInstanceElements1BoxedBoolean(boolean data) implements UnevaluateditemsWithNullInstanceElements1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UnevaluateditemsWithNullInstanceElements1BoxedNumber extends UnevaluateditemsWithNullInstanceElements1Boxed { - public final Number data; - private UnevaluateditemsWithNullInstanceElements1BoxedNumber(Number data) { - this.data = data; - } + public record UnevaluateditemsWithNullInstanceElements1BoxedNumber(Number data) implements UnevaluateditemsWithNullInstanceElements1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UnevaluateditemsWithNullInstanceElements1BoxedString extends UnevaluateditemsWithNullInstanceElements1Boxed { - public final String data; - private UnevaluateditemsWithNullInstanceElements1BoxedString(String data) { - this.data = data; - } + public record UnevaluateditemsWithNullInstanceElements1BoxedString(String data) implements UnevaluateditemsWithNullInstanceElements1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UnevaluateditemsWithNullInstanceElements1BoxedList extends UnevaluateditemsWithNullInstanceElements1Boxed { - public final FrozenList<@Nullable Object> data; - private UnevaluateditemsWithNullInstanceElements1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record UnevaluateditemsWithNullInstanceElements1BoxedList(FrozenList<@Nullable Object> data) implements UnevaluateditemsWithNullInstanceElements1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UnevaluateditemsWithNullInstanceElements1BoxedMap extends UnevaluateditemsWithNullInstanceElements1Boxed { - public final FrozenMap<@Nullable Object> data; - private UnevaluateditemsWithNullInstanceElements1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record UnevaluateditemsWithNullInstanceElements1BoxedMap(FrozenMap<@Nullable Object> data) implements UnevaluateditemsWithNullInstanceElements1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class UnevaluateditemsWithNullInstanceElements1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, UnevaluateditemsWithNullInstanceElements1BoxedList>, MapSchemaValidator, UnevaluateditemsWithNullInstanceElements1BoxedMap> { + public static class UnevaluateditemsWithNullInstanceElements1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, UnevaluateditemsWithNullInstanceElements1BoxedList>, MapSchemaValidator, UnevaluateditemsWithNullInstanceElements1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -223,11 +199,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -258,11 +234,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -341,5 +317,24 @@ public UnevaluateditemsWithNullInstanceElements1BoxedList validateAndBox(List public UnevaluateditemsWithNullInstanceElements1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new UnevaluateditemsWithNullInstanceElements1BoxedMap(validate(arg, configuration)); } + @Override + public UnevaluateditemsWithNullInstanceElements1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UnevaluatedpropertiesNotAffectedByPropertynames.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UnevaluatedpropertiesNotAffectedByPropertynames.java index d8304fee8fc..bda17631ee9 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UnevaluatedpropertiesNotAffectedByPropertynames.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UnevaluatedpropertiesNotAffectedByPropertynames.java @@ -36,24 +36,20 @@ public class UnevaluatedpropertiesNotAffectedByPropertynames { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class PropertyNamesBoxed permits PropertyNamesBoxedString { - public abstract @Nullable Object data(); + public sealed interface PropertyNamesBoxed permits PropertyNamesBoxedString { + @Nullable Object getData(); } - public static final class PropertyNamesBoxedString extends PropertyNamesBoxed { - public final String data; - private PropertyNamesBoxedString(String data) { - this.data = data; - } + public record PropertyNamesBoxedString(String data) implements PropertyNamesBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class PropertyNames extends JsonSchema implements StringSchemaValidator { + public static class PropertyNames extends JsonSchema implements StringSchemaValidator { private static @Nullable PropertyNames instance = null; protected PropertyNames() { @@ -101,6 +97,13 @@ public String validate(String arg, SchemaConfiguration configuration) throws Val public PropertyNamesBoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new PropertyNamesBoxedString(validate(arg, configuration)); } + @Override + public PropertyNamesBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class UnevaluatedProperties extends NumberJsonSchema.NumberJsonSchema1 { @@ -114,78 +117,54 @@ public static UnevaluatedProperties getInstance() { } - public static abstract sealed class UnevaluatedpropertiesNotAffectedByPropertynames1Boxed permits UnevaluatedpropertiesNotAffectedByPropertynames1BoxedVoid, UnevaluatedpropertiesNotAffectedByPropertynames1BoxedBoolean, UnevaluatedpropertiesNotAffectedByPropertynames1BoxedNumber, UnevaluatedpropertiesNotAffectedByPropertynames1BoxedString, UnevaluatedpropertiesNotAffectedByPropertynames1BoxedList, UnevaluatedpropertiesNotAffectedByPropertynames1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface UnevaluatedpropertiesNotAffectedByPropertynames1Boxed permits UnevaluatedpropertiesNotAffectedByPropertynames1BoxedVoid, UnevaluatedpropertiesNotAffectedByPropertynames1BoxedBoolean, UnevaluatedpropertiesNotAffectedByPropertynames1BoxedNumber, UnevaluatedpropertiesNotAffectedByPropertynames1BoxedString, UnevaluatedpropertiesNotAffectedByPropertynames1BoxedList, UnevaluatedpropertiesNotAffectedByPropertynames1BoxedMap { + @Nullable Object getData(); } - public static final class UnevaluatedpropertiesNotAffectedByPropertynames1BoxedVoid extends UnevaluatedpropertiesNotAffectedByPropertynames1Boxed { - public final Void data; - private UnevaluatedpropertiesNotAffectedByPropertynames1BoxedVoid(Void data) { - this.data = data; - } + public record UnevaluatedpropertiesNotAffectedByPropertynames1BoxedVoid(Void data) implements UnevaluatedpropertiesNotAffectedByPropertynames1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UnevaluatedpropertiesNotAffectedByPropertynames1BoxedBoolean extends UnevaluatedpropertiesNotAffectedByPropertynames1Boxed { - public final boolean data; - private UnevaluatedpropertiesNotAffectedByPropertynames1BoxedBoolean(boolean data) { - this.data = data; - } + public record UnevaluatedpropertiesNotAffectedByPropertynames1BoxedBoolean(boolean data) implements UnevaluatedpropertiesNotAffectedByPropertynames1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UnevaluatedpropertiesNotAffectedByPropertynames1BoxedNumber extends UnevaluatedpropertiesNotAffectedByPropertynames1Boxed { - public final Number data; - private UnevaluatedpropertiesNotAffectedByPropertynames1BoxedNumber(Number data) { - this.data = data; - } + public record UnevaluatedpropertiesNotAffectedByPropertynames1BoxedNumber(Number data) implements UnevaluatedpropertiesNotAffectedByPropertynames1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UnevaluatedpropertiesNotAffectedByPropertynames1BoxedString extends UnevaluatedpropertiesNotAffectedByPropertynames1Boxed { - public final String data; - private UnevaluatedpropertiesNotAffectedByPropertynames1BoxedString(String data) { - this.data = data; - } + public record UnevaluatedpropertiesNotAffectedByPropertynames1BoxedString(String data) implements UnevaluatedpropertiesNotAffectedByPropertynames1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UnevaluatedpropertiesNotAffectedByPropertynames1BoxedList extends UnevaluatedpropertiesNotAffectedByPropertynames1Boxed { - public final FrozenList<@Nullable Object> data; - private UnevaluatedpropertiesNotAffectedByPropertynames1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record UnevaluatedpropertiesNotAffectedByPropertynames1BoxedList(FrozenList<@Nullable Object> data) implements UnevaluatedpropertiesNotAffectedByPropertynames1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UnevaluatedpropertiesNotAffectedByPropertynames1BoxedMap extends UnevaluatedpropertiesNotAffectedByPropertynames1Boxed { - public final FrozenMap<@Nullable Object> data; - private UnevaluatedpropertiesNotAffectedByPropertynames1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record UnevaluatedpropertiesNotAffectedByPropertynames1BoxedMap(FrozenMap<@Nullable Object> data) implements UnevaluatedpropertiesNotAffectedByPropertynames1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class UnevaluatedpropertiesNotAffectedByPropertynames1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, UnevaluatedpropertiesNotAffectedByPropertynames1BoxedList>, MapSchemaValidator, UnevaluatedpropertiesNotAffectedByPropertynames1BoxedMap> { + public static class UnevaluatedpropertiesNotAffectedByPropertynames1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, UnevaluatedpropertiesNotAffectedByPropertynames1BoxedList>, MapSchemaValidator, UnevaluatedpropertiesNotAffectedByPropertynames1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -291,11 +270,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -326,11 +305,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -409,5 +388,24 @@ public UnevaluatedpropertiesNotAffectedByPropertynames1BoxedList validateAndBox( public UnevaluatedpropertiesNotAffectedByPropertynames1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new UnevaluatedpropertiesNotAffectedByPropertynames1BoxedMap(validate(arg, configuration)); } + @Override + public UnevaluatedpropertiesNotAffectedByPropertynames1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UnevaluatedpropertiesSchema.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UnevaluatedpropertiesSchema.java index 3a354b43d6a..548aeba1138 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UnevaluatedpropertiesSchema.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UnevaluatedpropertiesSchema.java @@ -27,24 +27,20 @@ public class UnevaluatedpropertiesSchema { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class UnevaluatedPropertiesBoxed permits UnevaluatedPropertiesBoxedString { - public abstract @Nullable Object data(); + public sealed interface UnevaluatedPropertiesBoxed permits UnevaluatedPropertiesBoxedString { + @Nullable Object getData(); } - public static final class UnevaluatedPropertiesBoxedString extends UnevaluatedPropertiesBoxed { - public final String data; - private UnevaluatedPropertiesBoxedString(String data) { - this.data = data; - } + public record UnevaluatedPropertiesBoxedString(String data) implements UnevaluatedPropertiesBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class UnevaluatedProperties extends JsonSchema implements StringSchemaValidator { + public static class UnevaluatedProperties extends JsonSchema implements StringSchemaValidator { private static @Nullable UnevaluatedProperties instance = null; protected UnevaluatedProperties() { @@ -92,25 +88,28 @@ public String validate(String arg, SchemaConfiguration configuration) throws Val public UnevaluatedPropertiesBoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new UnevaluatedPropertiesBoxedString(validate(arg, configuration)); } + @Override + public UnevaluatedPropertiesBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class UnevaluatedpropertiesSchema1Boxed permits UnevaluatedpropertiesSchema1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface UnevaluatedpropertiesSchema1Boxed permits UnevaluatedpropertiesSchema1BoxedMap { + @Nullable Object getData(); } - public static final class UnevaluatedpropertiesSchema1BoxedMap extends UnevaluatedpropertiesSchema1Boxed { - public final FrozenMap<@Nullable Object> data; - private UnevaluatedpropertiesSchema1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record UnevaluatedpropertiesSchema1BoxedMap(FrozenMap<@Nullable Object> data) implements UnevaluatedpropertiesSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class UnevaluatedpropertiesSchema1 extends JsonSchema implements MapSchemaValidator, UnevaluatedpropertiesSchema1BoxedMap> { + public static class UnevaluatedpropertiesSchema1 extends JsonSchema implements MapSchemaValidator, UnevaluatedpropertiesSchema1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -144,11 +143,11 @@ public static UnevaluatedpropertiesSchema1 getInstance() { List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -185,6 +184,13 @@ public static UnevaluatedpropertiesSchema1 getInstance() { public UnevaluatedpropertiesSchema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new UnevaluatedpropertiesSchema1BoxedMap(validate(arg, configuration)); } + @Override + public UnevaluatedpropertiesSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UnevaluatedpropertiesWithAdjacentAdditionalproperties.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UnevaluatedpropertiesWithAdjacentAdditionalproperties.java index 38bab810da2..31ec85272ba 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UnevaluatedpropertiesWithAdjacentAdditionalproperties.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UnevaluatedpropertiesWithAdjacentAdditionalproperties.java @@ -199,23 +199,19 @@ public static UnevaluatedProperties getInstance() { } - public static abstract sealed class UnevaluatedpropertiesWithAdjacentAdditionalproperties1Boxed permits UnevaluatedpropertiesWithAdjacentAdditionalproperties1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface UnevaluatedpropertiesWithAdjacentAdditionalproperties1Boxed permits UnevaluatedpropertiesWithAdjacentAdditionalproperties1BoxedMap { + @Nullable Object getData(); } - public static final class UnevaluatedpropertiesWithAdjacentAdditionalproperties1BoxedMap extends UnevaluatedpropertiesWithAdjacentAdditionalproperties1Boxed { - public final UnevaluatedpropertiesWithAdjacentAdditionalpropertiesMap data; - private UnevaluatedpropertiesWithAdjacentAdditionalproperties1BoxedMap(UnevaluatedpropertiesWithAdjacentAdditionalpropertiesMap data) { - this.data = data; - } + public record UnevaluatedpropertiesWithAdjacentAdditionalproperties1BoxedMap(UnevaluatedpropertiesWithAdjacentAdditionalpropertiesMap data) implements UnevaluatedpropertiesWithAdjacentAdditionalproperties1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class UnevaluatedpropertiesWithAdjacentAdditionalproperties1 extends JsonSchema implements MapSchemaValidator { + public static class UnevaluatedpropertiesWithAdjacentAdditionalproperties1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -253,11 +249,11 @@ public UnevaluatedpropertiesWithAdjacentAdditionalpropertiesMap getNewInstance(M List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -294,6 +290,13 @@ public UnevaluatedpropertiesWithAdjacentAdditionalpropertiesMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new UnevaluatedpropertiesWithAdjacentAdditionalproperties1BoxedMap(validate(arg, configuration)); } + @Override + public UnevaluatedpropertiesWithAdjacentAdditionalproperties1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UnevaluatedpropertiesWithNullValuedInstanceProperties.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UnevaluatedpropertiesWithNullValuedInstanceProperties.java index b97498c8fc4..9ad1f1ae961 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UnevaluatedpropertiesWithNullValuedInstanceProperties.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UnevaluatedpropertiesWithNullValuedInstanceProperties.java @@ -47,78 +47,54 @@ public static UnevaluatedProperties getInstance() { } - public static abstract sealed class UnevaluatedpropertiesWithNullValuedInstanceProperties1Boxed permits UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedVoid, UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedBoolean, UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedNumber, UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedString, UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedList, UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface UnevaluatedpropertiesWithNullValuedInstanceProperties1Boxed permits UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedVoid, UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedBoolean, UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedNumber, UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedString, UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedList, UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedMap { + @Nullable Object getData(); } - public static final class UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedVoid extends UnevaluatedpropertiesWithNullValuedInstanceProperties1Boxed { - public final Void data; - private UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedVoid(Void data) { - this.data = data; - } + public record UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedVoid(Void data) implements UnevaluatedpropertiesWithNullValuedInstanceProperties1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedBoolean extends UnevaluatedpropertiesWithNullValuedInstanceProperties1Boxed { - public final boolean data; - private UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedBoolean(boolean data) { - this.data = data; - } + public record UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedBoolean(boolean data) implements UnevaluatedpropertiesWithNullValuedInstanceProperties1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedNumber extends UnevaluatedpropertiesWithNullValuedInstanceProperties1Boxed { - public final Number data; - private UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedNumber(Number data) { - this.data = data; - } + public record UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedNumber(Number data) implements UnevaluatedpropertiesWithNullValuedInstanceProperties1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedString extends UnevaluatedpropertiesWithNullValuedInstanceProperties1Boxed { - public final String data; - private UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedString(String data) { - this.data = data; - } + public record UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedString(String data) implements UnevaluatedpropertiesWithNullValuedInstanceProperties1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedList extends UnevaluatedpropertiesWithNullValuedInstanceProperties1Boxed { - public final FrozenList<@Nullable Object> data; - private UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedList(FrozenList<@Nullable Object> data) implements UnevaluatedpropertiesWithNullValuedInstanceProperties1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedMap extends UnevaluatedpropertiesWithNullValuedInstanceProperties1Boxed { - public final FrozenMap<@Nullable Object> data; - private UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedMap(FrozenMap<@Nullable Object> data) implements UnevaluatedpropertiesWithNullValuedInstanceProperties1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class UnevaluatedpropertiesWithNullValuedInstanceProperties1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedList>, MapSchemaValidator, UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedMap> { + public static class UnevaluatedpropertiesWithNullValuedInstanceProperties1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedList>, MapSchemaValidator, UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -223,11 +199,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -258,11 +234,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -341,5 +317,24 @@ public UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedList validateA public UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new UnevaluatedpropertiesWithNullValuedInstanceProperties1BoxedMap(validate(arg, configuration)); } + @Override + public UnevaluatedpropertiesWithNullValuedInstanceProperties1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsFalseValidation.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsFalseValidation.java index bfb7f909fc0..4399cec94a9 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsFalseValidation.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsFalseValidation.java @@ -35,78 +35,54 @@ public class UniqueitemsFalseValidation { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class UniqueitemsFalseValidation1Boxed permits UniqueitemsFalseValidation1BoxedVoid, UniqueitemsFalseValidation1BoxedBoolean, UniqueitemsFalseValidation1BoxedNumber, UniqueitemsFalseValidation1BoxedString, UniqueitemsFalseValidation1BoxedList, UniqueitemsFalseValidation1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface UniqueitemsFalseValidation1Boxed permits UniqueitemsFalseValidation1BoxedVoid, UniqueitemsFalseValidation1BoxedBoolean, UniqueitemsFalseValidation1BoxedNumber, UniqueitemsFalseValidation1BoxedString, UniqueitemsFalseValidation1BoxedList, UniqueitemsFalseValidation1BoxedMap { + @Nullable Object getData(); } - public static final class UniqueitemsFalseValidation1BoxedVoid extends UniqueitemsFalseValidation1Boxed { - public final Void data; - private UniqueitemsFalseValidation1BoxedVoid(Void data) { - this.data = data; - } + public record UniqueitemsFalseValidation1BoxedVoid(Void data) implements UniqueitemsFalseValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UniqueitemsFalseValidation1BoxedBoolean extends UniqueitemsFalseValidation1Boxed { - public final boolean data; - private UniqueitemsFalseValidation1BoxedBoolean(boolean data) { - this.data = data; - } + public record UniqueitemsFalseValidation1BoxedBoolean(boolean data) implements UniqueitemsFalseValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UniqueitemsFalseValidation1BoxedNumber extends UniqueitemsFalseValidation1Boxed { - public final Number data; - private UniqueitemsFalseValidation1BoxedNumber(Number data) { - this.data = data; - } + public record UniqueitemsFalseValidation1BoxedNumber(Number data) implements UniqueitemsFalseValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UniqueitemsFalseValidation1BoxedString extends UniqueitemsFalseValidation1Boxed { - public final String data; - private UniqueitemsFalseValidation1BoxedString(String data) { - this.data = data; - } + public record UniqueitemsFalseValidation1BoxedString(String data) implements UniqueitemsFalseValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UniqueitemsFalseValidation1BoxedList extends UniqueitemsFalseValidation1Boxed { - public final FrozenList<@Nullable Object> data; - private UniqueitemsFalseValidation1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record UniqueitemsFalseValidation1BoxedList(FrozenList<@Nullable Object> data) implements UniqueitemsFalseValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UniqueitemsFalseValidation1BoxedMap extends UniqueitemsFalseValidation1Boxed { - public final FrozenMap<@Nullable Object> data; - private UniqueitemsFalseValidation1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record UniqueitemsFalseValidation1BoxedMap(FrozenMap<@Nullable Object> data) implements UniqueitemsFalseValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class UniqueitemsFalseValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, UniqueitemsFalseValidation1BoxedList>, MapSchemaValidator, UniqueitemsFalseValidation1BoxedMap> { + public static class UniqueitemsFalseValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, UniqueitemsFalseValidation1BoxedList>, MapSchemaValidator, UniqueitemsFalseValidation1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -211,11 +187,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -246,11 +222,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -329,5 +305,24 @@ public UniqueitemsFalseValidation1BoxedList validateAndBox(List arg, SchemaCo public UniqueitemsFalseValidation1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new UniqueitemsFalseValidation1BoxedMap(validate(arg, configuration)); } + @Override + public UniqueitemsFalseValidation1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsFalseWithAnArrayOfItems.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsFalseWithAnArrayOfItems.java index 35046fcd8e4..b88cfa6ce18 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsFalseWithAnArrayOfItems.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsFalseWithAnArrayOfItems.java @@ -130,78 +130,54 @@ public static Schema1 getInstance() { } - public static abstract sealed class UniqueitemsFalseWithAnArrayOfItems1Boxed permits UniqueitemsFalseWithAnArrayOfItems1BoxedVoid, UniqueitemsFalseWithAnArrayOfItems1BoxedBoolean, UniqueitemsFalseWithAnArrayOfItems1BoxedNumber, UniqueitemsFalseWithAnArrayOfItems1BoxedString, UniqueitemsFalseWithAnArrayOfItems1BoxedList, UniqueitemsFalseWithAnArrayOfItems1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface UniqueitemsFalseWithAnArrayOfItems1Boxed permits UniqueitemsFalseWithAnArrayOfItems1BoxedVoid, UniqueitemsFalseWithAnArrayOfItems1BoxedBoolean, UniqueitemsFalseWithAnArrayOfItems1BoxedNumber, UniqueitemsFalseWithAnArrayOfItems1BoxedString, UniqueitemsFalseWithAnArrayOfItems1BoxedList, UniqueitemsFalseWithAnArrayOfItems1BoxedMap { + @Nullable Object getData(); } - public static final class UniqueitemsFalseWithAnArrayOfItems1BoxedVoid extends UniqueitemsFalseWithAnArrayOfItems1Boxed { - public final Void data; - private UniqueitemsFalseWithAnArrayOfItems1BoxedVoid(Void data) { - this.data = data; - } + public record UniqueitemsFalseWithAnArrayOfItems1BoxedVoid(Void data) implements UniqueitemsFalseWithAnArrayOfItems1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UniqueitemsFalseWithAnArrayOfItems1BoxedBoolean extends UniqueitemsFalseWithAnArrayOfItems1Boxed { - public final boolean data; - private UniqueitemsFalseWithAnArrayOfItems1BoxedBoolean(boolean data) { - this.data = data; - } + public record UniqueitemsFalseWithAnArrayOfItems1BoxedBoolean(boolean data) implements UniqueitemsFalseWithAnArrayOfItems1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UniqueitemsFalseWithAnArrayOfItems1BoxedNumber extends UniqueitemsFalseWithAnArrayOfItems1Boxed { - public final Number data; - private UniqueitemsFalseWithAnArrayOfItems1BoxedNumber(Number data) { - this.data = data; - } + public record UniqueitemsFalseWithAnArrayOfItems1BoxedNumber(Number data) implements UniqueitemsFalseWithAnArrayOfItems1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UniqueitemsFalseWithAnArrayOfItems1BoxedString extends UniqueitemsFalseWithAnArrayOfItems1Boxed { - public final String data; - private UniqueitemsFalseWithAnArrayOfItems1BoxedString(String data) { - this.data = data; - } + public record UniqueitemsFalseWithAnArrayOfItems1BoxedString(String data) implements UniqueitemsFalseWithAnArrayOfItems1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UniqueitemsFalseWithAnArrayOfItems1BoxedList extends UniqueitemsFalseWithAnArrayOfItems1Boxed { - public final UniqueitemsFalseWithAnArrayOfItemsList data; - private UniqueitemsFalseWithAnArrayOfItems1BoxedList(UniqueitemsFalseWithAnArrayOfItemsList data) { - this.data = data; - } + public record UniqueitemsFalseWithAnArrayOfItems1BoxedList(UniqueitemsFalseWithAnArrayOfItemsList data) implements UniqueitemsFalseWithAnArrayOfItems1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UniqueitemsFalseWithAnArrayOfItems1BoxedMap extends UniqueitemsFalseWithAnArrayOfItems1Boxed { - public final FrozenMap<@Nullable Object> data; - private UniqueitemsFalseWithAnArrayOfItems1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record UniqueitemsFalseWithAnArrayOfItems1BoxedMap(FrozenMap<@Nullable Object> data) implements UniqueitemsFalseWithAnArrayOfItems1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class UniqueitemsFalseWithAnArrayOfItems1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, MapSchemaValidator, UniqueitemsFalseWithAnArrayOfItems1BoxedMap> { + public static class UniqueitemsFalseWithAnArrayOfItems1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, MapSchemaValidator, UniqueitemsFalseWithAnArrayOfItems1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -310,11 +286,11 @@ public UniqueitemsFalseWithAnArrayOfItemsList getNewInstance(List arg, List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -345,11 +321,11 @@ public UniqueitemsFalseWithAnArrayOfItemsList validate(List arg, SchemaConfig List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -428,5 +404,24 @@ public UniqueitemsFalseWithAnArrayOfItems1BoxedList validateAndBox(List arg, public UniqueitemsFalseWithAnArrayOfItems1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new UniqueitemsFalseWithAnArrayOfItems1BoxedMap(validate(arg, configuration)); } + @Override + public UniqueitemsFalseWithAnArrayOfItems1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsValidation.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsValidation.java index 02694a8bd17..2433913da51 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsValidation.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsValidation.java @@ -35,78 +35,54 @@ public class UniqueitemsValidation { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class UniqueitemsValidation1Boxed permits UniqueitemsValidation1BoxedVoid, UniqueitemsValidation1BoxedBoolean, UniqueitemsValidation1BoxedNumber, UniqueitemsValidation1BoxedString, UniqueitemsValidation1BoxedList, UniqueitemsValidation1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface UniqueitemsValidation1Boxed permits UniqueitemsValidation1BoxedVoid, UniqueitemsValidation1BoxedBoolean, UniqueitemsValidation1BoxedNumber, UniqueitemsValidation1BoxedString, UniqueitemsValidation1BoxedList, UniqueitemsValidation1BoxedMap { + @Nullable Object getData(); } - public static final class UniqueitemsValidation1BoxedVoid extends UniqueitemsValidation1Boxed { - public final Void data; - private UniqueitemsValidation1BoxedVoid(Void data) { - this.data = data; - } + public record UniqueitemsValidation1BoxedVoid(Void data) implements UniqueitemsValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UniqueitemsValidation1BoxedBoolean extends UniqueitemsValidation1Boxed { - public final boolean data; - private UniqueitemsValidation1BoxedBoolean(boolean data) { - this.data = data; - } + public record UniqueitemsValidation1BoxedBoolean(boolean data) implements UniqueitemsValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UniqueitemsValidation1BoxedNumber extends UniqueitemsValidation1Boxed { - public final Number data; - private UniqueitemsValidation1BoxedNumber(Number data) { - this.data = data; - } + public record UniqueitemsValidation1BoxedNumber(Number data) implements UniqueitemsValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UniqueitemsValidation1BoxedString extends UniqueitemsValidation1Boxed { - public final String data; - private UniqueitemsValidation1BoxedString(String data) { - this.data = data; - } + public record UniqueitemsValidation1BoxedString(String data) implements UniqueitemsValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UniqueitemsValidation1BoxedList extends UniqueitemsValidation1Boxed { - public final FrozenList<@Nullable Object> data; - private UniqueitemsValidation1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record UniqueitemsValidation1BoxedList(FrozenList<@Nullable Object> data) implements UniqueitemsValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UniqueitemsValidation1BoxedMap extends UniqueitemsValidation1Boxed { - public final FrozenMap<@Nullable Object> data; - private UniqueitemsValidation1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record UniqueitemsValidation1BoxedMap(FrozenMap<@Nullable Object> data) implements UniqueitemsValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class UniqueitemsValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, UniqueitemsValidation1BoxedList>, MapSchemaValidator, UniqueitemsValidation1BoxedMap> { + public static class UniqueitemsValidation1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, UniqueitemsValidation1BoxedList>, MapSchemaValidator, UniqueitemsValidation1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -211,11 +187,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -246,11 +222,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -329,5 +305,24 @@ public UniqueitemsValidation1BoxedList validateAndBox(List arg, SchemaConfigu public UniqueitemsValidation1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new UniqueitemsValidation1BoxedMap(validate(arg, configuration)); } + @Override + public UniqueitemsValidation1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsWithAnArrayOfItems.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsWithAnArrayOfItems.java index 0cdc695f7b8..b9a6aaaf51e 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsWithAnArrayOfItems.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UniqueitemsWithAnArrayOfItems.java @@ -130,78 +130,54 @@ public static Schema1 getInstance() { } - public static abstract sealed class UniqueitemsWithAnArrayOfItems1Boxed permits UniqueitemsWithAnArrayOfItems1BoxedVoid, UniqueitemsWithAnArrayOfItems1BoxedBoolean, UniqueitemsWithAnArrayOfItems1BoxedNumber, UniqueitemsWithAnArrayOfItems1BoxedString, UniqueitemsWithAnArrayOfItems1BoxedList, UniqueitemsWithAnArrayOfItems1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface UniqueitemsWithAnArrayOfItems1Boxed permits UniqueitemsWithAnArrayOfItems1BoxedVoid, UniqueitemsWithAnArrayOfItems1BoxedBoolean, UniqueitemsWithAnArrayOfItems1BoxedNumber, UniqueitemsWithAnArrayOfItems1BoxedString, UniqueitemsWithAnArrayOfItems1BoxedList, UniqueitemsWithAnArrayOfItems1BoxedMap { + @Nullable Object getData(); } - public static final class UniqueitemsWithAnArrayOfItems1BoxedVoid extends UniqueitemsWithAnArrayOfItems1Boxed { - public final Void data; - private UniqueitemsWithAnArrayOfItems1BoxedVoid(Void data) { - this.data = data; - } + public record UniqueitemsWithAnArrayOfItems1BoxedVoid(Void data) implements UniqueitemsWithAnArrayOfItems1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UniqueitemsWithAnArrayOfItems1BoxedBoolean extends UniqueitemsWithAnArrayOfItems1Boxed { - public final boolean data; - private UniqueitemsWithAnArrayOfItems1BoxedBoolean(boolean data) { - this.data = data; - } + public record UniqueitemsWithAnArrayOfItems1BoxedBoolean(boolean data) implements UniqueitemsWithAnArrayOfItems1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UniqueitemsWithAnArrayOfItems1BoxedNumber extends UniqueitemsWithAnArrayOfItems1Boxed { - public final Number data; - private UniqueitemsWithAnArrayOfItems1BoxedNumber(Number data) { - this.data = data; - } + public record UniqueitemsWithAnArrayOfItems1BoxedNumber(Number data) implements UniqueitemsWithAnArrayOfItems1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UniqueitemsWithAnArrayOfItems1BoxedString extends UniqueitemsWithAnArrayOfItems1Boxed { - public final String data; - private UniqueitemsWithAnArrayOfItems1BoxedString(String data) { - this.data = data; - } + public record UniqueitemsWithAnArrayOfItems1BoxedString(String data) implements UniqueitemsWithAnArrayOfItems1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UniqueitemsWithAnArrayOfItems1BoxedList extends UniqueitemsWithAnArrayOfItems1Boxed { - public final UniqueitemsWithAnArrayOfItemsList data; - private UniqueitemsWithAnArrayOfItems1BoxedList(UniqueitemsWithAnArrayOfItemsList data) { - this.data = data; - } + public record UniqueitemsWithAnArrayOfItems1BoxedList(UniqueitemsWithAnArrayOfItemsList data) implements UniqueitemsWithAnArrayOfItems1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UniqueitemsWithAnArrayOfItems1BoxedMap extends UniqueitemsWithAnArrayOfItems1Boxed { - public final FrozenMap<@Nullable Object> data; - private UniqueitemsWithAnArrayOfItems1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record UniqueitemsWithAnArrayOfItems1BoxedMap(FrozenMap<@Nullable Object> data) implements UniqueitemsWithAnArrayOfItems1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class UniqueitemsWithAnArrayOfItems1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, MapSchemaValidator, UniqueitemsWithAnArrayOfItems1BoxedMap> { + public static class UniqueitemsWithAnArrayOfItems1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, MapSchemaValidator, UniqueitemsWithAnArrayOfItems1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -310,11 +286,11 @@ public UniqueitemsWithAnArrayOfItemsList getNewInstance(List arg, List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -345,11 +321,11 @@ public UniqueitemsWithAnArrayOfItemsList validate(List arg, SchemaConfigurati List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -428,5 +404,24 @@ public UniqueitemsWithAnArrayOfItems1BoxedList validateAndBox(List arg, Schem public UniqueitemsWithAnArrayOfItems1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new UniqueitemsWithAnArrayOfItems1BoxedMap(validate(arg, configuration)); } + @Override + public UniqueitemsWithAnArrayOfItems1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriFormat.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriFormat.java index c7c3721ac5f..bc2d00b8518 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriFormat.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriFormat.java @@ -35,78 +35,54 @@ public class UriFormat { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class UriFormat1Boxed permits UriFormat1BoxedVoid, UriFormat1BoxedBoolean, UriFormat1BoxedNumber, UriFormat1BoxedString, UriFormat1BoxedList, UriFormat1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface UriFormat1Boxed permits UriFormat1BoxedVoid, UriFormat1BoxedBoolean, UriFormat1BoxedNumber, UriFormat1BoxedString, UriFormat1BoxedList, UriFormat1BoxedMap { + @Nullable Object getData(); } - public static final class UriFormat1BoxedVoid extends UriFormat1Boxed { - public final Void data; - private UriFormat1BoxedVoid(Void data) { - this.data = data; - } + public record UriFormat1BoxedVoid(Void data) implements UriFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UriFormat1BoxedBoolean extends UriFormat1Boxed { - public final boolean data; - private UriFormat1BoxedBoolean(boolean data) { - this.data = data; - } + public record UriFormat1BoxedBoolean(boolean data) implements UriFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UriFormat1BoxedNumber extends UriFormat1Boxed { - public final Number data; - private UriFormat1BoxedNumber(Number data) { - this.data = data; - } + public record UriFormat1BoxedNumber(Number data) implements UriFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UriFormat1BoxedString extends UriFormat1Boxed { - public final String data; - private UriFormat1BoxedString(String data) { - this.data = data; - } + public record UriFormat1BoxedString(String data) implements UriFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UriFormat1BoxedList extends UriFormat1Boxed { - public final FrozenList<@Nullable Object> data; - private UriFormat1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record UriFormat1BoxedList(FrozenList<@Nullable Object> data) implements UriFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UriFormat1BoxedMap extends UriFormat1Boxed { - public final FrozenMap<@Nullable Object> data; - private UriFormat1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record UriFormat1BoxedMap(FrozenMap<@Nullable Object> data) implements UriFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class UriFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, UriFormat1BoxedList>, MapSchemaValidator, UriFormat1BoxedMap> { + public static class UriFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, UriFormat1BoxedList>, MapSchemaValidator, UriFormat1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -211,11 +187,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -246,11 +222,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -329,5 +305,24 @@ public UriFormat1BoxedList validateAndBox(List arg, SchemaConfiguration confi public UriFormat1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new UriFormat1BoxedMap(validate(arg, configuration)); } + @Override + public UriFormat1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriReferenceFormat.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriReferenceFormat.java index a6f0712c973..bee6021f6cf 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriReferenceFormat.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriReferenceFormat.java @@ -35,78 +35,54 @@ public class UriReferenceFormat { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class UriReferenceFormat1Boxed permits UriReferenceFormat1BoxedVoid, UriReferenceFormat1BoxedBoolean, UriReferenceFormat1BoxedNumber, UriReferenceFormat1BoxedString, UriReferenceFormat1BoxedList, UriReferenceFormat1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface UriReferenceFormat1Boxed permits UriReferenceFormat1BoxedVoid, UriReferenceFormat1BoxedBoolean, UriReferenceFormat1BoxedNumber, UriReferenceFormat1BoxedString, UriReferenceFormat1BoxedList, UriReferenceFormat1BoxedMap { + @Nullable Object getData(); } - public static final class UriReferenceFormat1BoxedVoid extends UriReferenceFormat1Boxed { - public final Void data; - private UriReferenceFormat1BoxedVoid(Void data) { - this.data = data; - } + public record UriReferenceFormat1BoxedVoid(Void data) implements UriReferenceFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UriReferenceFormat1BoxedBoolean extends UriReferenceFormat1Boxed { - public final boolean data; - private UriReferenceFormat1BoxedBoolean(boolean data) { - this.data = data; - } + public record UriReferenceFormat1BoxedBoolean(boolean data) implements UriReferenceFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UriReferenceFormat1BoxedNumber extends UriReferenceFormat1Boxed { - public final Number data; - private UriReferenceFormat1BoxedNumber(Number data) { - this.data = data; - } + public record UriReferenceFormat1BoxedNumber(Number data) implements UriReferenceFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UriReferenceFormat1BoxedString extends UriReferenceFormat1Boxed { - public final String data; - private UriReferenceFormat1BoxedString(String data) { - this.data = data; - } + public record UriReferenceFormat1BoxedString(String data) implements UriReferenceFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UriReferenceFormat1BoxedList extends UriReferenceFormat1Boxed { - public final FrozenList<@Nullable Object> data; - private UriReferenceFormat1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record UriReferenceFormat1BoxedList(FrozenList<@Nullable Object> data) implements UriReferenceFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UriReferenceFormat1BoxedMap extends UriReferenceFormat1Boxed { - public final FrozenMap<@Nullable Object> data; - private UriReferenceFormat1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record UriReferenceFormat1BoxedMap(FrozenMap<@Nullable Object> data) implements UriReferenceFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class UriReferenceFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, UriReferenceFormat1BoxedList>, MapSchemaValidator, UriReferenceFormat1BoxedMap> { + public static class UriReferenceFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, UriReferenceFormat1BoxedList>, MapSchemaValidator, UriReferenceFormat1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -211,11 +187,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -246,11 +222,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -329,5 +305,24 @@ public UriReferenceFormat1BoxedList validateAndBox(List arg, SchemaConfigurat public UriReferenceFormat1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new UriReferenceFormat1BoxedMap(validate(arg, configuration)); } + @Override + public UriReferenceFormat1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriTemplateFormat.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriTemplateFormat.java index 2724eebd809..16dead22e86 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriTemplateFormat.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UriTemplateFormat.java @@ -35,78 +35,54 @@ public class UriTemplateFormat { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class UriTemplateFormat1Boxed permits UriTemplateFormat1BoxedVoid, UriTemplateFormat1BoxedBoolean, UriTemplateFormat1BoxedNumber, UriTemplateFormat1BoxedString, UriTemplateFormat1BoxedList, UriTemplateFormat1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface UriTemplateFormat1Boxed permits UriTemplateFormat1BoxedVoid, UriTemplateFormat1BoxedBoolean, UriTemplateFormat1BoxedNumber, UriTemplateFormat1BoxedString, UriTemplateFormat1BoxedList, UriTemplateFormat1BoxedMap { + @Nullable Object getData(); } - public static final class UriTemplateFormat1BoxedVoid extends UriTemplateFormat1Boxed { - public final Void data; - private UriTemplateFormat1BoxedVoid(Void data) { - this.data = data; - } + public record UriTemplateFormat1BoxedVoid(Void data) implements UriTemplateFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UriTemplateFormat1BoxedBoolean extends UriTemplateFormat1Boxed { - public final boolean data; - private UriTemplateFormat1BoxedBoolean(boolean data) { - this.data = data; - } + public record UriTemplateFormat1BoxedBoolean(boolean data) implements UriTemplateFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UriTemplateFormat1BoxedNumber extends UriTemplateFormat1Boxed { - public final Number data; - private UriTemplateFormat1BoxedNumber(Number data) { - this.data = data; - } + public record UriTemplateFormat1BoxedNumber(Number data) implements UriTemplateFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UriTemplateFormat1BoxedString extends UriTemplateFormat1Boxed { - public final String data; - private UriTemplateFormat1BoxedString(String data) { - this.data = data; - } + public record UriTemplateFormat1BoxedString(String data) implements UriTemplateFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UriTemplateFormat1BoxedList extends UriTemplateFormat1Boxed { - public final FrozenList<@Nullable Object> data; - private UriTemplateFormat1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record UriTemplateFormat1BoxedList(FrozenList<@Nullable Object> data) implements UriTemplateFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UriTemplateFormat1BoxedMap extends UriTemplateFormat1Boxed { - public final FrozenMap<@Nullable Object> data; - private UriTemplateFormat1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record UriTemplateFormat1BoxedMap(FrozenMap<@Nullable Object> data) implements UriTemplateFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class UriTemplateFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, UriTemplateFormat1BoxedList>, MapSchemaValidator, UriTemplateFormat1BoxedMap> { + public static class UriTemplateFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, UriTemplateFormat1BoxedList>, MapSchemaValidator, UriTemplateFormat1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -211,11 +187,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -246,11 +222,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -329,5 +305,24 @@ public UriTemplateFormat1BoxedList validateAndBox(List arg, SchemaConfigurati public UriTemplateFormat1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new UriTemplateFormat1BoxedMap(validate(arg, configuration)); } + @Override + public UriTemplateFormat1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UuidFormat.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UuidFormat.java index 45387fe6fa2..99b379ce994 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UuidFormat.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/UuidFormat.java @@ -35,78 +35,54 @@ public class UuidFormat { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class UuidFormat1Boxed permits UuidFormat1BoxedVoid, UuidFormat1BoxedBoolean, UuidFormat1BoxedNumber, UuidFormat1BoxedString, UuidFormat1BoxedList, UuidFormat1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface UuidFormat1Boxed permits UuidFormat1BoxedVoid, UuidFormat1BoxedBoolean, UuidFormat1BoxedNumber, UuidFormat1BoxedString, UuidFormat1BoxedList, UuidFormat1BoxedMap { + @Nullable Object getData(); } - public static final class UuidFormat1BoxedVoid extends UuidFormat1Boxed { - public final Void data; - private UuidFormat1BoxedVoid(Void data) { - this.data = data; - } + public record UuidFormat1BoxedVoid(Void data) implements UuidFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UuidFormat1BoxedBoolean extends UuidFormat1Boxed { - public final boolean data; - private UuidFormat1BoxedBoolean(boolean data) { - this.data = data; - } + public record UuidFormat1BoxedBoolean(boolean data) implements UuidFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UuidFormat1BoxedNumber extends UuidFormat1Boxed { - public final Number data; - private UuidFormat1BoxedNumber(Number data) { - this.data = data; - } + public record UuidFormat1BoxedNumber(Number data) implements UuidFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UuidFormat1BoxedString extends UuidFormat1Boxed { - public final String data; - private UuidFormat1BoxedString(String data) { - this.data = data; - } + public record UuidFormat1BoxedString(String data) implements UuidFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UuidFormat1BoxedList extends UuidFormat1Boxed { - public final FrozenList<@Nullable Object> data; - private UuidFormat1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record UuidFormat1BoxedList(FrozenList<@Nullable Object> data) implements UuidFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UuidFormat1BoxedMap extends UuidFormat1Boxed { - public final FrozenMap<@Nullable Object> data; - private UuidFormat1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record UuidFormat1BoxedMap(FrozenMap<@Nullable Object> data) implements UuidFormat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class UuidFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, UuidFormat1BoxedList>, MapSchemaValidator, UuidFormat1BoxedMap> { + public static class UuidFormat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, UuidFormat1BoxedList>, MapSchemaValidator, UuidFormat1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -211,11 +187,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -246,11 +222,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -329,5 +305,24 @@ public UuidFormat1BoxedList validateAndBox(List arg, SchemaConfiguration conf public UuidFormat1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new UuidFormat1BoxedMap(validate(arg, configuration)); } + @Override + public UuidFormat1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ValidateAgainstCorrectBranchThenVsElse.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ValidateAgainstCorrectBranchThenVsElse.java index 948be597c9d..cacd8bf2b2d 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ValidateAgainstCorrectBranchThenVsElse.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/components/schemas/ValidateAgainstCorrectBranchThenVsElse.java @@ -36,78 +36,54 @@ public class ValidateAgainstCorrectBranchThenVsElse { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class ElseSchemaBoxed permits ElseSchemaBoxedVoid, ElseSchemaBoxedBoolean, ElseSchemaBoxedNumber, ElseSchemaBoxedString, ElseSchemaBoxedList, ElseSchemaBoxedMap { - public abstract @Nullable Object data(); + public sealed interface ElseSchemaBoxed permits ElseSchemaBoxedVoid, ElseSchemaBoxedBoolean, ElseSchemaBoxedNumber, ElseSchemaBoxedString, ElseSchemaBoxedList, ElseSchemaBoxedMap { + @Nullable Object getData(); } - public static final class ElseSchemaBoxedVoid extends ElseSchemaBoxed { - public final Void data; - private ElseSchemaBoxedVoid(Void data) { - this.data = data; - } + public record ElseSchemaBoxedVoid(Void data) implements ElseSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ElseSchemaBoxedBoolean extends ElseSchemaBoxed { - public final boolean data; - private ElseSchemaBoxedBoolean(boolean data) { - this.data = data; - } + public record ElseSchemaBoxedBoolean(boolean data) implements ElseSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ElseSchemaBoxedNumber extends ElseSchemaBoxed { - public final Number data; - private ElseSchemaBoxedNumber(Number data) { - this.data = data; - } + public record ElseSchemaBoxedNumber(Number data) implements ElseSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ElseSchemaBoxedString extends ElseSchemaBoxed { - public final String data; - private ElseSchemaBoxedString(String data) { - this.data = data; - } + public record ElseSchemaBoxedString(String data) implements ElseSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ElseSchemaBoxedList extends ElseSchemaBoxed { - public final FrozenList<@Nullable Object> data; - private ElseSchemaBoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record ElseSchemaBoxedList(FrozenList<@Nullable Object> data) implements ElseSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ElseSchemaBoxedMap extends ElseSchemaBoxed { - public final FrozenMap<@Nullable Object> data; - private ElseSchemaBoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record ElseSchemaBoxedMap(FrozenMap<@Nullable Object> data) implements ElseSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ElseSchema extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ElseSchemaBoxedList>, MapSchemaValidator, ElseSchemaBoxedMap> { + public static class ElseSchema extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ElseSchemaBoxedList>, MapSchemaValidator, ElseSchemaBoxedMap> { private static @Nullable ElseSchema instance = null; protected ElseSchema() { @@ -206,11 +182,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -241,11 +217,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -324,80 +300,75 @@ public ElseSchemaBoxedList validateAndBox(List arg, SchemaConfiguration confi public ElseSchemaBoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ElseSchemaBoxedMap(validate(arg, configuration)); } + @Override + public ElseSchemaBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class IfSchemaBoxed permits IfSchemaBoxedVoid, IfSchemaBoxedBoolean, IfSchemaBoxedNumber, IfSchemaBoxedString, IfSchemaBoxedList, IfSchemaBoxedMap { - public abstract @Nullable Object data(); + public sealed interface IfSchemaBoxed permits IfSchemaBoxedVoid, IfSchemaBoxedBoolean, IfSchemaBoxedNumber, IfSchemaBoxedString, IfSchemaBoxedList, IfSchemaBoxedMap { + @Nullable Object getData(); } - public static final class IfSchemaBoxedVoid extends IfSchemaBoxed { - public final Void data; - private IfSchemaBoxedVoid(Void data) { - this.data = data; - } + public record IfSchemaBoxedVoid(Void data) implements IfSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IfSchemaBoxedBoolean extends IfSchemaBoxed { - public final boolean data; - private IfSchemaBoxedBoolean(boolean data) { - this.data = data; - } + public record IfSchemaBoxedBoolean(boolean data) implements IfSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IfSchemaBoxedNumber extends IfSchemaBoxed { - public final Number data; - private IfSchemaBoxedNumber(Number data) { - this.data = data; - } + public record IfSchemaBoxedNumber(Number data) implements IfSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IfSchemaBoxedString extends IfSchemaBoxed { - public final String data; - private IfSchemaBoxedString(String data) { - this.data = data; - } + public record IfSchemaBoxedString(String data) implements IfSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IfSchemaBoxedList extends IfSchemaBoxed { - public final FrozenList<@Nullable Object> data; - private IfSchemaBoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record IfSchemaBoxedList(FrozenList<@Nullable Object> data) implements IfSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IfSchemaBoxedMap extends IfSchemaBoxed { - public final FrozenMap<@Nullable Object> data; - private IfSchemaBoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record IfSchemaBoxedMap(FrozenMap<@Nullable Object> data) implements IfSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class IfSchema extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, IfSchemaBoxedList>, MapSchemaValidator, IfSchemaBoxedMap> { + public static class IfSchema extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, IfSchemaBoxedList>, MapSchemaValidator, IfSchemaBoxedMap> { private static @Nullable IfSchema instance = null; protected IfSchema() { @@ -496,11 +467,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -531,11 +502,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -614,80 +585,75 @@ public IfSchemaBoxedList validateAndBox(List arg, SchemaConfiguration configu public IfSchemaBoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new IfSchemaBoxedMap(validate(arg, configuration)); } + @Override + public IfSchemaBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class ThenBoxed permits ThenBoxedVoid, ThenBoxedBoolean, ThenBoxedNumber, ThenBoxedString, ThenBoxedList, ThenBoxedMap { - public abstract @Nullable Object data(); + public sealed interface ThenBoxed permits ThenBoxedVoid, ThenBoxedBoolean, ThenBoxedNumber, ThenBoxedString, ThenBoxedList, ThenBoxedMap { + @Nullable Object getData(); } - public static final class ThenBoxedVoid extends ThenBoxed { - public final Void data; - private ThenBoxedVoid(Void data) { - this.data = data; - } + public record ThenBoxedVoid(Void data) implements ThenBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ThenBoxedBoolean extends ThenBoxed { - public final boolean data; - private ThenBoxedBoolean(boolean data) { - this.data = data; - } + public record ThenBoxedBoolean(boolean data) implements ThenBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ThenBoxedNumber extends ThenBoxed { - public final Number data; - private ThenBoxedNumber(Number data) { - this.data = data; - } + public record ThenBoxedNumber(Number data) implements ThenBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ThenBoxedString extends ThenBoxed { - public final String data; - private ThenBoxedString(String data) { - this.data = data; - } + public record ThenBoxedString(String data) implements ThenBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ThenBoxedList extends ThenBoxed { - public final FrozenList<@Nullable Object> data; - private ThenBoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record ThenBoxedList(FrozenList<@Nullable Object> data) implements ThenBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ThenBoxedMap extends ThenBoxed { - public final FrozenMap<@Nullable Object> data; - private ThenBoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record ThenBoxedMap(FrozenMap<@Nullable Object> data) implements ThenBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Then extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ThenBoxedList>, MapSchemaValidator, ThenBoxedMap> { + public static class Then extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ThenBoxedList>, MapSchemaValidator, ThenBoxedMap> { private static @Nullable Then instance = null; protected Then() { @@ -786,11 +752,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -821,11 +787,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -904,80 +870,75 @@ public ThenBoxedList validateAndBox(List arg, SchemaConfiguration configurati public ThenBoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ThenBoxedMap(validate(arg, configuration)); } + @Override + public ThenBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class ValidateAgainstCorrectBranchThenVsElse1Boxed permits ValidateAgainstCorrectBranchThenVsElse1BoxedVoid, ValidateAgainstCorrectBranchThenVsElse1BoxedBoolean, ValidateAgainstCorrectBranchThenVsElse1BoxedNumber, ValidateAgainstCorrectBranchThenVsElse1BoxedString, ValidateAgainstCorrectBranchThenVsElse1BoxedList, ValidateAgainstCorrectBranchThenVsElse1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface ValidateAgainstCorrectBranchThenVsElse1Boxed permits ValidateAgainstCorrectBranchThenVsElse1BoxedVoid, ValidateAgainstCorrectBranchThenVsElse1BoxedBoolean, ValidateAgainstCorrectBranchThenVsElse1BoxedNumber, ValidateAgainstCorrectBranchThenVsElse1BoxedString, ValidateAgainstCorrectBranchThenVsElse1BoxedList, ValidateAgainstCorrectBranchThenVsElse1BoxedMap { + @Nullable Object getData(); } - public static final class ValidateAgainstCorrectBranchThenVsElse1BoxedVoid extends ValidateAgainstCorrectBranchThenVsElse1Boxed { - public final Void data; - private ValidateAgainstCorrectBranchThenVsElse1BoxedVoid(Void data) { - this.data = data; - } + public record ValidateAgainstCorrectBranchThenVsElse1BoxedVoid(Void data) implements ValidateAgainstCorrectBranchThenVsElse1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ValidateAgainstCorrectBranchThenVsElse1BoxedBoolean extends ValidateAgainstCorrectBranchThenVsElse1Boxed { - public final boolean data; - private ValidateAgainstCorrectBranchThenVsElse1BoxedBoolean(boolean data) { - this.data = data; - } + public record ValidateAgainstCorrectBranchThenVsElse1BoxedBoolean(boolean data) implements ValidateAgainstCorrectBranchThenVsElse1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ValidateAgainstCorrectBranchThenVsElse1BoxedNumber extends ValidateAgainstCorrectBranchThenVsElse1Boxed { - public final Number data; - private ValidateAgainstCorrectBranchThenVsElse1BoxedNumber(Number data) { - this.data = data; - } + public record ValidateAgainstCorrectBranchThenVsElse1BoxedNumber(Number data) implements ValidateAgainstCorrectBranchThenVsElse1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ValidateAgainstCorrectBranchThenVsElse1BoxedString extends ValidateAgainstCorrectBranchThenVsElse1Boxed { - public final String data; - private ValidateAgainstCorrectBranchThenVsElse1BoxedString(String data) { - this.data = data; - } + public record ValidateAgainstCorrectBranchThenVsElse1BoxedString(String data) implements ValidateAgainstCorrectBranchThenVsElse1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ValidateAgainstCorrectBranchThenVsElse1BoxedList extends ValidateAgainstCorrectBranchThenVsElse1Boxed { - public final FrozenList<@Nullable Object> data; - private ValidateAgainstCorrectBranchThenVsElse1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record ValidateAgainstCorrectBranchThenVsElse1BoxedList(FrozenList<@Nullable Object> data) implements ValidateAgainstCorrectBranchThenVsElse1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ValidateAgainstCorrectBranchThenVsElse1BoxedMap extends ValidateAgainstCorrectBranchThenVsElse1Boxed { - public final FrozenMap<@Nullable Object> data; - private ValidateAgainstCorrectBranchThenVsElse1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record ValidateAgainstCorrectBranchThenVsElse1BoxedMap(FrozenMap<@Nullable Object> data) implements ValidateAgainstCorrectBranchThenVsElse1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ValidateAgainstCorrectBranchThenVsElse1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ValidateAgainstCorrectBranchThenVsElse1BoxedList>, MapSchemaValidator, ValidateAgainstCorrectBranchThenVsElse1BoxedMap> { + public static class ValidateAgainstCorrectBranchThenVsElse1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ValidateAgainstCorrectBranchThenVsElse1BoxedList>, MapSchemaValidator, ValidateAgainstCorrectBranchThenVsElse1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -1084,11 +1045,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -1119,11 +1080,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -1202,5 +1163,24 @@ public ValidateAgainstCorrectBranchThenVsElse1BoxedList validateAndBox(List a public ValidateAgainstCorrectBranchThenVsElse1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ValidateAgainstCorrectBranchThenVsElse1BoxedMap(validate(arg, configuration)); } + @Override + public ValidateAgainstCorrectBranchThenVsElse1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/mediatype/MediaType.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/mediatype/MediaType.java index 7e55f79c911..e8392d15eda 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/mediatype/MediaType.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/mediatype/MediaType.java @@ -1,11 +1,8 @@ package org.openapijsonschematools.client.mediatype; import org.openapijsonschematools.client.schemas.validation.JsonSchema; -import org.checkerframework.checker.nullness.qual.Nullable; -import java.util.Map; - -public class MediaType { +public interface MediaType, U> { /* * Used to store request and response body schema information * encoding: @@ -14,16 +11,6 @@ public class MediaType { * The encoding object SHALL only apply to requestBody objects when the media type is * multipart or application/x-www-form-urlencoded. */ - public final T schema; - public final @Nullable Map encoding; - - public MediaType(T schema, @Nullable Map encoding) { - this.schema = schema; - this.encoding = encoding; - } - - public MediaType(T schema) { - this.schema = schema; - this.encoding = null; - } + T schema(); + U encoding(); } \ No newline at end of file diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/requestbody/RequestBodySerializer.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/requestbody/RequestBodySerializer.java index 3fdbcdbfde4..e221acb164a 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/requestbody/RequestBodySerializer.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/requestbody/RequestBodySerializer.java @@ -1,28 +1,32 @@ package org.openapijsonschematools.client.requestbody; -import org.openapijsonschematools.client.mediatype.MediaType; - import java.net.http.HttpRequest; import org.checkerframework.checker.nullness.qual.Nullable; import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.ToNumberPolicy; +import org.openapijsonschematools.client.schemas.validation.JsonSchema; import java.util.Map; import java.util.regex.Pattern; -public abstract class RequestBodySerializer { +public abstract class RequestBodySerializer { /* * Describes a single request body * content: contentType to MediaType schema info */ - public final Map> content; + public final Map content; public final boolean required; private static final Pattern jsonContentTypePattern = Pattern.compile( "application/[^+]*[+]?(json);?.*" ); - private static final Gson gson = new Gson(); + private static final Gson gson = new GsonBuilder() + .setObjectToNumberStrategy(ToNumberPolicy.LONG_OR_DOUBLE) + .setNumberToNumberStrategy(ToNumberPolicy.LONG_OR_DOUBLE) + .create(); private static final String textPlainContentType = "text/plain"; - public RequestBodySerializer(Map> content, boolean required) { + public RequestBodySerializer(Map content, boolean required) { this.content = content; this.required = required; } @@ -31,8 +35,13 @@ protected static boolean contentTypeIsJson(String contentType) { return jsonContentTypePattern.matcher(contentType).find(); } + @SuppressWarnings("nullness") + private String toJson(@Nullable Object body) { + return gson.toJson(body); + } + private SerializedRequestBody serializeJson(String contentType, @Nullable Object body) { - String jsonText = gson.toJson(body); + String jsonText = toJson(body); return new SerializedRequestBody(contentType, HttpRequest.BodyPublishers.ofString(jsonText)); } @@ -40,7 +49,7 @@ private SerializedRequestBody serializeTextPlain(String contentType, @Nullable O if (body instanceof String stringBody) { return new SerializedRequestBody(contentType, HttpRequest.BodyPublishers.ofString(stringBody)); } - throw new RuntimeException("Invalid non-string data type of "+body.getClass().getName()+" for text/plain body serialization"); + throw new RuntimeException("Invalid non-string data type of "+JsonSchema.getClass(body)+" for text/plain body serialization"); } protected SerializedRequestBody serialize(String contentType, @Nullable Object body) { diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/response/ApiResponse.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/response/ApiResponse.java new file mode 100644 index 00000000000..dab55e0f2da --- /dev/null +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/response/ApiResponse.java @@ -0,0 +1,9 @@ +package org.openapijsonschematools.client.response; + +import java.net.http.HttpResponse; + +public interface ApiResponse { + HttpResponse response(); + SealedBodyOutputClass body(); + HeaderOutputClass headers(); +} \ No newline at end of file diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/response/DeserializedApiResponse.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/response/DeserializedApiResponse.java new file mode 100644 index 00000000000..1e88d82646c --- /dev/null +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/response/DeserializedApiResponse.java @@ -0,0 +1,8 @@ +package org.openapijsonschematools.client.response; + +import java.net.http.HttpResponse; + +public record DeserializedApiResponse(HttpResponse response, + SealedBodyOutputClass body, + HeaderOutputClass headers) implements ApiResponse { +} \ No newline at end of file diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/response/ResponseDeserializer.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/response/ResponseDeserializer.java new file mode 100644 index 00000000000..766af80f088 --- /dev/null +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/response/ResponseDeserializer.java @@ -0,0 +1,83 @@ +package org.openapijsonschematools.client.response; + +import java.net.http.HttpHeaders; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.Map; +import java.util.Optional; +import java.util.regex.Pattern; + +import org.checkerframework.checker.nullness.qual.Nullable; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.ToNumberPolicy; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.schemas.validation.JsonSchema; + +public abstract class ResponseDeserializer { + public final Map content; + public final @Nullable Map headers; // todo change the value to header + private static final Pattern jsonContentTypePattern = Pattern.compile( + "application/[^+]*[+]?(json);?.*" + ); + private static final Gson gson = new GsonBuilder() + .setObjectToNumberStrategy(ToNumberPolicy.LONG_OR_DOUBLE) + .setNumberToNumberStrategy(ToNumberPolicy.LONG_OR_DOUBLE) + .create(); + protected static final String textPlainContentType = "text/plain"; + + public ResponseDeserializer(Map content) { + this.content = content; + this.headers = null; + } + + protected abstract SealedBodyClass getBody(String contentType, byte[] body, SchemaConfiguration configuration); + protected abstract HeaderClass getHeaders(HttpHeaders headers); + + protected @Nullable Object deserializeJson(byte[] body) { + String bodyStr = new String(body, StandardCharsets.UTF_8); + return gson.fromJson(bodyStr, Object.class); + } + + protected String deserializeTextPlain(byte[] body) { + return new String(body, StandardCharsets.UTF_8); + } + + protected static boolean contentTypeIsJson(String contentType) { + return jsonContentTypePattern.matcher(contentType).find(); + } + + protected static boolean contentTypeIsTextPlain(String contentType) { + return textPlainContentType.equals(contentType); + } + + protected T deserializeBody(String contentType, byte[] body, JsonSchema schema, SchemaConfiguration configuration) { + if (contentTypeIsJson(contentType)) { + @Nullable Object bodyData = deserializeJson(body); + return schema.validateAndBox(bodyData, configuration); + } else if (contentTypeIsTextPlain(contentType)) { + String bodyData = deserializeTextPlain(body); + return schema.validateAndBox(bodyData, configuration); + } + throw new RuntimeException("Deserialization for contentType="+contentType+" has not yet been implemented."); + } + + public ApiResponse deserialize(HttpResponse response, SchemaConfiguration configuration) { + Optional contentTypeInfo = response.headers().firstValue("Content-Type"); + if (contentTypeInfo.isEmpty()) { + throw new RuntimeException("Invalid response returned, Content-Type header is missing and it must be included"); + } + String contentType = contentTypeInfo.get(); + if (content != null && !content.containsKey(contentType)) { + throw new RuntimeException( + "Invalid contentType returned. contentType="+contentType+" was returned "+ + "when only "+content.keySet()+" are defined for statusCode="+response.statusCode() + ); + } + byte[] bodyBytes = response.body(); + SealedBodyClass body = getBody(contentType, bodyBytes, configuration); + HeaderClass headers = getHeaders(response.headers()); + return new DeserializedApiResponse<>(response, body, headers); + } +} \ No newline at end of file diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/AnyTypeJsonSchema.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/AnyTypeJsonSchema.java index ee6800e54ad..0ffcae114bd 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/AnyTypeJsonSchema.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/AnyTypeJsonSchema.java @@ -31,71 +31,47 @@ import java.util.UUID; public class AnyTypeJsonSchema { - public static abstract sealed class AnyTypeJsonSchema1Boxed permits AnyTypeJsonSchema1BoxedVoid, AnyTypeJsonSchema1BoxedBoolean, AnyTypeJsonSchema1BoxedNumber, AnyTypeJsonSchema1BoxedString, AnyTypeJsonSchema1BoxedList, AnyTypeJsonSchema1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface AnyTypeJsonSchema1Boxed permits AnyTypeJsonSchema1BoxedVoid, AnyTypeJsonSchema1BoxedBoolean, AnyTypeJsonSchema1BoxedNumber, AnyTypeJsonSchema1BoxedString, AnyTypeJsonSchema1BoxedList, AnyTypeJsonSchema1BoxedMap { + @Nullable Object getData(); } - public static final class AnyTypeJsonSchema1BoxedVoid extends AnyTypeJsonSchema1Boxed { - public final Void data; - private AnyTypeJsonSchema1BoxedVoid(Void data) { - this.data = data; - } + public record AnyTypeJsonSchema1BoxedVoid(Void data) implements AnyTypeJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AnyTypeJsonSchema1BoxedBoolean extends AnyTypeJsonSchema1Boxed { - public final boolean data; - private AnyTypeJsonSchema1BoxedBoolean(boolean data) { - this.data = data; - } + public record AnyTypeJsonSchema1BoxedBoolean(boolean data) implements AnyTypeJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AnyTypeJsonSchema1BoxedNumber extends AnyTypeJsonSchema1Boxed { - public final Number data; - private AnyTypeJsonSchema1BoxedNumber(Number data) { - this.data = data; - } + public record AnyTypeJsonSchema1BoxedNumber(Number data) implements AnyTypeJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AnyTypeJsonSchema1BoxedString extends AnyTypeJsonSchema1Boxed { - public final String data; - private AnyTypeJsonSchema1BoxedString(String data) { - this.data = data; - } + public record AnyTypeJsonSchema1BoxedString(String data) implements AnyTypeJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AnyTypeJsonSchema1BoxedList extends AnyTypeJsonSchema1Boxed { - public final FrozenList<@Nullable Object> data; - private AnyTypeJsonSchema1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record AnyTypeJsonSchema1BoxedList(FrozenList<@Nullable Object> data) implements AnyTypeJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AnyTypeJsonSchema1BoxedMap extends AnyTypeJsonSchema1Boxed { - public final FrozenMap<@Nullable Object> data; - private AnyTypeJsonSchema1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record AnyTypeJsonSchema1BoxedMap(FrozenMap<@Nullable Object> data) implements AnyTypeJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class AnyTypeJsonSchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, AnyTypeJsonSchema1BoxedList>, MapSchemaValidator, AnyTypeJsonSchema1BoxedMap> { + public static class AnyTypeJsonSchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, AnyTypeJsonSchema1BoxedList>, MapSchemaValidator, AnyTypeJsonSchema1BoxedMap> { private static @Nullable AnyTypeJsonSchema1 instance = null; protected AnyTypeJsonSchema1() { @@ -192,11 +168,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object castItem = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; @@ -227,11 +203,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object castValue = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } @@ -291,25 +267,50 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public AnyTypeJsonSchema1BoxedVoid validateAndBox(Void arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new AnyTypeJsonSchema1BoxedVoid(validate(arg, configuration)); } + @Override public AnyTypeJsonSchema1BoxedBoolean validateAndBox(boolean arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new AnyTypeJsonSchema1BoxedBoolean(validate(arg, configuration)); } + @Override public AnyTypeJsonSchema1BoxedNumber validateAndBox(Number arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new AnyTypeJsonSchema1BoxedNumber(validate(arg, configuration)); } + @Override public AnyTypeJsonSchema1BoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new AnyTypeJsonSchema1BoxedString(validate(arg, configuration)); } + @Override public AnyTypeJsonSchema1BoxedList validateAndBox(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new AnyTypeJsonSchema1BoxedList(validate(arg, configuration)); } + @Override public AnyTypeJsonSchema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new AnyTypeJsonSchema1BoxedMap(validate(arg, configuration)); } + + @Override + public AnyTypeJsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } \ No newline at end of file diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/BooleanJsonSchema.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/BooleanJsonSchema.java index 9cb93203682..2cceae9d49f 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/BooleanJsonSchema.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/BooleanJsonSchema.java @@ -18,20 +18,16 @@ import java.util.Set; public class BooleanJsonSchema { - public static abstract sealed class BooleanJsonSchema1Boxed permits BooleanJsonSchema1BoxedBoolean { - public abstract @Nullable Object data(); + public sealed interface BooleanJsonSchema1Boxed permits BooleanJsonSchema1BoxedBoolean { + @Nullable Object getData(); } - public static final class BooleanJsonSchema1BoxedBoolean extends BooleanJsonSchema1Boxed { - public final boolean data; - private BooleanJsonSchema1BoxedBoolean(boolean data) { - this.data = data; - } + public record BooleanJsonSchema1BoxedBoolean(boolean data) implements BooleanJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class BooleanJsonSchema1 extends JsonSchema implements BooleanSchemaValidator { + public static class BooleanJsonSchema1 extends JsonSchema implements BooleanSchemaValidator { private static @Nullable BooleanJsonSchema1 instance = null; protected BooleanJsonSchema1() { @@ -80,5 +76,14 @@ public boolean validate(boolean arg, SchemaConfiguration configuration) throws V public BooleanJsonSchema1BoxedBoolean validateAndBox(boolean arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new BooleanJsonSchema1BoxedBoolean(validate(arg, configuration)); } + + @Override + public BooleanJsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } \ No newline at end of file diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DateJsonSchema.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DateJsonSchema.java index 48da817d9b1..15b5ca67f26 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DateJsonSchema.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DateJsonSchema.java @@ -19,21 +19,17 @@ import java.util.Set; public class DateJsonSchema { - public static abstract sealed class DateJsonSchema1Boxed permits DateJsonSchema1BoxedString { - public abstract @Nullable Object data(); + public sealed interface DateJsonSchema1Boxed permits DateJsonSchema1BoxedString { + @Nullable Object getData(); } - public static final class DateJsonSchema1BoxedString extends DateJsonSchema1Boxed { - public final String data; - private DateJsonSchema1BoxedString(String data) { - this.data = data; - } + public record DateJsonSchema1BoxedString(String data) implements DateJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class DateJsonSchema1 extends JsonSchema implements StringSchemaValidator { + public static class DateJsonSchema1 extends JsonSchema implements StringSchemaValidator { private static @Nullable DateJsonSchema1 instance = null; protected DateJsonSchema1() { @@ -87,5 +83,13 @@ public String validate(LocalDate arg, SchemaConfiguration configuration) throws public DateJsonSchema1BoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new DateJsonSchema1BoxedString(validate(arg, configuration)); } + + @Override + public DateJsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } \ No newline at end of file diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DateTimeJsonSchema.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DateTimeJsonSchema.java index 9e048ab2c07..e695f3c2ac9 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DateTimeJsonSchema.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DateTimeJsonSchema.java @@ -19,21 +19,17 @@ import java.util.Set; public class DateTimeJsonSchema { - public static abstract sealed class DateTimeJsonSchema1Boxed permits DateTimeJsonSchema1BoxedString { - public abstract @Nullable Object data(); + public sealed interface DateTimeJsonSchema1Boxed permits DateTimeJsonSchema1BoxedString { + @Nullable Object getData(); } - public static final class DateTimeJsonSchema1BoxedString extends DateTimeJsonSchema1Boxed { - public final String data; - private DateTimeJsonSchema1BoxedString(String data) { - this.data = data; - } + public record DateTimeJsonSchema1BoxedString(String data) implements DateTimeJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class DateTimeJsonSchema1 extends JsonSchema implements StringSchemaValidator { + public static class DateTimeJsonSchema1 extends JsonSchema implements StringSchemaValidator { private static @Nullable DateTimeJsonSchema1 instance = null; protected DateTimeJsonSchema1() { @@ -87,5 +83,13 @@ public String validate(ZonedDateTime arg, SchemaConfiguration configuration) thr public DateTimeJsonSchema1BoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new DateTimeJsonSchema1BoxedString(validate(arg, configuration)); } + + @Override + public DateTimeJsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } \ No newline at end of file diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DecimalJsonSchema.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DecimalJsonSchema.java index af820a6b251..f961e94f802 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DecimalJsonSchema.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DecimalJsonSchema.java @@ -18,21 +18,17 @@ import java.util.Set; public class DecimalJsonSchema { - public static abstract sealed class DecimalJsonSchema1Boxed permits DecimalJsonSchema1BoxedString { - public abstract @Nullable Object data(); + public sealed interface DecimalJsonSchema1Boxed permits DecimalJsonSchema1BoxedString { + @Nullable Object getData(); } - public static final class DecimalJsonSchema1BoxedString extends DecimalJsonSchema1Boxed { - public final String data; - private DecimalJsonSchema1BoxedString(String data) { - this.data = data; - } + public record DecimalJsonSchema1BoxedString(String data) implements DecimalJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class DecimalJsonSchema1 extends JsonSchema implements StringSchemaValidator { + public static class DecimalJsonSchema1 extends JsonSchema implements StringSchemaValidator { private static @Nullable DecimalJsonSchema1 instance = null; protected DecimalJsonSchema1() { @@ -80,5 +76,13 @@ public String validate(String arg, SchemaConfiguration configuration) throws Val public DecimalJsonSchema1BoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new DecimalJsonSchema1BoxedString(validate(arg, configuration)); } + + @Override + public DecimalJsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } \ No newline at end of file diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DoubleJsonSchema.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DoubleJsonSchema.java index 8219f3ca213..56f7894f670 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DoubleJsonSchema.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/DoubleJsonSchema.java @@ -18,21 +18,17 @@ import java.util.Set; public class DoubleJsonSchema { - public static abstract sealed class DoubleJsonSchema1Boxed permits DoubleJsonSchema1BoxedNumber { - public abstract @Nullable Object data(); + public sealed interface DoubleJsonSchema1Boxed permits DoubleJsonSchema1BoxedNumber { + @Nullable Object getData(); } - public static final class DoubleJsonSchema1BoxedNumber extends DoubleJsonSchema1Boxed { - public final Number data; - private DoubleJsonSchema1BoxedNumber(Number data) { - this.data = data; - } + public record DoubleJsonSchema1BoxedNumber(Number data) implements DoubleJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class DoubleJsonSchema1 extends JsonSchema implements NumberSchemaValidator { + public static class DoubleJsonSchema1 extends JsonSchema implements NumberSchemaValidator { private static @Nullable DoubleJsonSchema1 instance = null; protected DoubleJsonSchema1() { @@ -84,5 +80,13 @@ public double validate(double arg, SchemaConfiguration configuration) { public DoubleJsonSchema1BoxedNumber validateAndBox(Number arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new DoubleJsonSchema1BoxedNumber(validate(arg, configuration)); } + + @Override + public DoubleJsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } \ No newline at end of file diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/FloatJsonSchema.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/FloatJsonSchema.java index 42e3806e845..65221627b46 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/FloatJsonSchema.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/FloatJsonSchema.java @@ -18,21 +18,17 @@ import java.util.Set; public class FloatJsonSchema { - public static abstract sealed class FloatJsonSchema1Boxed permits FloatJsonSchema1BoxedNumber { - public abstract @Nullable Object data(); + public sealed interface FloatJsonSchema1Boxed permits FloatJsonSchema1BoxedNumber { + @Nullable Object getData(); } - public static final class FloatJsonSchema1BoxedNumber extends FloatJsonSchema1Boxed { - public final Number data; - private FloatJsonSchema1BoxedNumber(Number data) { - this.data = data; - } + public record FloatJsonSchema1BoxedNumber(Number data) implements FloatJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class FloatJsonSchema1 extends JsonSchema implements NumberSchemaValidator { + public static class FloatJsonSchema1 extends JsonSchema implements NumberSchemaValidator { private static @Nullable FloatJsonSchema1 instance = null; protected FloatJsonSchema1() { @@ -84,5 +80,13 @@ public float validate(float arg, SchemaConfiguration configuration) { public FloatJsonSchema1BoxedNumber validateAndBox(Number arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new FloatJsonSchema1BoxedNumber(validate(arg, configuration)); } + + @Override + public FloatJsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/Int32JsonSchema.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/Int32JsonSchema.java index c9ae84e53f4..836fa1db724 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/Int32JsonSchema.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/Int32JsonSchema.java @@ -18,21 +18,17 @@ import java.util.Set; public class Int32JsonSchema { - public static abstract sealed class Int32JsonSchema1Boxed permits Int32JsonSchema1BoxedNumber { - public abstract @Nullable Object data(); + public sealed interface Int32JsonSchema1Boxed permits Int32JsonSchema1BoxedNumber { + @Nullable Object getData(); } - public static final class Int32JsonSchema1BoxedNumber extends Int32JsonSchema1Boxed { - public final Number data; - private Int32JsonSchema1BoxedNumber(Number data) { - this.data = data; - } + public record Int32JsonSchema1BoxedNumber(Number data) implements Int32JsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Int32JsonSchema1 extends JsonSchema implements NumberSchemaValidator { + public static class Int32JsonSchema1 extends JsonSchema implements NumberSchemaValidator { private static @Nullable Int32JsonSchema1 instance = null; protected Int32JsonSchema1() { @@ -91,5 +87,13 @@ public float validate(float arg, SchemaConfiguration configuration) throws Valid public Int32JsonSchema1BoxedNumber validateAndBox(Number arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Int32JsonSchema1BoxedNumber(validate(arg, configuration)); } + + @Override + public Int32JsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } \ No newline at end of file diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/Int64JsonSchema.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/Int64JsonSchema.java index e74999992ef..da3f9d8d5f7 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/Int64JsonSchema.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/Int64JsonSchema.java @@ -18,21 +18,17 @@ import java.util.Set; public class Int64JsonSchema { - public static abstract sealed class Int64JsonSchema1Boxed permits Int64JsonSchema1BoxedNumber { - public abstract @Nullable Object data(); + public sealed interface Int64JsonSchema1Boxed permits Int64JsonSchema1BoxedNumber { + @Nullable Object getData(); } - public static final class Int64JsonSchema1BoxedNumber extends Int64JsonSchema1Boxed { - public final Number data; - private Int64JsonSchema1BoxedNumber(Number data) { - this.data = data; - } + public record Int64JsonSchema1BoxedNumber(Number data) implements Int64JsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Int64JsonSchema1 extends JsonSchema implements NumberSchemaValidator { + public static class Int64JsonSchema1 extends JsonSchema implements NumberSchemaValidator { private static @Nullable Int64JsonSchema1 instance = null; protected Int64JsonSchema1() { @@ -101,5 +97,13 @@ public double validate(double arg, SchemaConfiguration configuration) throws Val public Int64JsonSchema1BoxedNumber validateAndBox(Number arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Int64JsonSchema1BoxedNumber(validate(arg, configuration)); } + + @Override + public Int64JsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } \ No newline at end of file diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/IntJsonSchema.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/IntJsonSchema.java index 42568a55f34..6205c5b4380 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/IntJsonSchema.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/IntJsonSchema.java @@ -18,21 +18,17 @@ import java.util.Set; public class IntJsonSchema { - public static abstract sealed class IntJsonSchema1Boxed permits IntJsonSchema1BoxedNumber { - public abstract @Nullable Object data(); + public sealed interface IntJsonSchema1Boxed permits IntJsonSchema1BoxedNumber { + @Nullable Object getData(); } - public static final class IntJsonSchema1BoxedNumber extends IntJsonSchema1Boxed { - public final Number data; - private IntJsonSchema1BoxedNumber(Number data) { - this.data = data; - } + public record IntJsonSchema1BoxedNumber(Number data) implements IntJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class IntJsonSchema1 extends JsonSchema implements NumberSchemaValidator { + public static class IntJsonSchema1 extends JsonSchema implements NumberSchemaValidator { private static @Nullable IntJsonSchema1 instance = null; protected IntJsonSchema1() { @@ -101,5 +97,13 @@ public double validate(double arg, SchemaConfiguration configuration) throws Val public IntJsonSchema1BoxedNumber validateAndBox(Number arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new IntJsonSchema1BoxedNumber(validate(arg, configuration)); } + + @Override + public IntJsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } \ No newline at end of file diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/ListJsonSchema.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/ListJsonSchema.java index 855e63d6573..7ebb3106467 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/ListJsonSchema.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/ListJsonSchema.java @@ -21,21 +21,17 @@ import java.util.Set; public class ListJsonSchema { - public static abstract sealed class ListJsonSchema1Boxed permits ListJsonSchema1BoxedList { - public abstract @Nullable Object data(); + public sealed interface ListJsonSchema1Boxed permits ListJsonSchema1BoxedList { + @Nullable Object getData(); } - public static final class ListJsonSchema1BoxedList extends ListJsonSchema1Boxed { - public final FrozenList<@Nullable Object> data; - private ListJsonSchema1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record ListJsonSchema1BoxedList(FrozenList<@Nullable Object> data) implements ListJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ListJsonSchema1 extends JsonSchema implements ListSchemaValidator, ListJsonSchema1BoxedList> { + public static class ListJsonSchema1 extends JsonSchema implements ListSchemaValidator, ListJsonSchema1BoxedList> { private static @Nullable ListJsonSchema1 instance = null; protected ListJsonSchema1() { @@ -58,11 +54,11 @@ public static ListJsonSchema1 getInstance() { for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object castItem = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; @@ -101,5 +97,13 @@ public static ListJsonSchema1 getInstance() { public ListJsonSchema1BoxedList validateAndBox(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ListJsonSchema1BoxedList(validate(arg, configuration)); } + + @Override + public ListJsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/MapJsonSchema.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/MapJsonSchema.java index 568471e3c8d..47e141dac53 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/MapJsonSchema.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/MapJsonSchema.java @@ -22,21 +22,17 @@ import java.util.Set; public class MapJsonSchema { - public static abstract sealed class MapJsonSchema1Boxed permits MapJsonSchema1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface MapJsonSchema1Boxed permits MapJsonSchema1BoxedMap { + @Nullable Object getData(); } - public static final class MapJsonSchema1BoxedMap extends MapJsonSchema1Boxed { - public final FrozenMap<@Nullable Object> data; - private MapJsonSchema1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record MapJsonSchema1BoxedMap(FrozenMap<@Nullable Object> data) implements MapJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class MapJsonSchema1 extends JsonSchema implements MapSchemaValidator, MapJsonSchema1BoxedMap> { + public static class MapJsonSchema1 extends JsonSchema implements MapSchemaValidator, MapJsonSchema1BoxedMap> { private static @Nullable MapJsonSchema1 instance = null; protected MapJsonSchema1() { @@ -64,11 +60,11 @@ public static MapJsonSchema1 getInstance() { List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object castValue = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } @@ -105,5 +101,13 @@ public static MapJsonSchema1 getInstance() { public MapJsonSchema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new MapJsonSchema1BoxedMap(validate(arg, configuration)); } + + @Override + public MapJsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NotAnyTypeJsonSchema.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NotAnyTypeJsonSchema.java index 705bb7aa6b9..de1ed91b0cd 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NotAnyTypeJsonSchema.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NotAnyTypeJsonSchema.java @@ -31,71 +31,47 @@ import java.util.UUID; public class NotAnyTypeJsonSchema { - public static abstract sealed class NotAnyTypeJsonSchema1Boxed permits NotAnyTypeJsonSchema1BoxedVoid, NotAnyTypeJsonSchema1BoxedBoolean, NotAnyTypeJsonSchema1BoxedNumber, NotAnyTypeJsonSchema1BoxedString, NotAnyTypeJsonSchema1BoxedList, NotAnyTypeJsonSchema1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface NotAnyTypeJsonSchema1Boxed permits NotAnyTypeJsonSchema1BoxedVoid, NotAnyTypeJsonSchema1BoxedBoolean, NotAnyTypeJsonSchema1BoxedNumber, NotAnyTypeJsonSchema1BoxedString, NotAnyTypeJsonSchema1BoxedList, NotAnyTypeJsonSchema1BoxedMap { + @Nullable Object getData(); } - public static final class NotAnyTypeJsonSchema1BoxedVoid extends NotAnyTypeJsonSchema1Boxed { - public final Void data; - private NotAnyTypeJsonSchema1BoxedVoid(Void data) { - this.data = data; - } + public record NotAnyTypeJsonSchema1BoxedVoid(Void data) implements NotAnyTypeJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NotAnyTypeJsonSchema1BoxedBoolean extends NotAnyTypeJsonSchema1Boxed { - public final boolean data; - private NotAnyTypeJsonSchema1BoxedBoolean(boolean data) { - this.data = data; - } + public record NotAnyTypeJsonSchema1BoxedBoolean(boolean data) implements NotAnyTypeJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NotAnyTypeJsonSchema1BoxedNumber extends NotAnyTypeJsonSchema1Boxed { - public final Number data; - private NotAnyTypeJsonSchema1BoxedNumber(Number data) { - this.data = data; - } + public record NotAnyTypeJsonSchema1BoxedNumber(Number data) implements NotAnyTypeJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NotAnyTypeJsonSchema1BoxedString extends NotAnyTypeJsonSchema1Boxed { - public final String data; - private NotAnyTypeJsonSchema1BoxedString(String data) { - this.data = data; - } + public record NotAnyTypeJsonSchema1BoxedString(String data) implements NotAnyTypeJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NotAnyTypeJsonSchema1BoxedList extends NotAnyTypeJsonSchema1Boxed { - public final FrozenList<@Nullable Object> data; - private NotAnyTypeJsonSchema1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record NotAnyTypeJsonSchema1BoxedList(FrozenList<@Nullable Object> data) implements NotAnyTypeJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NotAnyTypeJsonSchema1BoxedMap extends NotAnyTypeJsonSchema1Boxed { - public final FrozenMap<@Nullable Object> data; - private NotAnyTypeJsonSchema1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record NotAnyTypeJsonSchema1BoxedMap(FrozenMap<@Nullable Object> data) implements NotAnyTypeJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class NotAnyTypeJsonSchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, NotAnyTypeJsonSchema1BoxedList>, MapSchemaValidator, NotAnyTypeJsonSchema1BoxedMap> { + public static class NotAnyTypeJsonSchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, NotAnyTypeJsonSchema1BoxedList>, MapSchemaValidator, NotAnyTypeJsonSchema1BoxedMap> { private static @Nullable NotAnyTypeJsonSchema1 instance = null; protected NotAnyTypeJsonSchema1() { @@ -194,11 +170,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object castItem = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; @@ -229,11 +205,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object castValue = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } @@ -293,25 +269,50 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public NotAnyTypeJsonSchema1BoxedVoid validateAndBox(Void arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new NotAnyTypeJsonSchema1BoxedVoid(validate(arg, configuration)); } + @Override public NotAnyTypeJsonSchema1BoxedBoolean validateAndBox(boolean arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new NotAnyTypeJsonSchema1BoxedBoolean(validate(arg, configuration)); } + @Override public NotAnyTypeJsonSchema1BoxedNumber validateAndBox(Number arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new NotAnyTypeJsonSchema1BoxedNumber(validate(arg, configuration)); } + @Override public NotAnyTypeJsonSchema1BoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new NotAnyTypeJsonSchema1BoxedString(validate(arg, configuration)); } + @Override public NotAnyTypeJsonSchema1BoxedList validateAndBox(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new NotAnyTypeJsonSchema1BoxedList(validate(arg, configuration)); } + @Override public NotAnyTypeJsonSchema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new NotAnyTypeJsonSchema1BoxedMap(validate(arg, configuration)); } + + @Override + public NotAnyTypeJsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } \ No newline at end of file diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NullJsonSchema.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NullJsonSchema.java index 5882a7f23e5..d028dbf295e 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NullJsonSchema.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NullJsonSchema.java @@ -18,21 +18,17 @@ import java.util.Set; public class NullJsonSchema { - public static abstract sealed class NullJsonSchema1Boxed permits NullJsonSchema1BoxedVoid { - public abstract @Nullable Object data(); + public sealed interface NullJsonSchema1Boxed permits NullJsonSchema1BoxedVoid { + @Nullable Object getData(); } - public static final class NullJsonSchema1BoxedVoid extends NullJsonSchema1Boxed { - public final Void data; - private NullJsonSchema1BoxedVoid(Void data) { - this.data = data; - } + public record NullJsonSchema1BoxedVoid(Void data) implements NullJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class NullJsonSchema1 extends JsonSchema implements NullSchemaValidator { + public static class NullJsonSchema1 extends JsonSchema implements NullSchemaValidator { private static @Nullable NullJsonSchema1 instance = null; protected NullJsonSchema1() { @@ -79,5 +75,14 @@ public Void validate(Void arg, SchemaConfiguration configuration) throws Validat public NullJsonSchema1BoxedVoid validateAndBox(Void arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new NullJsonSchema1BoxedVoid(validate(arg, configuration)); } + + @Override + public NullJsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NumberJsonSchema.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NumberJsonSchema.java index 1340dcc4420..5c33b047d95 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NumberJsonSchema.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/NumberJsonSchema.java @@ -18,21 +18,17 @@ import java.util.Set; public class NumberJsonSchema { - public static abstract sealed class NumberJsonSchema1Boxed permits NumberJsonSchema1BoxedNumber { - public abstract @Nullable Object data(); + public sealed interface NumberJsonSchema1Boxed permits NumberJsonSchema1BoxedNumber { + @Nullable Object getData(); } - public static final class NumberJsonSchema1BoxedNumber extends NumberJsonSchema1Boxed { - public final Number data; - private NumberJsonSchema1BoxedNumber(Number data) { - this.data = data; - } + public record NumberJsonSchema1BoxedNumber(Number data) implements NumberJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class NumberJsonSchema1 extends JsonSchema implements NumberSchemaValidator { + public static class NumberJsonSchema1 extends JsonSchema implements NumberSchemaValidator { private static @Nullable NumberJsonSchema1 instance = null; protected NumberJsonSchema1() { @@ -100,5 +96,13 @@ public double validate(double arg, SchemaConfiguration configuration) { public NumberJsonSchema1BoxedNumber validateAndBox(Number arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new NumberJsonSchema1BoxedNumber(validate(arg, configuration)); } + + @Override + public NumberJsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } \ No newline at end of file diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/StringJsonSchema.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/StringJsonSchema.java index 2cd0e21f94d..749f5faba63 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/StringJsonSchema.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/StringJsonSchema.java @@ -21,20 +21,16 @@ import java.util.UUID; public class StringJsonSchema { - public static abstract sealed class StringJsonSchema1Boxed permits StringJsonSchema1BoxedString { - public abstract @Nullable Object data(); + public sealed interface StringJsonSchema1Boxed permits StringJsonSchema1BoxedString { + @Nullable Object getData(); } - public static final class StringJsonSchema1BoxedString extends StringJsonSchema1Boxed { - public final String data; - private StringJsonSchema1BoxedString(String data) { - this.data = data; - } + public record StringJsonSchema1BoxedString(String data) implements StringJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class StringJsonSchema1 extends JsonSchema implements StringSchemaValidator { + public static class StringJsonSchema1 extends JsonSchema implements StringSchemaValidator { private static @Nullable StringJsonSchema1 instance = null; protected StringJsonSchema1() { @@ -99,5 +95,13 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public StringJsonSchema1BoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new StringJsonSchema1BoxedString(validate(arg, configuration)); } + + @Override + public StringJsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/UuidJsonSchema.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/UuidJsonSchema.java index 2506b53a958..c2087929db7 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/UuidJsonSchema.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/UuidJsonSchema.java @@ -19,21 +19,17 @@ import java.util.UUID; public class UuidJsonSchema { - public static abstract sealed class UuidJsonSchema1Boxed permits UuidJsonSchema1BoxedString { - public abstract @Nullable Object data(); + public sealed interface UuidJsonSchema1Boxed permits UuidJsonSchema1BoxedString { + @Nullable Object getData(); } - public static final class UuidJsonSchema1BoxedString extends UuidJsonSchema1Boxed { - public final String data; - private UuidJsonSchema1BoxedString(String data) { - this.data = data; - } + public record UuidJsonSchema1BoxedString(String data) implements UuidJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class UuidJsonSchema1 extends JsonSchema implements StringSchemaValidator { + public static class UuidJsonSchema1 extends JsonSchema implements StringSchemaValidator { private static @Nullable UuidJsonSchema1 instance = null; protected UuidJsonSchema1() { @@ -87,5 +83,13 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public UuidJsonSchema1BoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new UuidJsonSchema1BoxedString(validate(arg, configuration)); } + + @Override + public UuidJsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } \ No newline at end of file diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/AdditionalPropertiesValidator.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/AdditionalPropertiesValidator.java index 2548452a115..64d9f476798 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/AdditionalPropertiesValidator.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/AdditionalPropertiesValidator.java @@ -43,7 +43,7 @@ public class AdditionalPropertiesValidator implements KeywordValidator { data.validationMetadata().validatedPathToSchemas(), data.validationMetadata().seenClasses() ); - JsonSchema addPropsSchema = JsonSchemaFactory.getInstance(additionalProperties); + JsonSchema addPropsSchema = JsonSchemaFactory.getInstance(additionalProperties); if (propValidationMetadata.validationRanEarlier(addPropsSchema)) { // todo add_deeper_validated_schemas continue; diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/AllOfValidator.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/AllOfValidator.java index 583017ea6b5..eb6bcf21d4a 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/AllOfValidator.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/AllOfValidator.java @@ -11,8 +11,8 @@ public class AllOfValidator implements KeywordValidator { return null; } PathToSchemasMap pathToSchemas = new PathToSchemasMap(); - for(Class allOfClass: allOf) { - JsonSchema allOfSchema = JsonSchemaFactory.getInstance(allOfClass); + for(Class> allOfClass: allOf) { + JsonSchema allOfSchema = JsonSchemaFactory.getInstance(allOfClass); PathToSchemasMap otherPathToSchemas = JsonSchema.validate(allOfSchema, data.arg(), data.validationMetadata()); pathToSchemas.update(otherPathToSchemas); } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/AnyOfValidator.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/AnyOfValidator.java index 062fa2eecdc..d466518d3fe 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/AnyOfValidator.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/AnyOfValidator.java @@ -16,8 +16,8 @@ public class AnyOfValidator implements KeywordValidator { return null; } PathToSchemasMap pathToSchemas = new PathToSchemasMap(); - List> validatedAnyOfClasses = new ArrayList<>(); - for(Class anyOfClass: anyOf) { + List>> validatedAnyOfClasses = new ArrayList<>(); + for(Class> anyOfClass: anyOf) { if (anyOfClass == data.schema().getClass()) { /* optimistically assume that schema will pass validation @@ -27,7 +27,7 @@ public class AnyOfValidator implements KeywordValidator { continue; } try { - JsonSchema anyOfSchema = JsonSchemaFactory.getInstance(anyOfClass); + JsonSchema anyOfSchema = JsonSchemaFactory.getInstance(anyOfClass); PathToSchemasMap otherPathToSchemas = JsonSchema.validate(anyOfSchema, data.arg(), data.validationMetadata()); validatedAnyOfClasses.add(anyOfClass); pathToSchemas.update(otherPathToSchemas); diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/DependentSchemasValidator.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/DependentSchemasValidator.java index 940157d3b48..e329529fe8a 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/DependentSchemasValidator.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/DependentSchemasValidator.java @@ -25,13 +25,13 @@ public class DependentSchemasValidator implements KeywordValidator { presentProperties.add((String) key); } } - for(Map.Entry> entry: dependentSchemas.entrySet()) { + for(Map.Entry>> entry: dependentSchemas.entrySet()) { String propName = entry.getKey(); if (!presentProperties.contains(propName)) { continue; } - Class dependentSchemaClass = entry.getValue(); - JsonSchema dependentSchema = JsonSchemaFactory.getInstance(dependentSchemaClass); + Class> dependentSchemaClass = entry.getValue(); + JsonSchema dependentSchema = JsonSchemaFactory.getInstance(dependentSchemaClass); PathToSchemasMap otherPathToSchemas = JsonSchema.validate(dependentSchema, mapArg, data.validationMetadata()); pathToSchemas.update(otherPathToSchemas); } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ElseValidator.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ElseValidator.java index b0ba9ecbc0a..3f50d9326c4 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ElseValidator.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ElseValidator.java @@ -22,7 +22,7 @@ public class ElseValidator implements KeywordValidator { // if validation is true return null; } - JsonSchema elseSchemaInstance = JsonSchemaFactory.getInstance(elseSchema); + JsonSchema elseSchemaInstance = JsonSchemaFactory.getInstance(elseSchema); PathToSchemasMap pathToSchemas = new PathToSchemasMap(); var elsePathToSchemas = JsonSchema.validate(elseSchemaInstance, data.arg(), data.validationMetadata()); // todo capture validation error and describe it as an else error? diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ItemsValidator.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ItemsValidator.java index 5bd194d47a9..1b03c0b3094 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ItemsValidator.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ItemsValidator.java @@ -22,7 +22,7 @@ public class ItemsValidator implements KeywordValidator { } PathToSchemasMap pathToSchemas = new PathToSchemasMap(); int minIndex = data.schema().prefixItems != null ? data.schema().prefixItems.size() : 0; - JsonSchema itemsSchema = JsonSchemaFactory.getInstance(items); + JsonSchema itemsSchema = JsonSchemaFactory.getInstance(items); for(int i = minIndex; i < listArg.size(); i++) { List itemPathToItem = new ArrayList<>(data.validationMetadata().pathToItem()); itemPathToItem.add(i); diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchema.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchema.java index 10d636e6b9d..beb7460b86c 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchema.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchema.java @@ -17,11 +17,11 @@ import java.util.UUID; import java.util.regex.Pattern; -public abstract class JsonSchema { +public abstract class JsonSchema { public final @Nullable Set> type; public final @Nullable String format; - public final @Nullable Class items; - public final @Nullable Map> properties; + public final @Nullable Class> items; + public final @Nullable Map>> properties; public final @Nullable Set required; public final @Nullable Number exclusiveMaximum; public final @Nullable Number exclusiveMinimum; @@ -34,11 +34,11 @@ public abstract class JsonSchema { public final @Nullable Number maximum; public final @Nullable Number minimum; public final @Nullable BigDecimal multipleOf; - public final @Nullable Class additionalProperties; - public final @Nullable List> allOf; - public final @Nullable List> anyOf; - public final @Nullable List> oneOf; - public final @Nullable Class not; + public final @Nullable Class> additionalProperties; + public final @Nullable List>> allOf; + public final @Nullable List>> anyOf; + public final @Nullable List>> oneOf; + public final @Nullable Class> not; public final @Nullable Boolean uniqueItems; public final @Nullable Set<@Nullable Object> enumValues; public final @Nullable Pattern pattern; @@ -46,19 +46,19 @@ public abstract class JsonSchema { public final boolean defaultValueSet; public final @Nullable Object constValue; public final boolean constValueSet; - public final @Nullable Class contains; + public final @Nullable Class> contains; public final @Nullable Integer maxContains; public final @Nullable Integer minContains; - public final @Nullable Class propertyNames; + public final @Nullable Class> propertyNames; public final @Nullable Map> dependentRequired; - public final @Nullable Map> dependentSchemas; - public final @Nullable Map> patternProperties; - public final @Nullable List> prefixItems; - public final @Nullable Class ifSchema; - public final @Nullable Class then; - public final @Nullable Class elseSchema; - public final @Nullable Class unevaluatedItems; - public final @Nullable Class unevaluatedProperties; + public final @Nullable Map>> dependentSchemas; + public final @Nullable Map>> patternProperties; + public final @Nullable List>> prefixItems; + public final @Nullable Class> ifSchema; + public final @Nullable Class> then; + public final @Nullable Class> elseSchema; + public final @Nullable Class> unevaluatedItems; + public final @Nullable Class> unevaluatedProperties; private final LinkedHashMap keywordToValidator; protected JsonSchema(JsonSchemaInfo jsonSchemaInfo) { @@ -223,6 +223,7 @@ protected JsonSchema(JsonSchemaInfo jsonSchemaInfo) { public abstract @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) throws InvalidTypeException; public abstract @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws InvalidTypeException, ValidationException; + public abstract T validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws InvalidTypeException, ValidationException; private List getContainsPathToSchemas( @Nullable Object arg, @@ -231,7 +232,7 @@ private List getContainsPathToSchemas( if (!(arg instanceof List listArg) || contains == null) { return new ArrayList<>(); } - JsonSchema containsSchema = JsonSchemaFactory.getInstance(contains); + JsonSchema containsSchema = JsonSchemaFactory.getInstance(contains); @Nullable List containsPathToSchemas = new ArrayList<>(); for(int i = 0; i < listArg.size(); i++) { PathToSchemasMap thesePathToSchemas = new PathToSchemasMap(); @@ -279,13 +280,13 @@ private PathToSchemasMap getPatternPropertiesPathToSchemas( validationMetadata.validatedPathToSchemas(), validationMetadata.seenClasses() ); - for (Map.Entry> patternPropEntry: patternProperties.entrySet()) { + for (Map.Entry>> patternPropEntry: patternProperties.entrySet()) { if (!patternPropEntry.getKey().matcher(key).find()) { continue; } - Class patternPropClass = patternPropEntry.getValue(); - JsonSchema patternPropSchema = JsonSchemaFactory.getInstance(patternPropClass); + Class> patternPropClass = patternPropEntry.getValue(); + JsonSchema patternPropSchema = JsonSchemaFactory.getInstance(patternPropClass); PathToSchemasMap otherPathToSchemas = JsonSchema.validate(patternPropSchema, entry.getValue(), propValidationMetadata); pathToSchemas.update(otherPathToSchemas); } @@ -300,7 +301,7 @@ private PathToSchemasMap getIfPathToSchemas( if (ifSchema == null) { return new PathToSchemasMap(); } - JsonSchema ifSchemaInstance = JsonSchemaFactory.getInstance(ifSchema); + JsonSchema ifSchemaInstance = JsonSchemaFactory.getInstance(ifSchema); PathToSchemasMap pathToSchemas = new PathToSchemasMap(); try { var otherPathToSchemas = JsonSchema.validate(ifSchemaInstance, arg, validationMetadata); @@ -310,7 +311,7 @@ private PathToSchemasMap getIfPathToSchemas( } public static PathToSchemasMap validate( - JsonSchema jsonSchema, + JsonSchema jsonSchema, @Nullable Object arg, ValidationMetadata validationMetadata ) throws ValidationException { @@ -361,7 +362,7 @@ public static PathToSchemasMap validate( if (!pathToSchemas.containsKey(pathToItem)) { pathToSchemas.put(validationMetadata.pathToItem(), new LinkedHashMap<>()); } - @Nullable LinkedHashMap schemas = pathToSchemas.get(pathToItem); + @Nullable LinkedHashMap, Void> schemas = pathToSchemas.get(pathToItem); if (schemas != null) { schemas.put(jsonSchema, null); } @@ -467,19 +468,19 @@ public String getNewInstance(String arg, List pathToItem, PathToSchemasM return arg; } - protected static PathToSchemasMap getPathToSchemas(JsonSchema jsonSchema, @Nullable Object arg, ValidationMetadata validationMetadata, Set> pathSet) { + protected static PathToSchemasMap getPathToSchemas(JsonSchema jsonSchema, @Nullable Object arg, ValidationMetadata validationMetadata, Set> pathSet) { PathToSchemasMap pathToSchemasMap = new PathToSchemasMap(); // todo add check of validationMetadata.validationRanEarlier(this) PathToSchemasMap otherPathToSchemas = validate(jsonSchema, arg, validationMetadata); pathToSchemasMap.update(otherPathToSchemas); for (var schemas: pathToSchemasMap.values()) { - JsonSchema firstSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema firstSchema = schemas.entrySet().iterator().next().getKey(); schemas.clear(); schemas.put(firstSchema, null); } pathSet.removeAll(pathToSchemasMap.keySet()); if (!pathSet.isEmpty()) { - LinkedHashMap unsetAnyTypeSchema = new LinkedHashMap<>(); + LinkedHashMap, Void> unsetAnyTypeSchema = new LinkedHashMap<>(); unsetAnyTypeSchema.put(UnsetAnyTypeJsonSchema.UnsetAnyTypeJsonSchema1.getInstance(), null); for (List pathToItem: pathSet) { pathToSchemasMap.put(pathToItem, unsetAnyTypeSchema); diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchemaFactory.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchemaFactory.java index 7c9b6402f2b..24729ac172d 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchemaFactory.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchemaFactory.java @@ -10,10 +10,10 @@ public class JsonSchemaFactory { - static Map, JsonSchema> classToInstance = new HashMap<>(); + static Map>, JsonSchema> classToInstance = new HashMap<>(); - public static V getInstance(Class schemaCls) { - @Nullable JsonSchema cacheInst = classToInstance.get(schemaCls); + public static > V getInstance(Class schemaCls) { + @Nullable JsonSchema cacheInst = classToInstance.get(schemaCls); if (cacheInst != null) { assert schemaCls.isInstance(cacheInst); return schemaCls.cast(cacheInst); diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchemaInfo.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchemaInfo.java index 8791c1c29ea..0a95fbbae6a 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchemaInfo.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchemaInfo.java @@ -18,13 +18,13 @@ public JsonSchemaInfo format(String format) { this.format = format; return this; } - public @Nullable Class items = null; - public JsonSchemaInfo items(Class items) { + public @Nullable Class> items = null; + public JsonSchemaInfo items(Class> items) { this.items = items; return this; } - public @Nullable Map> properties = null; - public JsonSchemaInfo properties(Map> properties) { + public @Nullable Map>> properties = null; + public JsonSchemaInfo properties(Map>> properties) { this.properties = properties; return this; } @@ -88,28 +88,28 @@ public JsonSchemaInfo multipleOf(BigDecimal multipleOf) { this.multipleOf = multipleOf; return this; } - public @Nullable Class additionalProperties; - public JsonSchemaInfo additionalProperties(Class additionalProperties) { + public @Nullable Class> additionalProperties; + public JsonSchemaInfo additionalProperties(Class> additionalProperties) { this.additionalProperties = additionalProperties; return this; } - public @Nullable List> allOf = null; - public JsonSchemaInfo allOf(List> allOf) { + public @Nullable List>> allOf = null; + public JsonSchemaInfo allOf(List>> allOf) { this.allOf = allOf; return this; } - public @Nullable List> anyOf = null; - public JsonSchemaInfo anyOf(List> anyOf) { + public @Nullable List>> anyOf = null; + public JsonSchemaInfo anyOf(List>> anyOf) { this.anyOf = anyOf; return this; } - public @Nullable List> oneOf = null; - public JsonSchemaInfo oneOf(List> oneOf) { + public @Nullable List>> oneOf = null; + public JsonSchemaInfo oneOf(List>> oneOf) { this.oneOf = oneOf; return this; } - public @Nullable Class not = null; - public JsonSchemaInfo not(Class not) { + public @Nullable Class> not = null; + public JsonSchemaInfo not(Class> not) { this.not = not; return this; } @@ -142,8 +142,8 @@ public JsonSchemaInfo constValue(@Nullable Object constValue) { this.constValueSet = true; return this; } - public @Nullable Class contains = null; - public JsonSchemaInfo contains(Class contains) { + public @Nullable Class> contains = null; + public JsonSchemaInfo contains(Class> contains) { this.contains = contains; return this; } @@ -157,8 +157,8 @@ public JsonSchemaInfo minContains(Integer minContains) { this.minContains = minContains; return this; } - public @Nullable Class propertyNames = null; - public JsonSchemaInfo propertyNames(Class propertyNames) { + public @Nullable Class> propertyNames = null; + public JsonSchemaInfo propertyNames(Class> propertyNames) { this.propertyNames = propertyNames; return this; } @@ -167,43 +167,43 @@ public JsonSchemaInfo dependentRequired(Map> dependentRequir this.dependentRequired = dependentRequired; return this; } - public @Nullable Map> dependentSchemas = null; - public JsonSchemaInfo dependentSchemas(Map> dependentSchemas) { + public @Nullable Map>> dependentSchemas = null; + public JsonSchemaInfo dependentSchemas(Map>> dependentSchemas) { this.dependentSchemas = dependentSchemas; return this; } - public @Nullable Map> patternProperties = null; - public JsonSchemaInfo patternProperties(Map> patternProperties) { + public @Nullable Map>> patternProperties = null; + public JsonSchemaInfo patternProperties(Map>> patternProperties) { this.patternProperties = patternProperties; return this; } - public @Nullable List> prefixItems = null; - public JsonSchemaInfo prefixItems(List> prefixItems) { + public @Nullable List>> prefixItems = null; + public JsonSchemaInfo prefixItems(List>> prefixItems) { this.prefixItems = prefixItems; return this; } - public @Nullable Class ifSchema = null; - public JsonSchemaInfo ifSchema(Class ifSchema) { + public @Nullable Class> ifSchema = null; + public JsonSchemaInfo ifSchema(Class> ifSchema) { this.ifSchema = ifSchema; return this; } - public @Nullable Class then = null; - public JsonSchemaInfo then(Class then) { + public @Nullable Class> then = null; + public JsonSchemaInfo then(Class> then) { this.then = then; return this; } - public @Nullable Class elseSchema = null; - public JsonSchemaInfo elseSchema(Class elseSchema) { + public @Nullable Class> elseSchema = null; + public JsonSchemaInfo elseSchema(Class> elseSchema) { this.elseSchema = elseSchema; return this; } - public @Nullable Class unevaluatedItems = null; - public JsonSchemaInfo unevaluatedItems(Class unevaluatedItems) { + public @Nullable Class> unevaluatedItems = null; + public JsonSchemaInfo unevaluatedItems(Class> unevaluatedItems) { this.unevaluatedItems = unevaluatedItems; return this; } - public @Nullable Class unevaluatedProperties = null; - public JsonSchemaInfo unevaluatedProperties(Class unevaluatedProperties) { + public @Nullable Class> unevaluatedProperties = null; + public JsonSchemaInfo unevaluatedProperties(Class> unevaluatedProperties) { this.unevaluatedProperties = unevaluatedProperties; return this; } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/NotValidator.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/NotValidator.java index aa61be1b624..b077e2056a1 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/NotValidator.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/NotValidator.java @@ -14,7 +14,7 @@ public class NotValidator implements KeywordValidator { } PathToSchemasMap pathToSchemas; try { - JsonSchema notSchema = JsonSchemaFactory.getInstance(not); + JsonSchema notSchema = JsonSchemaFactory.getInstance(not); pathToSchemas = JsonSchema.validate(notSchema, data.arg(), data.validationMetadata()); } catch (ValidationException e) { return null; diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/OneOfValidator.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/OneOfValidator.java index f84f7796a8c..3c4f4b5a085 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/OneOfValidator.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/OneOfValidator.java @@ -16,8 +16,8 @@ public class OneOfValidator implements KeywordValidator { return null; } PathToSchemasMap pathToSchemas = new PathToSchemasMap(); - List> validatedOneOfClasses = new ArrayList<>(); - for(Class oneOfClass: oneOf) { + List>> validatedOneOfClasses = new ArrayList<>(); + for(Class> oneOfClass: oneOf) { if (oneOfClass == data.schema().getClass()) { /* optimistically assume that schema will pass validation @@ -27,7 +27,7 @@ public class OneOfValidator implements KeywordValidator { continue; } try { - JsonSchema oneOfSchema = JsonSchemaFactory.getInstance(oneOfClass); + JsonSchema oneOfSchema = JsonSchemaFactory.getInstance(oneOfClass); PathToSchemasMap otherPathToSchemas = JsonSchema.validate(oneOfSchema, data.arg(), data.validationMetadata()); validatedOneOfClasses.add(oneOfClass); pathToSchemas.update(otherPathToSchemas); diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PathToSchemasMap.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PathToSchemasMap.java index 6e199334d4c..a3ce89066a2 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PathToSchemasMap.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PathToSchemasMap.java @@ -5,12 +5,12 @@ import java.util.Map; @SuppressWarnings("serial") -public class PathToSchemasMap extends LinkedHashMap, LinkedHashMap> { +public class PathToSchemasMap extends LinkedHashMap, LinkedHashMap, Void>> { public void update(PathToSchemasMap other) { - for (Map.Entry, LinkedHashMap> entry: other.entrySet()) { + for (Map.Entry, LinkedHashMap, Void>> entry: other.entrySet()) { List pathToItem = entry.getKey(); - LinkedHashMap otherSchemas = entry.getValue(); + LinkedHashMap, Void> otherSchemas = entry.getValue(); if (containsKey(pathToItem)) { get(pathToItem).putAll(otherSchemas); } else { diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PrefixItemsValidator.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PrefixItemsValidator.java index 00e5b17607b..237bc250190 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PrefixItemsValidator.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PrefixItemsValidator.java @@ -31,7 +31,7 @@ public class PrefixItemsValidator implements KeywordValidator { data.validationMetadata().validatedPathToSchemas(), data.validationMetadata().seenClasses() ); - JsonSchema itemsSchema = JsonSchemaFactory.getInstance(prefixItems.get(i)); + JsonSchema itemsSchema = JsonSchemaFactory.getInstance(prefixItems.get(i)); PathToSchemasMap otherPathToSchemas = JsonSchema.validate(itemsSchema, listArg.get(i), itemValidationMetadata); pathToSchemas.update(otherPathToSchemas); } diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PropertiesValidator.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PropertiesValidator.java index 17bccdd666a..b8ddd6fcb46 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PropertiesValidator.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PropertiesValidator.java @@ -27,7 +27,7 @@ public class PropertiesValidator implements KeywordValidator { presentProperties.add((String) key); } } - for(Map.Entry> entry: properties.entrySet()) { + for(Map.Entry>> entry: properties.entrySet()) { String propName = entry.getKey(); if (!presentProperties.contains(propName)) { continue; @@ -41,8 +41,8 @@ public class PropertiesValidator implements KeywordValidator { data.validationMetadata().validatedPathToSchemas(), data.validationMetadata().seenClasses() ); - Class propClass = entry.getValue(); - JsonSchema propSchema = JsonSchemaFactory.getInstance(propClass); + Class> propClass = entry.getValue(); + JsonSchema propSchema = JsonSchemaFactory.getInstance(propClass); if (propValidationMetadata.validationRanEarlier(propSchema)) { // todo add_deeper_validated_schemas continue; diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PropertyEntry.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PropertyEntry.java index aaaede643a0..8261eda6d49 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PropertyEntry.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PropertyEntry.java @@ -3,8 +3,8 @@ import java.util.AbstractMap; @SuppressWarnings("serial") -public class PropertyEntry extends AbstractMap.SimpleEntry> { - public PropertyEntry(String key, Class value) { +public class PropertyEntry extends AbstractMap.SimpleEntry>> { + public PropertyEntry(String key, Class> value) { super(key, value); } -} +} \ No newline at end of file diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PropertyNamesValidator.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PropertyNamesValidator.java index 55ea80b0382..087cd308b11 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PropertyNamesValidator.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PropertyNamesValidator.java @@ -18,7 +18,7 @@ public class PropertyNamesValidator implements KeywordValidator { if (!(data.arg() instanceof Map mapArg)) { return null; } - JsonSchema propertyNamesSchema = JsonSchemaFactory.getInstance(propertyNames); + JsonSchema propertyNamesSchema = JsonSchemaFactory.getInstance(propertyNames); for (Object objKey: mapArg.keySet()) { if (objKey instanceof String key) { List propPathToItem = new ArrayList<>(data.validationMetadata().pathToItem()); diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ThenValidator.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ThenValidator.java index ad97e0e554e..bf599bc812f 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ThenValidator.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ThenValidator.java @@ -22,7 +22,7 @@ public class ThenValidator implements KeywordValidator { // if validation is false return null; } - JsonSchema thenSchema = JsonSchemaFactory.getInstance(then); + JsonSchema thenSchema = JsonSchemaFactory.getInstance(then); PathToSchemasMap pathToSchemas = new PathToSchemasMap(); var thenPathToSchemas = JsonSchema.validate(thenSchema, data.arg(), data.validationMetadata()); // todo capture validation error and describe it as an then error? diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UnevaluatedItemsValidator.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UnevaluatedItemsValidator.java index cfb88550525..8903d0b19a7 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UnevaluatedItemsValidator.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UnevaluatedItemsValidator.java @@ -26,7 +26,7 @@ public class UnevaluatedItemsValidator implements KeywordValidator { } PathToSchemasMap pathToSchemas = new PathToSchemasMap(); int minIndex = data.schema().prefixItems != null ? data.schema().prefixItems.size() : 0; - JsonSchema unevaluatedItemsSchema = JsonSchemaFactory.getInstance(unevaluatedItems); + JsonSchema unevaluatedItemsSchema = JsonSchemaFactory.getInstance(unevaluatedItems); for(int i = minIndex; i < listArg.size(); i++) { List itemPathToItem = new ArrayList<>(data.validationMetadata().pathToItem()); itemPathToItem.add(i); diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UnevaluatedPropertiesValidator.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UnevaluatedPropertiesValidator.java index abc7f7e86f9..344c0cfab1b 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UnevaluatedPropertiesValidator.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UnevaluatedPropertiesValidator.java @@ -24,7 +24,7 @@ public class UnevaluatedPropertiesValidator implements KeywordValidator { return null; } PathToSchemasMap pathToSchemas = new PathToSchemasMap(); - JsonSchema unevaluatedPropertiesSchema = JsonSchemaFactory.getInstance(unevaluatedProperties); + JsonSchema unevaluatedPropertiesSchema = JsonSchemaFactory.getInstance(unevaluatedProperties); for(Map.Entry entry: mapArg.entrySet()) { if (!(entry.getKey() instanceof String propName)) { throw new InvalidTypeException("Map keys must be strings"); diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UnsetAnyTypeJsonSchema.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UnsetAnyTypeJsonSchema.java index 90b9e3b1870..1c23a427dd0 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UnsetAnyTypeJsonSchema.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UnsetAnyTypeJsonSchema.java @@ -19,70 +19,46 @@ import java.util.UUID; public class UnsetAnyTypeJsonSchema { - public static abstract sealed class UnsetAnyTypeJsonSchema1Boxed permits UnsetAnyTypeJsonSchema1BoxedVoid, UnsetAnyTypeJsonSchema1BoxedBoolean, UnsetAnyTypeJsonSchema1BoxedNumber, UnsetAnyTypeJsonSchema1BoxedString, UnsetAnyTypeJsonSchema1BoxedList, UnsetAnyTypeJsonSchema1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface UnsetAnyTypeJsonSchema1Boxed permits UnsetAnyTypeJsonSchema1BoxedVoid, UnsetAnyTypeJsonSchema1BoxedBoolean, UnsetAnyTypeJsonSchema1BoxedNumber, UnsetAnyTypeJsonSchema1BoxedString, UnsetAnyTypeJsonSchema1BoxedList, UnsetAnyTypeJsonSchema1BoxedMap { + @Nullable Object getData(); } - public static final class UnsetAnyTypeJsonSchema1BoxedVoid extends UnsetAnyTypeJsonSchema1Boxed { - public final Void data; - private UnsetAnyTypeJsonSchema1BoxedVoid(Void data) { - this.data = data; - } + public record UnsetAnyTypeJsonSchema1BoxedVoid(Void data) implements UnsetAnyTypeJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UnsetAnyTypeJsonSchema1BoxedBoolean extends UnsetAnyTypeJsonSchema1Boxed { - public final boolean data; - private UnsetAnyTypeJsonSchema1BoxedBoolean(boolean data) { - this.data = data; - } + public record UnsetAnyTypeJsonSchema1BoxedBoolean(boolean data) implements UnsetAnyTypeJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UnsetAnyTypeJsonSchema1BoxedNumber extends UnsetAnyTypeJsonSchema1Boxed { - public final Number data; - private UnsetAnyTypeJsonSchema1BoxedNumber(Number data) { - this.data = data; - } + public record UnsetAnyTypeJsonSchema1BoxedNumber(Number data) implements UnsetAnyTypeJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UnsetAnyTypeJsonSchema1BoxedString extends UnsetAnyTypeJsonSchema1Boxed { - public final String data; - private UnsetAnyTypeJsonSchema1BoxedString(String data) { - this.data = data; - } + public record UnsetAnyTypeJsonSchema1BoxedString(String data) implements UnsetAnyTypeJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UnsetAnyTypeJsonSchema1BoxedList extends UnsetAnyTypeJsonSchema1Boxed { - public final FrozenList<@Nullable Object> data; - private UnsetAnyTypeJsonSchema1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record UnsetAnyTypeJsonSchema1BoxedList(FrozenList<@Nullable Object> data) implements UnsetAnyTypeJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UnsetAnyTypeJsonSchema1BoxedMap extends UnsetAnyTypeJsonSchema1Boxed { - public final FrozenMap<@Nullable Object> data; - private UnsetAnyTypeJsonSchema1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record UnsetAnyTypeJsonSchema1BoxedMap(FrozenMap<@Nullable Object> data) implements UnsetAnyTypeJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class UnsetAnyTypeJsonSchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, UnsetAnyTypeJsonSchema1BoxedList>, MapSchemaValidator, UnsetAnyTypeJsonSchema1BoxedMap> { + public static class UnsetAnyTypeJsonSchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, UnsetAnyTypeJsonSchema1BoxedList>, MapSchemaValidator, UnsetAnyTypeJsonSchema1BoxedMap> { private static @Nullable UnsetAnyTypeJsonSchema1 instance = null; protected UnsetAnyTypeJsonSchema1() { @@ -179,11 +155,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object castItem = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; @@ -214,11 +190,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object castValue = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } @@ -278,25 +254,50 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public UnsetAnyTypeJsonSchema1BoxedVoid validateAndBox(Void arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new UnsetAnyTypeJsonSchema1BoxedVoid(validate(arg, configuration)); } + @Override public UnsetAnyTypeJsonSchema1BoxedBoolean validateAndBox(boolean arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new UnsetAnyTypeJsonSchema1BoxedBoolean(validate(arg, configuration)); } + @Override public UnsetAnyTypeJsonSchema1BoxedNumber validateAndBox(Number arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new UnsetAnyTypeJsonSchema1BoxedNumber(validate(arg, configuration)); } + @Override public UnsetAnyTypeJsonSchema1BoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new UnsetAnyTypeJsonSchema1BoxedString(validate(arg, configuration)); } + @Override public UnsetAnyTypeJsonSchema1BoxedList validateAndBox(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new UnsetAnyTypeJsonSchema1BoxedList(validate(arg, configuration)); } + @Override public UnsetAnyTypeJsonSchema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new UnsetAnyTypeJsonSchema1BoxedMap(validate(arg, configuration)); } + + @Override + public UnsetAnyTypeJsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } \ No newline at end of file diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ValidationData.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ValidationData.java index d5c4f5de75a..1563757d83a 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ValidationData.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ValidationData.java @@ -5,7 +5,7 @@ import java.util.List; public record ValidationData( - JsonSchema schema, + JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata, @Nullable List containsPathToSchemas, @@ -14,7 +14,7 @@ public record ValidationData( @Nullable PathToSchemasMap knownPathToSchemas ) { public ValidationData( - JsonSchema schema, + JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata ) { diff --git a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ValidationMetadata.java b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ValidationMetadata.java index 8d83f3b6207..9756257f507 100644 --- a/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ValidationMetadata.java +++ b/samples/client/3_1_0_unit_test/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ValidationMetadata.java @@ -13,8 +13,8 @@ public record ValidationMetadata( Set> seenClasses ) { - public boolean validationRanEarlier(JsonSchema schema) { - @Nullable Map validatedSchemas = validatedPathToSchemas.get(pathToItem); + public boolean validationRanEarlier(JsonSchema schema) { + @Nullable Map, Void> validatedSchemas = validatedPathToSchemas.get(pathToItem); if (validatedSchemas != null && validatedSchemas.containsKey(schema)) { return true; } diff --git a/samples/client/3_1_0_unit_test/java/src/test/java/org/openapijsonschematools/client/requestbody/RequestBodySerializerTest.java b/samples/client/3_1_0_unit_test/java/src/test/java/org/openapijsonschematools/client/requestbody/RequestBodySerializerTest.java index 0c618ead730..250d1e0f530 100644 --- a/samples/client/3_1_0_unit_test/java/src/test/java/org/openapijsonschematools/client/requestbody/RequestBodySerializerTest.java +++ b/samples/client/3_1_0_unit_test/java/src/test/java/org/openapijsonschematools/client/requestbody/RequestBodySerializerTest.java @@ -2,7 +2,8 @@ import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.schemas.MapJsonSchema; +import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.StringJsonSchema; import org.checkerframework.checker.nullness.qual.Nullable; import org.junit.Assert; @@ -11,73 +12,59 @@ import java.net.http.HttpResponse; import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; +import java.util.AbstractMap; import java.util.List; import java.util.Map; import java.util.concurrent.Flow; public final class RequestBodySerializerTest { + public sealed interface SealedMediaType permits ApplicationjsonMediaType, TextplainMediaType {} + public record ApplicationjsonMediaType(AnyTypeJsonSchema.AnyTypeJsonSchema1 schema) implements SealedMediaType {} + public record TextplainMediaType(StringJsonSchema.StringJsonSchema1 schema) implements SealedMediaType {} - public static abstract sealed class SealedRequestBody permits ApplicationjsonRequestBody, TextplainRequestBody {} - public static final class ApplicationjsonRequestBody extends SealedRequestBody implements GenericRequestBody<@Nullable Object> { - private final String contentType; - private final @Nullable Object body; - public ApplicationjsonRequestBody(@Nullable Object body) { - contentType = "application/json"; - this.body = body; - } + public sealed interface SealedRequestBody permits ApplicationjsonRequestBody, TextplainRequestBody {} + public record ApplicationjsonRequestBody(AnyTypeJsonSchema.AnyTypeJsonSchema1Boxed body) implements SealedRequestBody, GenericRequestBody<@Nullable Object> { @Override public String contentType() { - return contentType; - } - - @Override - public @Nullable Object body() { - return body; + return "application/json"; } } - public static final class TextplainRequestBody extends SealedRequestBody implements GenericRequestBody<@Nullable Object> { - private final String contentType; - private final @Nullable Object body; - public TextplainRequestBody(@Nullable Object body) { - contentType = "text/plain"; - this.body = body; - } + public record TextplainRequestBody(StringJsonSchema.StringJsonSchema1Boxed body) implements SealedRequestBody, GenericRequestBody<@Nullable Object> { @Override public String contentType() { - return contentType; - } - - @Override - public @Nullable Object body() { - return body; + return "text/plain"; } } - public static class MyRequestBodySerializer extends RequestBodySerializer { + public static class MyRequestBodySerializer extends RequestBodySerializer { public MyRequestBodySerializer() { - super(Map.of(), true); + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType(AnyTypeJsonSchema.AnyTypeJsonSchema1.getInstance())), + new AbstractMap.SimpleEntry<>("text/plain", new TextplainMediaType(StringJsonSchema.StringJsonSchema1.getInstance())) + ), + true); } public SerializedRequestBody serialize(SealedRequestBody requestBody) { if (requestBody instanceof ApplicationjsonRequestBody requestBody0) { - return serialize(requestBody0.contentType(), requestBody0.body()); + return serialize(requestBody0.contentType(), requestBody0.body().getData()); } else { TextplainRequestBody requestBody1 = (TextplainRequestBody) requestBody; - return serialize(requestBody1.contentType(), requestBody1.body()); + return serialize(requestBody1.contentType(), requestBody1.body().getData()); } } } @Test public void testContentTypeIsJson() { - var serializer = new MyRequestBodySerializer(); - Assert.assertTrue(serializer.contentTypeIsJson("application/json")); - Assert.assertTrue(serializer.contentTypeIsJson("application/json; charset=UTF-8")); - Assert.assertTrue(serializer.contentTypeIsJson("application/json-patch+json")); - Assert.assertTrue(serializer.contentTypeIsJson("application/geo+json")); + Assert.assertTrue(RequestBodySerializer.contentTypeIsJson("application/json")); + Assert.assertTrue(RequestBodySerializer.contentTypeIsJson("application/json; charset=UTF-8")); + Assert.assertTrue(RequestBodySerializer.contentTypeIsJson("application/json-patch+json")); + Assert.assertTrue(RequestBodySerializer.contentTypeIsJson("application/geo+json")); - Assert.assertFalse(serializer.contentTypeIsJson("application/octet-stream")); - Assert.assertFalse(serializer.contentTypeIsJson("text/plain")); + Assert.assertFalse(RequestBodySerializer.contentTypeIsJson("application/octet-stream")); + Assert.assertFalse(RequestBodySerializer.contentTypeIsJson("text/plain")); } static final class StringSubscriber implements Flow.Subscriber { @@ -101,63 +88,91 @@ private String getJsonBody(SerializedRequestBody requestBody) { var bodySubscriber = HttpResponse.BodySubscribers.ofString(StandardCharsets.UTF_8); var flowSubscriber = new StringSubscriber(bodySubscriber); requestBody.bodyPublisher.subscribe(flowSubscriber); - return bodySubscriber.getBody().toCompletableFuture().join(); } @Test public void testSerializeApplicationJson() { + SchemaConfiguration configuration = new SchemaConfiguration(JsonSchemaKeywordFlags.ofNone()); var serializer = new MyRequestBodySerializer(); String jsonBody; - SerializedRequestBody requestBody = serializer.serialize(new ApplicationjsonRequestBody(1)); + SerializedRequestBody requestBody = serializer.serialize( + new ApplicationjsonRequestBody( + AnyTypeJsonSchema.AnyTypeJsonSchema1.getInstance().validateAndBox(1, configuration) + ) + ); Assert.assertEquals("application/json", requestBody.contentType); jsonBody = getJsonBody(requestBody); Assert.assertEquals(jsonBody, "1"); - requestBody = serializer.serialize(new ApplicationjsonRequestBody(3.14)); + requestBody = serializer.serialize( + new ApplicationjsonRequestBody( + AnyTypeJsonSchema.AnyTypeJsonSchema1.getInstance().validateAndBox(3.14, configuration) + ) + ); jsonBody = getJsonBody(requestBody); Assert.assertEquals(jsonBody, "3.14"); - requestBody = serializer.serialize(new ApplicationjsonRequestBody(null)); + requestBody = serializer.serialize( + new ApplicationjsonRequestBody( + AnyTypeJsonSchema.AnyTypeJsonSchema1.getInstance().validateAndBox((Void) null, configuration) + ) + ); jsonBody = getJsonBody(requestBody); Assert.assertEquals(jsonBody, "null"); - requestBody = serializer.serialize(new ApplicationjsonRequestBody(true)); + requestBody = serializer.serialize( + new ApplicationjsonRequestBody( + AnyTypeJsonSchema.AnyTypeJsonSchema1.getInstance().validateAndBox(true, configuration) + ) + ); jsonBody = getJsonBody(requestBody); Assert.assertEquals(jsonBody, "true"); - requestBody = serializer.serialize(new ApplicationjsonRequestBody(false)); + requestBody = serializer.serialize( + new ApplicationjsonRequestBody( + AnyTypeJsonSchema.AnyTypeJsonSchema1.getInstance().validateAndBox(false, configuration) + ) + ); jsonBody = getJsonBody(requestBody); Assert.assertEquals(jsonBody, "false"); - - requestBody = serializer.serialize(new ApplicationjsonRequestBody(List.of())); + requestBody = serializer.serialize( + new ApplicationjsonRequestBody( + AnyTypeJsonSchema.AnyTypeJsonSchema1.getInstance().validateAndBox(List.of(), configuration) + ) + ); jsonBody = getJsonBody(requestBody); Assert.assertEquals(jsonBody, "[]"); - requestBody = serializer.serialize(new ApplicationjsonRequestBody(Map.of())); + requestBody = serializer.serialize( + new ApplicationjsonRequestBody( + AnyTypeJsonSchema.AnyTypeJsonSchema1.getInstance().validateAndBox(Map.of(), configuration) + ) + ); jsonBody = getJsonBody(requestBody); Assert.assertEquals(jsonBody, "{}"); - SchemaConfiguration configuration = new SchemaConfiguration(JsonSchemaKeywordFlags.ofNone()); - MapJsonSchema.MapJsonSchema1 mapJsonSchema = MapJsonSchema.MapJsonSchema1.getInstance(); - var frozenMap = mapJsonSchema.validate(Map.of("k1", "v1", "k2", "v2"), configuration); - requestBody = serializer.serialize(new ApplicationjsonRequestBody(frozenMap)); + requestBody = serializer.serialize( + new ApplicationjsonRequestBody( + AnyTypeJsonSchema.AnyTypeJsonSchema1.getInstance().validateAndBox(Map.of("k1", "v1", "k2", "v2"), configuration) + ) + ); jsonBody = getJsonBody(requestBody); Assert.assertEquals(jsonBody, "{\"k2\":\"v2\",\"k1\":\"v1\"}"); } @Test public void testSerializeTextPlain() { + SchemaConfiguration configuration = new SchemaConfiguration(JsonSchemaKeywordFlags.ofNone()); var serializer = new MyRequestBodySerializer(); - SerializedRequestBody requestBody = serializer.serialize(new TextplainRequestBody("a")); + SerializedRequestBody requestBody = serializer.serialize( + new TextplainRequestBody( + StringJsonSchema.StringJsonSchema1.getInstance().validateAndBox("a", configuration) + ) + ); Assert.assertEquals("text/plain", requestBody.contentType); String textBody = getJsonBody(requestBody); Assert.assertEquals(textBody, "a"); - - Assert.assertThrows( - RuntimeException.class, - () -> serializer.serialize(new TextplainRequestBody(null)) - ); } } \ No newline at end of file diff --git a/samples/client/3_1_0_unit_test/java/src/test/java/org/openapijsonschematools/client/response/ResponseDeserializerTest.java b/samples/client/3_1_0_unit_test/java/src/test/java/org/openapijsonschematools/client/response/ResponseDeserializerTest.java new file mode 100644 index 00000000000..50795dc89a9 --- /dev/null +++ b/samples/client/3_1_0_unit_test/java/src/test/java/org/openapijsonschematools/client/response/ResponseDeserializerTest.java @@ -0,0 +1,255 @@ +package org.openapijsonschematools.client.response; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.ToNumberPolicy; +import org.checkerframework.checker.nullness.qual.Nullable; +import org.junit.Assert; +import org.junit.Test; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.StringJsonSchema; + +import javax.net.ssl.SSLSession; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpHeaders; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.function.BiPredicate; + +public class ResponseDeserializerTest { + private static final Gson gson = new GsonBuilder() + .setObjectToNumberStrategy(ToNumberPolicy.LONG_OR_DOUBLE) + .setNumberToNumberStrategy(ToNumberPolicy.LONG_OR_DOUBLE) + .create(); + public sealed interface SealedResponseBody permits ApplicationjsonBody, TextplainBody { } + + public record ApplicationjsonBody(AnyTypeJsonSchema.AnyTypeJsonSchema1Boxed body) implements SealedResponseBody { } + + public record TextplainBody(StringJsonSchema.StringJsonSchema1Boxed body) implements SealedResponseBody {} + + public sealed interface SealedMediaType permits ApplicationjsonMediatype, TextplainMediatype { } + + public record ApplicationjsonMediatype(AnyTypeJsonSchema.AnyTypeJsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediatype() { + this(AnyTypeJsonSchema.AnyTypeJsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + + public record TextplainMediatype(StringJsonSchema.StringJsonSchema1 schema) implements SealedMediaType, MediaType { + public TextplainMediatype() { + this(StringJsonSchema.StringJsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + + public static class MyResponseDeserializer extends ResponseDeserializer { + + public MyResponseDeserializer() { + super(Map.of("application/json", new ApplicationjsonMediatype(), "text/plain", new TextplainMediatype())); + } + + @Override + protected SealedResponseBody getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + SealedMediaType mediaType = content.get(contentType); + if (mediaType == null) { + throw new RuntimeException("Invalid contentType was received back from the server that does not exist in the openapi document"); + } + if (mediaType instanceof ApplicationjsonMediatype thisMediaType) { + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonBody(deserializedBody); + } else { + TextplainMediatype thisMediaType = (TextplainMediatype) mediaType; + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new TextplainBody(deserializedBody); + } + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } + + public static class BytesHttpResponse implements HttpResponse { + private final byte[] body; + private final HttpHeaders headers; + private final HttpRequest request; + private final URI uri; + private final HttpClient.Version version; + public BytesHttpResponse(byte[] body, String contentType) { + this.body = body; + BiPredicate headerFilter = (key, val) -> true; + headers = HttpHeaders.of(Map.of("Content-Type", List.of(contentType)), headerFilter); + uri = URI.create("https://abc.com/"); + request = HttpRequest.newBuilder().uri(uri).build(); + version = HttpClient.Version.HTTP_2; + } + + @Override + public int statusCode() { + return 202; + } + + @Override + public HttpRequest request() { + return request; + } + + @Override + public Optional> previousResponse() { + return Optional.empty(); + } + + @Override + public HttpHeaders headers() { + return headers; + } + + @Override + public byte[] body() { + return body; + } + + @Override + public Optional sslSession() { + return Optional.empty(); + } + + @Override + public URI uri() { + return uri; + } + + @Override + public HttpClient.Version version() { + return version; + } + } + + @SuppressWarnings("nullness") + private String toJson(@Nullable Object body) { + return gson.toJson(body); + } + + @SuppressWarnings("nullness") + private void assertNull(@Nullable Object object) { + Assert.assertNull(object); + } + + @Test + public void testDeserializeApplicationJsonNull() { + var deserializer = new MyResponseDeserializer(); + byte[] bodyBytes = toJson(null).getBytes(StandardCharsets.UTF_8); + BytesHttpResponse response = new BytesHttpResponse(bodyBytes, "application/json"); + SchemaConfiguration configuration = new SchemaConfiguration(JsonSchemaKeywordFlags.ofNone()); + ApiResponse apiResponse = deserializer.deserialize(response, configuration); + Assert.assertEquals(response, apiResponse.response()); + if (!(apiResponse.body() instanceof ApplicationjsonBody jsonBody)) { + throw new RuntimeException("body must be type ApplicationjsonBody"); + } + if (!(jsonBody.body() instanceof AnyTypeJsonSchema.AnyTypeJsonSchema1BoxedVoid boxedVoid)) { + throw new RuntimeException("body must be type AnyTypeJsonSchema1BoxedVoid"); + } + assertNull(boxedVoid.data()); + } + + @Test + public void testDeserializeApplicationJsonTrue() { + var deserializer = new MyResponseDeserializer(); + byte[] bodyBytes = toJson(true).getBytes(StandardCharsets.UTF_8); + BytesHttpResponse response = new BytesHttpResponse(bodyBytes, "application/json"); + SchemaConfiguration configuration = new SchemaConfiguration(JsonSchemaKeywordFlags.ofNone()); + ApiResponse apiResponse = deserializer.deserialize(response, configuration); + Assert.assertEquals(response, apiResponse.response()); + if (!(apiResponse.body() instanceof ApplicationjsonBody jsonBody)) { + throw new RuntimeException("body must be type ApplicationjsonBody"); + } + if (!(jsonBody.body() instanceof AnyTypeJsonSchema.AnyTypeJsonSchema1BoxedBoolean boxedBoolean)) { + throw new RuntimeException("body must be type AnyTypeJsonSchema1BoxedBoolean"); + } + Assert.assertTrue(boxedBoolean.data()); + } + + @Test + public void testDeserializeApplicationJsonFalse() { + var deserializer = new MyResponseDeserializer(); + byte[] bodyBytes = toJson(false).getBytes(StandardCharsets.UTF_8); + BytesHttpResponse response = new BytesHttpResponse(bodyBytes, "application/json"); + SchemaConfiguration configuration = new SchemaConfiguration(JsonSchemaKeywordFlags.ofNone()); + ApiResponse apiResponse = deserializer.deserialize(response, configuration); + Assert.assertEquals(response, apiResponse.response()); + if (!(apiResponse.body() instanceof ApplicationjsonBody jsonBody)) { + throw new RuntimeException("body must be type ApplicationjsonBody"); + } + if (!(jsonBody.body() instanceof AnyTypeJsonSchema.AnyTypeJsonSchema1BoxedBoolean boxedBoolean)) { + throw new RuntimeException("body must be type AnyTypeJsonSchema1BoxedBoolean"); + } + Assert.assertFalse(boxedBoolean.data()); + } + + @Test + public void testDeserializeApplicationJsonInt() { + var deserializer = new MyResponseDeserializer(); + byte[] bodyBytes = toJson(1).getBytes(StandardCharsets.UTF_8); + BytesHttpResponse response = new BytesHttpResponse(bodyBytes, "application/json"); + SchemaConfiguration configuration = new SchemaConfiguration(JsonSchemaKeywordFlags.ofNone()); + ApiResponse apiResponse = deserializer.deserialize(response, configuration); + Assert.assertEquals(response, apiResponse.response()); + if (!(apiResponse.body() instanceof ApplicationjsonBody jsonBody)) { + throw new RuntimeException("body must be type ApplicationjsonBody"); + } + if (!(jsonBody.body() instanceof AnyTypeJsonSchema.AnyTypeJsonSchema1BoxedNumber boxedNumber)) { + throw new RuntimeException("body must be type AnyTypeJsonSchema1BoxedNumber"); + } + Assert.assertEquals(boxedNumber.data(), 1L); + } + + @Test + public void testDeserializeApplicationJsonFloat() { + var deserializer = new MyResponseDeserializer(); + byte[] bodyBytes = toJson(3.14).getBytes(StandardCharsets.UTF_8); + BytesHttpResponse response = new BytesHttpResponse(bodyBytes, "application/json"); + SchemaConfiguration configuration = new SchemaConfiguration(JsonSchemaKeywordFlags.ofNone()); + ApiResponse apiResponse = deserializer.deserialize(response, configuration); + Assert.assertEquals(response, apiResponse.response()); + if (!(apiResponse.body() instanceof ApplicationjsonBody jsonBody)) { + throw new RuntimeException("body must be type ApplicationjsonBody"); + } + if (!(jsonBody.body() instanceof AnyTypeJsonSchema.AnyTypeJsonSchema1BoxedNumber boxedNumber)) { + throw new RuntimeException("body must be type AnyTypeJsonSchema1BoxedNumber"); + } + Assert.assertEquals(boxedNumber.data(), 3.14); + } + + @Test + public void testDeserializeApplicationJsonString() { + var deserializer = new MyResponseDeserializer(); + byte[] bodyBytes = toJson("a").getBytes(StandardCharsets.UTF_8); + BytesHttpResponse response = new BytesHttpResponse(bodyBytes, "application/json"); + SchemaConfiguration configuration = new SchemaConfiguration(JsonSchemaKeywordFlags.ofNone()); + ApiResponse apiResponse = deserializer.deserialize(response, configuration); + Assert.assertEquals(response, apiResponse.response()); + if (!(apiResponse.body() instanceof ApplicationjsonBody jsonBody)) { + throw new RuntimeException("body must be type ApplicationjsonBody"); + } + if (!(jsonBody.body() instanceof AnyTypeJsonSchema.AnyTypeJsonSchema1BoxedString boxedString)) { + throw new RuntimeException("body must be type AnyTypeJsonSchema1BoxedString"); + } + Assert.assertEquals(boxedString.data(), "a"); + } +} \ No newline at end of file diff --git a/samples/client/3_1_0_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/ArrayTypeSchemaTest.java b/samples/client/3_1_0_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/ArrayTypeSchemaTest.java index a5cb7cd0519..42dfcabf0d0 100644 --- a/samples/client/3_1_0_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/ArrayTypeSchemaTest.java +++ b/samples/client/3_1_0_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/ArrayTypeSchemaTest.java @@ -31,16 +31,12 @@ public class ArrayTypeSchemaTest { new LinkedHashSet<>() ); - public static abstract sealed class ArrayWithItemsSchemaBoxed permits ArrayWithItemsSchemaBoxedList { + public sealed interface ArrayWithItemsSchemaBoxed permits ArrayWithItemsSchemaBoxedList { } - public static final class ArrayWithItemsSchemaBoxedList extends ArrayWithItemsSchemaBoxed { - public final FrozenList data; - private ArrayWithItemsSchemaBoxedList(FrozenList data) { - this.data = data; - } + public record ArrayWithItemsSchemaBoxedList(FrozenList data) implements ArrayWithItemsSchemaBoxed { } - public static class ArrayWithItemsSchema extends JsonSchema implements ListSchemaValidator, ArrayWithItemsSchemaBoxedList> { + public static class ArrayWithItemsSchema extends JsonSchema implements ListSchemaValidator, ArrayWithItemsSchemaBoxedList> { public ArrayWithItemsSchema() { super(new JsonSchemaInfo() .type(Set.of(List.class)) @@ -55,11 +51,11 @@ public FrozenList getNewInstance(List arg, List pathToItem, P for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object castItem = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(castItem instanceof String)) { throw new InvalidTypeException("Instantiated type of item is invalid"); @@ -100,6 +96,14 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); } + + @Override + public ArrayWithItemsSchemaBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws InvalidTypeException, ValidationException { + if (arg instanceof List listArg) { + return new ArrayWithItemsSchemaBoxedList(validate(listArg, configuration)); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class ArrayWithOutputClsSchemaList extends FrozenList { @@ -112,15 +116,11 @@ public static ArrayWithOutputClsSchemaList of(List arg, SchemaConfigurat } } - public static abstract sealed class ArrayWithOutputClsSchemaBoxed permits ArrayWithOutputClsSchemaBoxedList { + public sealed interface ArrayWithOutputClsSchemaBoxed permits ArrayWithOutputClsSchemaBoxedList { } - public static final class ArrayWithOutputClsSchemaBoxedList extends ArrayWithOutputClsSchemaBoxed { - public final ArrayWithOutputClsSchemaList data; - private ArrayWithOutputClsSchemaBoxedList(ArrayWithOutputClsSchemaList data) { - this.data = data; - } + public record ArrayWithOutputClsSchemaBoxedList(ArrayWithOutputClsSchemaList data) implements ArrayWithOutputClsSchemaBoxed { } - public static class ArrayWithOutputClsSchema extends JsonSchema implements ListSchemaValidator { + public static class ArrayWithOutputClsSchema extends JsonSchema implements ListSchemaValidator { public ArrayWithOutputClsSchema() { super(new JsonSchemaInfo() .type(Set.of(List.class)) @@ -136,11 +136,11 @@ public ArrayWithOutputClsSchemaList getNewInstance(List arg, List pat for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object castItem = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(castItem instanceof String)) { throw new InvalidTypeException("Instantiated type of item is invalid"); @@ -182,6 +182,14 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); } + + @Override + public ArrayWithOutputClsSchemaBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws InvalidTypeException, ValidationException { + if (arg instanceof List listArg) { + return new ArrayWithOutputClsSchemaBoxedList(validate(listArg, configuration)); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } @Test diff --git a/samples/client/3_1_0_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/ObjectTypeSchemaTest.java b/samples/client/3_1_0_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/ObjectTypeSchemaTest.java index acd412b00d1..02729b0f046 100644 --- a/samples/client/3_1_0_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/ObjectTypeSchemaTest.java +++ b/samples/client/3_1_0_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/ObjectTypeSchemaTest.java @@ -33,15 +33,11 @@ public class ObjectTypeSchemaTest { new LinkedHashSet<>() ); - public static abstract sealed class ObjectWithPropsSchemaBoxed permits ObjectWithPropsSchemaBoxedMap { + public sealed interface ObjectWithPropsSchemaBoxed permits ObjectWithPropsSchemaBoxedMap { } - public static final class ObjectWithPropsSchemaBoxedMap extends ObjectWithPropsSchemaBoxed { - public final FrozenMap<@Nullable Object> data; - private ObjectWithPropsSchemaBoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record ObjectWithPropsSchemaBoxedMap(FrozenMap<@Nullable Object> data) implements ObjectWithPropsSchemaBoxed { } - public static class ObjectWithPropsSchema extends JsonSchema implements MapSchemaValidator, ObjectWithPropsSchemaBoxedMap> { + public static class ObjectWithPropsSchema extends JsonSchema implements MapSchemaValidator, ObjectWithPropsSchemaBoxedMap> { private static @Nullable ObjectWithPropsSchema instance = null; private ObjectWithPropsSchema() { super(new JsonSchemaInfo() @@ -72,11 +68,11 @@ public static ObjectWithPropsSchema getInstance() { List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object castValue = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } @@ -113,18 +109,22 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); } + + @Override + public ObjectWithPropsSchemaBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws InvalidTypeException, ValidationException { + if (arg instanceof Map mapArg) { + return new ObjectWithPropsSchemaBoxedMap(validate(mapArg, configuration)); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class ObjectWithAddpropsSchemaBoxed permits ObjectWithAddpropsSchemaBoxedMap { + public sealed interface ObjectWithAddpropsSchemaBoxed permits ObjectWithAddpropsSchemaBoxedMap { } - public static final class ObjectWithAddpropsSchemaBoxedMap extends ObjectWithAddpropsSchemaBoxed { - public final FrozenMap data; - private ObjectWithAddpropsSchemaBoxedMap(FrozenMap data) { - this.data = data; - } + public record ObjectWithAddpropsSchemaBoxedMap(FrozenMap data) implements ObjectWithAddpropsSchemaBoxed { } - public static class ObjectWithAddpropsSchema extends JsonSchema implements MapSchemaValidator, ObjectWithAddpropsSchemaBoxedMap> { + public static class ObjectWithAddpropsSchema extends JsonSchema implements MapSchemaValidator, ObjectWithAddpropsSchemaBoxedMap> { private static @Nullable ObjectWithAddpropsSchema instance = null; private ObjectWithAddpropsSchema() { super(new JsonSchemaInfo() @@ -152,11 +152,11 @@ public FrozenMap getNewInstance(Map arg, List pathToItem, List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object castValue = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(castValue instanceof String)) { throw new InvalidTypeException("Invalid type for property value"); @@ -189,6 +189,14 @@ public ObjectWithAddpropsSchemaBoxedMap validateAndBox(Map arg, SchemaConf throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); } + @Override + public ObjectWithAddpropsSchemaBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws InvalidTypeException, ValidationException { + if (arg instanceof Map mapArg) { + return new ObjectWithAddpropsSchemaBoxedMap(validate(mapArg, configuration)); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + @Override public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof Map) { @@ -198,15 +206,11 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } } - public static abstract sealed class ObjectWithPropsAndAddpropsSchemaBoxed permits ObjectWithPropsAndAddpropsSchemaBoxedMap { + public sealed interface ObjectWithPropsAndAddpropsSchemaBoxed permits ObjectWithPropsAndAddpropsSchemaBoxedMap { } - public static final class ObjectWithPropsAndAddpropsSchemaBoxedMap extends ObjectWithPropsAndAddpropsSchemaBoxed { - public final FrozenMap<@Nullable Object> data; - private ObjectWithPropsAndAddpropsSchemaBoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record ObjectWithPropsAndAddpropsSchemaBoxedMap(FrozenMap<@Nullable Object> data) implements ObjectWithPropsAndAddpropsSchemaBoxed { } - public static class ObjectWithPropsAndAddpropsSchema extends JsonSchema implements MapSchemaValidator, ObjectWithPropsAndAddpropsSchemaBoxedMap> { + public static class ObjectWithPropsAndAddpropsSchema extends JsonSchema implements MapSchemaValidator, ObjectWithPropsAndAddpropsSchemaBoxedMap> { private static @Nullable ObjectWithPropsAndAddpropsSchema instance = null; private ObjectWithPropsAndAddpropsSchema() { super(new JsonSchemaInfo() @@ -237,11 +241,11 @@ public static ObjectWithPropsAndAddpropsSchema getInstance() { List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object castValue = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } @@ -271,6 +275,14 @@ public ObjectWithPropsAndAddpropsSchemaBoxedMap validateAndBox(Map arg, Sc throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); } + @Override + public ObjectWithPropsAndAddpropsSchemaBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws InvalidTypeException, ValidationException { + if (arg instanceof Map mapArg) { + return new ObjectWithPropsAndAddpropsSchemaBoxedMap(validate(mapArg, configuration)); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + @Override public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof Map) { @@ -290,15 +302,11 @@ public static ObjectWithOutputTypeSchemaMap of(Map arg, SchemaCo } } - public static abstract sealed class ObjectWithOutputTypeSchemaBoxed permits ObjectWithOutputTypeSchemaBoxedMap { + public sealed interface ObjectWithOutputTypeSchemaBoxed permits ObjectWithOutputTypeSchemaBoxedMap { } - public static final class ObjectWithOutputTypeSchemaBoxedMap extends ObjectWithOutputTypeSchemaBoxed { - public final ObjectWithOutputTypeSchemaMap data; - private ObjectWithOutputTypeSchemaBoxedMap(ObjectWithOutputTypeSchemaMap data) { - this.data = data; - } + public record ObjectWithOutputTypeSchemaBoxedMap(ObjectWithOutputTypeSchemaMap data) implements ObjectWithOutputTypeSchemaBoxed { } - public static class ObjectWithOutputTypeSchema extends JsonSchema implements MapSchemaValidator { + public static class ObjectWithOutputTypeSchema extends JsonSchema implements MapSchemaValidator { private static @Nullable ObjectWithOutputTypeSchema instance = null; public ObjectWithOutputTypeSchema() { super(new JsonSchemaInfo() @@ -328,11 +336,11 @@ public ObjectWithOutputTypeSchemaMap getNewInstance(Map arg, List List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object castValue = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } @@ -362,6 +370,14 @@ public ObjectWithOutputTypeSchemaBoxedMap validateAndBox(Map arg, SchemaCo throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); } + @Override + public ObjectWithOutputTypeSchemaBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws InvalidTypeException, ValidationException { + if (arg instanceof Map mapArg) { + return new ObjectWithOutputTypeSchemaBoxedMap(validate(mapArg, configuration)); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + @Override public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof FrozenMap) { diff --git a/samples/client/3_1_0_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/AdditionalPropertiesValidatorTest.java b/samples/client/3_1_0_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/AdditionalPropertiesValidatorTest.java index 5bf7ee3b6b5..40a01c9983d 100644 --- a/samples/client/3_1_0_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/AdditionalPropertiesValidatorTest.java +++ b/samples/client/3_1_0_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/AdditionalPropertiesValidatorTest.java @@ -18,7 +18,10 @@ import java.util.Set; public class AdditionalPropertiesValidatorTest { - public static class ObjectWithPropsSchema extends JsonSchema { + public sealed interface ObjectWithPropsSchemaBoxed permits ObjectWithPropsSchemaBoxedMap {} + public record ObjectWithPropsSchemaBoxedMap() implements ObjectWithPropsSchemaBoxed {} + + public static class ObjectWithPropsSchema extends JsonSchema { private static @Nullable ObjectWithPropsSchema instance = null; private ObjectWithPropsSchema() { super(new JsonSchemaInfo() @@ -53,6 +56,11 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); } + + @Override + public ObjectWithPropsSchemaBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws InvalidTypeException, ValidationException { + return new ObjectWithPropsSchemaBoxedMap(); + } } @SuppressWarnings("nullness") @@ -88,7 +96,7 @@ public void testCorrectPropertySucceeds() { List expectedPathToItem = new ArrayList<>(); expectedPathToItem.add("args[0]"); expectedPathToItem.add("someAddProp"); - LinkedHashMap expectedClasses = new LinkedHashMap<>(); + LinkedHashMap, Void> expectedClasses = new LinkedHashMap<>(); StringJsonSchema.StringJsonSchema1 schema = JsonSchemaFactory.getInstance(StringJsonSchema.StringJsonSchema1.class); expectedClasses.put(schema, null); PathToSchemasMap expectedPathToSchemas = new PathToSchemasMap(); diff --git a/samples/client/3_1_0_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/ItemsValidatorTest.java b/samples/client/3_1_0_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/ItemsValidatorTest.java index f9f01dcb28a..e0e4a0c859e 100644 --- a/samples/client/3_1_0_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/ItemsValidatorTest.java +++ b/samples/client/3_1_0_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/ItemsValidatorTest.java @@ -21,7 +21,10 @@ private void assertNull(@Nullable Object object) { Assert.assertNull(object); } - public static class ArrayWithItemsSchema extends JsonSchema { + public sealed interface ArrayWithItemsSchemaBoxed permits ArrayWithItemsSchemaBoxedList {} + public record ArrayWithItemsSchemaBoxedList() implements ArrayWithItemsSchemaBoxed {} + + public static class ArrayWithItemsSchema extends JsonSchema { public ArrayWithItemsSchema() { super(new JsonSchemaInfo() .type(Set.of(List.class)) @@ -44,6 +47,11 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); } + + @Override + public ArrayWithItemsSchemaBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws InvalidTypeException, ValidationException { + return new ArrayWithItemsSchemaBoxedList(); + } } @Test @@ -72,7 +80,7 @@ public void testCorrectItemsSucceeds() { List expectedPathToItem = new ArrayList<>(); expectedPathToItem.add("args[0]"); expectedPathToItem.add(0); - LinkedHashMap expectedClasses = new LinkedHashMap<>(); + LinkedHashMap, Void> expectedClasses = new LinkedHashMap<>(); StringJsonSchema.StringJsonSchema1 schema = JsonSchemaFactory.getInstance(StringJsonSchema.StringJsonSchema1.class); expectedClasses.put(schema, null); PathToSchemasMap expectedPathToSchemas = new PathToSchemasMap(); diff --git a/samples/client/3_1_0_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/JsonSchemaTest.java b/samples/client/3_1_0_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/JsonSchemaTest.java index 525222b9ad7..8a14df7edd6 100644 --- a/samples/client/3_1_0_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/JsonSchemaTest.java +++ b/samples/client/3_1_0_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/JsonSchemaTest.java @@ -13,39 +13,49 @@ import java.util.List; import java.util.Set; -class SomeSchema extends JsonSchema { - private static @Nullable SomeSchema instance = null; - protected SomeSchema() { - super(new JsonSchemaInfo() - .type(Set.of(String.class)) - ); - } +sealed interface SomeSchemaBoxed permits SomeSchemaBoxedString {} +record SomeSchemaBoxedString() implements SomeSchemaBoxed {} + +public class JsonSchemaTest { + sealed interface SomeSchemaBoxed permits SomeSchemaBoxedString {} + record SomeSchemaBoxedString() implements SomeSchemaBoxed {} - public static SomeSchema getInstance() { - if (instance == null) { - instance = new SomeSchema(); + static class SomeSchema extends JsonSchema { + private static @Nullable SomeSchema instance = null; + protected SomeSchema() { + super(new JsonSchemaInfo() + .type(Set.of(String.class)) + ); } - return instance; - } - @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { - if (arg instanceof String) { - return arg; + public static SomeSchema getInstance() { + if (instance == null) { + instance = new SomeSchema(); + } + return instance; } - throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); - } - @Override - public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws InvalidTypeException, ValidationException { - if (arg instanceof String) { - return arg; + @Override + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + if (arg instanceof String) { + return arg; + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } - throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } -} -public class JsonSchemaTest { + @Override + public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws InvalidTypeException, ValidationException { + if (arg instanceof String) { + return arg; + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + + @Override + public SomeSchemaBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws InvalidTypeException, ValidationException { + return new SomeSchemaBoxedString(); + } + } @Test public void testValidateSucceeds() { @@ -63,7 +73,7 @@ public void testValidateSucceeds() { validationMetadata ); PathToSchemasMap expectedPathToSchemas = new PathToSchemasMap(); - LinkedHashMap validatedClasses = new LinkedHashMap<>(); + LinkedHashMap, Void> validatedClasses = new LinkedHashMap<>(); validatedClasses.put(schema, null); expectedPathToSchemas.put(pathToItem, validatedClasses); Assert.assertEquals(pathToSchemas, expectedPathToSchemas); diff --git a/samples/client/3_1_0_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/PropertiesValidatorTest.java b/samples/client/3_1_0_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/PropertiesValidatorTest.java index 5a6edbe7299..492f45af0c7 100644 --- a/samples/client/3_1_0_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/PropertiesValidatorTest.java +++ b/samples/client/3_1_0_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/PropertiesValidatorTest.java @@ -17,7 +17,10 @@ import java.util.Set; public class PropertiesValidatorTest { - public static class ObjectWithPropsSchema extends JsonSchema { + public sealed interface ObjectWithPropsSchemaBoxed permits ObjectWithPropsSchemaBoxedMap {} + public record ObjectWithPropsSchemaBoxedMap() implements ObjectWithPropsSchemaBoxed {} + + public static class ObjectWithPropsSchema extends JsonSchema { private ObjectWithPropsSchema() { super(new JsonSchemaInfo() .type(Set.of(Map.class)) @@ -43,6 +46,11 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); } + + @Override + public ObjectWithPropsSchemaBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws InvalidTypeException, ValidationException { + return new ObjectWithPropsSchemaBoxedMap(); + } } @SuppressWarnings("nullness") @@ -76,7 +84,7 @@ public void testCorrectPropertySucceeds() { List expectedPathToItem = new ArrayList<>(); expectedPathToItem.add("args[0]"); expectedPathToItem.add("someString"); - LinkedHashMap expectedClasses = new LinkedHashMap<>(); + LinkedHashMap, Void> expectedClasses = new LinkedHashMap<>(); expectedClasses.put(JsonSchemaFactory.getInstance(StringJsonSchema.StringJsonSchema1.class), null); PathToSchemasMap expectedPathToSchemas = new PathToSchemasMap(); expectedPathToSchemas.put(expectedPathToItem, expectedClasses); diff --git a/samples/client/3_1_0_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/RequiredValidatorTest.java b/samples/client/3_1_0_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/RequiredValidatorTest.java index d2264b9a967..65ff030d74b 100644 --- a/samples/client/3_1_0_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/RequiredValidatorTest.java +++ b/samples/client/3_1_0_unit_test/java/src/test/java/org/openapijsonschematools/client/schemas/validation/RequiredValidatorTest.java @@ -15,7 +15,10 @@ import java.util.Set; public class RequiredValidatorTest { - public static class ObjectWithRequiredSchema extends JsonSchema { + public sealed interface ObjectWithRequiredSchemaBoxed permits ObjectWithRequiredSchemaBoxedMap {} + public record ObjectWithRequiredSchemaBoxedMap() implements ObjectWithRequiredSchemaBoxed {} + + public static class ObjectWithRequiredSchema extends JsonSchema { private ObjectWithRequiredSchema() { super(new JsonSchemaInfo() .type(Set.of(Map.class)) @@ -39,6 +42,11 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); } + + @Override + public ObjectWithRequiredSchemaBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws InvalidTypeException, ValidationException { + return new ObjectWithRequiredSchemaBoxedMap(); + } } @SuppressWarnings("nullness") diff --git a/samples/client/petstore/java/.openapi-generator/FILES b/samples/client/petstore/java/.openapi-generator/FILES index a500121d335..a6fa353c510 100644 --- a/samples/client/petstore/java/.openapi-generator/FILES +++ b/samples/client/petstore/java/.openapi-generator/FILES @@ -15,6 +15,13 @@ docs/components/requestbodies/client/content/applicationjson/ApplicationjsonSche docs/components/requestbodies/pet/content/applicationjson/ApplicationjsonSchema.md docs/components/requestbodies/pet/content/applicationxml/ApplicationxmlSchema.md docs/components/requestbodies/userarray/content/applicationjson/ApplicationjsonSchema.md +docs/components/responses/HeadersWithNoBody.md +docs/components/responses/RefSuccessDescriptionOnly.md +docs/components/responses/RefSuccessfulXmlAndJsonArrayOfPet.md +docs/components/responses/SuccessDescriptionOnly.md +docs/components/responses/SuccessInlineContentAndHeader.md +docs/components/responses/SuccessWithJsonApiResponse.md +docs/components/responses/SuccessfulXmlAndJsonArrayOfPet.md docs/components/responses/headerswithnobody/headers/location/LocationSchema.md docs/components/responses/successfulxmlandjsonarrayofpet/content/applicationjson/ApplicationjsonSchema.md docs/components/responses/successfulxmlandjsonarrayofpet/content/applicationxml/ApplicationxmlSchema.md @@ -167,7 +174,7 @@ docs/components/securityschemes/HttpBasicTest.md docs/components/securityschemes/HttpSignatureTest.md docs/components/securityschemes/OpenIdConnectTest.md docs/components/securityschemes/PetstoreAuth.md -docs/paths/anotherfakedummy/patch/responses/response200/content/applicationjson/ApplicationjsonSchema.md +docs/paths/anotherfakedummy/patch/responses/code200response/content/applicationjson/ApplicationjsonSchema.md docs/paths/commonparamsubdir/delete/parameters/parameter0/Schema0.md docs/paths/commonparamsubdir/delete/parameters/parameter1/Schema1.md docs/paths/commonparamsubdir/get/parameters/parameter0/Schema0.md @@ -186,37 +193,37 @@ docs/paths/fake/get/parameters/parameter3/Schema3.md docs/paths/fake/get/parameters/parameter4/Schema4.md docs/paths/fake/get/parameters/parameter5/Schema5.md docs/paths/fake/get/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.md -docs/paths/fake/get/responses/response404/content/applicationjson/ApplicationjsonSchema.md -docs/paths/fake/patch/responses/response200/content/applicationjson/ApplicationjsonSchema.md +docs/paths/fake/get/responses/code404response/content/applicationjson/ApplicationjsonSchema.md +docs/paths/fake/patch/responses/code200response/content/applicationjson/ApplicationjsonSchema.md docs/paths/fake/post/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.md docs/paths/fakeadditionalpropertieswitharrayofenums/get/requestbody/content/applicationjson/ApplicationjsonSchema.md -docs/paths/fakeadditionalpropertieswitharrayofenums/get/responses/response200/content/applicationjson/ApplicationjsonSchema.md +docs/paths/fakeadditionalpropertieswitharrayofenums/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md docs/paths/fakebodywithfileschema/put/requestbody/content/applicationjson/ApplicationjsonSchema.md docs/paths/fakebodywithqueryparams/put/parameters/parameter0/Schema0.md docs/paths/fakebodywithqueryparams/put/requestbody/content/applicationjson/ApplicationjsonSchema.md docs/paths/fakecasesensitiveparams/put/parameters/parameter0/Schema0.md docs/paths/fakecasesensitiveparams/put/parameters/parameter1/Schema1.md docs/paths/fakecasesensitiveparams/put/parameters/parameter2/Schema2.md -docs/paths/fakeclassnametest/patch/responses/response200/content/applicationjson/ApplicationjsonSchema.md +docs/paths/fakeclassnametest/patch/responses/code200response/content/applicationjson/ApplicationjsonSchema.md docs/paths/fakedeletecoffeeid/delete/parameters/parameter0/Schema0.md -docs/paths/fakehealth/get/responses/response200/content/applicationjson/ApplicationjsonSchema.md +docs/paths/fakehealth/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md docs/paths/fakeinlineadditionalproperties/post/requestbody/content/applicationjson/ApplicationjsonSchema.md docs/paths/fakeinlinecomposition/post/parameters/parameter0/Schema0.md docs/paths/fakeinlinecomposition/post/parameters/parameter1/Schema1.md docs/paths/fakeinlinecomposition/post/requestbody/content/applicationjson/ApplicationjsonSchema.md docs/paths/fakeinlinecomposition/post/requestbody/content/multipartformdata/MultipartformdataSchema.md -docs/paths/fakeinlinecomposition/post/responses/response200/content/applicationjson/ApplicationjsonSchema.md -docs/paths/fakeinlinecomposition/post/responses/response200/content/multipartformdata/MultipartformdataSchema.md +docs/paths/fakeinlinecomposition/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md +docs/paths/fakeinlinecomposition/post/responses/code200response/content/multipartformdata/MultipartformdataSchema.md docs/paths/fakejsonformdata/get/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.md docs/paths/fakejsonpatch/patch/requestbody/content/applicationjsonpatchjson/ApplicationjsonpatchjsonSchema.md docs/paths/fakejsonwithcharset/post/requestbody/content/applicationjsoncharsetutf8/Applicationjsoncharsetutf8Schema.md -docs/paths/fakejsonwithcharset/post/responses/response200/content/applicationjsoncharsetutf8/Applicationjsoncharsetutf8Schema.md +docs/paths/fakejsonwithcharset/post/responses/code200response/content/applicationjsoncharsetutf8/Applicationjsoncharsetutf8Schema.md docs/paths/fakemultiplerequestbodycontenttypes/post/requestbody/content/applicationjson/ApplicationjsonSchema.md docs/paths/fakemultiplerequestbodycontenttypes/post/requestbody/content/multipartformdata/MultipartformdataSchema.md -docs/paths/fakemultiplerequestbodycontenttypes/post/responses/response200/content/applicationjson/ApplicationjsonSchema.md -docs/paths/fakemultipleresponsebodies/get/responses/response200/content/applicationjson/ApplicationjsonSchema.md -docs/paths/fakemultipleresponsebodies/get/responses/response202/content/applicationjson/ApplicationjsonSchema.md -docs/paths/fakemultiplesecurities/get/responses/response200/content/applicationjson/ApplicationjsonSchema.md +docs/paths/fakemultiplerequestbodycontenttypes/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md +docs/paths/fakemultipleresponsebodies/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md +docs/paths/fakemultipleresponsebodies/get/responses/code202response/content/applicationjson/ApplicationjsonSchema.md +docs/paths/fakemultiplesecurities/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md docs/paths/fakeobjinquery/get/parameters/parameter0/Schema0.md docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter0/Schema0.md docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter1/Schema1.md @@ -238,33 +245,33 @@ docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter7/Schema7 docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter8/Schema8.md docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter9/Schema9.md docs/paths/fakeparametercollisions1ababselfab/post/requestbody/content/applicationjson/ApplicationjsonSchema.md -docs/paths/fakeparametercollisions1ababselfab/post/responses/response200/content/applicationjson/ApplicationjsonSchema.md +docs/paths/fakeparametercollisions1ababselfab/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md docs/paths/fakepemcontenttype/get/requestbody/content/applicationxpemfile/ApplicationxpemfileSchema.md -docs/paths/fakepemcontenttype/get/responses/response200/content/applicationxpemfile/ApplicationxpemfileSchema.md +docs/paths/fakepemcontenttype/get/responses/code200response/content/applicationxpemfile/ApplicationxpemfileSchema.md docs/paths/fakepetiduploadimagewithrequiredfile/post/parameters/parameter0/Schema0.md docs/paths/fakepetiduploadimagewithrequiredfile/post/requestbody/content/multipartformdata/MultipartformdataSchema.md -docs/paths/fakepetiduploadimagewithrequiredfile/post/responses/response200/content/applicationjson/ApplicationjsonSchema.md +docs/paths/fakepetiduploadimagewithrequiredfile/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md docs/paths/fakequeryparamwithjsoncontenttype/get/parameters/parameter0/content/applicationjson/Schema0.md -docs/paths/fakequeryparamwithjsoncontenttype/get/responses/response200/content/applicationjson/ApplicationjsonSchema.md +docs/paths/fakequeryparamwithjsoncontenttype/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md docs/paths/fakerefobjinquery/get/parameters/parameter0/Schema0.md docs/paths/fakerefsarraymodel/post/requestbody/content/applicationjson/ApplicationjsonSchema.md -docs/paths/fakerefsarraymodel/post/responses/response200/content/applicationjson/ApplicationjsonSchema.md +docs/paths/fakerefsarraymodel/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md docs/paths/fakerefsarrayofenums/post/requestbody/content/applicationjson/ApplicationjsonSchema.md -docs/paths/fakerefsarrayofenums/post/responses/response200/content/applicationjson/ApplicationjsonSchema.md +docs/paths/fakerefsarrayofenums/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md docs/paths/fakerefsboolean/post/requestbody/content/applicationjson/ApplicationjsonSchema.md -docs/paths/fakerefsboolean/post/responses/response200/content/applicationjson/ApplicationjsonSchema.md +docs/paths/fakerefsboolean/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md docs/paths/fakerefscomposedoneofnumberwithvalidations/post/requestbody/content/applicationjson/ApplicationjsonSchema.md -docs/paths/fakerefscomposedoneofnumberwithvalidations/post/responses/response200/content/applicationjson/ApplicationjsonSchema.md +docs/paths/fakerefscomposedoneofnumberwithvalidations/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md docs/paths/fakerefsenum/post/requestbody/content/applicationjson/ApplicationjsonSchema.md -docs/paths/fakerefsenum/post/responses/response200/content/applicationjson/ApplicationjsonSchema.md +docs/paths/fakerefsenum/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md docs/paths/fakerefsmammal/post/requestbody/content/applicationjson/ApplicationjsonSchema.md -docs/paths/fakerefsmammal/post/responses/response200/content/applicationjson/ApplicationjsonSchema.md +docs/paths/fakerefsmammal/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md docs/paths/fakerefsnumber/post/requestbody/content/applicationjson/ApplicationjsonSchema.md -docs/paths/fakerefsnumber/post/responses/response200/content/applicationjson/ApplicationjsonSchema.md +docs/paths/fakerefsnumber/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md docs/paths/fakerefsobjectmodelwithrefprops/post/requestbody/content/applicationjson/ApplicationjsonSchema.md -docs/paths/fakerefsobjectmodelwithrefprops/post/responses/response200/content/applicationjson/ApplicationjsonSchema.md +docs/paths/fakerefsobjectmodelwithrefprops/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md docs/paths/fakerefsstring/post/requestbody/content/applicationjson/ApplicationjsonSchema.md -docs/paths/fakerefsstring/post/responses/response200/content/applicationjson/ApplicationjsonSchema.md +docs/paths/fakerefsstring/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md docs/paths/faketestqueryparamters/put/parameters/parameter0/Schema0.md docs/paths/faketestqueryparamters/put/parameters/parameter1/Schema1.md docs/paths/faketestqueryparamters/put/parameters/parameter2/Schema2.md @@ -272,45 +279,45 @@ docs/paths/faketestqueryparamters/put/parameters/parameter3/Schema3.md docs/paths/faketestqueryparamters/put/parameters/parameter4/Schema4.md docs/paths/faketestqueryparamters/put/parameters/parameter5/Schema5.md docs/paths/fakeuploaddownloadfile/post/requestbody/content/applicationoctetstream/ApplicationoctetstreamSchema.md -docs/paths/fakeuploaddownloadfile/post/responses/response200/content/applicationoctetstream/ApplicationoctetstreamSchema.md +docs/paths/fakeuploaddownloadfile/post/responses/code200response/content/applicationoctetstream/ApplicationoctetstreamSchema.md docs/paths/fakeuploadfile/post/requestbody/content/multipartformdata/MultipartformdataSchema.md -docs/paths/fakeuploadfile/post/responses/response200/content/applicationjson/ApplicationjsonSchema.md +docs/paths/fakeuploadfile/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md docs/paths/fakeuploadfiles/post/requestbody/content/multipartformdata/MultipartformdataSchema.md -docs/paths/fakeuploadfiles/post/responses/response200/content/applicationjson/ApplicationjsonSchema.md -docs/paths/fakewildcardresponses/get/responses/response1xx/content/applicationjson/ApplicationjsonSchema.md -docs/paths/fakewildcardresponses/get/responses/response200/content/applicationjson/ApplicationjsonSchema.md -docs/paths/fakewildcardresponses/get/responses/response2xx/content/applicationjson/ApplicationjsonSchema.md -docs/paths/fakewildcardresponses/get/responses/response3xx/content/applicationjson/ApplicationjsonSchema.md -docs/paths/fakewildcardresponses/get/responses/response4xx/content/applicationjson/ApplicationjsonSchema.md -docs/paths/fakewildcardresponses/get/responses/response5xx/content/applicationjson/ApplicationjsonSchema.md -docs/paths/foo/get/responses/responsedefault/content/applicationjson/ApplicationjsonSchema.md +docs/paths/fakeuploadfiles/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md +docs/paths/fakewildcardresponses/get/responses/code1xxresponse/content/applicationjson/ApplicationjsonSchema.md +docs/paths/fakewildcardresponses/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md +docs/paths/fakewildcardresponses/get/responses/code2xxresponse/content/applicationjson/ApplicationjsonSchema.md +docs/paths/fakewildcardresponses/get/responses/code3xxresponse/content/applicationjson/ApplicationjsonSchema.md +docs/paths/fakewildcardresponses/get/responses/code4xxresponse/content/applicationjson/ApplicationjsonSchema.md +docs/paths/fakewildcardresponses/get/responses/code5xxresponse/content/applicationjson/ApplicationjsonSchema.md +docs/paths/foo/get/responses/codedefaultresponse/content/applicationjson/ApplicationjsonSchema.md docs/paths/petfindbystatus/get/parameters/parameter0/Schema0.md docs/paths/petfindbytags/get/parameters/parameter0/Schema0.md docs/paths/petpetid/delete/parameters/parameter0/Schema0.md docs/paths/petpetid/delete/parameters/parameter1/Schema1.md docs/paths/petpetid/get/parameters/parameter0/Schema0.md -docs/paths/petpetid/get/responses/response200/content/applicationjson/ApplicationjsonSchema.md -docs/paths/petpetid/get/responses/response200/content/applicationxml/ApplicationxmlSchema.md +docs/paths/petpetid/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md +docs/paths/petpetid/get/responses/code200response/content/applicationxml/ApplicationxmlSchema.md docs/paths/petpetid/post/parameters/parameter0/Schema0.md docs/paths/petpetid/post/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.md docs/paths/petpetiduploadimage/post/parameters/parameter0/Schema0.md docs/paths/petpetiduploadimage/post/requestbody/content/multipartformdata/MultipartformdataSchema.md docs/paths/storeorder/post/requestbody/content/applicationjson/ApplicationjsonSchema.md -docs/paths/storeorder/post/responses/response200/content/applicationjson/ApplicationjsonSchema.md -docs/paths/storeorder/post/responses/response200/content/applicationxml/ApplicationxmlSchema.md +docs/paths/storeorder/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md +docs/paths/storeorder/post/responses/code200response/content/applicationxml/ApplicationxmlSchema.md docs/paths/storeorderorderid/delete/parameters/parameter0/Schema0.md docs/paths/storeorderorderid/get/parameters/parameter0/Schema0.md -docs/paths/storeorderorderid/get/responses/response200/content/applicationjson/ApplicationjsonSchema.md -docs/paths/storeorderorderid/get/responses/response200/content/applicationxml/ApplicationxmlSchema.md +docs/paths/storeorderorderid/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md +docs/paths/storeorderorderid/get/responses/code200response/content/applicationxml/ApplicationxmlSchema.md docs/paths/user/post/requestbody/content/applicationjson/ApplicationjsonSchema.md docs/paths/userlogin/get/parameters/parameter0/Schema0.md docs/paths/userlogin/get/parameters/parameter1/Schema1.md -docs/paths/userlogin/get/responses/response200/content/applicationjson/ApplicationjsonSchema.md -docs/paths/userlogin/get/responses/response200/content/applicationxml/ApplicationxmlSchema.md -docs/paths/userlogin/get/responses/response200/headers/xexpiresafter/XExpiresAfterSchema.md -docs/paths/userlogin/get/responses/response200/headers/xratelimit/content/applicationjson/XRateLimitSchema.md -docs/paths/userusername/get/responses/response200/content/applicationjson/ApplicationjsonSchema.md -docs/paths/userusername/get/responses/response200/content/applicationxml/ApplicationxmlSchema.md +docs/paths/userlogin/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md +docs/paths/userlogin/get/responses/code200response/content/applicationxml/ApplicationxmlSchema.md +docs/paths/userlogin/get/responses/code200response/headers/xexpiresafter/XExpiresAfterSchema.md +docs/paths/userlogin/get/responses/code200response/headers/xratelimit/content/applicationjson/XRateLimitSchema.md +docs/paths/userusername/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md +docs/paths/userusername/get/responses/code200response/content/applicationxml/ApplicationxmlSchema.md docs/paths/userusername/put/requestbody/content/applicationjson/ApplicationjsonSchema.md docs/servers/Server0.md docs/servers/Server1.md @@ -333,6 +340,13 @@ src/main/java/org/openapijsonschematools/client/components/requestbodies/client/ src/main/java/org/openapijsonschematools/client/components/requestbodies/pet/content/applicationjson/ApplicationjsonSchema.java src/main/java/org/openapijsonschematools/client/components/requestbodies/pet/content/applicationxml/ApplicationxmlSchema.java src/main/java/org/openapijsonschematools/client/components/requestbodies/userarray/content/applicationjson/ApplicationjsonSchema.java +src/main/java/org/openapijsonschematools/client/components/responses/HeadersWithNoBody.java +src/main/java/org/openapijsonschematools/client/components/responses/RefSuccessDescriptionOnly.java +src/main/java/org/openapijsonschematools/client/components/responses/RefSuccessfulXmlAndJsonArrayOfPet.java +src/main/java/org/openapijsonschematools/client/components/responses/SuccessDescriptionOnly.java +src/main/java/org/openapijsonschematools/client/components/responses/SuccessInlineContentAndHeader.java +src/main/java/org/openapijsonschematools/client/components/responses/SuccessWithJsonApiResponse.java +src/main/java/org/openapijsonschematools/client/components/responses/SuccessfulXmlAndJsonArrayOfPet.java src/main/java/org/openapijsonschematools/client/components/responses/headerswithnobody/Headers.java src/main/java/org/openapijsonschematools/client/components/responses/headerswithnobody/headers/location/LocationSchema.java src/main/java/org/openapijsonschematools/client/components/responses/successfulxmlandjsonarrayofpet/content/applicationjson/ApplicationjsonSchema.java @@ -500,18 +514,22 @@ src/main/java/org/openapijsonschematools/client/mediatype/Encoding.java src/main/java/org/openapijsonschematools/client/mediatype/MediaType.java src/main/java/org/openapijsonschematools/client/parameter/ParameterStyle.java src/main/java/org/openapijsonschematools/client/paths/anotherfakedummy/patch/RequestBody.java -src/main/java/org/openapijsonschematools/client/paths/anotherfakedummy/patch/responses/response200/content/applicationjson/ApplicationjsonSchema.java +src/main/java/org/openapijsonschematools/client/paths/anotherfakedummy/patch/responses/Code200Response.java +src/main/java/org/openapijsonschematools/client/paths/anotherfakedummy/patch/responses/code200response/content/applicationjson/ApplicationjsonSchema.java src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/delete/HeaderParameters.java src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/delete/PathParameters.java src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/delete/parameters/parameter0/Schema0.java src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/delete/parameters/parameter1/Schema1.java +src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/delete/responses/Code200Response.java src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/get/PathParameters.java src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/get/QueryParameters.java src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/get/parameters/parameter0/Schema0.java +src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/get/responses/Code200Response.java src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/parameters/parameter0/PathParamSchema0.java src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/post/HeaderParameters.java src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/post/PathParameters.java src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/post/parameters/parameter0/Schema0.java +src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/post/responses/Code200Response.java src/main/java/org/openapijsonschematools/client/paths/fake/delete/FakeDeleteSecurityInfo.java src/main/java/org/openapijsonschematools/client/paths/fake/delete/HeaderParameters.java src/main/java/org/openapijsonschematools/client/paths/fake/delete/QueryParameters.java @@ -521,6 +539,7 @@ src/main/java/org/openapijsonschematools/client/paths/fake/delete/parameters/par src/main/java/org/openapijsonschematools/client/paths/fake/delete/parameters/parameter3/Schema3.java src/main/java/org/openapijsonschematools/client/paths/fake/delete/parameters/parameter4/Schema4.java src/main/java/org/openapijsonschematools/client/paths/fake/delete/parameters/parameter5/Schema5.java +src/main/java/org/openapijsonschematools/client/paths/fake/delete/responses/Code200Response.java src/main/java/org/openapijsonschematools/client/paths/fake/delete/security/FakeDeleteSecurityRequirementObject0.java src/main/java/org/openapijsonschematools/client/paths/fake/get/HeaderParameters.java src/main/java/org/openapijsonschematools/client/paths/fake/get/QueryParameters.java @@ -532,63 +551,86 @@ src/main/java/org/openapijsonschematools/client/paths/fake/get/parameters/parame src/main/java/org/openapijsonschematools/client/paths/fake/get/parameters/parameter4/Schema4.java src/main/java/org/openapijsonschematools/client/paths/fake/get/parameters/parameter5/Schema5.java src/main/java/org/openapijsonschematools/client/paths/fake/get/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.java -src/main/java/org/openapijsonschematools/client/paths/fake/get/responses/response404/content/applicationjson/ApplicationjsonSchema.java +src/main/java/org/openapijsonschematools/client/paths/fake/get/responses/Code200Response.java +src/main/java/org/openapijsonschematools/client/paths/fake/get/responses/Code404Response.java +src/main/java/org/openapijsonschematools/client/paths/fake/get/responses/code404response/content/applicationjson/ApplicationjsonSchema.java src/main/java/org/openapijsonschematools/client/paths/fake/patch/RequestBody.java -src/main/java/org/openapijsonschematools/client/paths/fake/patch/responses/response200/content/applicationjson/ApplicationjsonSchema.java +src/main/java/org/openapijsonschematools/client/paths/fake/patch/responses/Code200Response.java +src/main/java/org/openapijsonschematools/client/paths/fake/patch/responses/code200response/content/applicationjson/ApplicationjsonSchema.java src/main/java/org/openapijsonschematools/client/paths/fake/post/FakePostSecurityInfo.java src/main/java/org/openapijsonschematools/client/paths/fake/post/RequestBody.java src/main/java/org/openapijsonschematools/client/paths/fake/post/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.java +src/main/java/org/openapijsonschematools/client/paths/fake/post/responses/Code200Response.java +src/main/java/org/openapijsonschematools/client/paths/fake/post/responses/Code404Response.java src/main/java/org/openapijsonschematools/client/paths/fake/post/security/FakePostSecurityRequirementObject0.java src/main/java/org/openapijsonschematools/client/paths/fakeadditionalpropertieswitharrayofenums/get/RequestBody.java src/main/java/org/openapijsonschematools/client/paths/fakeadditionalpropertieswitharrayofenums/get/requestbody/content/applicationjson/ApplicationjsonSchema.java -src/main/java/org/openapijsonschematools/client/paths/fakeadditionalpropertieswitharrayofenums/get/responses/response200/content/applicationjson/ApplicationjsonSchema.java +src/main/java/org/openapijsonschematools/client/paths/fakeadditionalpropertieswitharrayofenums/get/responses/Code200Response.java +src/main/java/org/openapijsonschematools/client/paths/fakeadditionalpropertieswitharrayofenums/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.java src/main/java/org/openapijsonschematools/client/paths/fakebodywithfileschema/put/RequestBody.java src/main/java/org/openapijsonschematools/client/paths/fakebodywithfileschema/put/requestbody/content/applicationjson/ApplicationjsonSchema.java +src/main/java/org/openapijsonschematools/client/paths/fakebodywithfileschema/put/responses/Code200Response.java src/main/java/org/openapijsonschematools/client/paths/fakebodywithqueryparams/put/QueryParameters.java src/main/java/org/openapijsonschematools/client/paths/fakebodywithqueryparams/put/RequestBody.java src/main/java/org/openapijsonschematools/client/paths/fakebodywithqueryparams/put/parameters/parameter0/Schema0.java src/main/java/org/openapijsonschematools/client/paths/fakebodywithqueryparams/put/requestbody/content/applicationjson/ApplicationjsonSchema.java +src/main/java/org/openapijsonschematools/client/paths/fakebodywithqueryparams/put/responses/Code200Response.java src/main/java/org/openapijsonschematools/client/paths/fakecasesensitiveparams/put/QueryParameters.java src/main/java/org/openapijsonschematools/client/paths/fakecasesensitiveparams/put/parameters/parameter0/Schema0.java src/main/java/org/openapijsonschematools/client/paths/fakecasesensitiveparams/put/parameters/parameter1/Schema1.java src/main/java/org/openapijsonschematools/client/paths/fakecasesensitiveparams/put/parameters/parameter2/Schema2.java +src/main/java/org/openapijsonschematools/client/paths/fakecasesensitiveparams/put/responses/Code200Response.java src/main/java/org/openapijsonschematools/client/paths/fakeclassnametest/patch/FakeclassnametestPatchSecurityInfo.java src/main/java/org/openapijsonschematools/client/paths/fakeclassnametest/patch/RequestBody.java -src/main/java/org/openapijsonschematools/client/paths/fakeclassnametest/patch/responses/response200/content/applicationjson/ApplicationjsonSchema.java +src/main/java/org/openapijsonschematools/client/paths/fakeclassnametest/patch/responses/Code200Response.java +src/main/java/org/openapijsonschematools/client/paths/fakeclassnametest/patch/responses/code200response/content/applicationjson/ApplicationjsonSchema.java src/main/java/org/openapijsonschematools/client/paths/fakeclassnametest/patch/security/FakeclassnametestPatchSecurityRequirementObject0.java src/main/java/org/openapijsonschematools/client/paths/fakedeletecoffeeid/delete/PathParameters.java src/main/java/org/openapijsonschematools/client/paths/fakedeletecoffeeid/delete/parameters/parameter0/Schema0.java -src/main/java/org/openapijsonschematools/client/paths/fakehealth/get/responses/response200/content/applicationjson/ApplicationjsonSchema.java +src/main/java/org/openapijsonschematools/client/paths/fakedeletecoffeeid/delete/responses/Code200Response.java +src/main/java/org/openapijsonschematools/client/paths/fakedeletecoffeeid/delete/responses/CodedefaultResponse.java +src/main/java/org/openapijsonschematools/client/paths/fakehealth/get/responses/Code200Response.java +src/main/java/org/openapijsonschematools/client/paths/fakehealth/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.java src/main/java/org/openapijsonschematools/client/paths/fakeinlineadditionalproperties/post/RequestBody.java src/main/java/org/openapijsonschematools/client/paths/fakeinlineadditionalproperties/post/requestbody/content/applicationjson/ApplicationjsonSchema.java +src/main/java/org/openapijsonschematools/client/paths/fakeinlineadditionalproperties/post/responses/Code200Response.java src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/QueryParameters.java src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/RequestBody.java src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/parameters/parameter0/Schema0.java src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/parameters/parameter1/Schema1.java src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/requestbody/content/applicationjson/ApplicationjsonSchema.java src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/requestbody/content/multipartformdata/MultipartformdataSchema.java -src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/responses/response200/content/applicationjson/ApplicationjsonSchema.java -src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/responses/response200/content/multipartformdata/MultipartformdataSchema.java +src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/responses/Code200Response.java +src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java +src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/responses/code200response/content/multipartformdata/MultipartformdataSchema.java src/main/java/org/openapijsonschematools/client/paths/fakejsonformdata/get/RequestBody.java src/main/java/org/openapijsonschematools/client/paths/fakejsonformdata/get/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.java +src/main/java/org/openapijsonschematools/client/paths/fakejsonformdata/get/responses/Code200Response.java src/main/java/org/openapijsonschematools/client/paths/fakejsonpatch/patch/RequestBody.java src/main/java/org/openapijsonschematools/client/paths/fakejsonpatch/patch/requestbody/content/applicationjsonpatchjson/ApplicationjsonpatchjsonSchema.java +src/main/java/org/openapijsonschematools/client/paths/fakejsonpatch/patch/responses/Code200Response.java src/main/java/org/openapijsonschematools/client/paths/fakejsonwithcharset/post/RequestBody.java src/main/java/org/openapijsonschematools/client/paths/fakejsonwithcharset/post/requestbody/content/applicationjsoncharsetutf8/Applicationjsoncharsetutf8Schema.java -src/main/java/org/openapijsonschematools/client/paths/fakejsonwithcharset/post/responses/response200/content/applicationjsoncharsetutf8/Applicationjsoncharsetutf8Schema.java +src/main/java/org/openapijsonschematools/client/paths/fakejsonwithcharset/post/responses/Code200Response.java +src/main/java/org/openapijsonschematools/client/paths/fakejsonwithcharset/post/responses/code200response/content/applicationjsoncharsetutf8/Applicationjsoncharsetutf8Schema.java src/main/java/org/openapijsonschematools/client/paths/fakemultiplerequestbodycontenttypes/post/RequestBody.java src/main/java/org/openapijsonschematools/client/paths/fakemultiplerequestbodycontenttypes/post/requestbody/content/applicationjson/ApplicationjsonSchema.java src/main/java/org/openapijsonschematools/client/paths/fakemultiplerequestbodycontenttypes/post/requestbody/content/multipartformdata/MultipartformdataSchema.java -src/main/java/org/openapijsonschematools/client/paths/fakemultiplerequestbodycontenttypes/post/responses/response200/content/applicationjson/ApplicationjsonSchema.java -src/main/java/org/openapijsonschematools/client/paths/fakemultipleresponsebodies/get/responses/response200/content/applicationjson/ApplicationjsonSchema.java -src/main/java/org/openapijsonschematools/client/paths/fakemultipleresponsebodies/get/responses/response202/content/applicationjson/ApplicationjsonSchema.java +src/main/java/org/openapijsonschematools/client/paths/fakemultiplerequestbodycontenttypes/post/responses/Code200Response.java +src/main/java/org/openapijsonschematools/client/paths/fakemultiplerequestbodycontenttypes/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java +src/main/java/org/openapijsonschematools/client/paths/fakemultipleresponsebodies/get/responses/Code200Response.java +src/main/java/org/openapijsonschematools/client/paths/fakemultipleresponsebodies/get/responses/Code202Response.java +src/main/java/org/openapijsonschematools/client/paths/fakemultipleresponsebodies/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.java +src/main/java/org/openapijsonschematools/client/paths/fakemultipleresponsebodies/get/responses/code202response/content/applicationjson/ApplicationjsonSchema.java src/main/java/org/openapijsonschematools/client/paths/fakemultiplesecurities/get/FakemultiplesecuritiesGetSecurityInfo.java -src/main/java/org/openapijsonschematools/client/paths/fakemultiplesecurities/get/responses/response200/content/applicationjson/ApplicationjsonSchema.java +src/main/java/org/openapijsonschematools/client/paths/fakemultiplesecurities/get/responses/Code200Response.java +src/main/java/org/openapijsonschematools/client/paths/fakemultiplesecurities/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.java src/main/java/org/openapijsonschematools/client/paths/fakemultiplesecurities/get/security/FakemultiplesecuritiesGetSecurityRequirementObject0.java src/main/java/org/openapijsonschematools/client/paths/fakemultiplesecurities/get/security/FakemultiplesecuritiesGetSecurityRequirementObject1.java src/main/java/org/openapijsonschematools/client/paths/fakemultiplesecurities/get/security/FakemultiplesecuritiesGetSecurityRequirementObject2.java src/main/java/org/openapijsonschematools/client/paths/fakeobjinquery/get/QueryParameters.java src/main/java/org/openapijsonschematools/client/paths/fakeobjinquery/get/parameters/parameter0/Schema0.java +src/main/java/org/openapijsonschematools/client/paths/fakeobjinquery/get/responses/Code200Response.java src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/CookieParameters.java src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/HeaderParameters.java src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/PathParameters.java @@ -614,49 +656,66 @@ src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ab src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/parameters/parameter8/Schema8.java src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/parameters/parameter9/Schema9.java src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/requestbody/content/applicationjson/ApplicationjsonSchema.java -src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/responses/response200/content/applicationjson/ApplicationjsonSchema.java +src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/responses/Code200Response.java +src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java src/main/java/org/openapijsonschematools/client/paths/fakepemcontenttype/get/RequestBody.java src/main/java/org/openapijsonschematools/client/paths/fakepemcontenttype/get/requestbody/content/applicationxpemfile/ApplicationxpemfileSchema.java -src/main/java/org/openapijsonschematools/client/paths/fakepemcontenttype/get/responses/response200/content/applicationxpemfile/ApplicationxpemfileSchema.java +src/main/java/org/openapijsonschematools/client/paths/fakepemcontenttype/get/responses/Code200Response.java +src/main/java/org/openapijsonschematools/client/paths/fakepemcontenttype/get/responses/code200response/content/applicationxpemfile/ApplicationxpemfileSchema.java src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/post/FakepetiduploadimagewithrequiredfilePostSecurityInfo.java src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/post/PathParameters.java src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/post/RequestBody.java src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/post/parameters/parameter0/Schema0.java src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/post/requestbody/content/multipartformdata/MultipartformdataSchema.java -src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/post/responses/response200/content/applicationjson/ApplicationjsonSchema.java +src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/post/responses/Code200Response.java +src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/post/security/FakepetiduploadimagewithrequiredfilePostSecurityRequirementObject0.java src/main/java/org/openapijsonschematools/client/paths/fakequeryparamwithjsoncontenttype/get/QueryParameters.java src/main/java/org/openapijsonschematools/client/paths/fakequeryparamwithjsoncontenttype/get/parameters/parameter0/content/applicationjson/Schema0.java -src/main/java/org/openapijsonschematools/client/paths/fakequeryparamwithjsoncontenttype/get/responses/response200/content/applicationjson/ApplicationjsonSchema.java +src/main/java/org/openapijsonschematools/client/paths/fakequeryparamwithjsoncontenttype/get/responses/Code200Response.java +src/main/java/org/openapijsonschematools/client/paths/fakequeryparamwithjsoncontenttype/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.java +src/main/java/org/openapijsonschematools/client/paths/fakeredirection/get/responses/Code303Response.java +src/main/java/org/openapijsonschematools/client/paths/fakeredirection/get/responses/Code3XXResponse.java src/main/java/org/openapijsonschematools/client/paths/fakerefobjinquery/get/QueryParameters.java src/main/java/org/openapijsonschematools/client/paths/fakerefobjinquery/get/parameters/parameter0/Schema0.java +src/main/java/org/openapijsonschematools/client/paths/fakerefobjinquery/get/responses/Code200Response.java src/main/java/org/openapijsonschematools/client/paths/fakerefsarraymodel/post/RequestBody.java src/main/java/org/openapijsonschematools/client/paths/fakerefsarraymodel/post/requestbody/content/applicationjson/ApplicationjsonSchema.java -src/main/java/org/openapijsonschematools/client/paths/fakerefsarraymodel/post/responses/response200/content/applicationjson/ApplicationjsonSchema.java +src/main/java/org/openapijsonschematools/client/paths/fakerefsarraymodel/post/responses/Code200Response.java +src/main/java/org/openapijsonschematools/client/paths/fakerefsarraymodel/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java src/main/java/org/openapijsonschematools/client/paths/fakerefsarrayofenums/post/RequestBody.java src/main/java/org/openapijsonschematools/client/paths/fakerefsarrayofenums/post/requestbody/content/applicationjson/ApplicationjsonSchema.java -src/main/java/org/openapijsonschematools/client/paths/fakerefsarrayofenums/post/responses/response200/content/applicationjson/ApplicationjsonSchema.java +src/main/java/org/openapijsonschematools/client/paths/fakerefsarrayofenums/post/responses/Code200Response.java +src/main/java/org/openapijsonschematools/client/paths/fakerefsarrayofenums/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java src/main/java/org/openapijsonschematools/client/paths/fakerefsboolean/post/RequestBody.java src/main/java/org/openapijsonschematools/client/paths/fakerefsboolean/post/requestbody/content/applicationjson/ApplicationjsonSchema.java -src/main/java/org/openapijsonschematools/client/paths/fakerefsboolean/post/responses/response200/content/applicationjson/ApplicationjsonSchema.java +src/main/java/org/openapijsonschematools/client/paths/fakerefsboolean/post/responses/Code200Response.java +src/main/java/org/openapijsonschematools/client/paths/fakerefsboolean/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java src/main/java/org/openapijsonschematools/client/paths/fakerefscomposedoneofnumberwithvalidations/post/RequestBody.java src/main/java/org/openapijsonschematools/client/paths/fakerefscomposedoneofnumberwithvalidations/post/requestbody/content/applicationjson/ApplicationjsonSchema.java -src/main/java/org/openapijsonschematools/client/paths/fakerefscomposedoneofnumberwithvalidations/post/responses/response200/content/applicationjson/ApplicationjsonSchema.java +src/main/java/org/openapijsonschematools/client/paths/fakerefscomposedoneofnumberwithvalidations/post/responses/Code200Response.java +src/main/java/org/openapijsonschematools/client/paths/fakerefscomposedoneofnumberwithvalidations/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java src/main/java/org/openapijsonschematools/client/paths/fakerefsenum/post/RequestBody.java src/main/java/org/openapijsonschematools/client/paths/fakerefsenum/post/requestbody/content/applicationjson/ApplicationjsonSchema.java -src/main/java/org/openapijsonschematools/client/paths/fakerefsenum/post/responses/response200/content/applicationjson/ApplicationjsonSchema.java +src/main/java/org/openapijsonschematools/client/paths/fakerefsenum/post/responses/Code200Response.java +src/main/java/org/openapijsonschematools/client/paths/fakerefsenum/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java src/main/java/org/openapijsonschematools/client/paths/fakerefsmammal/post/RequestBody.java src/main/java/org/openapijsonschematools/client/paths/fakerefsmammal/post/requestbody/content/applicationjson/ApplicationjsonSchema.java -src/main/java/org/openapijsonschematools/client/paths/fakerefsmammal/post/responses/response200/content/applicationjson/ApplicationjsonSchema.java +src/main/java/org/openapijsonschematools/client/paths/fakerefsmammal/post/responses/Code200Response.java +src/main/java/org/openapijsonschematools/client/paths/fakerefsmammal/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java src/main/java/org/openapijsonschematools/client/paths/fakerefsnumber/post/RequestBody.java src/main/java/org/openapijsonschematools/client/paths/fakerefsnumber/post/requestbody/content/applicationjson/ApplicationjsonSchema.java -src/main/java/org/openapijsonschematools/client/paths/fakerefsnumber/post/responses/response200/content/applicationjson/ApplicationjsonSchema.java +src/main/java/org/openapijsonschematools/client/paths/fakerefsnumber/post/responses/Code200Response.java +src/main/java/org/openapijsonschematools/client/paths/fakerefsnumber/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java src/main/java/org/openapijsonschematools/client/paths/fakerefsobjectmodelwithrefprops/post/RequestBody.java src/main/java/org/openapijsonschematools/client/paths/fakerefsobjectmodelwithrefprops/post/requestbody/content/applicationjson/ApplicationjsonSchema.java -src/main/java/org/openapijsonschematools/client/paths/fakerefsobjectmodelwithrefprops/post/responses/response200/content/applicationjson/ApplicationjsonSchema.java +src/main/java/org/openapijsonschematools/client/paths/fakerefsobjectmodelwithrefprops/post/responses/Code200Response.java +src/main/java/org/openapijsonschematools/client/paths/fakerefsobjectmodelwithrefprops/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java src/main/java/org/openapijsonschematools/client/paths/fakerefsstring/post/RequestBody.java src/main/java/org/openapijsonschematools/client/paths/fakerefsstring/post/requestbody/content/applicationjson/ApplicationjsonSchema.java -src/main/java/org/openapijsonschematools/client/paths/fakerefsstring/post/responses/response200/content/applicationjson/ApplicationjsonSchema.java +src/main/java/org/openapijsonschematools/client/paths/fakerefsstring/post/responses/Code200Response.java +src/main/java/org/openapijsonschematools/client/paths/fakerefsstring/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java +src/main/java/org/openapijsonschematools/client/paths/fakeresponsewithoutschema/get/responses/Code200Response.java src/main/java/org/openapijsonschematools/client/paths/faketestqueryparamters/put/QueryParameters.java src/main/java/org/openapijsonschematools/client/paths/faketestqueryparamters/put/parameters/parameter0/Schema0.java src/main/java/org/openapijsonschematools/client/paths/faketestqueryparamters/put/parameters/parameter1/Schema1.java @@ -664,39 +723,57 @@ src/main/java/org/openapijsonschematools/client/paths/faketestqueryparamters/put src/main/java/org/openapijsonschematools/client/paths/faketestqueryparamters/put/parameters/parameter3/Schema3.java src/main/java/org/openapijsonschematools/client/paths/faketestqueryparamters/put/parameters/parameter4/Schema4.java src/main/java/org/openapijsonschematools/client/paths/faketestqueryparamters/put/parameters/parameter5/Schema5.java +src/main/java/org/openapijsonschematools/client/paths/faketestqueryparamters/put/responses/Code200Response.java src/main/java/org/openapijsonschematools/client/paths/fakeuploaddownloadfile/post/RequestBody.java src/main/java/org/openapijsonschematools/client/paths/fakeuploaddownloadfile/post/requestbody/content/applicationoctetstream/ApplicationoctetstreamSchema.java -src/main/java/org/openapijsonschematools/client/paths/fakeuploaddownloadfile/post/responses/response200/content/applicationoctetstream/ApplicationoctetstreamSchema.java +src/main/java/org/openapijsonschematools/client/paths/fakeuploaddownloadfile/post/responses/Code200Response.java +src/main/java/org/openapijsonschematools/client/paths/fakeuploaddownloadfile/post/responses/code200response/content/applicationoctetstream/ApplicationoctetstreamSchema.java src/main/java/org/openapijsonschematools/client/paths/fakeuploadfile/post/RequestBody.java src/main/java/org/openapijsonschematools/client/paths/fakeuploadfile/post/requestbody/content/multipartformdata/MultipartformdataSchema.java -src/main/java/org/openapijsonschematools/client/paths/fakeuploadfile/post/responses/response200/content/applicationjson/ApplicationjsonSchema.java +src/main/java/org/openapijsonschematools/client/paths/fakeuploadfile/post/responses/Code200Response.java +src/main/java/org/openapijsonschematools/client/paths/fakeuploadfile/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java src/main/java/org/openapijsonschematools/client/paths/fakeuploadfiles/post/RequestBody.java src/main/java/org/openapijsonschematools/client/paths/fakeuploadfiles/post/requestbody/content/multipartformdata/MultipartformdataSchema.java -src/main/java/org/openapijsonschematools/client/paths/fakeuploadfiles/post/responses/response200/content/applicationjson/ApplicationjsonSchema.java -src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/response1xx/content/applicationjson/ApplicationjsonSchema.java -src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/response200/content/applicationjson/ApplicationjsonSchema.java -src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/response2xx/content/applicationjson/ApplicationjsonSchema.java -src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/response3xx/content/applicationjson/ApplicationjsonSchema.java -src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/response4xx/content/applicationjson/ApplicationjsonSchema.java -src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/response5xx/content/applicationjson/ApplicationjsonSchema.java +src/main/java/org/openapijsonschematools/client/paths/fakeuploadfiles/post/responses/Code200Response.java +src/main/java/org/openapijsonschematools/client/paths/fakeuploadfiles/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java +src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/Code1XXResponse.java +src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/Code200Response.java +src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/Code2XXResponse.java +src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/Code3XXResponse.java +src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/Code4XXResponse.java +src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/Code5XXResponse.java +src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/code1xxresponse/content/applicationjson/ApplicationjsonSchema.java +src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.java +src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/code2xxresponse/content/applicationjson/ApplicationjsonSchema.java +src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/code3xxresponse/content/applicationjson/ApplicationjsonSchema.java +src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/code4xxresponse/content/applicationjson/ApplicationjsonSchema.java +src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/code5xxresponse/content/applicationjson/ApplicationjsonSchema.java src/main/java/org/openapijsonschematools/client/paths/foo/get/FooGetServerInfo.java -src/main/java/org/openapijsonschematools/client/paths/foo/get/responses/responsedefault/content/applicationjson/ApplicationjsonSchema.java +src/main/java/org/openapijsonschematools/client/paths/foo/get/responses/CodedefaultResponse.java +src/main/java/org/openapijsonschematools/client/paths/foo/get/responses/codedefaultresponse/content/applicationjson/ApplicationjsonSchema.java src/main/java/org/openapijsonschematools/client/paths/foo/get/servers/FooGetServer0.java src/main/java/org/openapijsonschematools/client/paths/foo/get/servers/FooGetServer1.java src/main/java/org/openapijsonschematools/client/paths/foo/get/servers/server1/Variables.java src/main/java/org/openapijsonschematools/client/paths/pet/post/PetPostSecurityInfo.java src/main/java/org/openapijsonschematools/client/paths/pet/post/RequestBody.java +src/main/java/org/openapijsonschematools/client/paths/pet/post/responses/Code200Response.java +src/main/java/org/openapijsonschematools/client/paths/pet/post/responses/Code405Response.java src/main/java/org/openapijsonschematools/client/paths/pet/post/security/PetPostSecurityRequirementObject0.java src/main/java/org/openapijsonschematools/client/paths/pet/post/security/PetPostSecurityRequirementObject1.java src/main/java/org/openapijsonschematools/client/paths/pet/post/security/PetPostSecurityRequirementObject2.java src/main/java/org/openapijsonschematools/client/paths/pet/put/PetPutSecurityInfo.java src/main/java/org/openapijsonschematools/client/paths/pet/put/RequestBody.java +src/main/java/org/openapijsonschematools/client/paths/pet/put/responses/Code400Response.java +src/main/java/org/openapijsonschematools/client/paths/pet/put/responses/Code404Response.java +src/main/java/org/openapijsonschematools/client/paths/pet/put/responses/Code405Response.java src/main/java/org/openapijsonschematools/client/paths/pet/put/security/PetPutSecurityRequirementObject0.java src/main/java/org/openapijsonschematools/client/paths/pet/put/security/PetPutSecurityRequirementObject1.java src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/PetfindbystatusServerInfo.java src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/get/PetfindbystatusGetSecurityInfo.java src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/get/QueryParameters.java src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/get/parameters/parameter0/Schema0.java +src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/get/responses/Code200Response.java +src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/get/responses/Code400Response.java src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/get/security/PetfindbystatusGetSecurityRequirementObject0.java src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/get/security/PetfindbystatusGetSecurityRequirementObject1.java src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/get/security/PetfindbystatusGetSecurityRequirementObject2.java @@ -706,6 +783,8 @@ src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/servers/se src/main/java/org/openapijsonschematools/client/paths/petfindbytags/get/PetfindbytagsGetSecurityInfo.java src/main/java/org/openapijsonschematools/client/paths/petfindbytags/get/QueryParameters.java src/main/java/org/openapijsonschematools/client/paths/petfindbytags/get/parameters/parameter0/Schema0.java +src/main/java/org/openapijsonschematools/client/paths/petfindbytags/get/responses/Code200Response.java +src/main/java/org/openapijsonschematools/client/paths/petfindbytags/get/responses/Code400Response.java src/main/java/org/openapijsonschematools/client/paths/petfindbytags/get/security/PetfindbytagsGetSecurityRequirementObject0.java src/main/java/org/openapijsonschematools/client/paths/petfindbytags/get/security/PetfindbytagsGetSecurityRequirementObject1.java src/main/java/org/openapijsonschematools/client/paths/petpetid/delete/HeaderParameters.java @@ -713,19 +792,24 @@ src/main/java/org/openapijsonschematools/client/paths/petpetid/delete/PathParame src/main/java/org/openapijsonschematools/client/paths/petpetid/delete/PetpetidDeleteSecurityInfo.java src/main/java/org/openapijsonschematools/client/paths/petpetid/delete/parameters/parameter0/Schema0.java src/main/java/org/openapijsonschematools/client/paths/petpetid/delete/parameters/parameter1/Schema1.java +src/main/java/org/openapijsonschematools/client/paths/petpetid/delete/responses/Code400Response.java src/main/java/org/openapijsonschematools/client/paths/petpetid/delete/security/PetpetidDeleteSecurityRequirementObject0.java src/main/java/org/openapijsonschematools/client/paths/petpetid/delete/security/PetpetidDeleteSecurityRequirementObject1.java src/main/java/org/openapijsonschematools/client/paths/petpetid/get/PathParameters.java src/main/java/org/openapijsonschematools/client/paths/petpetid/get/PetpetidGetSecurityInfo.java src/main/java/org/openapijsonschematools/client/paths/petpetid/get/parameters/parameter0/Schema0.java -src/main/java/org/openapijsonschematools/client/paths/petpetid/get/responses/response200/content/applicationjson/ApplicationjsonSchema.java -src/main/java/org/openapijsonschematools/client/paths/petpetid/get/responses/response200/content/applicationxml/ApplicationxmlSchema.java +src/main/java/org/openapijsonschematools/client/paths/petpetid/get/responses/Code200Response.java +src/main/java/org/openapijsonschematools/client/paths/petpetid/get/responses/Code400Response.java +src/main/java/org/openapijsonschematools/client/paths/petpetid/get/responses/Code404Response.java +src/main/java/org/openapijsonschematools/client/paths/petpetid/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.java +src/main/java/org/openapijsonschematools/client/paths/petpetid/get/responses/code200response/content/applicationxml/ApplicationxmlSchema.java src/main/java/org/openapijsonschematools/client/paths/petpetid/get/security/PetpetidGetSecurityRequirementObject0.java src/main/java/org/openapijsonschematools/client/paths/petpetid/post/PathParameters.java src/main/java/org/openapijsonschematools/client/paths/petpetid/post/PetpetidPostSecurityInfo.java src/main/java/org/openapijsonschematools/client/paths/petpetid/post/RequestBody.java src/main/java/org/openapijsonschematools/client/paths/petpetid/post/parameters/parameter0/Schema0.java src/main/java/org/openapijsonschematools/client/paths/petpetid/post/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.java +src/main/java/org/openapijsonschematools/client/paths/petpetid/post/responses/Code405Response.java src/main/java/org/openapijsonschematools/client/paths/petpetid/post/security/PetpetidPostSecurityRequirementObject0.java src/main/java/org/openapijsonschematools/client/paths/petpetid/post/security/PetpetidPostSecurityRequirementObject1.java src/main/java/org/openapijsonschematools/client/paths/petpetiduploadimage/post/PathParameters.java @@ -733,41 +817,67 @@ src/main/java/org/openapijsonschematools/client/paths/petpetiduploadimage/post/P src/main/java/org/openapijsonschematools/client/paths/petpetiduploadimage/post/RequestBody.java src/main/java/org/openapijsonschematools/client/paths/petpetiduploadimage/post/parameters/parameter0/Schema0.java src/main/java/org/openapijsonschematools/client/paths/petpetiduploadimage/post/requestbody/content/multipartformdata/MultipartformdataSchema.java +src/main/java/org/openapijsonschematools/client/paths/petpetiduploadimage/post/responses/Code200Response.java src/main/java/org/openapijsonschematools/client/paths/petpetiduploadimage/post/security/PetpetiduploadimagePostSecurityRequirementObject0.java +src/main/java/org/openapijsonschematools/client/paths/solidus/get/responses/Code200Response.java src/main/java/org/openapijsonschematools/client/paths/storeinventory/get/StoreinventoryGetSecurityInfo.java +src/main/java/org/openapijsonschematools/client/paths/storeinventory/get/responses/Code200Response.java src/main/java/org/openapijsonschematools/client/paths/storeinventory/get/security/StoreinventoryGetSecurityRequirementObject0.java src/main/java/org/openapijsonschematools/client/paths/storeorder/post/RequestBody.java src/main/java/org/openapijsonschematools/client/paths/storeorder/post/requestbody/content/applicationjson/ApplicationjsonSchema.java -src/main/java/org/openapijsonschematools/client/paths/storeorder/post/responses/response200/content/applicationjson/ApplicationjsonSchema.java -src/main/java/org/openapijsonschematools/client/paths/storeorder/post/responses/response200/content/applicationxml/ApplicationxmlSchema.java +src/main/java/org/openapijsonschematools/client/paths/storeorder/post/responses/Code200Response.java +src/main/java/org/openapijsonschematools/client/paths/storeorder/post/responses/Code400Response.java +src/main/java/org/openapijsonschematools/client/paths/storeorder/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java +src/main/java/org/openapijsonschematools/client/paths/storeorder/post/responses/code200response/content/applicationxml/ApplicationxmlSchema.java src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/delete/PathParameters.java src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/delete/parameters/parameter0/Schema0.java +src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/delete/responses/Code400Response.java +src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/delete/responses/Code404Response.java src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/PathParameters.java src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/parameters/parameter0/Schema0.java -src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/responses/response200/content/applicationjson/ApplicationjsonSchema.java -src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/responses/response200/content/applicationxml/ApplicationxmlSchema.java +src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/responses/Code200Response.java +src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/responses/Code400Response.java +src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/responses/Code404Response.java +src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.java +src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/responses/code200response/content/applicationxml/ApplicationxmlSchema.java src/main/java/org/openapijsonschematools/client/paths/user/post/RequestBody.java src/main/java/org/openapijsonschematools/client/paths/user/post/requestbody/content/applicationjson/ApplicationjsonSchema.java +src/main/java/org/openapijsonschematools/client/paths/user/post/responses/CodedefaultResponse.java src/main/java/org/openapijsonschematools/client/paths/usercreatewitharray/post/RequestBody.java +src/main/java/org/openapijsonschematools/client/paths/usercreatewitharray/post/responses/CodedefaultResponse.java src/main/java/org/openapijsonschematools/client/paths/usercreatewithlist/post/RequestBody.java +src/main/java/org/openapijsonschematools/client/paths/usercreatewithlist/post/responses/CodedefaultResponse.java src/main/java/org/openapijsonschematools/client/paths/userlogin/get/QueryParameters.java src/main/java/org/openapijsonschematools/client/paths/userlogin/get/parameters/parameter0/Schema0.java src/main/java/org/openapijsonschematools/client/paths/userlogin/get/parameters/parameter1/Schema1.java -src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/response200/Headers.java -src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/response200/content/applicationjson/ApplicationjsonSchema.java -src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/response200/content/applicationxml/ApplicationxmlSchema.java -src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/response200/headers/xexpiresafter/XExpiresAfterSchema.java -src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/response200/headers/xratelimit/content/applicationjson/XRateLimitSchema.java +src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/Code200Response.java +src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/Code400Response.java +src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/code200response/Headers.java +src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.java +src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/code200response/content/applicationxml/ApplicationxmlSchema.java +src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/code200response/headers/xexpiresafter/XExpiresAfterSchema.java +src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/code200response/headers/xratelimit/content/applicationjson/XRateLimitSchema.java +src/main/java/org/openapijsonschematools/client/paths/userlogout/get/responses/CodedefaultResponse.java src/main/java/org/openapijsonschematools/client/paths/userusername/delete/PathParameters.java +src/main/java/org/openapijsonschematools/client/paths/userusername/delete/responses/Code200Response.java +src/main/java/org/openapijsonschematools/client/paths/userusername/delete/responses/Code404Response.java src/main/java/org/openapijsonschematools/client/paths/userusername/get/PathParameters.java -src/main/java/org/openapijsonschematools/client/paths/userusername/get/responses/response200/content/applicationjson/ApplicationjsonSchema.java -src/main/java/org/openapijsonschematools/client/paths/userusername/get/responses/response200/content/applicationxml/ApplicationxmlSchema.java +src/main/java/org/openapijsonschematools/client/paths/userusername/get/responses/Code200Response.java +src/main/java/org/openapijsonschematools/client/paths/userusername/get/responses/Code400Response.java +src/main/java/org/openapijsonschematools/client/paths/userusername/get/responses/Code404Response.java +src/main/java/org/openapijsonschematools/client/paths/userusername/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.java +src/main/java/org/openapijsonschematools/client/paths/userusername/get/responses/code200response/content/applicationxml/ApplicationxmlSchema.java src/main/java/org/openapijsonschematools/client/paths/userusername/put/PathParameters.java src/main/java/org/openapijsonschematools/client/paths/userusername/put/RequestBody.java src/main/java/org/openapijsonschematools/client/paths/userusername/put/requestbody/content/applicationjson/ApplicationjsonSchema.java +src/main/java/org/openapijsonschematools/client/paths/userusername/put/responses/Code400Response.java +src/main/java/org/openapijsonschematools/client/paths/userusername/put/responses/Code404Response.java src/main/java/org/openapijsonschematools/client/requestbody/GenericRequestBody.java src/main/java/org/openapijsonschematools/client/requestbody/RequestBodySerializer.java src/main/java/org/openapijsonschematools/client/requestbody/SerializedRequestBody.java +src/main/java/org/openapijsonschematools/client/response/ApiResponse.java +src/main/java/org/openapijsonschematools/client/response/DeserializedApiResponse.java +src/main/java/org/openapijsonschematools/client/response/ResponseDeserializer.java src/main/java/org/openapijsonschematools/client/schemas/AnyTypeJsonSchema.java src/main/java/org/openapijsonschematools/client/schemas/BooleanJsonSchema.java src/main/java/org/openapijsonschematools/client/schemas/DateJsonSchema.java @@ -888,6 +998,7 @@ src/main/java/org/openapijsonschematools/client/servers/server0/Variables.java src/main/java/org/openapijsonschematools/client/servers/server1/Variables.java src/test/java/org/openapijsonschematools/client/configurations/JsonSchemaKeywordFlagsTest.java src/test/java/org/openapijsonschematools/client/requestbody/RequestBodySerializerTest.java +src/test/java/org/openapijsonschematools/client/response/ResponseDeserializerTest.java src/test/java/org/openapijsonschematools/client/schemas/AnyTypeSchemaTest.java src/test/java/org/openapijsonschematools/client/schemas/ArrayTypeSchemaTest.java src/test/java/org/openapijsonschematools/client/schemas/BooleanSchemaTest.java diff --git a/samples/client/petstore/java/README.md b/samples/client/petstore/java/README.md index 64c0fe18b67..72667a4c61d 100644 --- a/samples/client/petstore/java/README.md +++ b/samples/client/petstore/java/README.md @@ -308,6 +308,18 @@ Class | Description [RefUserArray.RefUserArray1](docs/components/requestbodies/RefUserArray.md#refuserarray1) | [UserArray.UserArray1](docs/components/requestbodies/UserArray.md#userarray1) | List of user object +## Component Responses + +Class | Description +----- | ------------ +[HeadersWithNoBody.HeadersWithNoBody1](docs/components/responses/HeadersWithNoBody.md#headerswithnobody1) | A response that contains headers but no body
+[RefSuccessDescriptionOnly.RefSuccessDescriptionOnly1](docs/components/responses/RefSuccessDescriptionOnly.md#refsuccessdescriptiononly1) | +[RefSuccessfulXmlAndJsonArrayOfPet.RefSuccessfulXmlAndJsonArrayOfPet1](docs/components/responses/RefSuccessfulXmlAndJsonArrayOfPet.md#refsuccessfulxmlandjsonarrayofpet1) | +[SuccessDescriptionOnly.SuccessDescriptionOnly1](docs/components/responses/SuccessDescriptionOnly.md#successdescriptiononly1) | Success +[SuccessInlineContentAndHeader.SuccessInlineContentAndHeader1](docs/components/responses/SuccessInlineContentAndHeader.md#successinlinecontentandheader1) | successful operation +[SuccessWithJsonApiResponse.SuccessWithJsonApiResponse1](docs/components/responses/SuccessWithJsonApiResponse.md#successwithjsonapiresponse1) | successful operation +[SuccessfulXmlAndJsonArrayOfPet.SuccessfulXmlAndJsonArrayOfPet1](docs/components/responses/SuccessfulXmlAndJsonArrayOfPet.md#successfulxmlandjsonarrayofpet1) | successful operation, multiple content types + ## Component SecuritySchemes | Class | Description | diff --git a/samples/client/petstore/java/docs/components/headers/int32jsoncontenttypeheader/content/applicationjson/Int32JsonContentTypeHeaderSchema.md b/samples/client/petstore/java/docs/components/headers/int32jsoncontenttypeheader/content/applicationjson/Int32JsonContentTypeHeaderSchema.md index 220215d1138..de1f0ba7c0b 100644 --- a/samples/client/petstore/java/docs/components/headers/int32jsoncontenttypeheader/content/applicationjson/Int32JsonContentTypeHeaderSchema.md +++ b/samples/client/petstore/java/docs/components/headers/int32jsoncontenttypeheader/content/applicationjson/Int32JsonContentTypeHeaderSchema.md @@ -3,38 +3,39 @@ public class Int32JsonContentTypeHeaderSchema
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Int32JsonContentTypeHeaderSchema.Int32JsonContentTypeHeaderSchema1Boxed](#int32jsoncontenttypeheaderschema1boxed)
abstract sealed validated payload class | -| static class | [Int32JsonContentTypeHeaderSchema.Int32JsonContentTypeHeaderSchema1BoxedNumber](#int32jsoncontenttypeheaderschema1boxednumber)
boxed class to store validated Number payloads | +| sealed interface | [Int32JsonContentTypeHeaderSchema.Int32JsonContentTypeHeaderSchema1Boxed](#int32jsoncontenttypeheaderschema1boxed)
sealed interface for validated payloads | +| record | [Int32JsonContentTypeHeaderSchema.Int32JsonContentTypeHeaderSchema1BoxedNumber](#int32jsoncontenttypeheaderschema1boxednumber)
boxed class to store validated Number payloads | | static class | [Int32JsonContentTypeHeaderSchema.Int32JsonContentTypeHeaderSchema1](#int32jsoncontenttypeheaderschema1)
schema class | ## Int32JsonContentTypeHeaderSchema1Boxed -public static abstract sealed class Int32JsonContentTypeHeaderSchema1Boxed
+public sealed interface Int32JsonContentTypeHeaderSchema1Boxed
permits
[Int32JsonContentTypeHeaderSchema1BoxedNumber](#int32jsoncontenttypeheaderschema1boxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Int32JsonContentTypeHeaderSchema1BoxedNumber -public static final class Int32JsonContentTypeHeaderSchema1BoxedNumber
-extends [Int32JsonContentTypeHeaderSchema1Boxed](#int32jsoncontenttypeheaderschema1boxed) +public record Int32JsonContentTypeHeaderSchema1BoxedNumber
+implements [Int32JsonContentTypeHeaderSchema1Boxed](#int32jsoncontenttypeheaderschema1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Int32JsonContentTypeHeaderSchema1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Int32JsonContentTypeHeaderSchema1 public static class Int32JsonContentTypeHeaderSchema1
diff --git a/samples/client/petstore/java/docs/components/headers/numberheader/NumberHeaderSchema.md b/samples/client/petstore/java/docs/components/headers/numberheader/NumberHeaderSchema.md index 08af9d96b44..95b3751f87b 100644 --- a/samples/client/petstore/java/docs/components/headers/numberheader/NumberHeaderSchema.md +++ b/samples/client/petstore/java/docs/components/headers/numberheader/NumberHeaderSchema.md @@ -3,38 +3,39 @@ public class NumberHeaderSchema
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [NumberHeaderSchema.NumberHeaderSchema1Boxed](#numberheaderschema1boxed)
abstract sealed validated payload class | -| static class | [NumberHeaderSchema.NumberHeaderSchema1BoxedString](#numberheaderschema1boxedstring)
boxed class to store validated String payloads | +| sealed interface | [NumberHeaderSchema.NumberHeaderSchema1Boxed](#numberheaderschema1boxed)
sealed interface for validated payloads | +| record | [NumberHeaderSchema.NumberHeaderSchema1BoxedString](#numberheaderschema1boxedstring)
boxed class to store validated String payloads | | static class | [NumberHeaderSchema.NumberHeaderSchema1](#numberheaderschema1)
schema class | ## NumberHeaderSchema1Boxed -public static abstract sealed class NumberHeaderSchema1Boxed
+public sealed interface NumberHeaderSchema1Boxed
permits
[NumberHeaderSchema1BoxedString](#numberheaderschema1boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## NumberHeaderSchema1BoxedString -public static final class NumberHeaderSchema1BoxedString
-extends [NumberHeaderSchema1Boxed](#numberheaderschema1boxed) +public record NumberHeaderSchema1BoxedString
+implements [NumberHeaderSchema1Boxed](#numberheaderschema1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NumberHeaderSchema1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NumberHeaderSchema1 public static class NumberHeaderSchema1
diff --git a/samples/client/petstore/java/docs/components/headers/refcontentschemaheader/content/applicationjson/RefContentSchemaHeaderSchema.md b/samples/client/petstore/java/docs/components/headers/refcontentschemaheader/content/applicationjson/RefContentSchemaHeaderSchema.md index f0dc3e6ad60..eda54180919 100644 --- a/samples/client/petstore/java/docs/components/headers/refcontentschemaheader/content/applicationjson/RefContentSchemaHeaderSchema.md +++ b/samples/client/petstore/java/docs/components/headers/refcontentschemaheader/content/applicationjson/RefContentSchemaHeaderSchema.md @@ -4,7 +4,7 @@ extends [StringWithValidation1](../../../../../../components/schemas/StringWithV A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary diff --git a/samples/client/petstore/java/docs/components/headers/refschemaheader/RefSchemaHeaderSchema.md b/samples/client/petstore/java/docs/components/headers/refschemaheader/RefSchemaHeaderSchema.md index 191e7f26140..d73c936d9b6 100644 --- a/samples/client/petstore/java/docs/components/headers/refschemaheader/RefSchemaHeaderSchema.md +++ b/samples/client/petstore/java/docs/components/headers/refschemaheader/RefSchemaHeaderSchema.md @@ -4,7 +4,7 @@ extends [StringWithValidation1](../../../components/schemas/StringWithValidation A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary diff --git a/samples/client/petstore/java/docs/components/headers/stringheader/StringHeaderSchema.md b/samples/client/petstore/java/docs/components/headers/stringheader/StringHeaderSchema.md index 74c2c81129b..a62142869f9 100644 --- a/samples/client/petstore/java/docs/components/headers/stringheader/StringHeaderSchema.md +++ b/samples/client/petstore/java/docs/components/headers/stringheader/StringHeaderSchema.md @@ -3,38 +3,39 @@ public class StringHeaderSchema
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [StringHeaderSchema.StringHeaderSchema1Boxed](#stringheaderschema1boxed)
abstract sealed validated payload class | -| static class | [StringHeaderSchema.StringHeaderSchema1BoxedString](#stringheaderschema1boxedstring)
boxed class to store validated String payloads | +| sealed interface | [StringHeaderSchema.StringHeaderSchema1Boxed](#stringheaderschema1boxed)
sealed interface for validated payloads | +| record | [StringHeaderSchema.StringHeaderSchema1BoxedString](#stringheaderschema1boxedstring)
boxed class to store validated String payloads | | static class | [StringHeaderSchema.StringHeaderSchema1](#stringheaderschema1)
schema class | ## StringHeaderSchema1Boxed -public static abstract sealed class StringHeaderSchema1Boxed
+public sealed interface StringHeaderSchema1Boxed
permits
[StringHeaderSchema1BoxedString](#stringheaderschema1boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## StringHeaderSchema1BoxedString -public static final class StringHeaderSchema1BoxedString
-extends [StringHeaderSchema1Boxed](#stringheaderschema1boxed) +public record StringHeaderSchema1BoxedString
+implements [StringHeaderSchema1Boxed](#stringheaderschema1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | StringHeaderSchema1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## StringHeaderSchema1 public static class StringHeaderSchema1
diff --git a/samples/client/petstore/java/docs/components/parameters/componentrefschemastringwithvalidation/content/applicationjson/ApplicationjsonSchema.md b/samples/client/petstore/java/docs/components/parameters/componentrefschemastringwithvalidation/content/applicationjson/ApplicationjsonSchema.md index 2cef0d5e45b..3853dcd998e 100644 --- a/samples/client/petstore/java/docs/components/parameters/componentrefschemastringwithvalidation/content/applicationjson/ApplicationjsonSchema.md +++ b/samples/client/petstore/java/docs/components/parameters/componentrefschemastringwithvalidation/content/applicationjson/ApplicationjsonSchema.md @@ -4,7 +4,7 @@ extends [StringWithValidation1](../../../../../../components/schemas/StringWithV A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary diff --git a/samples/client/petstore/java/docs/components/parameters/pathusername/Schema.md b/samples/client/petstore/java/docs/components/parameters/pathusername/Schema.md index afe3fdcd0f1..07b8e07c3a7 100644 --- a/samples/client/petstore/java/docs/components/parameters/pathusername/Schema.md +++ b/samples/client/petstore/java/docs/components/parameters/pathusername/Schema.md @@ -3,38 +3,39 @@ public class Schema
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Schema.Schema1Boxed](#schema1boxed)
abstract sealed validated payload class | -| static class | [Schema.Schema1BoxedString](#schema1boxedstring)
boxed class to store validated String payloads | +| sealed interface | [Schema.Schema1Boxed](#schema1boxed)
sealed interface for validated payloads | +| record | [Schema.Schema1BoxedString](#schema1boxedstring)
boxed class to store validated String payloads | | static class | [Schema.Schema1](#schema1)
schema class | ## Schema1Boxed -public static abstract sealed class Schema1Boxed
+public sealed interface Schema1Boxed
permits
[Schema1BoxedString](#schema1boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema1BoxedString -public static final class Schema1BoxedString
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedString
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1 public static class Schema1
diff --git a/samples/client/petstore/java/docs/components/parameters/refschemastringwithvalidation/Schema.md b/samples/client/petstore/java/docs/components/parameters/refschemastringwithvalidation/Schema.md index 101b5cc700b..29a01b850e9 100644 --- a/samples/client/petstore/java/docs/components/parameters/refschemastringwithvalidation/Schema.md +++ b/samples/client/petstore/java/docs/components/parameters/refschemastringwithvalidation/Schema.md @@ -4,7 +4,7 @@ extends [StringWithValidation1](../../../components/schemas/StringWithValidation A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary diff --git a/samples/client/petstore/java/docs/components/requestbodies/Client.md b/samples/client/petstore/java/docs/components/requestbodies/Client.md index 994b42ed642..287b9634107 100644 --- a/samples/client/petstore/java/docs/components/requestbodies/Client.md +++ b/samples/client/petstore/java/docs/components/requestbodies/Client.md @@ -4,22 +4,32 @@ Client.java public class Client A class that contains necessary nested request body classes -- supporting XMediaType classes which store the openapi request body contentType to schema information +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types - a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances -- SealedRequestBody class, an abstract sealed class which contains all the contentType/schema input types -- final classes which extend SealedRequestBody, the concrete request body types +- SealedRequestBody, a sealed interface which contains all the contentType/schema input types +- records which implement SealedRequestBody, the concrete request body types ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | --------------------- | -| static class | [Client.ApplicationjsonMediaType](#applicationjsonmediatype)
class storing schema info for a specific contentType | +| sealed interface | [Client.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [Client.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | | static class | [Client.Client1](#client1)
class that serializes request bodies | -| static class | [Client.SealedRequestBody](#sealedrequestbody)
abstract sealed request body class | -| static class | [Client.ApplicationjsonRequestBody](#applicationjsonrequestbody)
implementing sealed class to store request body input | +| sealed interface | [Client.SealedRequestBody](#sealedrequestbody)
request body sealed interface | +| record | [Client.ApplicationjsonRequestBody](#applicationjsonrequestbody)
implements sealed interface to store request body input | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[ApplicationjsonMediaType](#applicationjsonmediatype) + +sealed interface that stores schema and encoding info + ## ApplicationjsonMediaType -public static class ApplicationjsonMediaType
-extends MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../components/requestbodies/client/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1)> +public record ApplicationjsonMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../components/requestbodies/client/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> class storing schema info for a specific contentType @@ -28,10 +38,11 @@ class storing schema info for a specific contentType | --------------------------- | | ApplicationjsonMediaType()
Creates an instance | -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [ApplicationjsonSchema.ApplicationjsonSchema1](../../components/requestbodies/client/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema
the schema for this MediaType | +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationjsonSchema.ApplicationjsonSchema1](../../components/requestbodies/client/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | ## Client1 public static class Client1
@@ -47,7 +58,7 @@ a class that serializes SealedRequestBody request bodies | Modifier and Type | Field and Description | | ----------------- | --------------------- | | boolean | required = true
whether the request body is required | -| Map> | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | ### Method Summary | Modifier and Type | Method and Description | @@ -55,18 +66,18 @@ a class that serializes SealedRequestBody request bodies | SerializedRequestBody | serialize([SealedRequestBody](#sealedrequestbody) requestBody)
called by endpoint when creating request body bytes | ## SealedRequestBody -public static abstract sealed class SealedRequestBody
+public sealed interface SealedRequestBody
permits
[ApplicationjsonRequestBody](#applicationjsonrequestbody) -abstract sealed class that stores request contentType + validated schema data +sealed interface that stores request contentType + validated schema data ## ApplicationjsonRequestBody -public static final class ApplicationjsonRequestBody
-extends [SealedRequestBody](#sealedrequestbody)
-implements GenericRequestBody
+public record ApplicationjsonRequestBody
+implements [SealedRequestBody](#sealedrequestbody),
+GenericRequestBody
-A final class to store request body input for contentType="application/json" +A record class to store request body input for contentType="application/json" ### Constructor Summary | Constructor and Description | diff --git a/samples/client/petstore/java/docs/components/requestbodies/Pet.md b/samples/client/petstore/java/docs/components/requestbodies/Pet.md index d8d122607e1..c7c5a349462 100644 --- a/samples/client/petstore/java/docs/components/requestbodies/Pet.md +++ b/samples/client/petstore/java/docs/components/requestbodies/Pet.md @@ -4,24 +4,35 @@ Pet.java public class Pet A class that contains necessary nested request body classes -- supporting XMediaType classes which store the openapi request body contentType to schema information +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types - a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances -- SealedRequestBody class, an abstract sealed class which contains all the contentType/schema input types -- final classes which extend SealedRequestBody, the concrete request body types +- SealedRequestBody, a sealed interface which contains all the contentType/schema input types +- records which implement SealedRequestBody, the concrete request body types ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | --------------------- | -| static class | [Pet.ApplicationjsonMediaType](#applicationjsonmediatype)
class storing schema info for a specific contentType | -| static class | [Pet.ApplicationxmlMediaType](#applicationxmlmediatype)
class storing schema info for a specific contentType | +| sealed interface | [Pet.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [Pet.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | +| record | [Pet.ApplicationxmlMediaType](#applicationxmlmediatype)
record storing schema + encoding for a specific contentType | | static class | [Pet.Pet1](#pet1)
class that serializes request bodies | -| static class | [Pet.SealedRequestBody](#sealedrequestbody)
abstract sealed request body class | -| static class | [Pet.ApplicationjsonRequestBody](#applicationjsonrequestbody)
implementing sealed class to store request body input | -| static class | [Pet.ApplicationxmlRequestBody](#applicationxmlrequestbody)
implementing sealed class to store request body input | +| sealed interface | [Pet.SealedRequestBody](#sealedrequestbody)
request body sealed interface | +| record | [Pet.ApplicationjsonRequestBody](#applicationjsonrequestbody)
implements sealed interface to store request body input | +| record | [Pet.ApplicationxmlRequestBody](#applicationxmlrequestbody)
implements sealed interface to store request body input | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[ApplicationjsonMediaType](#applicationjsonmediatype), +[ApplicationxmlMediaType](#applicationxmlmediatype) + +sealed interface that stores schema and encoding info + ## ApplicationjsonMediaType -public static class ApplicationjsonMediaType
-extends MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../components/requestbodies/pet/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1)> +public record ApplicationjsonMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../components/requestbodies/pet/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> class storing schema info for a specific contentType @@ -30,14 +41,15 @@ class storing schema info for a specific contentType | --------------------------- | | ApplicationjsonMediaType()
Creates an instance | -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [ApplicationjsonSchema.ApplicationjsonSchema1](../../components/requestbodies/pet/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema
the schema for this MediaType | +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationjsonSchema.ApplicationjsonSchema1](../../components/requestbodies/pet/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | ## ApplicationxmlMediaType -public static class ApplicationxmlMediaType
-extends MediaType<[ApplicationxmlSchema.ApplicationxmlSchema1](../../components/requestbodies/pet/content/applicationxml/ApplicationxmlSchema.md#applicationxmlschema1)> +public record ApplicationxmlMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationxmlSchema.ApplicationxmlSchema1](../../components/requestbodies/pet/content/applicationxml/ApplicationxmlSchema.md#applicationxmlschema1), Void> class storing schema info for a specific contentType @@ -46,10 +58,11 @@ class storing schema info for a specific contentType | --------------------------- | | ApplicationxmlMediaType()
Creates an instance | -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [ApplicationxmlSchema.ApplicationxmlSchema1](../../components/requestbodies/pet/content/applicationxml/ApplicationxmlSchema.md#applicationxmlschema1) | schema
the schema for this MediaType | +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationxmlSchema.ApplicationxmlSchema1](../../components/requestbodies/pet/content/applicationxml/ApplicationxmlSchema.md#applicationxmlschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | ## Pet1 public static class Pet1
@@ -65,7 +78,7 @@ a class that serializes SealedRequestBody request bodies | Modifier and Type | Field and Description | | ----------------- | --------------------- | | boolean | required = true
whether the request body is required | -| Map> | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)()),
    new AbstractMap.SimpleEntry<>("application/xml", new [ApplicationxmlMediaType](#applicationxmlmediatype)())
)
the contentType to schema info | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)()),
    new AbstractMap.SimpleEntry<>("application/xml", new [ApplicationxmlMediaType](#applicationxmlmediatype)())
)
the contentType to schema info | ### Method Summary | Modifier and Type | Method and Description | @@ -73,19 +86,19 @@ a class that serializes SealedRequestBody request bodies | SerializedRequestBody | serialize([SealedRequestBody](#sealedrequestbody) requestBody)
called by endpoint when creating request body bytes | ## SealedRequestBody -public static abstract sealed class SealedRequestBody
+public sealed interface SealedRequestBody
permits
[ApplicationjsonRequestBody](#applicationjsonrequestbody), [ApplicationxmlRequestBody](#applicationxmlrequestbody) -abstract sealed class that stores request contentType + validated schema data +sealed interface that stores request contentType + validated schema data ## ApplicationjsonRequestBody -public static final class ApplicationjsonRequestBody
-extends [SealedRequestBody](#sealedrequestbody)
-implements GenericRequestBody
+public record ApplicationjsonRequestBody
+implements [SealedRequestBody](#sealedrequestbody),
+GenericRequestBody
-A final class to store request body input for contentType="application/json" +A record class to store request body input for contentType="application/json" ### Constructor Summary | Constructor and Description | @@ -98,11 +111,11 @@ A final class to store request body input for contentType="application/json" | String | contentType()
always returns "application/json" | | ApplicationjsonSchema.[Pet1Boxed](../../components/schemas/Pet.md#pet1boxed) | body()
returns the body passed in in the constructor | ## ApplicationxmlRequestBody -public static final class ApplicationxmlRequestBody
-extends [SealedRequestBody](#sealedrequestbody)
-implements GenericRequestBody
+public record ApplicationxmlRequestBody
+implements [SealedRequestBody](#sealedrequestbody),
+GenericRequestBody
-A final class to store request body input for contentType="application/xml" +A record class to store request body input for contentType="application/xml" ### Constructor Summary | Constructor and Description | diff --git a/samples/client/petstore/java/docs/components/requestbodies/UserArray.md b/samples/client/petstore/java/docs/components/requestbodies/UserArray.md index c36097f63e5..bd309e0092d 100644 --- a/samples/client/petstore/java/docs/components/requestbodies/UserArray.md +++ b/samples/client/petstore/java/docs/components/requestbodies/UserArray.md @@ -4,22 +4,32 @@ UserArray.java public class UserArray A class that contains necessary nested request body classes -- supporting XMediaType classes which store the openapi request body contentType to schema information +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types - a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances -- SealedRequestBody class, an abstract sealed class which contains all the contentType/schema input types -- final classes which extend SealedRequestBody, the concrete request body types +- SealedRequestBody, a sealed interface which contains all the contentType/schema input types +- records which implement SealedRequestBody, the concrete request body types ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | --------------------- | -| static class | [UserArray.ApplicationjsonMediaType](#applicationjsonmediatype)
class storing schema info for a specific contentType | +| sealed interface | [UserArray.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [UserArray.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | | static class | [UserArray.UserArray1](#userarray1)
class that serializes request bodies | -| static class | [UserArray.SealedRequestBody](#sealedrequestbody)
abstract sealed request body class | -| static class | [UserArray.ApplicationjsonRequestBody](#applicationjsonrequestbody)
implementing sealed class to store request body input | +| sealed interface | [UserArray.SealedRequestBody](#sealedrequestbody)
request body sealed interface | +| record | [UserArray.ApplicationjsonRequestBody](#applicationjsonrequestbody)
implements sealed interface to store request body input | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[ApplicationjsonMediaType](#applicationjsonmediatype) + +sealed interface that stores schema and encoding info + ## ApplicationjsonMediaType -public static class ApplicationjsonMediaType
-extends MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../components/requestbodies/userarray/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1)> +public record ApplicationjsonMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../components/requestbodies/userarray/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> class storing schema info for a specific contentType @@ -28,10 +38,11 @@ class storing schema info for a specific contentType | --------------------------- | | ApplicationjsonMediaType()
Creates an instance | -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [ApplicationjsonSchema.ApplicationjsonSchema1](../../components/requestbodies/userarray/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema
the schema for this MediaType | +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationjsonSchema.ApplicationjsonSchema1](../../components/requestbodies/userarray/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | ## UserArray1 public static class UserArray1
@@ -47,7 +58,7 @@ a class that serializes SealedRequestBody request bodies | Modifier and Type | Field and Description | | ----------------- | --------------------- | | boolean | required = true
whether the request body is required | -| Map> | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | ### Method Summary | Modifier and Type | Method and Description | @@ -55,18 +66,18 @@ a class that serializes SealedRequestBody request bodies | SerializedRequestBody | serialize([SealedRequestBody](#sealedrequestbody) requestBody)
called by endpoint when creating request body bytes | ## SealedRequestBody -public static abstract sealed class SealedRequestBody
+public sealed interface SealedRequestBody
permits
[ApplicationjsonRequestBody](#applicationjsonrequestbody) -abstract sealed class that stores request contentType + validated schema data +sealed interface that stores request contentType + validated schema data ## ApplicationjsonRequestBody -public static final class ApplicationjsonRequestBody
-extends [SealedRequestBody](#sealedrequestbody)
-implements GenericRequestBody
+public record ApplicationjsonRequestBody
+implements [SealedRequestBody](#sealedrequestbody),
+GenericRequestBody
-A final class to store request body input for contentType="application/json" +A record class to store request body input for contentType="application/json" ### Constructor Summary | Constructor and Description | diff --git a/samples/client/petstore/java/docs/components/requestbodies/client/content/applicationjson/ApplicationjsonSchema.md b/samples/client/petstore/java/docs/components/requestbodies/client/content/applicationjson/ApplicationjsonSchema.md index 2738605d2d8..5a8221e0efb 100644 --- a/samples/client/petstore/java/docs/components/requestbodies/client/content/applicationjson/ApplicationjsonSchema.md +++ b/samples/client/petstore/java/docs/components/requestbodies/client/content/applicationjson/ApplicationjsonSchema.md @@ -4,7 +4,7 @@ extends [Client1](../../../../../components/schemas/Client.md#client) A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary diff --git a/samples/client/petstore/java/docs/components/requestbodies/pet/content/applicationjson/ApplicationjsonSchema.md b/samples/client/petstore/java/docs/components/requestbodies/pet/content/applicationjson/ApplicationjsonSchema.md index 0c3ca9b7c75..33800a35ef7 100644 --- a/samples/client/petstore/java/docs/components/requestbodies/pet/content/applicationjson/ApplicationjsonSchema.md +++ b/samples/client/petstore/java/docs/components/requestbodies/pet/content/applicationjson/ApplicationjsonSchema.md @@ -4,7 +4,7 @@ extends [Pet1](../../../../../components/schemas/Pet.md#pet) A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary diff --git a/samples/client/petstore/java/docs/components/requestbodies/pet/content/applicationxml/ApplicationxmlSchema.md b/samples/client/petstore/java/docs/components/requestbodies/pet/content/applicationxml/ApplicationxmlSchema.md index 3d6790f5452..87b9e69e465 100644 --- a/samples/client/petstore/java/docs/components/requestbodies/pet/content/applicationxml/ApplicationxmlSchema.md +++ b/samples/client/petstore/java/docs/components/requestbodies/pet/content/applicationxml/ApplicationxmlSchema.md @@ -4,7 +4,7 @@ extends [RefPet1](../../../../../components/schemas/RefPet.md#refpet) A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary diff --git a/samples/client/petstore/java/docs/components/requestbodies/userarray/content/applicationjson/ApplicationjsonSchema.md b/samples/client/petstore/java/docs/components/requestbodies/userarray/content/applicationjson/ApplicationjsonSchema.md index df9f7fddb30..1c136590bb9 100644 --- a/samples/client/petstore/java/docs/components/requestbodies/userarray/content/applicationjson/ApplicationjsonSchema.md +++ b/samples/client/petstore/java/docs/components/requestbodies/userarray/content/applicationjson/ApplicationjsonSchema.md @@ -3,7 +3,7 @@ public class ApplicationjsonSchema
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated list payloads, extends FrozenList - classes to build inputs for list payloads @@ -11,34 +11,35 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed)
abstract sealed validated payload class | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedList](#applicationjsonschema1boxedlist)
boxed class to store validated List payloads | +| sealed interface | [ApplicationjsonSchema.ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed)
sealed interface for validated payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedList](#applicationjsonschema1boxedlist)
boxed class to store validated List payloads | | static class | [ApplicationjsonSchema.ApplicationjsonSchema1](#applicationjsonschema1)
schema class | | static class | [ApplicationjsonSchema.ApplicationjsonSchemaListBuilder](#applicationjsonschemalistbuilder)
builder for List payloads | | static class | [ApplicationjsonSchema.ApplicationjsonSchemaList](#applicationjsonschemalist)
output class for List payloads | ## ApplicationjsonSchema1Boxed -public static abstract sealed class ApplicationjsonSchema1Boxed
+public sealed interface ApplicationjsonSchema1Boxed
permits
[ApplicationjsonSchema1BoxedList](#applicationjsonschema1boxedlist) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ApplicationjsonSchema1BoxedList -public static final class ApplicationjsonSchema1BoxedList
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) +public record ApplicationjsonSchema1BoxedList
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ApplicationjsonSchema1BoxedList([ApplicationjsonSchemaList](#applicationjsonschemalist) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [ApplicationjsonSchemaList](#applicationjsonschemalist) | data
validated payload | +| [ApplicationjsonSchemaList](#applicationjsonschemalist) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ApplicationjsonSchema1 public static class ApplicationjsonSchema1
@@ -121,7 +122,9 @@ ApplicationjsonSchema.ApplicationjsonSchemaList validatedPayload = | ----------------- | ---------------------- | | [ApplicationjsonSchemaList](#applicationjsonschemalist) | validate([List](#applicationjsonschemalistbuilder) arg, SchemaConfiguration configuration) | | [ApplicationjsonSchema1BoxedList](#applicationjsonschema1boxedlist) | validateAndBox([List](#applicationjsonschemalistbuilder) arg, SchemaConfiguration configuration) | +| [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ApplicationjsonSchemaListBuilder public class ApplicationjsonSchemaListBuilder
builder for `List>` diff --git a/samples/client/petstore/java/docs/components/responses/HeadersWithNoBody.md b/samples/client/petstore/java/docs/components/responses/HeadersWithNoBody.md new file mode 100644 index 00000000000..7039572f287 --- /dev/null +++ b/samples/client/petstore/java/docs/components/responses/HeadersWithNoBody.md @@ -0,0 +1,35 @@ +# HeadersWithNoBody +HeadersWithNoBody.java + +public class HeadersWithNoBody + +A class that contains necessary nested response classes +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [HeadersWithNoBody.HeadersWithNoBody1](#headerswithnobody1)
class that deserializes responses | + +## HeadersWithNoBody1 +public static class HeadersWithNoBody1
+extends ResponseDeserializer + +a class that deserializes responses + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| HeadersWithNoBody1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| Map | content = MapUtils.makeMap(
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApiResponse | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | + +[[Back to top]](#top) [[Back to Component Responses]](../../../README.md#Component-Responses) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/components/responses/RefSuccessDescriptionOnly.md b/samples/client/petstore/java/docs/components/responses/RefSuccessDescriptionOnly.md new file mode 100644 index 00000000000..f3e5b549571 --- /dev/null +++ b/samples/client/petstore/java/docs/components/responses/RefSuccessDescriptionOnly.md @@ -0,0 +1,20 @@ +# RefSuccessDescriptionOnly +RefSuccessDescriptionOnly.java + +public class RefSuccessDescriptionOnly extends [SuccessDescriptionOnly](../../components/responses/SuccessDescriptionOnly.md) + +A class (extended from the $ref class) that contains necessary nested response classes +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [RefSuccessDescriptionOnly.RefSuccessDescriptionOnly1](#refsuccessdescriptiononly1)
class that deserializes responses | + +## RefSuccessDescriptionOnly1 +public static class RefSuccessDescriptionOnly1 extends [SuccessDescriptionOnly1](../../components/responses/SuccessDescriptionOnly.md#successdescriptiononly1)
+ +a class that deserializes responses, extended from the $ref class + + +[[Back to top]](#top) [[Back to Component Responses]](../../../README.md#Component-Responses) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/components/responses/RefSuccessfulXmlAndJsonArrayOfPet.md b/samples/client/petstore/java/docs/components/responses/RefSuccessfulXmlAndJsonArrayOfPet.md new file mode 100644 index 00000000000..eea32f8e387 --- /dev/null +++ b/samples/client/petstore/java/docs/components/responses/RefSuccessfulXmlAndJsonArrayOfPet.md @@ -0,0 +1,20 @@ +# RefSuccessfulXmlAndJsonArrayOfPet +RefSuccessfulXmlAndJsonArrayOfPet.java + +public class RefSuccessfulXmlAndJsonArrayOfPet extends [SuccessfulXmlAndJsonArrayOfPet](../../components/responses/SuccessfulXmlAndJsonArrayOfPet.md) + +A class (extended from the $ref class) that contains necessary nested response classes +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [RefSuccessfulXmlAndJsonArrayOfPet.RefSuccessfulXmlAndJsonArrayOfPet1](#refsuccessfulxmlandjsonarrayofpet1)
class that deserializes responses | + +## RefSuccessfulXmlAndJsonArrayOfPet1 +public static class RefSuccessfulXmlAndJsonArrayOfPet1 extends [SuccessfulXmlAndJsonArrayOfPet1](../../components/responses/SuccessfulXmlAndJsonArrayOfPet.md#successfulxmlandjsonarrayofpet1)
+ +a class that deserializes responses, extended from the $ref class + + +[[Back to top]](#top) [[Back to Component Responses]](../../../README.md#Component-Responses) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/components/responses/SuccessDescriptionOnly.md b/samples/client/petstore/java/docs/components/responses/SuccessDescriptionOnly.md new file mode 100644 index 00000000000..1d7b3de9bb3 --- /dev/null +++ b/samples/client/petstore/java/docs/components/responses/SuccessDescriptionOnly.md @@ -0,0 +1,35 @@ +# SuccessDescriptionOnly +SuccessDescriptionOnly.java + +public class SuccessDescriptionOnly + +A class that contains necessary nested response classes +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [SuccessDescriptionOnly.SuccessDescriptionOnly1](#successdescriptiononly1)
class that deserializes responses | + +## SuccessDescriptionOnly1 +public static class SuccessDescriptionOnly1
+extends ResponseDeserializer + +a class that deserializes responses + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| SuccessDescriptionOnly1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| Map | content = MapUtils.makeMap(
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApiResponse | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | + +[[Back to top]](#top) [[Back to Component Responses]](../../../README.md#Component-Responses) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/components/responses/SuccessInlineContentAndHeader.md b/samples/client/petstore/java/docs/components/responses/SuccessInlineContentAndHeader.md new file mode 100644 index 00000000000..2aa8884741d --- /dev/null +++ b/samples/client/petstore/java/docs/components/responses/SuccessInlineContentAndHeader.md @@ -0,0 +1,90 @@ +# SuccessInlineContentAndHeader +SuccessInlineContentAndHeader.java + +public class SuccessInlineContentAndHeader + +A class that contains necessary nested response classes +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types +- SealedResponseBody, a sealed interface which contains all the contentType/schema types +- records which implement SealedResponseBody, the concrete response body types +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [SuccessInlineContentAndHeader.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [SuccessInlineContentAndHeader.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | +| sealed interface | [SuccessInlineContentAndHeader.SealedResponseBody](#sealedresponsebody)
response body sealed interface | +| record | [SuccessInlineContentAndHeader.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | +| static class | [SuccessInlineContentAndHeader.SuccessInlineContentAndHeader1](#successinlinecontentandheader1)
class that deserializes responses | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[ApplicationjsonMediaType](#applicationjsonmediatype) + +sealed interface that stores schema and encoding info + +## ApplicationjsonMediaType +public record ApplicationjsonMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../components/responses/successinlinecontentandheader/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationjsonSchema.ApplicationjsonSchema1](../../components/responses/successinlinecontentandheader/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## SealedResponseBody +public sealed interface SealedResponseBody
+permits
+[ApplicationjsonResponseBody](#applicationjsonresponsebody) + +sealed interface that stores response body + +## ApplicationjsonResponseBody +public record ApplicationjsonResponseBody
+implements [SealedResponseBody](#sealedresponsebody) + +A record class to store response body for contentType="application/json" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonResponseBody(ApplicationjsonSchema.[ApplicationjsonSchema1Boxed](../../components/responses/successinlinecontentandheader/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1boxed) body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApplicationjsonSchema.[ApplicationjsonSchema1Boxed](../../components/responses/successinlinecontentandheader/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1boxed) | body()
returns the body passed in in the constructor | + +## SuccessInlineContentAndHeader1 +public static class SuccessInlineContentAndHeader1
+extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> + +a class that deserializes responses + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| SuccessInlineContentAndHeader1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | + +[[Back to top]](#top) [[Back to Component Responses]](../../../README.md#Component-Responses) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/components/responses/SuccessWithJsonApiResponse.md b/samples/client/petstore/java/docs/components/responses/SuccessWithJsonApiResponse.md new file mode 100644 index 00000000000..65c594106d9 --- /dev/null +++ b/samples/client/petstore/java/docs/components/responses/SuccessWithJsonApiResponse.md @@ -0,0 +1,90 @@ +# SuccessWithJsonApiResponse +SuccessWithJsonApiResponse.java + +public class SuccessWithJsonApiResponse + +A class that contains necessary nested response classes +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types +- SealedResponseBody, a sealed interface which contains all the contentType/schema types +- records which implement SealedResponseBody, the concrete response body types +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [SuccessWithJsonApiResponse.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [SuccessWithJsonApiResponse.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | +| sealed interface | [SuccessWithJsonApiResponse.SealedResponseBody](#sealedresponsebody)
response body sealed interface | +| record | [SuccessWithJsonApiResponse.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | +| static class | [SuccessWithJsonApiResponse.SuccessWithJsonApiResponse1](#successwithjsonapiresponse1)
class that deserializes responses | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[ApplicationjsonMediaType](#applicationjsonmediatype) + +sealed interface that stores schema and encoding info + +## ApplicationjsonMediaType +public record ApplicationjsonMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../components/responses/successwithjsonapiresponse/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationjsonSchema.ApplicationjsonSchema1](../../components/responses/successwithjsonapiresponse/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## SealedResponseBody +public sealed interface SealedResponseBody
+permits
+[ApplicationjsonResponseBody](#applicationjsonresponsebody) + +sealed interface that stores response body + +## ApplicationjsonResponseBody +public record ApplicationjsonResponseBody
+implements [SealedResponseBody](#sealedresponsebody) + +A record class to store response body for contentType="application/json" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonResponseBody(ApplicationjsonSchema.[ApiResponseSchema1Boxed](../../components/schemas/ApiResponseSchema.md#apiresponseschema1boxed) body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApplicationjsonSchema.[ApiResponseSchema1Boxed](../../components/schemas/ApiResponseSchema.md#apiresponseschema1boxed) | body()
returns the body passed in in the constructor | + +## SuccessWithJsonApiResponse1 +public static class SuccessWithJsonApiResponse1
+extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> + +a class that deserializes responses + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| SuccessWithJsonApiResponse1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | + +[[Back to top]](#top) [[Back to Component Responses]](../../../README.md#Component-Responses) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/components/responses/SuccessfulXmlAndJsonArrayOfPet.md b/samples/client/petstore/java/docs/components/responses/SuccessfulXmlAndJsonArrayOfPet.md new file mode 100644 index 00000000000..81290f28220 --- /dev/null +++ b/samples/client/petstore/java/docs/components/responses/SuccessfulXmlAndJsonArrayOfPet.md @@ -0,0 +1,126 @@ +# SuccessfulXmlAndJsonArrayOfPet +SuccessfulXmlAndJsonArrayOfPet.java + +public class SuccessfulXmlAndJsonArrayOfPet + +A class that contains necessary nested response classes +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types +- SealedResponseBody, a sealed interface which contains all the contentType/schema types +- records which implement SealedResponseBody, the concrete response body types +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [SuccessfulXmlAndJsonArrayOfPet.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [SuccessfulXmlAndJsonArrayOfPet.ApplicationxmlMediaType](#applicationxmlmediatype)
record storing schema + encoding for a specific contentType | +| record | [SuccessfulXmlAndJsonArrayOfPet.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | +| sealed interface | [SuccessfulXmlAndJsonArrayOfPet.SealedResponseBody](#sealedresponsebody)
response body sealed interface | +| record | [SuccessfulXmlAndJsonArrayOfPet.ApplicationxmlResponseBody](#applicationxmlresponsebody)
implements sealed interface to store response body | +| record | [SuccessfulXmlAndJsonArrayOfPet.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | +| static class | [SuccessfulXmlAndJsonArrayOfPet.SuccessfulXmlAndJsonArrayOfPet1](#successfulxmlandjsonarrayofpet1)
class that deserializes responses | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[ApplicationxmlMediaType](#applicationxmlmediatype), +[ApplicationjsonMediaType](#applicationjsonmediatype) + +sealed interface that stores schema and encoding info + +## ApplicationxmlMediaType +public record ApplicationxmlMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationxmlSchema.ApplicationxmlSchema1](../../components/responses/successfulxmlandjsonarrayofpet/content/applicationxml/ApplicationxmlSchema.md#applicationxmlschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationxmlMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationxmlSchema.ApplicationxmlSchema1](../../components/responses/successfulxmlandjsonarrayofpet/content/applicationxml/ApplicationxmlSchema.md#applicationxmlschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## ApplicationjsonMediaType +public record ApplicationjsonMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../components/responses/successfulxmlandjsonarrayofpet/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationjsonSchema.ApplicationjsonSchema1](../../components/responses/successfulxmlandjsonarrayofpet/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## SealedResponseBody +public sealed interface SealedResponseBody
+permits
+[ApplicationxmlResponseBody](#applicationxmlresponsebody), +[ApplicationjsonResponseBody](#applicationjsonresponsebody) + +sealed interface that stores response body + +## ApplicationxmlResponseBody +public record ApplicationxmlResponseBody
+implements [SealedResponseBody](#sealedresponsebody) + +A record class to store response body for contentType="application/xml" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationxmlResponseBody(ApplicationxmlSchema.[ApplicationxmlSchema1Boxed](../../components/responses/successfulxmlandjsonarrayofpet/content/applicationxml/ApplicationxmlSchema.md#applicationxmlschema1boxed) body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApplicationxmlSchema.[ApplicationxmlSchema1Boxed](../../components/responses/successfulxmlandjsonarrayofpet/content/applicationxml/ApplicationxmlSchema.md#applicationxmlschema1boxed) | body()
returns the body passed in in the constructor | +## ApplicationjsonResponseBody +public record ApplicationjsonResponseBody
+implements [SealedResponseBody](#sealedresponsebody) + +A record class to store response body for contentType="application/json" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonResponseBody(ApplicationjsonSchema.[ApplicationjsonSchema1Boxed](../../components/responses/successfulxmlandjsonarrayofpet/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1boxed) body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApplicationjsonSchema.[ApplicationjsonSchema1Boxed](../../components/responses/successfulxmlandjsonarrayofpet/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1boxed) | body()
returns the body passed in in the constructor | + +## SuccessfulXmlAndJsonArrayOfPet1 +public static class SuccessfulXmlAndJsonArrayOfPet1
+extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> + +a class that deserializes responses + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| SuccessfulXmlAndJsonArrayOfPet1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/xml", new [ApplicationxmlMediaType](#applicationxmlmediatype)()),
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | + +[[Back to top]](#top) [[Back to Component Responses]](../../../README.md#Component-Responses) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/components/responses/headerswithnobody/headers/location/LocationSchema.md b/samples/client/petstore/java/docs/components/responses/headerswithnobody/headers/location/LocationSchema.md index 916b572fcf8..82bd0c2a14f 100644 --- a/samples/client/petstore/java/docs/components/responses/headerswithnobody/headers/location/LocationSchema.md +++ b/samples/client/petstore/java/docs/components/responses/headerswithnobody/headers/location/LocationSchema.md @@ -3,38 +3,39 @@ public class LocationSchema
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [LocationSchema.LocationSchema1Boxed](#locationschema1boxed)
abstract sealed validated payload class | -| static class | [LocationSchema.LocationSchema1BoxedString](#locationschema1boxedstring)
boxed class to store validated String payloads | +| sealed interface | [LocationSchema.LocationSchema1Boxed](#locationschema1boxed)
sealed interface for validated payloads | +| record | [LocationSchema.LocationSchema1BoxedString](#locationschema1boxedstring)
boxed class to store validated String payloads | | static class | [LocationSchema.LocationSchema1](#locationschema1)
schema class | ## LocationSchema1Boxed -public static abstract sealed class LocationSchema1Boxed
+public sealed interface LocationSchema1Boxed
permits
[LocationSchema1BoxedString](#locationschema1boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## LocationSchema1BoxedString -public static final class LocationSchema1BoxedString
-extends [LocationSchema1Boxed](#locationschema1boxed) +public record LocationSchema1BoxedString
+implements [LocationSchema1Boxed](#locationschema1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | LocationSchema1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## LocationSchema1 public static class LocationSchema1
diff --git a/samples/client/petstore/java/docs/components/responses/successfulxmlandjsonarrayofpet/content/applicationjson/ApplicationjsonSchema.md b/samples/client/petstore/java/docs/components/responses/successfulxmlandjsonarrayofpet/content/applicationjson/ApplicationjsonSchema.md index dccdc888a43..630e488a953 100644 --- a/samples/client/petstore/java/docs/components/responses/successfulxmlandjsonarrayofpet/content/applicationjson/ApplicationjsonSchema.md +++ b/samples/client/petstore/java/docs/components/responses/successfulxmlandjsonarrayofpet/content/applicationjson/ApplicationjsonSchema.md @@ -3,7 +3,7 @@ public class ApplicationjsonSchema
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated list payloads, extends FrozenList - classes to build inputs for list payloads @@ -11,34 +11,35 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed)
abstract sealed validated payload class | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedList](#applicationjsonschema1boxedlist)
boxed class to store validated List payloads | +| sealed interface | [ApplicationjsonSchema.ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed)
sealed interface for validated payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedList](#applicationjsonschema1boxedlist)
boxed class to store validated List payloads | | static class | [ApplicationjsonSchema.ApplicationjsonSchema1](#applicationjsonschema1)
schema class | | static class | [ApplicationjsonSchema.ApplicationjsonSchemaListBuilder](#applicationjsonschemalistbuilder)
builder for List payloads | | static class | [ApplicationjsonSchema.ApplicationjsonSchemaList](#applicationjsonschemalist)
output class for List payloads | ## ApplicationjsonSchema1Boxed -public static abstract sealed class ApplicationjsonSchema1Boxed
+public sealed interface ApplicationjsonSchema1Boxed
permits
[ApplicationjsonSchema1BoxedList](#applicationjsonschema1boxedlist) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ApplicationjsonSchema1BoxedList -public static final class ApplicationjsonSchema1BoxedList
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) +public record ApplicationjsonSchema1BoxedList
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ApplicationjsonSchema1BoxedList([ApplicationjsonSchemaList](#applicationjsonschemalist) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [ApplicationjsonSchemaList](#applicationjsonschemalist) | data
validated payload | +| [ApplicationjsonSchemaList](#applicationjsonschemalist) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ApplicationjsonSchema1 public static class ApplicationjsonSchema1
@@ -127,7 +128,9 @@ ApplicationjsonSchema.ApplicationjsonSchemaList validatedPayload = | ----------------- | ---------------------- | | [ApplicationjsonSchemaList](#applicationjsonschemalist) | validate([List](#applicationjsonschemalistbuilder) arg, SchemaConfiguration configuration) | | [ApplicationjsonSchema1BoxedList](#applicationjsonschema1boxedlist) | validateAndBox([List](#applicationjsonschemalistbuilder) arg, SchemaConfiguration configuration) | +| [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ApplicationjsonSchemaListBuilder public class ApplicationjsonSchemaListBuilder
builder for `List>` diff --git a/samples/client/petstore/java/docs/components/responses/successfulxmlandjsonarrayofpet/content/applicationxml/ApplicationxmlSchema.md b/samples/client/petstore/java/docs/components/responses/successfulxmlandjsonarrayofpet/content/applicationxml/ApplicationxmlSchema.md index 487b313295a..0519c5f3b6f 100644 --- a/samples/client/petstore/java/docs/components/responses/successfulxmlandjsonarrayofpet/content/applicationxml/ApplicationxmlSchema.md +++ b/samples/client/petstore/java/docs/components/responses/successfulxmlandjsonarrayofpet/content/applicationxml/ApplicationxmlSchema.md @@ -3,7 +3,7 @@ public class ApplicationxmlSchema
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated list payloads, extends FrozenList - classes to build inputs for list payloads @@ -11,34 +11,35 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ApplicationxmlSchema.ApplicationxmlSchema1Boxed](#applicationxmlschema1boxed)
abstract sealed validated payload class | -| static class | [ApplicationxmlSchema.ApplicationxmlSchema1BoxedList](#applicationxmlschema1boxedlist)
boxed class to store validated List payloads | +| sealed interface | [ApplicationxmlSchema.ApplicationxmlSchema1Boxed](#applicationxmlschema1boxed)
sealed interface for validated payloads | +| record | [ApplicationxmlSchema.ApplicationxmlSchema1BoxedList](#applicationxmlschema1boxedlist)
boxed class to store validated List payloads | | static class | [ApplicationxmlSchema.ApplicationxmlSchema1](#applicationxmlschema1)
schema class | | static class | [ApplicationxmlSchema.ApplicationxmlSchemaListBuilder](#applicationxmlschemalistbuilder)
builder for List payloads | | static class | [ApplicationxmlSchema.ApplicationxmlSchemaList](#applicationxmlschemalist)
output class for List payloads | ## ApplicationxmlSchema1Boxed -public static abstract sealed class ApplicationxmlSchema1Boxed
+public sealed interface ApplicationxmlSchema1Boxed
permits
[ApplicationxmlSchema1BoxedList](#applicationxmlschema1boxedlist) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ApplicationxmlSchema1BoxedList -public static final class ApplicationxmlSchema1BoxedList
-extends [ApplicationxmlSchema1Boxed](#applicationxmlschema1boxed) +public record ApplicationxmlSchema1BoxedList
+implements [ApplicationxmlSchema1Boxed](#applicationxmlschema1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ApplicationxmlSchema1BoxedList([ApplicationxmlSchemaList](#applicationxmlschemalist) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [ApplicationxmlSchemaList](#applicationxmlschemalist) | data
validated payload | +| [ApplicationxmlSchemaList](#applicationxmlschemalist) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ApplicationxmlSchema1 public static class ApplicationxmlSchema1
@@ -127,7 +128,9 @@ ApplicationxmlSchema.ApplicationxmlSchemaList validatedPayload = | ----------------- | ---------------------- | | [ApplicationxmlSchemaList](#applicationxmlschemalist) | validate([List](#applicationxmlschemalistbuilder) arg, SchemaConfiguration configuration) | | [ApplicationxmlSchema1BoxedList](#applicationxmlschema1boxedlist) | validateAndBox([List](#applicationxmlschemalistbuilder) arg, SchemaConfiguration configuration) | +| [ApplicationxmlSchema1Boxed](#applicationxmlschema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ApplicationxmlSchemaListBuilder public class ApplicationxmlSchemaListBuilder
builder for `List>` diff --git a/samples/client/petstore/java/docs/components/responses/successinlinecontentandheader/content/applicationjson/ApplicationjsonSchema.md b/samples/client/petstore/java/docs/components/responses/successinlinecontentandheader/content/applicationjson/ApplicationjsonSchema.md index 0e56aa153f1..4c66fb9c3a2 100644 --- a/samples/client/petstore/java/docs/components/responses/successinlinecontentandheader/content/applicationjson/ApplicationjsonSchema.md +++ b/samples/client/petstore/java/docs/components/responses/successinlinecontentandheader/content/applicationjson/ApplicationjsonSchema.md @@ -3,7 +3,7 @@ public class ApplicationjsonSchema
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -11,37 +11,38 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed)
abstract sealed validated payload class | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ApplicationjsonSchema.ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed)
sealed interface for validated payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap)
boxed class to store validated Map payloads | | static class | [ApplicationjsonSchema.ApplicationjsonSchema1](#applicationjsonschema1)
schema class | | static class | [ApplicationjsonSchema.ApplicationjsonSchemaMapBuilder](#applicationjsonschemamapbuilder)
builder for Map payloads | | static class | [ApplicationjsonSchema.ApplicationjsonSchemaMap](#applicationjsonschemamap)
output class for Map payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonAdditionalPropertiesBoxed](#applicationjsonadditionalpropertiesboxed)
abstract sealed validated payload class | -| static class | [ApplicationjsonSchema.ApplicationjsonAdditionalPropertiesBoxedNumber](#applicationjsonadditionalpropertiesboxednumber)
boxed class to store validated Number payloads | +| sealed interface | [ApplicationjsonSchema.ApplicationjsonAdditionalPropertiesBoxed](#applicationjsonadditionalpropertiesboxed)
sealed interface for validated payloads | +| record | [ApplicationjsonSchema.ApplicationjsonAdditionalPropertiesBoxedNumber](#applicationjsonadditionalpropertiesboxednumber)
boxed class to store validated Number payloads | | static class | [ApplicationjsonSchema.ApplicationjsonAdditionalProperties](#applicationjsonadditionalproperties)
schema class | ## ApplicationjsonSchema1Boxed -public static abstract sealed class ApplicationjsonSchema1Boxed
+public sealed interface ApplicationjsonSchema1Boxed
permits
[ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ApplicationjsonSchema1BoxedMap -public static final class ApplicationjsonSchema1BoxedMap
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) +public record ApplicationjsonSchema1BoxedMap
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ApplicationjsonSchema1BoxedMap([ApplicationjsonSchemaMap](#applicationjsonschemamap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [ApplicationjsonSchemaMap](#applicationjsonschemamap) | data
validated payload | +| [ApplicationjsonSchemaMap](#applicationjsonschemamap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ApplicationjsonSchema1 public static class ApplicationjsonSchema1
@@ -86,7 +87,9 @@ ApplicationjsonSchema.ApplicationjsonSchemaMap validatedPayload = | ----------------- | ---------------------- | | [ApplicationjsonSchemaMap](#applicationjsonschemamap) | validate([Map<?, ?>](#applicationjsonschemamapbuilder) arg, SchemaConfiguration configuration) | | [ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap) | validateAndBox([Map<?, ?>](#applicationjsonschemamapbuilder) arg, SchemaConfiguration configuration) | +| [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ApplicationjsonSchemaMapBuilder public class ApplicationjsonSchemaMapBuilder
builder for `Map` @@ -118,27 +121,28 @@ A class to store validated Map payloads | Number | getAdditionalProperty(String name)
provides type safety for additional properties | ## ApplicationjsonAdditionalPropertiesBoxed -public static abstract sealed class ApplicationjsonAdditionalPropertiesBoxed
+public sealed interface ApplicationjsonAdditionalPropertiesBoxed
permits
[ApplicationjsonAdditionalPropertiesBoxedNumber](#applicationjsonadditionalpropertiesboxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ApplicationjsonAdditionalPropertiesBoxedNumber -public static final class ApplicationjsonAdditionalPropertiesBoxedNumber
-extends [ApplicationjsonAdditionalPropertiesBoxed](#applicationjsonadditionalpropertiesboxed) +public record ApplicationjsonAdditionalPropertiesBoxedNumber
+implements [ApplicationjsonAdditionalPropertiesBoxed](#applicationjsonadditionalpropertiesboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ApplicationjsonAdditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ApplicationjsonAdditionalProperties public static class ApplicationjsonAdditionalProperties
diff --git a/samples/client/petstore/java/docs/components/responses/successinlinecontentandheader/headers/someheader/SomeHeaderSchema.md b/samples/client/petstore/java/docs/components/responses/successinlinecontentandheader/headers/someheader/SomeHeaderSchema.md index 58e022870dc..752e31ffc15 100644 --- a/samples/client/petstore/java/docs/components/responses/successinlinecontentandheader/headers/someheader/SomeHeaderSchema.md +++ b/samples/client/petstore/java/docs/components/responses/successinlinecontentandheader/headers/someheader/SomeHeaderSchema.md @@ -3,38 +3,39 @@ public class SomeHeaderSchema
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [SomeHeaderSchema.SomeHeaderSchema1Boxed](#someheaderschema1boxed)
abstract sealed validated payload class | -| static class | [SomeHeaderSchema.SomeHeaderSchema1BoxedString](#someheaderschema1boxedstring)
boxed class to store validated String payloads | +| sealed interface | [SomeHeaderSchema.SomeHeaderSchema1Boxed](#someheaderschema1boxed)
sealed interface for validated payloads | +| record | [SomeHeaderSchema.SomeHeaderSchema1BoxedString](#someheaderschema1boxedstring)
boxed class to store validated String payloads | | static class | [SomeHeaderSchema.SomeHeaderSchema1](#someheaderschema1)
schema class | ## SomeHeaderSchema1Boxed -public static abstract sealed class SomeHeaderSchema1Boxed
+public sealed interface SomeHeaderSchema1Boxed
permits
[SomeHeaderSchema1BoxedString](#someheaderschema1boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## SomeHeaderSchema1BoxedString -public static final class SomeHeaderSchema1BoxedString
-extends [SomeHeaderSchema1Boxed](#someheaderschema1boxed) +public record SomeHeaderSchema1BoxedString
+implements [SomeHeaderSchema1Boxed](#someheaderschema1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | SomeHeaderSchema1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## SomeHeaderSchema1 public static class SomeHeaderSchema1
diff --git a/samples/client/petstore/java/docs/components/responses/successwithjsonapiresponse/content/applicationjson/ApplicationjsonSchema.md b/samples/client/petstore/java/docs/components/responses/successwithjsonapiresponse/content/applicationjson/ApplicationjsonSchema.md index 47ed11ea57f..5220d8f5ade 100644 --- a/samples/client/petstore/java/docs/components/responses/successwithjsonapiresponse/content/applicationjson/ApplicationjsonSchema.md +++ b/samples/client/petstore/java/docs/components/responses/successwithjsonapiresponse/content/applicationjson/ApplicationjsonSchema.md @@ -4,7 +4,7 @@ extends [ApiResponseSchema1](../../../../../../components/schemas/ApiResponseSch A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary diff --git a/samples/client/petstore/java/docs/components/schemas/AbstractStepMessage.md b/samples/client/petstore/java/docs/components/schemas/AbstractStepMessage.md index 15a4cc0308d..e908b99ca3a 100644 --- a/samples/client/petstore/java/docs/components/schemas/AbstractStepMessage.md +++ b/samples/client/petstore/java/docs/components/schemas/AbstractStepMessage.md @@ -4,7 +4,7 @@ public class AbstractStepMessage
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,37 +12,38 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [AbstractStepMessage.AbstractStepMessage1Boxed](#abstractstepmessage1boxed)
abstract sealed validated payload class | -| static class | [AbstractStepMessage.AbstractStepMessage1BoxedMap](#abstractstepmessage1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AbstractStepMessage.AbstractStepMessage1Boxed](#abstractstepmessage1boxed)
sealed interface for validated payloads | +| record | [AbstractStepMessage.AbstractStepMessage1BoxedMap](#abstractstepmessage1boxedmap)
boxed class to store validated Map payloads | | static class | [AbstractStepMessage.AbstractStepMessage1](#abstractstepmessage1)
schema class | | static class | [AbstractStepMessage.AbstractStepMessageMapBuilder](#abstractstepmessagemapbuilder)
builder for Map payloads | | static class | [AbstractStepMessage.AbstractStepMessageMap](#abstractstepmessagemap)
output class for Map payloads | -| static class | [AbstractStepMessage.DiscriminatorBoxed](#discriminatorboxed)
abstract sealed validated payload class | -| static class | [AbstractStepMessage.DiscriminatorBoxedString](#discriminatorboxedstring)
boxed class to store validated String payloads | +| sealed interface | [AbstractStepMessage.DiscriminatorBoxed](#discriminatorboxed)
sealed interface for validated payloads | +| record | [AbstractStepMessage.DiscriminatorBoxedString](#discriminatorboxedstring)
boxed class to store validated String payloads | | static class | [AbstractStepMessage.Discriminator](#discriminator)
schema class | ## AbstractStepMessage1Boxed -public static abstract sealed class AbstractStepMessage1Boxed
+public sealed interface AbstractStepMessage1Boxed
permits
[AbstractStepMessage1BoxedMap](#abstractstepmessage1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AbstractStepMessage1BoxedMap -public static final class AbstractStepMessage1BoxedMap
-extends [AbstractStepMessage1Boxed](#abstractstepmessage1boxed) +public record AbstractStepMessage1BoxedMap
+implements [AbstractStepMessage1Boxed](#abstractstepmessage1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AbstractStepMessage1BoxedMap([AbstractStepMessageMap](#abstractstepmessagemap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [AbstractStepMessageMap](#abstractstepmessagemap) | data
validated payload | +| [AbstractStepMessageMap](#abstractstepmessagemap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AbstractStepMessage1 public static class AbstractStepMessage1
@@ -92,7 +93,9 @@ AbstractStepMessage.AbstractStepMessageMap validatedPayload = | ----------------- | ---------------------- | | [AbstractStepMessageMap](#abstractstepmessagemap) | validate([Map<?, ?>](#abstractstepmessagemapbuilder) arg, SchemaConfiguration configuration) | | [AbstractStepMessage1BoxedMap](#abstractstepmessage1boxedmap) | validateAndBox([Map<?, ?>](#abstractstepmessagemapbuilder) arg, SchemaConfiguration configuration) | +| [AbstractStepMessage1Boxed](#abstractstepmessage1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## AbstractStepMessageMap000Builder public class AbstractStepMessageMap000Builder
builder for `Map` @@ -315,27 +318,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## DiscriminatorBoxed -public static abstract sealed class DiscriminatorBoxed
+public sealed interface DiscriminatorBoxed
permits
[DiscriminatorBoxedString](#discriminatorboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## DiscriminatorBoxedString -public static final class DiscriminatorBoxedString
-extends [DiscriminatorBoxed](#discriminatorboxed) +public record DiscriminatorBoxedString
+implements [DiscriminatorBoxed](#discriminatorboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DiscriminatorBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Discriminator public static class Discriminator
diff --git a/samples/client/petstore/java/docs/components/schemas/AdditionalPropertiesClass.md b/samples/client/petstore/java/docs/components/schemas/AdditionalPropertiesClass.md index f836d04a9ef..f316710c8bb 100644 --- a/samples/client/petstore/java/docs/components/schemas/AdditionalPropertiesClass.md +++ b/samples/client/petstore/java/docs/components/schemas/AdditionalPropertiesClass.md @@ -4,7 +4,7 @@ public class AdditionalPropertiesClass
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,103 +12,104 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [AdditionalPropertiesClass.AdditionalPropertiesClass1Boxed](#additionalpropertiesclass1boxed)
abstract sealed validated payload class | -| static class | [AdditionalPropertiesClass.AdditionalPropertiesClass1BoxedMap](#additionalpropertiesclass1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AdditionalPropertiesClass.AdditionalPropertiesClass1Boxed](#additionalpropertiesclass1boxed)
sealed interface for validated payloads | +| record | [AdditionalPropertiesClass.AdditionalPropertiesClass1BoxedMap](#additionalpropertiesclass1boxedmap)
boxed class to store validated Map payloads | | static class | [AdditionalPropertiesClass.AdditionalPropertiesClass1](#additionalpropertiesclass1)
schema class | | static class | [AdditionalPropertiesClass.AdditionalPropertiesClassMapBuilder](#additionalpropertiesclassmapbuilder)
builder for Map payloads | | static class | [AdditionalPropertiesClass.AdditionalPropertiesClassMap](#additionalpropertiesclassmap)
output class for Map payloads | -| static class | [AdditionalPropertiesClass.MapWithUndeclaredPropertiesStringBoxed](#mapwithundeclaredpropertiesstringboxed)
abstract sealed validated payload class | -| static class | [AdditionalPropertiesClass.MapWithUndeclaredPropertiesStringBoxedMap](#mapwithundeclaredpropertiesstringboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AdditionalPropertiesClass.MapWithUndeclaredPropertiesStringBoxed](#mapwithundeclaredpropertiesstringboxed)
sealed interface for validated payloads | +| record | [AdditionalPropertiesClass.MapWithUndeclaredPropertiesStringBoxedMap](#mapwithundeclaredpropertiesstringboxedmap)
boxed class to store validated Map payloads | | static class | [AdditionalPropertiesClass.MapWithUndeclaredPropertiesString](#mapwithundeclaredpropertiesstring)
schema class | | static class | [AdditionalPropertiesClass.MapWithUndeclaredPropertiesStringMapBuilder](#mapwithundeclaredpropertiesstringmapbuilder)
builder for Map payloads | | static class | [AdditionalPropertiesClass.MapWithUndeclaredPropertiesStringMap](#mapwithundeclaredpropertiesstringmap)
output class for Map payloads | -| static class | [AdditionalPropertiesClass.AdditionalProperties5Boxed](#additionalproperties5boxed)
abstract sealed validated payload class | -| static class | [AdditionalPropertiesClass.AdditionalProperties5BoxedString](#additionalproperties5boxedstring)
boxed class to store validated String payloads | +| sealed interface | [AdditionalPropertiesClass.AdditionalProperties5Boxed](#additionalproperties5boxed)
sealed interface for validated payloads | +| record | [AdditionalPropertiesClass.AdditionalProperties5BoxedString](#additionalproperties5boxedstring)
boxed class to store validated String payloads | | static class | [AdditionalPropertiesClass.AdditionalProperties5](#additionalproperties5)
schema class | -| static class | [AdditionalPropertiesClass.EmptyMapBoxed](#emptymapboxed)
abstract sealed validated payload class | -| static class | [AdditionalPropertiesClass.EmptyMapBoxedMap](#emptymapboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AdditionalPropertiesClass.EmptyMapBoxed](#emptymapboxed)
sealed interface for validated payloads | +| record | [AdditionalPropertiesClass.EmptyMapBoxedMap](#emptymapboxedmap)
boxed class to store validated Map payloads | | static class | [AdditionalPropertiesClass.EmptyMap](#emptymap)
schema class | | static class | [AdditionalPropertiesClass.EmptyMapMapBuilder](#emptymapmapbuilder)
builder for Map payloads | | static class | [AdditionalPropertiesClass.EmptyMapMap](#emptymapmap)
output class for Map payloads | -| static class | [AdditionalPropertiesClass.AdditionalProperties4Boxed](#additionalproperties4boxed)
abstract sealed validated payload class | -| static class | [AdditionalPropertiesClass.AdditionalProperties4BoxedVoid](#additionalproperties4boxedvoid)
boxed class to store validated null payloads | -| static class | [AdditionalPropertiesClass.AdditionalProperties4BoxedBoolean](#additionalproperties4boxedboolean)
boxed class to store validated boolean payloads | -| static class | [AdditionalPropertiesClass.AdditionalProperties4BoxedNumber](#additionalproperties4boxednumber)
boxed class to store validated Number payloads | -| static class | [AdditionalPropertiesClass.AdditionalProperties4BoxedString](#additionalproperties4boxedstring)
boxed class to store validated String payloads | -| static class | [AdditionalPropertiesClass.AdditionalProperties4BoxedList](#additionalproperties4boxedlist)
boxed class to store validated List payloads | -| static class | [AdditionalPropertiesClass.AdditionalProperties4BoxedMap](#additionalproperties4boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AdditionalPropertiesClass.AdditionalProperties4Boxed](#additionalproperties4boxed)
sealed interface for validated payloads | +| record | [AdditionalPropertiesClass.AdditionalProperties4BoxedVoid](#additionalproperties4boxedvoid)
boxed class to store validated null payloads | +| record | [AdditionalPropertiesClass.AdditionalProperties4BoxedBoolean](#additionalproperties4boxedboolean)
boxed class to store validated boolean payloads | +| record | [AdditionalPropertiesClass.AdditionalProperties4BoxedNumber](#additionalproperties4boxednumber)
boxed class to store validated Number payloads | +| record | [AdditionalPropertiesClass.AdditionalProperties4BoxedString](#additionalproperties4boxedstring)
boxed class to store validated String payloads | +| record | [AdditionalPropertiesClass.AdditionalProperties4BoxedList](#additionalproperties4boxedlist)
boxed class to store validated List payloads | +| record | [AdditionalPropertiesClass.AdditionalProperties4BoxedMap](#additionalproperties4boxedmap)
boxed class to store validated Map payloads | | static class | [AdditionalPropertiesClass.AdditionalProperties4](#additionalproperties4)
schema class | -| static class | [AdditionalPropertiesClass.MapWithUndeclaredPropertiesAnytype3Boxed](#mapwithundeclaredpropertiesanytype3boxed)
abstract sealed validated payload class | -| static class | [AdditionalPropertiesClass.MapWithUndeclaredPropertiesAnytype3BoxedMap](#mapwithundeclaredpropertiesanytype3boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AdditionalPropertiesClass.MapWithUndeclaredPropertiesAnytype3Boxed](#mapwithundeclaredpropertiesanytype3boxed)
sealed interface for validated payloads | +| record | [AdditionalPropertiesClass.MapWithUndeclaredPropertiesAnytype3BoxedMap](#mapwithundeclaredpropertiesanytype3boxedmap)
boxed class to store validated Map payloads | | static class | [AdditionalPropertiesClass.MapWithUndeclaredPropertiesAnytype3](#mapwithundeclaredpropertiesanytype3)
schema class | | static class | [AdditionalPropertiesClass.MapWithUndeclaredPropertiesAnytype3MapBuilder](#mapwithundeclaredpropertiesanytype3mapbuilder)
builder for Map payloads | | static class | [AdditionalPropertiesClass.MapWithUndeclaredPropertiesAnytype3Map](#mapwithundeclaredpropertiesanytype3map)
output class for Map payloads | -| static class | [AdditionalPropertiesClass.AdditionalProperties3Boxed](#additionalproperties3boxed)
abstract sealed validated payload class | -| static class | [AdditionalPropertiesClass.AdditionalProperties3BoxedVoid](#additionalproperties3boxedvoid)
boxed class to store validated null payloads | -| static class | [AdditionalPropertiesClass.AdditionalProperties3BoxedBoolean](#additionalproperties3boxedboolean)
boxed class to store validated boolean payloads | -| static class | [AdditionalPropertiesClass.AdditionalProperties3BoxedNumber](#additionalproperties3boxednumber)
boxed class to store validated Number payloads | -| static class | [AdditionalPropertiesClass.AdditionalProperties3BoxedString](#additionalproperties3boxedstring)
boxed class to store validated String payloads | -| static class | [AdditionalPropertiesClass.AdditionalProperties3BoxedList](#additionalproperties3boxedlist)
boxed class to store validated List payloads | -| static class | [AdditionalPropertiesClass.AdditionalProperties3BoxedMap](#additionalproperties3boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AdditionalPropertiesClass.AdditionalProperties3Boxed](#additionalproperties3boxed)
sealed interface for validated payloads | +| record | [AdditionalPropertiesClass.AdditionalProperties3BoxedVoid](#additionalproperties3boxedvoid)
boxed class to store validated null payloads | +| record | [AdditionalPropertiesClass.AdditionalProperties3BoxedBoolean](#additionalproperties3boxedboolean)
boxed class to store validated boolean payloads | +| record | [AdditionalPropertiesClass.AdditionalProperties3BoxedNumber](#additionalproperties3boxednumber)
boxed class to store validated Number payloads | +| record | [AdditionalPropertiesClass.AdditionalProperties3BoxedString](#additionalproperties3boxedstring)
boxed class to store validated String payloads | +| record | [AdditionalPropertiesClass.AdditionalProperties3BoxedList](#additionalproperties3boxedlist)
boxed class to store validated List payloads | +| record | [AdditionalPropertiesClass.AdditionalProperties3BoxedMap](#additionalproperties3boxedmap)
boxed class to store validated Map payloads | | static class | [AdditionalPropertiesClass.AdditionalProperties3](#additionalproperties3)
schema class | -| static class | [AdditionalPropertiesClass.MapWithUndeclaredPropertiesAnytype2Boxed](#mapwithundeclaredpropertiesanytype2boxed)
abstract sealed validated payload class | -| static class | [AdditionalPropertiesClass.MapWithUndeclaredPropertiesAnytype2BoxedMap](#mapwithundeclaredpropertiesanytype2boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AdditionalPropertiesClass.MapWithUndeclaredPropertiesAnytype2Boxed](#mapwithundeclaredpropertiesanytype2boxed)
sealed interface for validated payloads | +| record | [AdditionalPropertiesClass.MapWithUndeclaredPropertiesAnytype2BoxedMap](#mapwithundeclaredpropertiesanytype2boxedmap)
boxed class to store validated Map payloads | | static class | [AdditionalPropertiesClass.MapWithUndeclaredPropertiesAnytype2](#mapwithundeclaredpropertiesanytype2)
schema class | -| static class | [AdditionalPropertiesClass.MapWithUndeclaredPropertiesAnytype1Boxed](#mapwithundeclaredpropertiesanytype1boxed)
abstract sealed validated payload class | -| static class | [AdditionalPropertiesClass.MapWithUndeclaredPropertiesAnytype1BoxedMap](#mapwithundeclaredpropertiesanytype1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AdditionalPropertiesClass.MapWithUndeclaredPropertiesAnytype1Boxed](#mapwithundeclaredpropertiesanytype1boxed)
sealed interface for validated payloads | +| record | [AdditionalPropertiesClass.MapWithUndeclaredPropertiesAnytype1BoxedMap](#mapwithundeclaredpropertiesanytype1boxedmap)
boxed class to store validated Map payloads | | static class | [AdditionalPropertiesClass.MapWithUndeclaredPropertiesAnytype1](#mapwithundeclaredpropertiesanytype1)
schema class | -| static class | [AdditionalPropertiesClass.Anytype1Boxed](#anytype1boxed)
abstract sealed validated payload class | -| static class | [AdditionalPropertiesClass.Anytype1BoxedVoid](#anytype1boxedvoid)
boxed class to store validated null payloads | -| static class | [AdditionalPropertiesClass.Anytype1BoxedBoolean](#anytype1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [AdditionalPropertiesClass.Anytype1BoxedNumber](#anytype1boxednumber)
boxed class to store validated Number payloads | -| static class | [AdditionalPropertiesClass.Anytype1BoxedString](#anytype1boxedstring)
boxed class to store validated String payloads | -| static class | [AdditionalPropertiesClass.Anytype1BoxedList](#anytype1boxedlist)
boxed class to store validated List payloads | -| static class | [AdditionalPropertiesClass.Anytype1BoxedMap](#anytype1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AdditionalPropertiesClass.Anytype1Boxed](#anytype1boxed)
sealed interface for validated payloads | +| record | [AdditionalPropertiesClass.Anytype1BoxedVoid](#anytype1boxedvoid)
boxed class to store validated null payloads | +| record | [AdditionalPropertiesClass.Anytype1BoxedBoolean](#anytype1boxedboolean)
boxed class to store validated boolean payloads | +| record | [AdditionalPropertiesClass.Anytype1BoxedNumber](#anytype1boxednumber)
boxed class to store validated Number payloads | +| record | [AdditionalPropertiesClass.Anytype1BoxedString](#anytype1boxedstring)
boxed class to store validated String payloads | +| record | [AdditionalPropertiesClass.Anytype1BoxedList](#anytype1boxedlist)
boxed class to store validated List payloads | +| record | [AdditionalPropertiesClass.Anytype1BoxedMap](#anytype1boxedmap)
boxed class to store validated Map payloads | | static class | [AdditionalPropertiesClass.Anytype1](#anytype1)
schema class | -| static class | [AdditionalPropertiesClass.MapOfMapPropertyBoxed](#mapofmappropertyboxed)
abstract sealed validated payload class | -| static class | [AdditionalPropertiesClass.MapOfMapPropertyBoxedMap](#mapofmappropertyboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AdditionalPropertiesClass.MapOfMapPropertyBoxed](#mapofmappropertyboxed)
sealed interface for validated payloads | +| record | [AdditionalPropertiesClass.MapOfMapPropertyBoxedMap](#mapofmappropertyboxedmap)
boxed class to store validated Map payloads | | static class | [AdditionalPropertiesClass.MapOfMapProperty](#mapofmapproperty)
schema class | | static class | [AdditionalPropertiesClass.MapOfMapPropertyMapBuilder](#mapofmappropertymapbuilder)
builder for Map payloads | | static class | [AdditionalPropertiesClass.MapOfMapPropertyMap](#mapofmappropertymap)
output class for Map payloads | -| static class | [AdditionalPropertiesClass.AdditionalProperties1Boxed](#additionalproperties1boxed)
abstract sealed validated payload class | -| static class | [AdditionalPropertiesClass.AdditionalProperties1BoxedMap](#additionalproperties1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AdditionalPropertiesClass.AdditionalProperties1Boxed](#additionalproperties1boxed)
sealed interface for validated payloads | +| record | [AdditionalPropertiesClass.AdditionalProperties1BoxedMap](#additionalproperties1boxedmap)
boxed class to store validated Map payloads | | static class | [AdditionalPropertiesClass.AdditionalProperties1](#additionalproperties1)
schema class | | static class | [AdditionalPropertiesClass.AdditionalPropertiesMapBuilder2](#additionalpropertiesmapbuilder2)
builder for Map payloads | | static class | [AdditionalPropertiesClass.AdditionalPropertiesMap](#additionalpropertiesmap)
output class for Map payloads | -| static class | [AdditionalPropertiesClass.AdditionalProperties2Boxed](#additionalproperties2boxed)
abstract sealed validated payload class | -| static class | [AdditionalPropertiesClass.AdditionalProperties2BoxedString](#additionalproperties2boxedstring)
boxed class to store validated String payloads | +| sealed interface | [AdditionalPropertiesClass.AdditionalProperties2Boxed](#additionalproperties2boxed)
sealed interface for validated payloads | +| record | [AdditionalPropertiesClass.AdditionalProperties2BoxedString](#additionalproperties2boxedstring)
boxed class to store validated String payloads | | static class | [AdditionalPropertiesClass.AdditionalProperties2](#additionalproperties2)
schema class | -| static class | [AdditionalPropertiesClass.MapPropertyBoxed](#mappropertyboxed)
abstract sealed validated payload class | -| static class | [AdditionalPropertiesClass.MapPropertyBoxedMap](#mappropertyboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AdditionalPropertiesClass.MapPropertyBoxed](#mappropertyboxed)
sealed interface for validated payloads | +| record | [AdditionalPropertiesClass.MapPropertyBoxedMap](#mappropertyboxedmap)
boxed class to store validated Map payloads | | static class | [AdditionalPropertiesClass.MapProperty](#mapproperty)
schema class | | static class | [AdditionalPropertiesClass.MapPropertyMapBuilder](#mappropertymapbuilder)
builder for Map payloads | | static class | [AdditionalPropertiesClass.MapPropertyMap](#mappropertymap)
output class for Map payloads | -| static class | [AdditionalPropertiesClass.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
abstract sealed validated payload class | -| static class | [AdditionalPropertiesClass.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | +| sealed interface | [AdditionalPropertiesClass.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
sealed interface for validated payloads | +| record | [AdditionalPropertiesClass.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | | static class | [AdditionalPropertiesClass.AdditionalProperties](#additionalproperties)
schema class | ## AdditionalPropertiesClass1Boxed -public static abstract sealed class AdditionalPropertiesClass1Boxed
+public sealed interface AdditionalPropertiesClass1Boxed
permits
[AdditionalPropertiesClass1BoxedMap](#additionalpropertiesclass1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AdditionalPropertiesClass1BoxedMap -public static final class AdditionalPropertiesClass1BoxedMap
-extends [AdditionalPropertiesClass1Boxed](#additionalpropertiesclass1boxed) +public record AdditionalPropertiesClass1BoxedMap
+implements [AdditionalPropertiesClass1Boxed](#additionalpropertiesclass1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesClass1BoxedMap([AdditionalPropertiesClassMap](#additionalpropertiesclassmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [AdditionalPropertiesClassMap](#additionalpropertiesclassmap) | data
validated payload | +| [AdditionalPropertiesClassMap](#additionalpropertiesclassmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesClass1 public static class AdditionalPropertiesClass1
@@ -188,7 +189,9 @@ AdditionalPropertiesClass.AdditionalPropertiesClassMap validatedPayload = | ----------------- | ---------------------- | | [AdditionalPropertiesClassMap](#additionalpropertiesclassmap) | validate([Map<?, ?>](#additionalpropertiesclassmapbuilder) arg, SchemaConfiguration configuration) | | [AdditionalPropertiesClass1BoxedMap](#additionalpropertiesclass1boxedmap) | validateAndBox([Map<?, ?>](#additionalpropertiesclassmapbuilder) arg, SchemaConfiguration configuration) | +| [AdditionalPropertiesClass1Boxed](#additionalpropertiesclass1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## AdditionalPropertiesClassMapBuilder public class AdditionalPropertiesClassMapBuilder
builder for `Map` @@ -251,27 +254,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## MapWithUndeclaredPropertiesStringBoxed -public static abstract sealed class MapWithUndeclaredPropertiesStringBoxed
+public sealed interface MapWithUndeclaredPropertiesStringBoxed
permits
[MapWithUndeclaredPropertiesStringBoxedMap](#mapwithundeclaredpropertiesstringboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## MapWithUndeclaredPropertiesStringBoxedMap -public static final class MapWithUndeclaredPropertiesStringBoxedMap
-extends [MapWithUndeclaredPropertiesStringBoxed](#mapwithundeclaredpropertiesstringboxed) +public record MapWithUndeclaredPropertiesStringBoxedMap
+implements [MapWithUndeclaredPropertiesStringBoxed](#mapwithundeclaredpropertiesstringboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MapWithUndeclaredPropertiesStringBoxedMap([MapWithUndeclaredPropertiesStringMap](#mapwithundeclaredpropertiesstringmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [MapWithUndeclaredPropertiesStringMap](#mapwithundeclaredpropertiesstringmap) | data
validated payload | +| [MapWithUndeclaredPropertiesStringMap](#mapwithundeclaredpropertiesstringmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MapWithUndeclaredPropertiesString public static class MapWithUndeclaredPropertiesString
@@ -316,7 +320,9 @@ AdditionalPropertiesClass.MapWithUndeclaredPropertiesStringMap validatedPayload | ----------------- | ---------------------- | | [MapWithUndeclaredPropertiesStringMap](#mapwithundeclaredpropertiesstringmap) | validate([Map<?, ?>](#mapwithundeclaredpropertiesstringmapbuilder) arg, SchemaConfiguration configuration) | | [MapWithUndeclaredPropertiesStringBoxedMap](#mapwithundeclaredpropertiesstringboxedmap) | validateAndBox([Map<?, ?>](#mapwithundeclaredpropertiesstringmapbuilder) arg, SchemaConfiguration configuration) | +| [MapWithUndeclaredPropertiesStringBoxed](#mapwithundeclaredpropertiesstringboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## MapWithUndeclaredPropertiesStringMapBuilder public class MapWithUndeclaredPropertiesStringMapBuilder
builder for `Map` @@ -347,27 +353,28 @@ A class to store validated Map payloads | String | getAdditionalProperty(String name)
provides type safety for additional properties | ## AdditionalProperties5Boxed -public static abstract sealed class AdditionalProperties5Boxed
+public sealed interface AdditionalProperties5Boxed
permits
[AdditionalProperties5BoxedString](#additionalproperties5boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AdditionalProperties5BoxedString -public static final class AdditionalProperties5BoxedString
-extends [AdditionalProperties5Boxed](#additionalproperties5boxed) +public record AdditionalProperties5BoxedString
+implements [AdditionalProperties5Boxed](#additionalproperties5boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalProperties5BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalProperties5 public static class AdditionalProperties5
@@ -381,27 +388,28 @@ A schema class that validates payloads | validateAndBox | ## EmptyMapBoxed -public static abstract sealed class EmptyMapBoxed
+public sealed interface EmptyMapBoxed
permits
[EmptyMapBoxedMap](#emptymapboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## EmptyMapBoxedMap -public static final class EmptyMapBoxedMap
-extends [EmptyMapBoxed](#emptymapboxed) +public record EmptyMapBoxedMap
+implements [EmptyMapBoxed](#emptymapboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | EmptyMapBoxedMap([EmptyMapMap](#emptymapmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [EmptyMapMap](#emptymapmap) | data
validated payload | +| [EmptyMapMap](#emptymapmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## EmptyMap public static class EmptyMap
@@ -447,7 +455,9 @@ AdditionalPropertiesClass.EmptyMapMap validatedPayload = | ----------------- | ---------------------- | | [EmptyMapMap](#emptymapmap) | validate([Map<?, ?>](#emptymapmapbuilder) arg, SchemaConfiguration configuration) | | [EmptyMapBoxedMap](#emptymapboxedmap) | validateAndBox([Map<?, ?>](#emptymapmapbuilder) arg, SchemaConfiguration configuration) | +| [EmptyMapBoxed](#emptymapboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## EmptyMapMapBuilder public class EmptyMapMapBuilder
builder for `Map` @@ -476,7 +486,7 @@ A class to store validated Map payloads | static [EmptyMapMap](#emptymapmap) | of([Map](#emptymapmapbuilder) arg, SchemaConfiguration configuration) | ## AdditionalProperties4Boxed -public static abstract sealed class AdditionalProperties4Boxed
+public sealed interface AdditionalProperties4Boxed
permits
[AdditionalProperties4BoxedVoid](#additionalproperties4boxedvoid), [AdditionalProperties4BoxedBoolean](#additionalproperties4boxedboolean), @@ -485,103 +495,109 @@ permits
[AdditionalProperties4BoxedList](#additionalproperties4boxedlist), [AdditionalProperties4BoxedMap](#additionalproperties4boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AdditionalProperties4BoxedVoid -public static final class AdditionalProperties4BoxedVoid
-extends [AdditionalProperties4Boxed](#additionalproperties4boxed) +public record AdditionalProperties4BoxedVoid
+implements [AdditionalProperties4Boxed](#additionalproperties4boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalProperties4BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalProperties4BoxedBoolean -public static final class AdditionalProperties4BoxedBoolean
-extends [AdditionalProperties4Boxed](#additionalproperties4boxed) +public record AdditionalProperties4BoxedBoolean
+implements [AdditionalProperties4Boxed](#additionalproperties4boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalProperties4BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalProperties4BoxedNumber -public static final class AdditionalProperties4BoxedNumber
-extends [AdditionalProperties4Boxed](#additionalproperties4boxed) +public record AdditionalProperties4BoxedNumber
+implements [AdditionalProperties4Boxed](#additionalproperties4boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalProperties4BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalProperties4BoxedString -public static final class AdditionalProperties4BoxedString
-extends [AdditionalProperties4Boxed](#additionalproperties4boxed) +public record AdditionalProperties4BoxedString
+implements [AdditionalProperties4Boxed](#additionalproperties4boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalProperties4BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalProperties4BoxedList -public static final class AdditionalProperties4BoxedList
-extends [AdditionalProperties4Boxed](#additionalproperties4boxed) +public record AdditionalProperties4BoxedList
+implements [AdditionalProperties4Boxed](#additionalproperties4boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalProperties4BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalProperties4BoxedMap -public static final class AdditionalProperties4BoxedMap
-extends [AdditionalProperties4Boxed](#additionalproperties4boxed) +public record AdditionalProperties4BoxedMap
+implements [AdditionalProperties4Boxed](#additionalproperties4boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalProperties4BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalProperties4 public static class AdditionalProperties4
@@ -595,27 +611,28 @@ A schema class that validates payloads | validateAndBox | ## MapWithUndeclaredPropertiesAnytype3Boxed -public static abstract sealed class MapWithUndeclaredPropertiesAnytype3Boxed
+public sealed interface MapWithUndeclaredPropertiesAnytype3Boxed
permits
[MapWithUndeclaredPropertiesAnytype3BoxedMap](#mapwithundeclaredpropertiesanytype3boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## MapWithUndeclaredPropertiesAnytype3BoxedMap -public static final class MapWithUndeclaredPropertiesAnytype3BoxedMap
-extends [MapWithUndeclaredPropertiesAnytype3Boxed](#mapwithundeclaredpropertiesanytype3boxed) +public record MapWithUndeclaredPropertiesAnytype3BoxedMap
+implements [MapWithUndeclaredPropertiesAnytype3Boxed](#mapwithundeclaredpropertiesanytype3boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MapWithUndeclaredPropertiesAnytype3BoxedMap([MapWithUndeclaredPropertiesAnytype3Map](#mapwithundeclaredpropertiesanytype3map) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [MapWithUndeclaredPropertiesAnytype3Map](#mapwithundeclaredpropertiesanytype3map) | data
validated payload | +| [MapWithUndeclaredPropertiesAnytype3Map](#mapwithundeclaredpropertiesanytype3map) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MapWithUndeclaredPropertiesAnytype3 public static class MapWithUndeclaredPropertiesAnytype3
@@ -658,7 +675,9 @@ AdditionalPropertiesClass.MapWithUndeclaredPropertiesAnytype3Map validatedPayloa | ----------------- | ---------------------- | | [MapWithUndeclaredPropertiesAnytype3Map](#mapwithundeclaredpropertiesanytype3map) | validate([Map<?, ?>](#mapwithundeclaredpropertiesanytype3mapbuilder) arg, SchemaConfiguration configuration) | | [MapWithUndeclaredPropertiesAnytype3BoxedMap](#mapwithundeclaredpropertiesanytype3boxedmap) | validateAndBox([Map<?, ?>](#mapwithundeclaredpropertiesanytype3mapbuilder) arg, SchemaConfiguration configuration) | +| [MapWithUndeclaredPropertiesAnytype3Boxed](#mapwithundeclaredpropertiesanytype3boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## MapWithUndeclaredPropertiesAnytype3MapBuilder public class MapWithUndeclaredPropertiesAnytype3MapBuilder
builder for `Map` @@ -697,7 +716,7 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## AdditionalProperties3Boxed -public static abstract sealed class AdditionalProperties3Boxed
+public sealed interface AdditionalProperties3Boxed
permits
[AdditionalProperties3BoxedVoid](#additionalproperties3boxedvoid), [AdditionalProperties3BoxedBoolean](#additionalproperties3boxedboolean), @@ -706,103 +725,109 @@ permits
[AdditionalProperties3BoxedList](#additionalproperties3boxedlist), [AdditionalProperties3BoxedMap](#additionalproperties3boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AdditionalProperties3BoxedVoid -public static final class AdditionalProperties3BoxedVoid
-extends [AdditionalProperties3Boxed](#additionalproperties3boxed) +public record AdditionalProperties3BoxedVoid
+implements [AdditionalProperties3Boxed](#additionalproperties3boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalProperties3BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalProperties3BoxedBoolean -public static final class AdditionalProperties3BoxedBoolean
-extends [AdditionalProperties3Boxed](#additionalproperties3boxed) +public record AdditionalProperties3BoxedBoolean
+implements [AdditionalProperties3Boxed](#additionalproperties3boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalProperties3BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalProperties3BoxedNumber -public static final class AdditionalProperties3BoxedNumber
-extends [AdditionalProperties3Boxed](#additionalproperties3boxed) +public record AdditionalProperties3BoxedNumber
+implements [AdditionalProperties3Boxed](#additionalproperties3boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalProperties3BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalProperties3BoxedString -public static final class AdditionalProperties3BoxedString
-extends [AdditionalProperties3Boxed](#additionalproperties3boxed) +public record AdditionalProperties3BoxedString
+implements [AdditionalProperties3Boxed](#additionalproperties3boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalProperties3BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalProperties3BoxedList -public static final class AdditionalProperties3BoxedList
-extends [AdditionalProperties3Boxed](#additionalproperties3boxed) +public record AdditionalProperties3BoxedList
+implements [AdditionalProperties3Boxed](#additionalproperties3boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalProperties3BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalProperties3BoxedMap -public static final class AdditionalProperties3BoxedMap
-extends [AdditionalProperties3Boxed](#additionalproperties3boxed) +public record AdditionalProperties3BoxedMap
+implements [AdditionalProperties3Boxed](#additionalproperties3boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalProperties3BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalProperties3 public static class AdditionalProperties3
@@ -816,27 +841,28 @@ A schema class that validates payloads | validateAndBox | ## MapWithUndeclaredPropertiesAnytype2Boxed -public static abstract sealed class MapWithUndeclaredPropertiesAnytype2Boxed
+public sealed interface MapWithUndeclaredPropertiesAnytype2Boxed
permits
[MapWithUndeclaredPropertiesAnytype2BoxedMap](#mapwithundeclaredpropertiesanytype2boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## MapWithUndeclaredPropertiesAnytype2BoxedMap -public static final class MapWithUndeclaredPropertiesAnytype2BoxedMap
-extends [MapWithUndeclaredPropertiesAnytype2Boxed](#mapwithundeclaredpropertiesanytype2boxed) +public record MapWithUndeclaredPropertiesAnytype2BoxedMap
+implements [MapWithUndeclaredPropertiesAnytype2Boxed](#mapwithundeclaredpropertiesanytype2boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MapWithUndeclaredPropertiesAnytype2BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MapWithUndeclaredPropertiesAnytype2 public static class MapWithUndeclaredPropertiesAnytype2
@@ -850,27 +876,28 @@ A schema class that validates payloads | validateAndBox | ## MapWithUndeclaredPropertiesAnytype1Boxed -public static abstract sealed class MapWithUndeclaredPropertiesAnytype1Boxed
+public sealed interface MapWithUndeclaredPropertiesAnytype1Boxed
permits
[MapWithUndeclaredPropertiesAnytype1BoxedMap](#mapwithundeclaredpropertiesanytype1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## MapWithUndeclaredPropertiesAnytype1BoxedMap -public static final class MapWithUndeclaredPropertiesAnytype1BoxedMap
-extends [MapWithUndeclaredPropertiesAnytype1Boxed](#mapwithundeclaredpropertiesanytype1boxed) +public record MapWithUndeclaredPropertiesAnytype1BoxedMap
+implements [MapWithUndeclaredPropertiesAnytype1Boxed](#mapwithundeclaredpropertiesanytype1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MapWithUndeclaredPropertiesAnytype1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MapWithUndeclaredPropertiesAnytype1 public static class MapWithUndeclaredPropertiesAnytype1
@@ -884,7 +911,7 @@ A schema class that validates payloads | validateAndBox | ## Anytype1Boxed -public static abstract sealed class Anytype1Boxed
+public sealed interface Anytype1Boxed
permits
[Anytype1BoxedVoid](#anytype1boxedvoid), [Anytype1BoxedBoolean](#anytype1boxedboolean), @@ -893,103 +920,109 @@ permits
[Anytype1BoxedList](#anytype1boxedlist), [Anytype1BoxedMap](#anytype1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Anytype1BoxedVoid -public static final class Anytype1BoxedVoid
-extends [Anytype1Boxed](#anytype1boxed) +public record Anytype1BoxedVoid
+implements [Anytype1Boxed](#anytype1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Anytype1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Anytype1BoxedBoolean -public static final class Anytype1BoxedBoolean
-extends [Anytype1Boxed](#anytype1boxed) +public record Anytype1BoxedBoolean
+implements [Anytype1Boxed](#anytype1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Anytype1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Anytype1BoxedNumber -public static final class Anytype1BoxedNumber
-extends [Anytype1Boxed](#anytype1boxed) +public record Anytype1BoxedNumber
+implements [Anytype1Boxed](#anytype1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Anytype1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Anytype1BoxedString -public static final class Anytype1BoxedString
-extends [Anytype1Boxed](#anytype1boxed) +public record Anytype1BoxedString
+implements [Anytype1Boxed](#anytype1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Anytype1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Anytype1BoxedList -public static final class Anytype1BoxedList
-extends [Anytype1Boxed](#anytype1boxed) +public record Anytype1BoxedList
+implements [Anytype1Boxed](#anytype1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Anytype1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Anytype1BoxedMap -public static final class Anytype1BoxedMap
-extends [Anytype1Boxed](#anytype1boxed) +public record Anytype1BoxedMap
+implements [Anytype1Boxed](#anytype1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Anytype1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Anytype1 public static class Anytype1
@@ -1003,27 +1036,28 @@ A schema class that validates payloads | validateAndBox | ## MapOfMapPropertyBoxed -public static abstract sealed class MapOfMapPropertyBoxed
+public sealed interface MapOfMapPropertyBoxed
permits
[MapOfMapPropertyBoxedMap](#mapofmappropertyboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## MapOfMapPropertyBoxedMap -public static final class MapOfMapPropertyBoxedMap
-extends [MapOfMapPropertyBoxed](#mapofmappropertyboxed) +public record MapOfMapPropertyBoxedMap
+implements [MapOfMapPropertyBoxed](#mapofmappropertyboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MapOfMapPropertyBoxedMap([MapOfMapPropertyMap](#mapofmappropertymap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [MapOfMapPropertyMap](#mapofmappropertymap) | data
validated payload | +| [MapOfMapPropertyMap](#mapofmappropertymap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MapOfMapProperty public static class MapOfMapProperty
@@ -1075,7 +1109,9 @@ AdditionalPropertiesClass.MapOfMapPropertyMap validatedPayload = | ----------------- | ---------------------- | | [MapOfMapPropertyMap](#mapofmappropertymap) | validate([Map<?, ?>](#mapofmappropertymapbuilder) arg, SchemaConfiguration configuration) | | [MapOfMapPropertyBoxedMap](#mapofmappropertyboxedmap) | validateAndBox([Map<?, ?>](#mapofmappropertymapbuilder) arg, SchemaConfiguration configuration) | +| [MapOfMapPropertyBoxed](#mapofmappropertyboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## MapOfMapPropertyMapBuilder public class MapOfMapPropertyMapBuilder
builder for `Map>` @@ -1106,27 +1142,28 @@ A class to store validated Map payloads | [AdditionalPropertiesMap](#additionalpropertiesmap) | getAdditionalProperty(String name)
provides type safety for additional properties | ## AdditionalProperties1Boxed -public static abstract sealed class AdditionalProperties1Boxed
+public sealed interface AdditionalProperties1Boxed
permits
[AdditionalProperties1BoxedMap](#additionalproperties1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AdditionalProperties1BoxedMap -public static final class AdditionalProperties1BoxedMap
-extends [AdditionalProperties1Boxed](#additionalproperties1boxed) +public record AdditionalProperties1BoxedMap
+implements [AdditionalProperties1Boxed](#additionalproperties1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalProperties1BoxedMap([AdditionalPropertiesMap](#additionalpropertiesmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [AdditionalPropertiesMap](#additionalpropertiesmap) | data
validated payload | +| [AdditionalPropertiesMap](#additionalpropertiesmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalProperties1 public static class AdditionalProperties1
@@ -1171,7 +1208,9 @@ AdditionalPropertiesClass.AdditionalPropertiesMap validatedPayload = | ----------------- | ---------------------- | | [AdditionalPropertiesMap](#additionalpropertiesmap) | validate([Map<?, ?>](#additionalpropertiesmapbuilder2) arg, SchemaConfiguration configuration) | | [AdditionalProperties1BoxedMap](#additionalproperties1boxedmap) | validateAndBox([Map<?, ?>](#additionalpropertiesmapbuilder2) arg, SchemaConfiguration configuration) | +| [AdditionalProperties1Boxed](#additionalproperties1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## AdditionalPropertiesMapBuilder2 public class AdditionalPropertiesMapBuilder2
builder for `Map` @@ -1202,27 +1241,28 @@ A class to store validated Map payloads | String | getAdditionalProperty(String name)
provides type safety for additional properties | ## AdditionalProperties2Boxed -public static abstract sealed class AdditionalProperties2Boxed
+public sealed interface AdditionalProperties2Boxed
permits
[AdditionalProperties2BoxedString](#additionalproperties2boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AdditionalProperties2BoxedString -public static final class AdditionalProperties2BoxedString
-extends [AdditionalProperties2Boxed](#additionalproperties2boxed) +public record AdditionalProperties2BoxedString
+implements [AdditionalProperties2Boxed](#additionalproperties2boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalProperties2BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalProperties2 public static class AdditionalProperties2
@@ -1236,27 +1276,28 @@ A schema class that validates payloads | validateAndBox | ## MapPropertyBoxed -public static abstract sealed class MapPropertyBoxed
+public sealed interface MapPropertyBoxed
permits
[MapPropertyBoxedMap](#mappropertyboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## MapPropertyBoxedMap -public static final class MapPropertyBoxedMap
-extends [MapPropertyBoxed](#mappropertyboxed) +public record MapPropertyBoxedMap
+implements [MapPropertyBoxed](#mappropertyboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MapPropertyBoxedMap([MapPropertyMap](#mappropertymap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [MapPropertyMap](#mappropertymap) | data
validated payload | +| [MapPropertyMap](#mappropertymap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MapProperty public static class MapProperty
@@ -1301,7 +1342,9 @@ AdditionalPropertiesClass.MapPropertyMap validatedPayload = | ----------------- | ---------------------- | | [MapPropertyMap](#mappropertymap) | validate([Map<?, ?>](#mappropertymapbuilder) arg, SchemaConfiguration configuration) | | [MapPropertyBoxedMap](#mappropertyboxedmap) | validateAndBox([Map<?, ?>](#mappropertymapbuilder) arg, SchemaConfiguration configuration) | +| [MapPropertyBoxed](#mappropertyboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## MapPropertyMapBuilder public class MapPropertyMapBuilder
builder for `Map` @@ -1332,27 +1375,28 @@ A class to store validated Map payloads | String | getAdditionalProperty(String name)
provides type safety for additional properties | ## AdditionalPropertiesBoxed -public static abstract sealed class AdditionalPropertiesBoxed
+public sealed interface AdditionalPropertiesBoxed
permits
[AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AdditionalPropertiesBoxedString -public static final class AdditionalPropertiesBoxedString
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedString
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalProperties public static class AdditionalProperties
diff --git a/samples/client/petstore/java/docs/components/schemas/AdditionalPropertiesSchema.md b/samples/client/petstore/java/docs/components/schemas/AdditionalPropertiesSchema.md index 11b73499be7..bf4ef48b838 100644 --- a/samples/client/petstore/java/docs/components/schemas/AdditionalPropertiesSchema.md +++ b/samples/client/petstore/java/docs/components/schemas/AdditionalPropertiesSchema.md @@ -4,7 +4,7 @@ public class AdditionalPropertiesSchema
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,71 +12,72 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [AdditionalPropertiesSchema.AdditionalPropertiesSchema1Boxed](#additionalpropertiesschema1boxed)
abstract sealed validated payload class | -| static class | [AdditionalPropertiesSchema.AdditionalPropertiesSchema1BoxedMap](#additionalpropertiesschema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AdditionalPropertiesSchema.AdditionalPropertiesSchema1Boxed](#additionalpropertiesschema1boxed)
sealed interface for validated payloads | +| record | [AdditionalPropertiesSchema.AdditionalPropertiesSchema1BoxedMap](#additionalpropertiesschema1boxedmap)
boxed class to store validated Map payloads | | static class | [AdditionalPropertiesSchema.AdditionalPropertiesSchema1](#additionalpropertiesschema1)
schema class | -| static class | [AdditionalPropertiesSchema.Schema2Boxed](#schema2boxed)
abstract sealed validated payload class | -| static class | [AdditionalPropertiesSchema.Schema2BoxedMap](#schema2boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AdditionalPropertiesSchema.Schema2Boxed](#schema2boxed)
sealed interface for validated payloads | +| record | [AdditionalPropertiesSchema.Schema2BoxedMap](#schema2boxedmap)
boxed class to store validated Map payloads | | static class | [AdditionalPropertiesSchema.Schema2](#schema2)
schema class | | static class | [AdditionalPropertiesSchema.Schema2MapBuilder](#schema2mapbuilder)
builder for Map payloads | | static class | [AdditionalPropertiesSchema.Schema2Map](#schema2map)
output class for Map payloads | -| static class | [AdditionalPropertiesSchema.AdditionalProperties2Boxed](#additionalproperties2boxed)
abstract sealed validated payload class | -| static class | [AdditionalPropertiesSchema.AdditionalProperties2BoxedVoid](#additionalproperties2boxedvoid)
boxed class to store validated null payloads | -| static class | [AdditionalPropertiesSchema.AdditionalProperties2BoxedBoolean](#additionalproperties2boxedboolean)
boxed class to store validated boolean payloads | -| static class | [AdditionalPropertiesSchema.AdditionalProperties2BoxedNumber](#additionalproperties2boxednumber)
boxed class to store validated Number payloads | -| static class | [AdditionalPropertiesSchema.AdditionalProperties2BoxedString](#additionalproperties2boxedstring)
boxed class to store validated String payloads | -| static class | [AdditionalPropertiesSchema.AdditionalProperties2BoxedList](#additionalproperties2boxedlist)
boxed class to store validated List payloads | -| static class | [AdditionalPropertiesSchema.AdditionalProperties2BoxedMap](#additionalproperties2boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AdditionalPropertiesSchema.AdditionalProperties2Boxed](#additionalproperties2boxed)
sealed interface for validated payloads | +| record | [AdditionalPropertiesSchema.AdditionalProperties2BoxedVoid](#additionalproperties2boxedvoid)
boxed class to store validated null payloads | +| record | [AdditionalPropertiesSchema.AdditionalProperties2BoxedBoolean](#additionalproperties2boxedboolean)
boxed class to store validated boolean payloads | +| record | [AdditionalPropertiesSchema.AdditionalProperties2BoxedNumber](#additionalproperties2boxednumber)
boxed class to store validated Number payloads | +| record | [AdditionalPropertiesSchema.AdditionalProperties2BoxedString](#additionalproperties2boxedstring)
boxed class to store validated String payloads | +| record | [AdditionalPropertiesSchema.AdditionalProperties2BoxedList](#additionalproperties2boxedlist)
boxed class to store validated List payloads | +| record | [AdditionalPropertiesSchema.AdditionalProperties2BoxedMap](#additionalproperties2boxedmap)
boxed class to store validated Map payloads | | static class | [AdditionalPropertiesSchema.AdditionalProperties2](#additionalproperties2)
schema class | -| static class | [AdditionalPropertiesSchema.Schema1Boxed](#schema1boxed)
abstract sealed validated payload class | -| static class | [AdditionalPropertiesSchema.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AdditionalPropertiesSchema.Schema1Boxed](#schema1boxed)
sealed interface for validated payloads | +| record | [AdditionalPropertiesSchema.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | | static class | [AdditionalPropertiesSchema.Schema1](#schema1)
schema class | | static class | [AdditionalPropertiesSchema.Schema1MapBuilder](#schema1mapbuilder)
builder for Map payloads | | static class | [AdditionalPropertiesSchema.Schema1Map](#schema1map)
output class for Map payloads | -| static class | [AdditionalPropertiesSchema.AdditionalProperties1Boxed](#additionalproperties1boxed)
abstract sealed validated payload class | -| static class | [AdditionalPropertiesSchema.AdditionalProperties1BoxedVoid](#additionalproperties1boxedvoid)
boxed class to store validated null payloads | -| static class | [AdditionalPropertiesSchema.AdditionalProperties1BoxedBoolean](#additionalproperties1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [AdditionalPropertiesSchema.AdditionalProperties1BoxedNumber](#additionalproperties1boxednumber)
boxed class to store validated Number payloads | -| static class | [AdditionalPropertiesSchema.AdditionalProperties1BoxedString](#additionalproperties1boxedstring)
boxed class to store validated String payloads | -| static class | [AdditionalPropertiesSchema.AdditionalProperties1BoxedList](#additionalproperties1boxedlist)
boxed class to store validated List payloads | -| static class | [AdditionalPropertiesSchema.AdditionalProperties1BoxedMap](#additionalproperties1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AdditionalPropertiesSchema.AdditionalProperties1Boxed](#additionalproperties1boxed)
sealed interface for validated payloads | +| record | [AdditionalPropertiesSchema.AdditionalProperties1BoxedVoid](#additionalproperties1boxedvoid)
boxed class to store validated null payloads | +| record | [AdditionalPropertiesSchema.AdditionalProperties1BoxedBoolean](#additionalproperties1boxedboolean)
boxed class to store validated boolean payloads | +| record | [AdditionalPropertiesSchema.AdditionalProperties1BoxedNumber](#additionalproperties1boxednumber)
boxed class to store validated Number payloads | +| record | [AdditionalPropertiesSchema.AdditionalProperties1BoxedString](#additionalproperties1boxedstring)
boxed class to store validated String payloads | +| record | [AdditionalPropertiesSchema.AdditionalProperties1BoxedList](#additionalproperties1boxedlist)
boxed class to store validated List payloads | +| record | [AdditionalPropertiesSchema.AdditionalProperties1BoxedMap](#additionalproperties1boxedmap)
boxed class to store validated Map payloads | | static class | [AdditionalPropertiesSchema.AdditionalProperties1](#additionalproperties1)
schema class | -| static class | [AdditionalPropertiesSchema.Schema0Boxed](#schema0boxed)
abstract sealed validated payload class | -| static class | [AdditionalPropertiesSchema.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AdditionalPropertiesSchema.Schema0Boxed](#schema0boxed)
sealed interface for validated payloads | +| record | [AdditionalPropertiesSchema.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | | static class | [AdditionalPropertiesSchema.Schema0](#schema0)
schema class | | static class | [AdditionalPropertiesSchema.Schema0MapBuilder](#schema0mapbuilder)
builder for Map payloads | | static class | [AdditionalPropertiesSchema.Schema0Map](#schema0map)
output class for Map payloads | -| static class | [AdditionalPropertiesSchema.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
abstract sealed validated payload class | -| static class | [AdditionalPropertiesSchema.AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid)
boxed class to store validated null payloads | -| static class | [AdditionalPropertiesSchema.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | -| static class | [AdditionalPropertiesSchema.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | -| static class | [AdditionalPropertiesSchema.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | -| static class | [AdditionalPropertiesSchema.AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist)
boxed class to store validated List payloads | -| static class | [AdditionalPropertiesSchema.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AdditionalPropertiesSchema.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
sealed interface for validated payloads | +| record | [AdditionalPropertiesSchema.AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid)
boxed class to store validated null payloads | +| record | [AdditionalPropertiesSchema.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | +| record | [AdditionalPropertiesSchema.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | +| record | [AdditionalPropertiesSchema.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | +| record | [AdditionalPropertiesSchema.AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist)
boxed class to store validated List payloads | +| record | [AdditionalPropertiesSchema.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | | static class | [AdditionalPropertiesSchema.AdditionalProperties](#additionalproperties)
schema class | ## AdditionalPropertiesSchema1Boxed -public static abstract sealed class AdditionalPropertiesSchema1Boxed
+public sealed interface AdditionalPropertiesSchema1Boxed
permits
[AdditionalPropertiesSchema1BoxedMap](#additionalpropertiesschema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AdditionalPropertiesSchema1BoxedMap -public static final class AdditionalPropertiesSchema1BoxedMap
-extends [AdditionalPropertiesSchema1Boxed](#additionalpropertiesschema1boxed) +public record AdditionalPropertiesSchema1BoxedMap
+implements [AdditionalPropertiesSchema1Boxed](#additionalpropertiesschema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesSchema1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesSchema1 public static class AdditionalPropertiesSchema1
@@ -95,29 +96,32 @@ A schema class that validates payloads | ----------------- | ---------------------- | | FrozenMap | validate(Map<?, ?> arg, SchemaConfiguration configuration) | | [AdditionalPropertiesSchema1BoxedMap](#additionalpropertiesschema1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | +| [AdditionalPropertiesSchema1Boxed](#additionalpropertiesschema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema2Boxed -public static abstract sealed class Schema2Boxed
+public sealed interface Schema2Boxed
permits
[Schema2BoxedMap](#schema2boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema2BoxedMap -public static final class Schema2BoxedMap
-extends [Schema2Boxed](#schema2boxed) +public record Schema2BoxedMap
+implements [Schema2Boxed](#schema2boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema2BoxedMap([Schema2Map](#schema2map) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [Schema2Map](#schema2map) | data
validated payload | +| [Schema2Map](#schema2map) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema2 public static class Schema2
@@ -160,7 +164,9 @@ AdditionalPropertiesSchema.Schema2Map validatedPayload = | ----------------- | ---------------------- | | [Schema2Map](#schema2map) | validate([Map<?, ?>](#schema2mapbuilder) arg, SchemaConfiguration configuration) | | [Schema2BoxedMap](#schema2boxedmap) | validateAndBox([Map<?, ?>](#schema2mapbuilder) arg, SchemaConfiguration configuration) | +| [Schema2Boxed](#schema2boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema2MapBuilder public class Schema2MapBuilder
builder for `Map` @@ -199,7 +205,7 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## AdditionalProperties2Boxed -public static abstract sealed class AdditionalProperties2Boxed
+public sealed interface AdditionalProperties2Boxed
permits
[AdditionalProperties2BoxedVoid](#additionalproperties2boxedvoid), [AdditionalProperties2BoxedBoolean](#additionalproperties2boxedboolean), @@ -208,103 +214,109 @@ permits
[AdditionalProperties2BoxedList](#additionalproperties2boxedlist), [AdditionalProperties2BoxedMap](#additionalproperties2boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AdditionalProperties2BoxedVoid -public static final class AdditionalProperties2BoxedVoid
-extends [AdditionalProperties2Boxed](#additionalproperties2boxed) +public record AdditionalProperties2BoxedVoid
+implements [AdditionalProperties2Boxed](#additionalproperties2boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalProperties2BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalProperties2BoxedBoolean -public static final class AdditionalProperties2BoxedBoolean
-extends [AdditionalProperties2Boxed](#additionalproperties2boxed) +public record AdditionalProperties2BoxedBoolean
+implements [AdditionalProperties2Boxed](#additionalproperties2boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalProperties2BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalProperties2BoxedNumber -public static final class AdditionalProperties2BoxedNumber
-extends [AdditionalProperties2Boxed](#additionalproperties2boxed) +public record AdditionalProperties2BoxedNumber
+implements [AdditionalProperties2Boxed](#additionalproperties2boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalProperties2BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalProperties2BoxedString -public static final class AdditionalProperties2BoxedString
-extends [AdditionalProperties2Boxed](#additionalproperties2boxed) +public record AdditionalProperties2BoxedString
+implements [AdditionalProperties2Boxed](#additionalproperties2boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalProperties2BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalProperties2BoxedList -public static final class AdditionalProperties2BoxedList
-extends [AdditionalProperties2Boxed](#additionalproperties2boxed) +public record AdditionalProperties2BoxedList
+implements [AdditionalProperties2Boxed](#additionalproperties2boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalProperties2BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalProperties2BoxedMap -public static final class AdditionalProperties2BoxedMap
-extends [AdditionalProperties2Boxed](#additionalproperties2boxed) +public record AdditionalProperties2BoxedMap
+implements [AdditionalProperties2Boxed](#additionalproperties2boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalProperties2BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalProperties2 public static class AdditionalProperties2
@@ -336,29 +348,32 @@ A schema class that validates payloads | [AdditionalProperties2BoxedBoolean](#additionalproperties2boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [AdditionalProperties2BoxedMap](#additionalproperties2boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [AdditionalProperties2BoxedList](#additionalproperties2boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [AdditionalProperties2Boxed](#additionalproperties2boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema1Boxed -public static abstract sealed class Schema1Boxed
+public sealed interface Schema1Boxed
permits
[Schema1BoxedMap](#schema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema1BoxedMap -public static final class Schema1BoxedMap
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedMap
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedMap([Schema1Map](#schema1map) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [Schema1Map](#schema1map) | data
validated payload | +| [Schema1Map](#schema1map) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1 public static class Schema1
@@ -401,7 +416,9 @@ AdditionalPropertiesSchema.Schema1Map validatedPayload = | ----------------- | ---------------------- | | [Schema1Map](#schema1map) | validate([Map<?, ?>](#schema1mapbuilder) arg, SchemaConfiguration configuration) | | [Schema1BoxedMap](#schema1boxedmap) | validateAndBox([Map<?, ?>](#schema1mapbuilder) arg, SchemaConfiguration configuration) | +| [Schema1Boxed](#schema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema1MapBuilder public class Schema1MapBuilder
builder for `Map` @@ -440,7 +457,7 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## AdditionalProperties1Boxed -public static abstract sealed class AdditionalProperties1Boxed
+public sealed interface AdditionalProperties1Boxed
permits
[AdditionalProperties1BoxedVoid](#additionalproperties1boxedvoid), [AdditionalProperties1BoxedBoolean](#additionalproperties1boxedboolean), @@ -449,103 +466,109 @@ permits
[AdditionalProperties1BoxedList](#additionalproperties1boxedlist), [AdditionalProperties1BoxedMap](#additionalproperties1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AdditionalProperties1BoxedVoid -public static final class AdditionalProperties1BoxedVoid
-extends [AdditionalProperties1Boxed](#additionalproperties1boxed) +public record AdditionalProperties1BoxedVoid
+implements [AdditionalProperties1Boxed](#additionalproperties1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalProperties1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalProperties1BoxedBoolean -public static final class AdditionalProperties1BoxedBoolean
-extends [AdditionalProperties1Boxed](#additionalproperties1boxed) +public record AdditionalProperties1BoxedBoolean
+implements [AdditionalProperties1Boxed](#additionalproperties1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalProperties1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalProperties1BoxedNumber -public static final class AdditionalProperties1BoxedNumber
-extends [AdditionalProperties1Boxed](#additionalproperties1boxed) +public record AdditionalProperties1BoxedNumber
+implements [AdditionalProperties1Boxed](#additionalproperties1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalProperties1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalProperties1BoxedString -public static final class AdditionalProperties1BoxedString
-extends [AdditionalProperties1Boxed](#additionalproperties1boxed) +public record AdditionalProperties1BoxedString
+implements [AdditionalProperties1Boxed](#additionalproperties1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalProperties1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalProperties1BoxedList -public static final class AdditionalProperties1BoxedList
-extends [AdditionalProperties1Boxed](#additionalproperties1boxed) +public record AdditionalProperties1BoxedList
+implements [AdditionalProperties1Boxed](#additionalproperties1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalProperties1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalProperties1BoxedMap -public static final class AdditionalProperties1BoxedMap
-extends [AdditionalProperties1Boxed](#additionalproperties1boxed) +public record AdditionalProperties1BoxedMap
+implements [AdditionalProperties1Boxed](#additionalproperties1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalProperties1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalProperties1 public static class AdditionalProperties1
@@ -577,29 +600,32 @@ A schema class that validates payloads | [AdditionalProperties1BoxedBoolean](#additionalproperties1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [AdditionalProperties1BoxedMap](#additionalproperties1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [AdditionalProperties1BoxedList](#additionalproperties1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [AdditionalProperties1Boxed](#additionalproperties1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema0Boxed -public static abstract sealed class Schema0Boxed
+public sealed interface Schema0Boxed
permits
[Schema0BoxedMap](#schema0boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema0BoxedMap -public static final class Schema0BoxedMap
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedMap
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedMap([Schema0Map](#schema0map) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [Schema0Map](#schema0map) | data
validated payload | +| [Schema0Map](#schema0map) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0 public static class Schema0
@@ -642,7 +668,9 @@ AdditionalPropertiesSchema.Schema0Map validatedPayload = | ----------------- | ---------------------- | | [Schema0Map](#schema0map) | validate([Map<?, ?>](#schema0mapbuilder) arg, SchemaConfiguration configuration) | | [Schema0BoxedMap](#schema0boxedmap) | validateAndBox([Map<?, ?>](#schema0mapbuilder) arg, SchemaConfiguration configuration) | +| [Schema0Boxed](#schema0boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema0MapBuilder public class Schema0MapBuilder
builder for `Map` @@ -681,7 +709,7 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## AdditionalPropertiesBoxed -public static abstract sealed class AdditionalPropertiesBoxed
+public sealed interface AdditionalPropertiesBoxed
permits
[AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid), [AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean), @@ -690,103 +718,109 @@ permits
[AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist), [AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AdditionalPropertiesBoxedVoid -public static final class AdditionalPropertiesBoxedVoid
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedVoid
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedBoolean -public static final class AdditionalPropertiesBoxedBoolean
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedBoolean
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedNumber -public static final class AdditionalPropertiesBoxedNumber
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedNumber
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedString -public static final class AdditionalPropertiesBoxedString
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedString
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedList -public static final class AdditionalPropertiesBoxedList
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedList
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedMap -public static final class AdditionalPropertiesBoxedMap
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedMap
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalProperties public static class AdditionalProperties
diff --git a/samples/client/petstore/java/docs/components/schemas/AdditionalPropertiesWithArrayOfEnums.md b/samples/client/petstore/java/docs/components/schemas/AdditionalPropertiesWithArrayOfEnums.md index 055d2a28e6f..ab31b7a2537 100644 --- a/samples/client/petstore/java/docs/components/schemas/AdditionalPropertiesWithArrayOfEnums.md +++ b/samples/client/petstore/java/docs/components/schemas/AdditionalPropertiesWithArrayOfEnums.md @@ -4,7 +4,7 @@ public class AdditionalPropertiesWithArrayOfEnums
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated list payloads, extends FrozenList - classes to build inputs for list payloads @@ -14,39 +14,40 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [AdditionalPropertiesWithArrayOfEnums.AdditionalPropertiesWithArrayOfEnums1Boxed](#additionalpropertieswitharrayofenums1boxed)
abstract sealed validated payload class | -| static class | [AdditionalPropertiesWithArrayOfEnums.AdditionalPropertiesWithArrayOfEnums1BoxedMap](#additionalpropertieswitharrayofenums1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AdditionalPropertiesWithArrayOfEnums.AdditionalPropertiesWithArrayOfEnums1Boxed](#additionalpropertieswitharrayofenums1boxed)
sealed interface for validated payloads | +| record | [AdditionalPropertiesWithArrayOfEnums.AdditionalPropertiesWithArrayOfEnums1BoxedMap](#additionalpropertieswitharrayofenums1boxedmap)
boxed class to store validated Map payloads | | static class | [AdditionalPropertiesWithArrayOfEnums.AdditionalPropertiesWithArrayOfEnums1](#additionalpropertieswitharrayofenums1)
schema class | | static class | [AdditionalPropertiesWithArrayOfEnums.AdditionalPropertiesWithArrayOfEnumsMapBuilder](#additionalpropertieswitharrayofenumsmapbuilder)
builder for Map payloads | | static class | [AdditionalPropertiesWithArrayOfEnums.AdditionalPropertiesWithArrayOfEnumsMap](#additionalpropertieswitharrayofenumsmap)
output class for Map payloads | -| static class | [AdditionalPropertiesWithArrayOfEnums.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
abstract sealed validated payload class | -| static class | [AdditionalPropertiesWithArrayOfEnums.AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist)
boxed class to store validated List payloads | +| sealed interface | [AdditionalPropertiesWithArrayOfEnums.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
sealed interface for validated payloads | +| record | [AdditionalPropertiesWithArrayOfEnums.AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist)
boxed class to store validated List payloads | | static class | [AdditionalPropertiesWithArrayOfEnums.AdditionalProperties](#additionalproperties)
schema class | | static class | [AdditionalPropertiesWithArrayOfEnums.AdditionalPropertiesListBuilder](#additionalpropertieslistbuilder)
builder for List payloads | | static class | [AdditionalPropertiesWithArrayOfEnums.AdditionalPropertiesList](#additionalpropertieslist)
output class for List payloads | ## AdditionalPropertiesWithArrayOfEnums1Boxed -public static abstract sealed class AdditionalPropertiesWithArrayOfEnums1Boxed
+public sealed interface AdditionalPropertiesWithArrayOfEnums1Boxed
permits
[AdditionalPropertiesWithArrayOfEnums1BoxedMap](#additionalpropertieswitharrayofenums1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AdditionalPropertiesWithArrayOfEnums1BoxedMap -public static final class AdditionalPropertiesWithArrayOfEnums1BoxedMap
-extends [AdditionalPropertiesWithArrayOfEnums1Boxed](#additionalpropertieswitharrayofenums1boxed) +public record AdditionalPropertiesWithArrayOfEnums1BoxedMap
+implements [AdditionalPropertiesWithArrayOfEnums1Boxed](#additionalpropertieswitharrayofenums1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesWithArrayOfEnums1BoxedMap([AdditionalPropertiesWithArrayOfEnumsMap](#additionalpropertieswitharrayofenumsmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [AdditionalPropertiesWithArrayOfEnumsMap](#additionalpropertieswitharrayofenumsmap) | data
validated payload | +| [AdditionalPropertiesWithArrayOfEnumsMap](#additionalpropertieswitharrayofenumsmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesWithArrayOfEnums1 public static class AdditionalPropertiesWithArrayOfEnums1
@@ -95,7 +96,9 @@ AdditionalPropertiesWithArrayOfEnums.AdditionalPropertiesWithArrayOfEnumsMap val | ----------------- | ---------------------- | | [AdditionalPropertiesWithArrayOfEnumsMap](#additionalpropertieswitharrayofenumsmap) | validate([Map<?, ?>](#additionalpropertieswitharrayofenumsmapbuilder) arg, SchemaConfiguration configuration) | | [AdditionalPropertiesWithArrayOfEnums1BoxedMap](#additionalpropertieswitharrayofenums1boxedmap) | validateAndBox([Map<?, ?>](#additionalpropertieswitharrayofenumsmapbuilder) arg, SchemaConfiguration configuration) | +| [AdditionalPropertiesWithArrayOfEnums1Boxed](#additionalpropertieswitharrayofenums1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## AdditionalPropertiesWithArrayOfEnumsMapBuilder public class AdditionalPropertiesWithArrayOfEnumsMapBuilder
builder for `Map>` @@ -126,27 +129,28 @@ A class to store validated Map payloads | [AdditionalPropertiesList](#additionalpropertieslist) | getAdditionalProperty(String name)
provides type safety for additional properties | ## AdditionalPropertiesBoxed -public static abstract sealed class AdditionalPropertiesBoxed
+public sealed interface AdditionalPropertiesBoxed
permits
[AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AdditionalPropertiesBoxedList -public static final class AdditionalPropertiesBoxedList
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedList
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedList([AdditionalPropertiesList](#additionalpropertieslist) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [AdditionalPropertiesList](#additionalpropertieslist) | data
validated payload | +| [AdditionalPropertiesList](#additionalpropertieslist) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalProperties public static class AdditionalProperties
@@ -191,7 +195,9 @@ AdditionalPropertiesWithArrayOfEnums.AdditionalPropertiesList validatedPayload = | ----------------- | ---------------------- | | [AdditionalPropertiesList](#additionalpropertieslist) | validate([List](#additionalpropertieslistbuilder) arg, SchemaConfiguration configuration) | | [AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist) | validateAndBox([List](#additionalpropertieslistbuilder) arg, SchemaConfiguration configuration) | +| [AdditionalPropertiesBoxed](#additionalpropertiesboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## AdditionalPropertiesListBuilder public class AdditionalPropertiesListBuilder
builder for `List` diff --git a/samples/client/petstore/java/docs/components/schemas/Address.md b/samples/client/petstore/java/docs/components/schemas/Address.md index 1499075edc6..d24784427f9 100644 --- a/samples/client/petstore/java/docs/components/schemas/Address.md +++ b/samples/client/petstore/java/docs/components/schemas/Address.md @@ -4,7 +4,7 @@ public class Address
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,37 +12,38 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Address.Address1Boxed](#address1boxed)
abstract sealed validated payload class | -| static class | [Address.Address1BoxedMap](#address1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [Address.Address1Boxed](#address1boxed)
sealed interface for validated payloads | +| record | [Address.Address1BoxedMap](#address1boxedmap)
boxed class to store validated Map payloads | | static class | [Address.Address1](#address1)
schema class | | static class | [Address.AddressMapBuilder](#addressmapbuilder)
builder for Map payloads | | static class | [Address.AddressMap](#addressmap)
output class for Map payloads | -| static class | [Address.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
abstract sealed validated payload class | -| static class | [Address.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | +| sealed interface | [Address.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
sealed interface for validated payloads | +| record | [Address.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | | static class | [Address.AdditionalProperties](#additionalproperties)
schema class | ## Address1Boxed -public static abstract sealed class Address1Boxed
+public sealed interface Address1Boxed
permits
[Address1BoxedMap](#address1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Address1BoxedMap -public static final class Address1BoxedMap
-extends [Address1Boxed](#address1boxed) +public record Address1BoxedMap
+implements [Address1Boxed](#address1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Address1BoxedMap([AddressMap](#addressmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [AddressMap](#addressmap) | data
validated payload | +| [AddressMap](#addressmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Address1 public static class Address1
@@ -87,7 +88,9 @@ Address.AddressMap validatedPayload = | ----------------- | ---------------------- | | [AddressMap](#addressmap) | validate([Map<?, ?>](#addressmapbuilder) arg, SchemaConfiguration configuration) | | [Address1BoxedMap](#address1boxedmap) | validateAndBox([Map<?, ?>](#addressmapbuilder) arg, SchemaConfiguration configuration) | +| [Address1Boxed](#address1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## AddressMapBuilder public class AddressMapBuilder
builder for `Map` @@ -121,27 +124,28 @@ A class to store validated Map payloads | Number | getAdditionalProperty(String name)
provides type safety for additional properties | ## AdditionalPropertiesBoxed -public static abstract sealed class AdditionalPropertiesBoxed
+public sealed interface AdditionalPropertiesBoxed
permits
[AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AdditionalPropertiesBoxedNumber -public static final class AdditionalPropertiesBoxedNumber
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedNumber
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalProperties public static class AdditionalProperties
diff --git a/samples/client/petstore/java/docs/components/schemas/Animal.md b/samples/client/petstore/java/docs/components/schemas/Animal.md index 8026958ff6c..f82bb6edb77 100644 --- a/samples/client/petstore/java/docs/components/schemas/Animal.md +++ b/samples/client/petstore/java/docs/components/schemas/Animal.md @@ -4,7 +4,7 @@ public class Animal
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,40 +12,41 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Animal.Animal1Boxed](#animal1boxed)
abstract sealed validated payload class | -| static class | [Animal.Animal1BoxedMap](#animal1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [Animal.Animal1Boxed](#animal1boxed)
sealed interface for validated payloads | +| record | [Animal.Animal1BoxedMap](#animal1boxedmap)
boxed class to store validated Map payloads | | static class | [Animal.Animal1](#animal1)
schema class | | static class | [Animal.AnimalMapBuilder](#animalmapbuilder)
builder for Map payloads | | static class | [Animal.AnimalMap](#animalmap)
output class for Map payloads | -| static class | [Animal.ColorBoxed](#colorboxed)
abstract sealed validated payload class | -| static class | [Animal.ColorBoxedString](#colorboxedstring)
boxed class to store validated String payloads | +| sealed interface | [Animal.ColorBoxed](#colorboxed)
sealed interface for validated payloads | +| record | [Animal.ColorBoxedString](#colorboxedstring)
boxed class to store validated String payloads | | static class | [Animal.Color](#color)
schema class | -| static class | [Animal.ClassNameBoxed](#classnameboxed)
abstract sealed validated payload class | -| static class | [Animal.ClassNameBoxedString](#classnameboxedstring)
boxed class to store validated String payloads | +| sealed interface | [Animal.ClassNameBoxed](#classnameboxed)
sealed interface for validated payloads | +| record | [Animal.ClassNameBoxedString](#classnameboxedstring)
boxed class to store validated String payloads | | static class | [Animal.ClassName](#classname)
schema class | ## Animal1Boxed -public static abstract sealed class Animal1Boxed
+public sealed interface Animal1Boxed
permits
[Animal1BoxedMap](#animal1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Animal1BoxedMap -public static final class Animal1BoxedMap
-extends [Animal1Boxed](#animal1boxed) +public record Animal1BoxedMap
+implements [Animal1Boxed](#animal1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Animal1BoxedMap([AnimalMap](#animalmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [AnimalMap](#animalmap) | data
validated payload | +| [AnimalMap](#animalmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Animal1 public static class Animal1
@@ -93,7 +94,9 @@ Animal.AnimalMap validatedPayload = | ----------------- | ---------------------- | | [AnimalMap](#animalmap) | validate([Map<?, ?>](#animalmapbuilder) arg, SchemaConfiguration configuration) | | [Animal1BoxedMap](#animal1boxedmap) | validateAndBox([Map<?, ?>](#animalmapbuilder) arg, SchemaConfiguration configuration) | +| [Animal1Boxed](#animal1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## AnimalMap0Builder public class AnimalMap0Builder
builder for `Map` @@ -151,27 +154,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## ColorBoxed -public static abstract sealed class ColorBoxed
+public sealed interface ColorBoxed
permits
[ColorBoxedString](#colorboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ColorBoxedString -public static final class ColorBoxedString
-extends [ColorBoxed](#colorboxed) +public record ColorBoxedString
+implements [ColorBoxed](#colorboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ColorBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Color public static class Color
@@ -212,29 +216,32 @@ String validatedPayload = Animal.Color.validate( | ----------------- | ---------------------- | | String | validate(String arg, SchemaConfiguration configuration) | | [ColorBoxedString](#colorboxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [ColorBoxed](#colorboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ClassNameBoxed -public static abstract sealed class ClassNameBoxed
+public sealed interface ClassNameBoxed
permits
[ClassNameBoxedString](#classnameboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ClassNameBoxedString -public static final class ClassNameBoxedString
-extends [ClassNameBoxed](#classnameboxed) +public record ClassNameBoxedString
+implements [ClassNameBoxed](#classnameboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ClassNameBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ClassName public static class ClassName
diff --git a/samples/client/petstore/java/docs/components/schemas/AnimalFarm.md b/samples/client/petstore/java/docs/components/schemas/AnimalFarm.md index cb195ae69ce..7c6055d3722 100644 --- a/samples/client/petstore/java/docs/components/schemas/AnimalFarm.md +++ b/samples/client/petstore/java/docs/components/schemas/AnimalFarm.md @@ -4,7 +4,7 @@ public class AnimalFarm
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated list payloads, extends FrozenList - classes to build inputs for list payloads @@ -12,34 +12,35 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [AnimalFarm.AnimalFarm1Boxed](#animalfarm1boxed)
abstract sealed validated payload class | -| static class | [AnimalFarm.AnimalFarm1BoxedList](#animalfarm1boxedlist)
boxed class to store validated List payloads | +| sealed interface | [AnimalFarm.AnimalFarm1Boxed](#animalfarm1boxed)
sealed interface for validated payloads | +| record | [AnimalFarm.AnimalFarm1BoxedList](#animalfarm1boxedlist)
boxed class to store validated List payloads | | static class | [AnimalFarm.AnimalFarm1](#animalfarm1)
schema class | | static class | [AnimalFarm.AnimalFarmListBuilder](#animalfarmlistbuilder)
builder for List payloads | | static class | [AnimalFarm.AnimalFarmList](#animalfarmlist)
output class for List payloads | ## AnimalFarm1Boxed -public static abstract sealed class AnimalFarm1Boxed
+public sealed interface AnimalFarm1Boxed
permits
[AnimalFarm1BoxedList](#animalfarm1boxedlist) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AnimalFarm1BoxedList -public static final class AnimalFarm1BoxedList
-extends [AnimalFarm1Boxed](#animalfarm1boxed) +public record AnimalFarm1BoxedList
+implements [AnimalFarm1Boxed](#animalfarm1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AnimalFarm1BoxedList([AnimalFarmList](#animalfarmlist) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [AnimalFarmList](#animalfarmlist) | data
validated payload | +| [AnimalFarmList](#animalfarmlist) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AnimalFarm1 public static class AnimalFarm1
@@ -94,7 +95,9 @@ AnimalFarm.AnimalFarmList validatedPayload = | ----------------- | ---------------------- | | [AnimalFarmList](#animalfarmlist) | validate([List](#animalfarmlistbuilder) arg, SchemaConfiguration configuration) | | [AnimalFarm1BoxedList](#animalfarm1boxedlist) | validateAndBox([List](#animalfarmlistbuilder) arg, SchemaConfiguration configuration) | +| [AnimalFarm1Boxed](#animalfarm1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## AnimalFarmListBuilder public class AnimalFarmListBuilder
builder for `List>` diff --git a/samples/client/petstore/java/docs/components/schemas/AnyTypeAndFormat.md b/samples/client/petstore/java/docs/components/schemas/AnyTypeAndFormat.md index b8265995e84..8b435c339b6 100644 --- a/samples/client/petstore/java/docs/components/schemas/AnyTypeAndFormat.md +++ b/samples/client/petstore/java/docs/components/schemas/AnyTypeAndFormat.md @@ -4,7 +4,7 @@ public class AnyTypeAndFormat
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,106 +12,107 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [AnyTypeAndFormat.AnyTypeAndFormat1Boxed](#anytypeandformat1boxed)
abstract sealed validated payload class | -| static class | [AnyTypeAndFormat.AnyTypeAndFormat1BoxedMap](#anytypeandformat1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AnyTypeAndFormat.AnyTypeAndFormat1Boxed](#anytypeandformat1boxed)
sealed interface for validated payloads | +| record | [AnyTypeAndFormat.AnyTypeAndFormat1BoxedMap](#anytypeandformat1boxedmap)
boxed class to store validated Map payloads | | static class | [AnyTypeAndFormat.AnyTypeAndFormat1](#anytypeandformat1)
schema class | | static class | [AnyTypeAndFormat.AnyTypeAndFormatMapBuilder](#anytypeandformatmapbuilder)
builder for Map payloads | | static class | [AnyTypeAndFormat.AnyTypeAndFormatMap](#anytypeandformatmap)
output class for Map payloads | -| static class | [AnyTypeAndFormat.FloatSchemaBoxed](#floatschemaboxed)
abstract sealed validated payload class | -| static class | [AnyTypeAndFormat.FloatSchemaBoxedVoid](#floatschemaboxedvoid)
boxed class to store validated null payloads | -| static class | [AnyTypeAndFormat.FloatSchemaBoxedBoolean](#floatschemaboxedboolean)
boxed class to store validated boolean payloads | -| static class | [AnyTypeAndFormat.FloatSchemaBoxedNumber](#floatschemaboxednumber)
boxed class to store validated Number payloads | -| static class | [AnyTypeAndFormat.FloatSchemaBoxedString](#floatschemaboxedstring)
boxed class to store validated String payloads | -| static class | [AnyTypeAndFormat.FloatSchemaBoxedList](#floatschemaboxedlist)
boxed class to store validated List payloads | -| static class | [AnyTypeAndFormat.FloatSchemaBoxedMap](#floatschemaboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AnyTypeAndFormat.FloatSchemaBoxed](#floatschemaboxed)
sealed interface for validated payloads | +| record | [AnyTypeAndFormat.FloatSchemaBoxedVoid](#floatschemaboxedvoid)
boxed class to store validated null payloads | +| record | [AnyTypeAndFormat.FloatSchemaBoxedBoolean](#floatschemaboxedboolean)
boxed class to store validated boolean payloads | +| record | [AnyTypeAndFormat.FloatSchemaBoxedNumber](#floatschemaboxednumber)
boxed class to store validated Number payloads | +| record | [AnyTypeAndFormat.FloatSchemaBoxedString](#floatschemaboxedstring)
boxed class to store validated String payloads | +| record | [AnyTypeAndFormat.FloatSchemaBoxedList](#floatschemaboxedlist)
boxed class to store validated List payloads | +| record | [AnyTypeAndFormat.FloatSchemaBoxedMap](#floatschemaboxedmap)
boxed class to store validated Map payloads | | static class | [AnyTypeAndFormat.FloatSchema](#floatschema)
schema class | -| static class | [AnyTypeAndFormat.DoubleSchemaBoxed](#doubleschemaboxed)
abstract sealed validated payload class | -| static class | [AnyTypeAndFormat.DoubleSchemaBoxedVoid](#doubleschemaboxedvoid)
boxed class to store validated null payloads | -| static class | [AnyTypeAndFormat.DoubleSchemaBoxedBoolean](#doubleschemaboxedboolean)
boxed class to store validated boolean payloads | -| static class | [AnyTypeAndFormat.DoubleSchemaBoxedNumber](#doubleschemaboxednumber)
boxed class to store validated Number payloads | -| static class | [AnyTypeAndFormat.DoubleSchemaBoxedString](#doubleschemaboxedstring)
boxed class to store validated String payloads | -| static class | [AnyTypeAndFormat.DoubleSchemaBoxedList](#doubleschemaboxedlist)
boxed class to store validated List payloads | -| static class | [AnyTypeAndFormat.DoubleSchemaBoxedMap](#doubleschemaboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AnyTypeAndFormat.DoubleSchemaBoxed](#doubleschemaboxed)
sealed interface for validated payloads | +| record | [AnyTypeAndFormat.DoubleSchemaBoxedVoid](#doubleschemaboxedvoid)
boxed class to store validated null payloads | +| record | [AnyTypeAndFormat.DoubleSchemaBoxedBoolean](#doubleschemaboxedboolean)
boxed class to store validated boolean payloads | +| record | [AnyTypeAndFormat.DoubleSchemaBoxedNumber](#doubleschemaboxednumber)
boxed class to store validated Number payloads | +| record | [AnyTypeAndFormat.DoubleSchemaBoxedString](#doubleschemaboxedstring)
boxed class to store validated String payloads | +| record | [AnyTypeAndFormat.DoubleSchemaBoxedList](#doubleschemaboxedlist)
boxed class to store validated List payloads | +| record | [AnyTypeAndFormat.DoubleSchemaBoxedMap](#doubleschemaboxedmap)
boxed class to store validated Map payloads | | static class | [AnyTypeAndFormat.DoubleSchema](#doubleschema)
schema class | -| static class | [AnyTypeAndFormat.Int64Boxed](#int64boxed)
abstract sealed validated payload class | -| static class | [AnyTypeAndFormat.Int64BoxedVoid](#int64boxedvoid)
boxed class to store validated null payloads | -| static class | [AnyTypeAndFormat.Int64BoxedBoolean](#int64boxedboolean)
boxed class to store validated boolean payloads | -| static class | [AnyTypeAndFormat.Int64BoxedNumber](#int64boxednumber)
boxed class to store validated Number payloads | -| static class | [AnyTypeAndFormat.Int64BoxedString](#int64boxedstring)
boxed class to store validated String payloads | -| static class | [AnyTypeAndFormat.Int64BoxedList](#int64boxedlist)
boxed class to store validated List payloads | -| static class | [AnyTypeAndFormat.Int64BoxedMap](#int64boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AnyTypeAndFormat.Int64Boxed](#int64boxed)
sealed interface for validated payloads | +| record | [AnyTypeAndFormat.Int64BoxedVoid](#int64boxedvoid)
boxed class to store validated null payloads | +| record | [AnyTypeAndFormat.Int64BoxedBoolean](#int64boxedboolean)
boxed class to store validated boolean payloads | +| record | [AnyTypeAndFormat.Int64BoxedNumber](#int64boxednumber)
boxed class to store validated Number payloads | +| record | [AnyTypeAndFormat.Int64BoxedString](#int64boxedstring)
boxed class to store validated String payloads | +| record | [AnyTypeAndFormat.Int64BoxedList](#int64boxedlist)
boxed class to store validated List payloads | +| record | [AnyTypeAndFormat.Int64BoxedMap](#int64boxedmap)
boxed class to store validated Map payloads | | static class | [AnyTypeAndFormat.Int64](#int64)
schema class | -| static class | [AnyTypeAndFormat.Int32Boxed](#int32boxed)
abstract sealed validated payload class | -| static class | [AnyTypeAndFormat.Int32BoxedVoid](#int32boxedvoid)
boxed class to store validated null payloads | -| static class | [AnyTypeAndFormat.Int32BoxedBoolean](#int32boxedboolean)
boxed class to store validated boolean payloads | -| static class | [AnyTypeAndFormat.Int32BoxedNumber](#int32boxednumber)
boxed class to store validated Number payloads | -| static class | [AnyTypeAndFormat.Int32BoxedString](#int32boxedstring)
boxed class to store validated String payloads | -| static class | [AnyTypeAndFormat.Int32BoxedList](#int32boxedlist)
boxed class to store validated List payloads | -| static class | [AnyTypeAndFormat.Int32BoxedMap](#int32boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AnyTypeAndFormat.Int32Boxed](#int32boxed)
sealed interface for validated payloads | +| record | [AnyTypeAndFormat.Int32BoxedVoid](#int32boxedvoid)
boxed class to store validated null payloads | +| record | [AnyTypeAndFormat.Int32BoxedBoolean](#int32boxedboolean)
boxed class to store validated boolean payloads | +| record | [AnyTypeAndFormat.Int32BoxedNumber](#int32boxednumber)
boxed class to store validated Number payloads | +| record | [AnyTypeAndFormat.Int32BoxedString](#int32boxedstring)
boxed class to store validated String payloads | +| record | [AnyTypeAndFormat.Int32BoxedList](#int32boxedlist)
boxed class to store validated List payloads | +| record | [AnyTypeAndFormat.Int32BoxedMap](#int32boxedmap)
boxed class to store validated Map payloads | | static class | [AnyTypeAndFormat.Int32](#int32)
schema class | -| static class | [AnyTypeAndFormat.BinaryBoxed](#binaryboxed)
abstract sealed validated payload class | -| static class | [AnyTypeAndFormat.BinaryBoxedVoid](#binaryboxedvoid)
boxed class to store validated null payloads | -| static class | [AnyTypeAndFormat.BinaryBoxedBoolean](#binaryboxedboolean)
boxed class to store validated boolean payloads | -| static class | [AnyTypeAndFormat.BinaryBoxedNumber](#binaryboxednumber)
boxed class to store validated Number payloads | -| static class | [AnyTypeAndFormat.BinaryBoxedString](#binaryboxedstring)
boxed class to store validated String payloads | -| static class | [AnyTypeAndFormat.BinaryBoxedList](#binaryboxedlist)
boxed class to store validated List payloads | -| static class | [AnyTypeAndFormat.BinaryBoxedMap](#binaryboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AnyTypeAndFormat.BinaryBoxed](#binaryboxed)
sealed interface for validated payloads | +| record | [AnyTypeAndFormat.BinaryBoxedVoid](#binaryboxedvoid)
boxed class to store validated null payloads | +| record | [AnyTypeAndFormat.BinaryBoxedBoolean](#binaryboxedboolean)
boxed class to store validated boolean payloads | +| record | [AnyTypeAndFormat.BinaryBoxedNumber](#binaryboxednumber)
boxed class to store validated Number payloads | +| record | [AnyTypeAndFormat.BinaryBoxedString](#binaryboxedstring)
boxed class to store validated String payloads | +| record | [AnyTypeAndFormat.BinaryBoxedList](#binaryboxedlist)
boxed class to store validated List payloads | +| record | [AnyTypeAndFormat.BinaryBoxedMap](#binaryboxedmap)
boxed class to store validated Map payloads | | static class | [AnyTypeAndFormat.Binary](#binary)
schema class | -| static class | [AnyTypeAndFormat.NumberSchemaBoxed](#numberschemaboxed)
abstract sealed validated payload class | -| static class | [AnyTypeAndFormat.NumberSchemaBoxedVoid](#numberschemaboxedvoid)
boxed class to store validated null payloads | -| static class | [AnyTypeAndFormat.NumberSchemaBoxedBoolean](#numberschemaboxedboolean)
boxed class to store validated boolean payloads | -| static class | [AnyTypeAndFormat.NumberSchemaBoxedNumber](#numberschemaboxednumber)
boxed class to store validated Number payloads | -| static class | [AnyTypeAndFormat.NumberSchemaBoxedString](#numberschemaboxedstring)
boxed class to store validated String payloads | -| static class | [AnyTypeAndFormat.NumberSchemaBoxedList](#numberschemaboxedlist)
boxed class to store validated List payloads | -| static class | [AnyTypeAndFormat.NumberSchemaBoxedMap](#numberschemaboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AnyTypeAndFormat.NumberSchemaBoxed](#numberschemaboxed)
sealed interface for validated payloads | +| record | [AnyTypeAndFormat.NumberSchemaBoxedVoid](#numberschemaboxedvoid)
boxed class to store validated null payloads | +| record | [AnyTypeAndFormat.NumberSchemaBoxedBoolean](#numberschemaboxedboolean)
boxed class to store validated boolean payloads | +| record | [AnyTypeAndFormat.NumberSchemaBoxedNumber](#numberschemaboxednumber)
boxed class to store validated Number payloads | +| record | [AnyTypeAndFormat.NumberSchemaBoxedString](#numberschemaboxedstring)
boxed class to store validated String payloads | +| record | [AnyTypeAndFormat.NumberSchemaBoxedList](#numberschemaboxedlist)
boxed class to store validated List payloads | +| record | [AnyTypeAndFormat.NumberSchemaBoxedMap](#numberschemaboxedmap)
boxed class to store validated Map payloads | | static class | [AnyTypeAndFormat.NumberSchema](#numberschema)
schema class | -| static class | [AnyTypeAndFormat.DatetimeBoxed](#datetimeboxed)
abstract sealed validated payload class | -| static class | [AnyTypeAndFormat.DatetimeBoxedVoid](#datetimeboxedvoid)
boxed class to store validated null payloads | -| static class | [AnyTypeAndFormat.DatetimeBoxedBoolean](#datetimeboxedboolean)
boxed class to store validated boolean payloads | -| static class | [AnyTypeAndFormat.DatetimeBoxedNumber](#datetimeboxednumber)
boxed class to store validated Number payloads | -| static class | [AnyTypeAndFormat.DatetimeBoxedString](#datetimeboxedstring)
boxed class to store validated String payloads | -| static class | [AnyTypeAndFormat.DatetimeBoxedList](#datetimeboxedlist)
boxed class to store validated List payloads | -| static class | [AnyTypeAndFormat.DatetimeBoxedMap](#datetimeboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AnyTypeAndFormat.DatetimeBoxed](#datetimeboxed)
sealed interface for validated payloads | +| record | [AnyTypeAndFormat.DatetimeBoxedVoid](#datetimeboxedvoid)
boxed class to store validated null payloads | +| record | [AnyTypeAndFormat.DatetimeBoxedBoolean](#datetimeboxedboolean)
boxed class to store validated boolean payloads | +| record | [AnyTypeAndFormat.DatetimeBoxedNumber](#datetimeboxednumber)
boxed class to store validated Number payloads | +| record | [AnyTypeAndFormat.DatetimeBoxedString](#datetimeboxedstring)
boxed class to store validated String payloads | +| record | [AnyTypeAndFormat.DatetimeBoxedList](#datetimeboxedlist)
boxed class to store validated List payloads | +| record | [AnyTypeAndFormat.DatetimeBoxedMap](#datetimeboxedmap)
boxed class to store validated Map payloads | | static class | [AnyTypeAndFormat.Datetime](#datetime)
schema class | -| static class | [AnyTypeAndFormat.DateBoxed](#dateboxed)
abstract sealed validated payload class | -| static class | [AnyTypeAndFormat.DateBoxedVoid](#dateboxedvoid)
boxed class to store validated null payloads | -| static class | [AnyTypeAndFormat.DateBoxedBoolean](#dateboxedboolean)
boxed class to store validated boolean payloads | -| static class | [AnyTypeAndFormat.DateBoxedNumber](#dateboxednumber)
boxed class to store validated Number payloads | -| static class | [AnyTypeAndFormat.DateBoxedString](#dateboxedstring)
boxed class to store validated String payloads | -| static class | [AnyTypeAndFormat.DateBoxedList](#dateboxedlist)
boxed class to store validated List payloads | -| static class | [AnyTypeAndFormat.DateBoxedMap](#dateboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AnyTypeAndFormat.DateBoxed](#dateboxed)
sealed interface for validated payloads | +| record | [AnyTypeAndFormat.DateBoxedVoid](#dateboxedvoid)
boxed class to store validated null payloads | +| record | [AnyTypeAndFormat.DateBoxedBoolean](#dateboxedboolean)
boxed class to store validated boolean payloads | +| record | [AnyTypeAndFormat.DateBoxedNumber](#dateboxednumber)
boxed class to store validated Number payloads | +| record | [AnyTypeAndFormat.DateBoxedString](#dateboxedstring)
boxed class to store validated String payloads | +| record | [AnyTypeAndFormat.DateBoxedList](#dateboxedlist)
boxed class to store validated List payloads | +| record | [AnyTypeAndFormat.DateBoxedMap](#dateboxedmap)
boxed class to store validated Map payloads | | static class | [AnyTypeAndFormat.Date](#date)
schema class | -| static class | [AnyTypeAndFormat.UuidSchemaBoxed](#uuidschemaboxed)
abstract sealed validated payload class | -| static class | [AnyTypeAndFormat.UuidSchemaBoxedVoid](#uuidschemaboxedvoid)
boxed class to store validated null payloads | -| static class | [AnyTypeAndFormat.UuidSchemaBoxedBoolean](#uuidschemaboxedboolean)
boxed class to store validated boolean payloads | -| static class | [AnyTypeAndFormat.UuidSchemaBoxedNumber](#uuidschemaboxednumber)
boxed class to store validated Number payloads | -| static class | [AnyTypeAndFormat.UuidSchemaBoxedString](#uuidschemaboxedstring)
boxed class to store validated String payloads | -| static class | [AnyTypeAndFormat.UuidSchemaBoxedList](#uuidschemaboxedlist)
boxed class to store validated List payloads | -| static class | [AnyTypeAndFormat.UuidSchemaBoxedMap](#uuidschemaboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AnyTypeAndFormat.UuidSchemaBoxed](#uuidschemaboxed)
sealed interface for validated payloads | +| record | [AnyTypeAndFormat.UuidSchemaBoxedVoid](#uuidschemaboxedvoid)
boxed class to store validated null payloads | +| record | [AnyTypeAndFormat.UuidSchemaBoxedBoolean](#uuidschemaboxedboolean)
boxed class to store validated boolean payloads | +| record | [AnyTypeAndFormat.UuidSchemaBoxedNumber](#uuidschemaboxednumber)
boxed class to store validated Number payloads | +| record | [AnyTypeAndFormat.UuidSchemaBoxedString](#uuidschemaboxedstring)
boxed class to store validated String payloads | +| record | [AnyTypeAndFormat.UuidSchemaBoxedList](#uuidschemaboxedlist)
boxed class to store validated List payloads | +| record | [AnyTypeAndFormat.UuidSchemaBoxedMap](#uuidschemaboxedmap)
boxed class to store validated Map payloads | | static class | [AnyTypeAndFormat.UuidSchema](#uuidschema)
schema class | ## AnyTypeAndFormat1Boxed -public static abstract sealed class AnyTypeAndFormat1Boxed
+public sealed interface AnyTypeAndFormat1Boxed
permits
[AnyTypeAndFormat1BoxedMap](#anytypeandformat1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AnyTypeAndFormat1BoxedMap -public static final class AnyTypeAndFormat1BoxedMap
-extends [AnyTypeAndFormat1Boxed](#anytypeandformat1boxed) +public record AnyTypeAndFormat1BoxedMap
+implements [AnyTypeAndFormat1Boxed](#anytypeandformat1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AnyTypeAndFormat1BoxedMap([AnyTypeAndFormatMap](#anytypeandformatmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [AnyTypeAndFormatMap](#anytypeandformatmap) | data
validated payload | +| [AnyTypeAndFormatMap](#anytypeandformatmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AnyTypeAndFormat1 public static class AnyTypeAndFormat1
@@ -154,7 +155,9 @@ AnyTypeAndFormat.AnyTypeAndFormatMap validatedPayload = | ----------------- | ---------------------- | | [AnyTypeAndFormatMap](#anytypeandformatmap) | validate([Map<?, ?>](#anytypeandformatmapbuilder) arg, SchemaConfiguration configuration) | | [AnyTypeAndFormat1BoxedMap](#anytypeandformat1boxedmap) | validateAndBox([Map<?, ?>](#anytypeandformatmapbuilder) arg, SchemaConfiguration configuration) | +| [AnyTypeAndFormat1Boxed](#anytypeandformat1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## AnyTypeAndFormatMapBuilder public class AnyTypeAndFormatMapBuilder
builder for `Map` @@ -279,7 +282,7 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## FloatSchemaBoxed -public static abstract sealed class FloatSchemaBoxed
+public sealed interface FloatSchemaBoxed
permits
[FloatSchemaBoxedVoid](#floatschemaboxedvoid), [FloatSchemaBoxedBoolean](#floatschemaboxedboolean), @@ -288,103 +291,109 @@ permits
[FloatSchemaBoxedList](#floatschemaboxedlist), [FloatSchemaBoxedMap](#floatschemaboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## FloatSchemaBoxedVoid -public static final class FloatSchemaBoxedVoid
-extends [FloatSchemaBoxed](#floatschemaboxed) +public record FloatSchemaBoxedVoid
+implements [FloatSchemaBoxed](#floatschemaboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FloatSchemaBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FloatSchemaBoxedBoolean -public static final class FloatSchemaBoxedBoolean
-extends [FloatSchemaBoxed](#floatschemaboxed) +public record FloatSchemaBoxedBoolean
+implements [FloatSchemaBoxed](#floatschemaboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FloatSchemaBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FloatSchemaBoxedNumber -public static final class FloatSchemaBoxedNumber
-extends [FloatSchemaBoxed](#floatschemaboxed) +public record FloatSchemaBoxedNumber
+implements [FloatSchemaBoxed](#floatschemaboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FloatSchemaBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FloatSchemaBoxedString -public static final class FloatSchemaBoxedString
-extends [FloatSchemaBoxed](#floatschemaboxed) +public record FloatSchemaBoxedString
+implements [FloatSchemaBoxed](#floatschemaboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FloatSchemaBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FloatSchemaBoxedList -public static final class FloatSchemaBoxedList
-extends [FloatSchemaBoxed](#floatschemaboxed) +public record FloatSchemaBoxedList
+implements [FloatSchemaBoxed](#floatschemaboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FloatSchemaBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FloatSchemaBoxedMap -public static final class FloatSchemaBoxedMap
-extends [FloatSchemaBoxed](#floatschemaboxed) +public record FloatSchemaBoxedMap
+implements [FloatSchemaBoxed](#floatschemaboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FloatSchemaBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FloatSchema public static class FloatSchema
@@ -416,9 +425,11 @@ A schema class that validates payloads | [FloatSchemaBoxedBoolean](#floatschemaboxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [FloatSchemaBoxedMap](#floatschemaboxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [FloatSchemaBoxedList](#floatschemaboxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [FloatSchemaBoxed](#floatschemaboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## DoubleSchemaBoxed -public static abstract sealed class DoubleSchemaBoxed
+public sealed interface DoubleSchemaBoxed
permits
[DoubleSchemaBoxedVoid](#doubleschemaboxedvoid), [DoubleSchemaBoxedBoolean](#doubleschemaboxedboolean), @@ -427,103 +438,109 @@ permits
[DoubleSchemaBoxedList](#doubleschemaboxedlist), [DoubleSchemaBoxedMap](#doubleschemaboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## DoubleSchemaBoxedVoid -public static final class DoubleSchemaBoxedVoid
-extends [DoubleSchemaBoxed](#doubleschemaboxed) +public record DoubleSchemaBoxedVoid
+implements [DoubleSchemaBoxed](#doubleschemaboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DoubleSchemaBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## DoubleSchemaBoxedBoolean -public static final class DoubleSchemaBoxedBoolean
-extends [DoubleSchemaBoxed](#doubleschemaboxed) +public record DoubleSchemaBoxedBoolean
+implements [DoubleSchemaBoxed](#doubleschemaboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DoubleSchemaBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## DoubleSchemaBoxedNumber -public static final class DoubleSchemaBoxedNumber
-extends [DoubleSchemaBoxed](#doubleschemaboxed) +public record DoubleSchemaBoxedNumber
+implements [DoubleSchemaBoxed](#doubleschemaboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DoubleSchemaBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## DoubleSchemaBoxedString -public static final class DoubleSchemaBoxedString
-extends [DoubleSchemaBoxed](#doubleschemaboxed) +public record DoubleSchemaBoxedString
+implements [DoubleSchemaBoxed](#doubleschemaboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DoubleSchemaBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## DoubleSchemaBoxedList -public static final class DoubleSchemaBoxedList
-extends [DoubleSchemaBoxed](#doubleschemaboxed) +public record DoubleSchemaBoxedList
+implements [DoubleSchemaBoxed](#doubleschemaboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DoubleSchemaBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## DoubleSchemaBoxedMap -public static final class DoubleSchemaBoxedMap
-extends [DoubleSchemaBoxed](#doubleschemaboxed) +public record DoubleSchemaBoxedMap
+implements [DoubleSchemaBoxed](#doubleschemaboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DoubleSchemaBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## DoubleSchema public static class DoubleSchema
@@ -555,9 +572,11 @@ A schema class that validates payloads | [DoubleSchemaBoxedBoolean](#doubleschemaboxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [DoubleSchemaBoxedMap](#doubleschemaboxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [DoubleSchemaBoxedList](#doubleschemaboxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [DoubleSchemaBoxed](#doubleschemaboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Int64Boxed -public static abstract sealed class Int64Boxed
+public sealed interface Int64Boxed
permits
[Int64BoxedVoid](#int64boxedvoid), [Int64BoxedBoolean](#int64boxedboolean), @@ -566,103 +585,109 @@ permits
[Int64BoxedList](#int64boxedlist), [Int64BoxedMap](#int64boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Int64BoxedVoid -public static final class Int64BoxedVoid
-extends [Int64Boxed](#int64boxed) +public record Int64BoxedVoid
+implements [Int64Boxed](#int64boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Int64BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Int64BoxedBoolean -public static final class Int64BoxedBoolean
-extends [Int64Boxed](#int64boxed) +public record Int64BoxedBoolean
+implements [Int64Boxed](#int64boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Int64BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Int64BoxedNumber -public static final class Int64BoxedNumber
-extends [Int64Boxed](#int64boxed) +public record Int64BoxedNumber
+implements [Int64Boxed](#int64boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Int64BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Int64BoxedString -public static final class Int64BoxedString
-extends [Int64Boxed](#int64boxed) +public record Int64BoxedString
+implements [Int64Boxed](#int64boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Int64BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Int64BoxedList -public static final class Int64BoxedList
-extends [Int64Boxed](#int64boxed) +public record Int64BoxedList
+implements [Int64Boxed](#int64boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Int64BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Int64BoxedMap -public static final class Int64BoxedMap
-extends [Int64Boxed](#int64boxed) +public record Int64BoxedMap
+implements [Int64Boxed](#int64boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Int64BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Int64 public static class Int64
@@ -694,9 +719,11 @@ A schema class that validates payloads | [Int64BoxedBoolean](#int64boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Int64BoxedMap](#int64boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [Int64BoxedList](#int64boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Int64Boxed](#int64boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Int32Boxed -public static abstract sealed class Int32Boxed
+public sealed interface Int32Boxed
permits
[Int32BoxedVoid](#int32boxedvoid), [Int32BoxedBoolean](#int32boxedboolean), @@ -705,103 +732,109 @@ permits
[Int32BoxedList](#int32boxedlist), [Int32BoxedMap](#int32boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Int32BoxedVoid -public static final class Int32BoxedVoid
-extends [Int32Boxed](#int32boxed) +public record Int32BoxedVoid
+implements [Int32Boxed](#int32boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Int32BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Int32BoxedBoolean -public static final class Int32BoxedBoolean
-extends [Int32Boxed](#int32boxed) +public record Int32BoxedBoolean
+implements [Int32Boxed](#int32boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Int32BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Int32BoxedNumber -public static final class Int32BoxedNumber
-extends [Int32Boxed](#int32boxed) +public record Int32BoxedNumber
+implements [Int32Boxed](#int32boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Int32BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Int32BoxedString -public static final class Int32BoxedString
-extends [Int32Boxed](#int32boxed) +public record Int32BoxedString
+implements [Int32Boxed](#int32boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Int32BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Int32BoxedList -public static final class Int32BoxedList
-extends [Int32Boxed](#int32boxed) +public record Int32BoxedList
+implements [Int32Boxed](#int32boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Int32BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Int32BoxedMap -public static final class Int32BoxedMap
-extends [Int32Boxed](#int32boxed) +public record Int32BoxedMap
+implements [Int32Boxed](#int32boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Int32BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Int32 public static class Int32
@@ -833,9 +866,11 @@ A schema class that validates payloads | [Int32BoxedBoolean](#int32boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Int32BoxedMap](#int32boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [Int32BoxedList](#int32boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Int32Boxed](#int32boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## BinaryBoxed -public static abstract sealed class BinaryBoxed
+public sealed interface BinaryBoxed
permits
[BinaryBoxedVoid](#binaryboxedvoid), [BinaryBoxedBoolean](#binaryboxedboolean), @@ -844,103 +879,109 @@ permits
[BinaryBoxedList](#binaryboxedlist), [BinaryBoxedMap](#binaryboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## BinaryBoxedVoid -public static final class BinaryBoxedVoid
-extends [BinaryBoxed](#binaryboxed) +public record BinaryBoxedVoid
+implements [BinaryBoxed](#binaryboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BinaryBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## BinaryBoxedBoolean -public static final class BinaryBoxedBoolean
-extends [BinaryBoxed](#binaryboxed) +public record BinaryBoxedBoolean
+implements [BinaryBoxed](#binaryboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BinaryBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## BinaryBoxedNumber -public static final class BinaryBoxedNumber
-extends [BinaryBoxed](#binaryboxed) +public record BinaryBoxedNumber
+implements [BinaryBoxed](#binaryboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BinaryBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## BinaryBoxedString -public static final class BinaryBoxedString
-extends [BinaryBoxed](#binaryboxed) +public record BinaryBoxedString
+implements [BinaryBoxed](#binaryboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BinaryBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## BinaryBoxedList -public static final class BinaryBoxedList
-extends [BinaryBoxed](#binaryboxed) +public record BinaryBoxedList
+implements [BinaryBoxed](#binaryboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BinaryBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## BinaryBoxedMap -public static final class BinaryBoxedMap
-extends [BinaryBoxed](#binaryboxed) +public record BinaryBoxedMap
+implements [BinaryBoxed](#binaryboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BinaryBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Binary public static class Binary
@@ -972,9 +1013,11 @@ A schema class that validates payloads | [BinaryBoxedBoolean](#binaryboxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [BinaryBoxedMap](#binaryboxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [BinaryBoxedList](#binaryboxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [BinaryBoxed](#binaryboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## NumberSchemaBoxed -public static abstract sealed class NumberSchemaBoxed
+public sealed interface NumberSchemaBoxed
permits
[NumberSchemaBoxedVoid](#numberschemaboxedvoid), [NumberSchemaBoxedBoolean](#numberschemaboxedboolean), @@ -983,103 +1026,109 @@ permits
[NumberSchemaBoxedList](#numberschemaboxedlist), [NumberSchemaBoxedMap](#numberschemaboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## NumberSchemaBoxedVoid -public static final class NumberSchemaBoxedVoid
-extends [NumberSchemaBoxed](#numberschemaboxed) +public record NumberSchemaBoxedVoid
+implements [NumberSchemaBoxed](#numberschemaboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NumberSchemaBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NumberSchemaBoxedBoolean -public static final class NumberSchemaBoxedBoolean
-extends [NumberSchemaBoxed](#numberschemaboxed) +public record NumberSchemaBoxedBoolean
+implements [NumberSchemaBoxed](#numberschemaboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NumberSchemaBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NumberSchemaBoxedNumber -public static final class NumberSchemaBoxedNumber
-extends [NumberSchemaBoxed](#numberschemaboxed) +public record NumberSchemaBoxedNumber
+implements [NumberSchemaBoxed](#numberschemaboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NumberSchemaBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NumberSchemaBoxedString -public static final class NumberSchemaBoxedString
-extends [NumberSchemaBoxed](#numberschemaboxed) +public record NumberSchemaBoxedString
+implements [NumberSchemaBoxed](#numberschemaboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NumberSchemaBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NumberSchemaBoxedList -public static final class NumberSchemaBoxedList
-extends [NumberSchemaBoxed](#numberschemaboxed) +public record NumberSchemaBoxedList
+implements [NumberSchemaBoxed](#numberschemaboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NumberSchemaBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NumberSchemaBoxedMap -public static final class NumberSchemaBoxedMap
-extends [NumberSchemaBoxed](#numberschemaboxed) +public record NumberSchemaBoxedMap
+implements [NumberSchemaBoxed](#numberschemaboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NumberSchemaBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NumberSchema public static class NumberSchema
@@ -1111,9 +1160,11 @@ A schema class that validates payloads | [NumberSchemaBoxedBoolean](#numberschemaboxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [NumberSchemaBoxedMap](#numberschemaboxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [NumberSchemaBoxedList](#numberschemaboxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [NumberSchemaBoxed](#numberschemaboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## DatetimeBoxed -public static abstract sealed class DatetimeBoxed
+public sealed interface DatetimeBoxed
permits
[DatetimeBoxedVoid](#datetimeboxedvoid), [DatetimeBoxedBoolean](#datetimeboxedboolean), @@ -1122,103 +1173,109 @@ permits
[DatetimeBoxedList](#datetimeboxedlist), [DatetimeBoxedMap](#datetimeboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## DatetimeBoxedVoid -public static final class DatetimeBoxedVoid
-extends [DatetimeBoxed](#datetimeboxed) +public record DatetimeBoxedVoid
+implements [DatetimeBoxed](#datetimeboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DatetimeBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## DatetimeBoxedBoolean -public static final class DatetimeBoxedBoolean
-extends [DatetimeBoxed](#datetimeboxed) +public record DatetimeBoxedBoolean
+implements [DatetimeBoxed](#datetimeboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DatetimeBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## DatetimeBoxedNumber -public static final class DatetimeBoxedNumber
-extends [DatetimeBoxed](#datetimeboxed) +public record DatetimeBoxedNumber
+implements [DatetimeBoxed](#datetimeboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DatetimeBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## DatetimeBoxedString -public static final class DatetimeBoxedString
-extends [DatetimeBoxed](#datetimeboxed) +public record DatetimeBoxedString
+implements [DatetimeBoxed](#datetimeboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DatetimeBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## DatetimeBoxedList -public static final class DatetimeBoxedList
-extends [DatetimeBoxed](#datetimeboxed) +public record DatetimeBoxedList
+implements [DatetimeBoxed](#datetimeboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DatetimeBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## DatetimeBoxedMap -public static final class DatetimeBoxedMap
-extends [DatetimeBoxed](#datetimeboxed) +public record DatetimeBoxedMap
+implements [DatetimeBoxed](#datetimeboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DatetimeBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Datetime public static class Datetime
@@ -1250,9 +1307,11 @@ A schema class that validates payloads | [DatetimeBoxedBoolean](#datetimeboxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [DatetimeBoxedMap](#datetimeboxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [DatetimeBoxedList](#datetimeboxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [DatetimeBoxed](#datetimeboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## DateBoxed -public static abstract sealed class DateBoxed
+public sealed interface DateBoxed
permits
[DateBoxedVoid](#dateboxedvoid), [DateBoxedBoolean](#dateboxedboolean), @@ -1261,103 +1320,109 @@ permits
[DateBoxedList](#dateboxedlist), [DateBoxedMap](#dateboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## DateBoxedVoid -public static final class DateBoxedVoid
-extends [DateBoxed](#dateboxed) +public record DateBoxedVoid
+implements [DateBoxed](#dateboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DateBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## DateBoxedBoolean -public static final class DateBoxedBoolean
-extends [DateBoxed](#dateboxed) +public record DateBoxedBoolean
+implements [DateBoxed](#dateboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DateBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## DateBoxedNumber -public static final class DateBoxedNumber
-extends [DateBoxed](#dateboxed) +public record DateBoxedNumber
+implements [DateBoxed](#dateboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DateBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## DateBoxedString -public static final class DateBoxedString
-extends [DateBoxed](#dateboxed) +public record DateBoxedString
+implements [DateBoxed](#dateboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DateBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## DateBoxedList -public static final class DateBoxedList
-extends [DateBoxed](#dateboxed) +public record DateBoxedList
+implements [DateBoxed](#dateboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DateBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## DateBoxedMap -public static final class DateBoxedMap
-extends [DateBoxed](#dateboxed) +public record DateBoxedMap
+implements [DateBoxed](#dateboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DateBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Date public static class Date
@@ -1389,9 +1454,11 @@ A schema class that validates payloads | [DateBoxedBoolean](#dateboxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [DateBoxedMap](#dateboxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [DateBoxedList](#dateboxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [DateBoxed](#dateboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## UuidSchemaBoxed -public static abstract sealed class UuidSchemaBoxed
+public sealed interface UuidSchemaBoxed
permits
[UuidSchemaBoxedVoid](#uuidschemaboxedvoid), [UuidSchemaBoxedBoolean](#uuidschemaboxedboolean), @@ -1400,103 +1467,109 @@ permits
[UuidSchemaBoxedList](#uuidschemaboxedlist), [UuidSchemaBoxedMap](#uuidschemaboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## UuidSchemaBoxedVoid -public static final class UuidSchemaBoxedVoid
-extends [UuidSchemaBoxed](#uuidschemaboxed) +public record UuidSchemaBoxedVoid
+implements [UuidSchemaBoxed](#uuidschemaboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UuidSchemaBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UuidSchemaBoxedBoolean -public static final class UuidSchemaBoxedBoolean
-extends [UuidSchemaBoxed](#uuidschemaboxed) +public record UuidSchemaBoxedBoolean
+implements [UuidSchemaBoxed](#uuidschemaboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UuidSchemaBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UuidSchemaBoxedNumber -public static final class UuidSchemaBoxedNumber
-extends [UuidSchemaBoxed](#uuidschemaboxed) +public record UuidSchemaBoxedNumber
+implements [UuidSchemaBoxed](#uuidschemaboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UuidSchemaBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UuidSchemaBoxedString -public static final class UuidSchemaBoxedString
-extends [UuidSchemaBoxed](#uuidschemaboxed) +public record UuidSchemaBoxedString
+implements [UuidSchemaBoxed](#uuidschemaboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UuidSchemaBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UuidSchemaBoxedList -public static final class UuidSchemaBoxedList
-extends [UuidSchemaBoxed](#uuidschemaboxed) +public record UuidSchemaBoxedList
+implements [UuidSchemaBoxed](#uuidschemaboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UuidSchemaBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UuidSchemaBoxedMap -public static final class UuidSchemaBoxedMap
-extends [UuidSchemaBoxed](#uuidschemaboxed) +public record UuidSchemaBoxedMap
+implements [UuidSchemaBoxed](#uuidschemaboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UuidSchemaBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UuidSchema public static class UuidSchema
@@ -1528,5 +1601,7 @@ A schema class that validates payloads | [UuidSchemaBoxedBoolean](#uuidschemaboxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [UuidSchemaBoxedMap](#uuidschemaboxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [UuidSchemaBoxedList](#uuidschemaboxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [UuidSchemaBoxed](#uuidschemaboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/components/schemas/AnyTypeNotString.md b/samples/client/petstore/java/docs/components/schemas/AnyTypeNotString.md index 1b5b02be520..7e555611498 100644 --- a/samples/client/petstore/java/docs/components/schemas/AnyTypeNotString.md +++ b/samples/client/petstore/java/docs/components/schemas/AnyTypeNotString.md @@ -4,26 +4,26 @@ public class AnyTypeNotString
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [AnyTypeNotString.AnyTypeNotString1Boxed](#anytypenotstring1boxed)
abstract sealed validated payload class | -| static class | [AnyTypeNotString.AnyTypeNotString1BoxedVoid](#anytypenotstring1boxedvoid)
boxed class to store validated null payloads | -| static class | [AnyTypeNotString.AnyTypeNotString1BoxedBoolean](#anytypenotstring1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [AnyTypeNotString.AnyTypeNotString1BoxedNumber](#anytypenotstring1boxednumber)
boxed class to store validated Number payloads | -| static class | [AnyTypeNotString.AnyTypeNotString1BoxedString](#anytypenotstring1boxedstring)
boxed class to store validated String payloads | -| static class | [AnyTypeNotString.AnyTypeNotString1BoxedList](#anytypenotstring1boxedlist)
boxed class to store validated List payloads | -| static class | [AnyTypeNotString.AnyTypeNotString1BoxedMap](#anytypenotstring1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AnyTypeNotString.AnyTypeNotString1Boxed](#anytypenotstring1boxed)
sealed interface for validated payloads | +| record | [AnyTypeNotString.AnyTypeNotString1BoxedVoid](#anytypenotstring1boxedvoid)
boxed class to store validated null payloads | +| record | [AnyTypeNotString.AnyTypeNotString1BoxedBoolean](#anytypenotstring1boxedboolean)
boxed class to store validated boolean payloads | +| record | [AnyTypeNotString.AnyTypeNotString1BoxedNumber](#anytypenotstring1boxednumber)
boxed class to store validated Number payloads | +| record | [AnyTypeNotString.AnyTypeNotString1BoxedString](#anytypenotstring1boxedstring)
boxed class to store validated String payloads | +| record | [AnyTypeNotString.AnyTypeNotString1BoxedList](#anytypenotstring1boxedlist)
boxed class to store validated List payloads | +| record | [AnyTypeNotString.AnyTypeNotString1BoxedMap](#anytypenotstring1boxedmap)
boxed class to store validated Map payloads | | static class | [AnyTypeNotString.AnyTypeNotString1](#anytypenotstring1)
schema class | -| static class | [AnyTypeNotString.NotBoxed](#notboxed)
abstract sealed validated payload class | -| static class | [AnyTypeNotString.NotBoxedString](#notboxedstring)
boxed class to store validated String payloads | +| sealed interface | [AnyTypeNotString.NotBoxed](#notboxed)
sealed interface for validated payloads | +| record | [AnyTypeNotString.NotBoxedString](#notboxedstring)
boxed class to store validated String payloads | | static class | [AnyTypeNotString.Not](#not)
schema class | ## AnyTypeNotString1Boxed -public static abstract sealed class AnyTypeNotString1Boxed
+public sealed interface AnyTypeNotString1Boxed
permits
[AnyTypeNotString1BoxedVoid](#anytypenotstring1boxedvoid), [AnyTypeNotString1BoxedBoolean](#anytypenotstring1boxedboolean), @@ -32,103 +32,109 @@ permits
[AnyTypeNotString1BoxedList](#anytypenotstring1boxedlist), [AnyTypeNotString1BoxedMap](#anytypenotstring1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AnyTypeNotString1BoxedVoid -public static final class AnyTypeNotString1BoxedVoid
-extends [AnyTypeNotString1Boxed](#anytypenotstring1boxed) +public record AnyTypeNotString1BoxedVoid
+implements [AnyTypeNotString1Boxed](#anytypenotstring1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AnyTypeNotString1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AnyTypeNotString1BoxedBoolean -public static final class AnyTypeNotString1BoxedBoolean
-extends [AnyTypeNotString1Boxed](#anytypenotstring1boxed) +public record AnyTypeNotString1BoxedBoolean
+implements [AnyTypeNotString1Boxed](#anytypenotstring1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AnyTypeNotString1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AnyTypeNotString1BoxedNumber -public static final class AnyTypeNotString1BoxedNumber
-extends [AnyTypeNotString1Boxed](#anytypenotstring1boxed) +public record AnyTypeNotString1BoxedNumber
+implements [AnyTypeNotString1Boxed](#anytypenotstring1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AnyTypeNotString1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AnyTypeNotString1BoxedString -public static final class AnyTypeNotString1BoxedString
-extends [AnyTypeNotString1Boxed](#anytypenotstring1boxed) +public record AnyTypeNotString1BoxedString
+implements [AnyTypeNotString1Boxed](#anytypenotstring1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AnyTypeNotString1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AnyTypeNotString1BoxedList -public static final class AnyTypeNotString1BoxedList
-extends [AnyTypeNotString1Boxed](#anytypenotstring1boxed) +public record AnyTypeNotString1BoxedList
+implements [AnyTypeNotString1Boxed](#anytypenotstring1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AnyTypeNotString1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AnyTypeNotString1BoxedMap -public static final class AnyTypeNotString1BoxedMap
-extends [AnyTypeNotString1Boxed](#anytypenotstring1boxed) +public record AnyTypeNotString1BoxedMap
+implements [AnyTypeNotString1Boxed](#anytypenotstring1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AnyTypeNotString1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AnyTypeNotString1 public static class AnyTypeNotString1
@@ -160,29 +166,32 @@ A schema class that validates payloads | [AnyTypeNotString1BoxedBoolean](#anytypenotstring1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [AnyTypeNotString1BoxedMap](#anytypenotstring1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [AnyTypeNotString1BoxedList](#anytypenotstring1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [AnyTypeNotString1Boxed](#anytypenotstring1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## NotBoxed -public static abstract sealed class NotBoxed
+public sealed interface NotBoxed
permits
[NotBoxedString](#notboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## NotBoxedString -public static final class NotBoxedString
-extends [NotBoxed](#notboxed) +public record NotBoxedString
+implements [NotBoxed](#notboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NotBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Not public static class Not
diff --git a/samples/client/petstore/java/docs/components/schemas/ApiResponseSchema.md b/samples/client/petstore/java/docs/components/schemas/ApiResponseSchema.md index a0950c3a623..757a8d34850 100644 --- a/samples/client/petstore/java/docs/components/schemas/ApiResponseSchema.md +++ b/samples/client/petstore/java/docs/components/schemas/ApiResponseSchema.md @@ -4,7 +4,7 @@ public class ApiResponseSchema
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,43 +12,44 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ApiResponseSchema.ApiResponseSchema1Boxed](#apiresponseschema1boxed)
abstract sealed validated payload class | -| static class | [ApiResponseSchema.ApiResponseSchema1BoxedMap](#apiresponseschema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ApiResponseSchema.ApiResponseSchema1Boxed](#apiresponseschema1boxed)
sealed interface for validated payloads | +| record | [ApiResponseSchema.ApiResponseSchema1BoxedMap](#apiresponseschema1boxedmap)
boxed class to store validated Map payloads | | static class | [ApiResponseSchema.ApiResponseSchema1](#apiresponseschema1)
schema class | | static class | [ApiResponseSchema.ApiResponseMapBuilder](#apiresponsemapbuilder)
builder for Map payloads | | static class | [ApiResponseSchema.ApiResponseMap](#apiresponsemap)
output class for Map payloads | -| static class | [ApiResponseSchema.MessageBoxed](#messageboxed)
abstract sealed validated payload class | -| static class | [ApiResponseSchema.MessageBoxedString](#messageboxedstring)
boxed class to store validated String payloads | +| sealed interface | [ApiResponseSchema.MessageBoxed](#messageboxed)
sealed interface for validated payloads | +| record | [ApiResponseSchema.MessageBoxedString](#messageboxedstring)
boxed class to store validated String payloads | | static class | [ApiResponseSchema.Message](#message)
schema class | -| static class | [ApiResponseSchema.TypeBoxed](#typeboxed)
abstract sealed validated payload class | -| static class | [ApiResponseSchema.TypeBoxedString](#typeboxedstring)
boxed class to store validated String payloads | +| sealed interface | [ApiResponseSchema.TypeBoxed](#typeboxed)
sealed interface for validated payloads | +| record | [ApiResponseSchema.TypeBoxedString](#typeboxedstring)
boxed class to store validated String payloads | | static class | [ApiResponseSchema.Type](#type)
schema class | -| static class | [ApiResponseSchema.CodeBoxed](#codeboxed)
abstract sealed validated payload class | -| static class | [ApiResponseSchema.CodeBoxedNumber](#codeboxednumber)
boxed class to store validated Number payloads | +| sealed interface | [ApiResponseSchema.CodeBoxed](#codeboxed)
sealed interface for validated payloads | +| record | [ApiResponseSchema.CodeBoxedNumber](#codeboxednumber)
boxed class to store validated Number payloads | | static class | [ApiResponseSchema.Code](#code)
schema class | ## ApiResponseSchema1Boxed -public static abstract sealed class ApiResponseSchema1Boxed
+public sealed interface ApiResponseSchema1Boxed
permits
[ApiResponseSchema1BoxedMap](#apiresponseschema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ApiResponseSchema1BoxedMap -public static final class ApiResponseSchema1BoxedMap
-extends [ApiResponseSchema1Boxed](#apiresponseschema1boxed) +public record ApiResponseSchema1BoxedMap
+implements [ApiResponseSchema1Boxed](#apiresponseschema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ApiResponseSchema1BoxedMap([ApiResponseMap](#apiresponsemap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [ApiResponseMap](#apiresponsemap) | data
validated payload | +| [ApiResponseMap](#apiresponsemap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ApiResponseSchema1 public static class ApiResponseSchema1
@@ -97,7 +98,9 @@ ApiResponseSchema.ApiResponseMap validatedPayload = | ----------------- | ---------------------- | | [ApiResponseMap](#apiresponsemap) | validate([Map<?, ?>](#apiresponsemapbuilder) arg, SchemaConfiguration configuration) | | [ApiResponseSchema1BoxedMap](#apiresponseschema1boxedmap) | validateAndBox([Map<?, ?>](#apiresponsemapbuilder) arg, SchemaConfiguration configuration) | +| [ApiResponseSchema1Boxed](#apiresponseschema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ApiResponseMapBuilder public class ApiResponseMapBuilder
builder for `Map` @@ -143,27 +146,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## MessageBoxed -public static abstract sealed class MessageBoxed
+public sealed interface MessageBoxed
permits
[MessageBoxedString](#messageboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## MessageBoxedString -public static final class MessageBoxedString
-extends [MessageBoxed](#messageboxed) +public record MessageBoxedString
+implements [MessageBoxed](#messageboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MessageBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Message public static class Message
@@ -177,27 +181,28 @@ A schema class that validates payloads | validateAndBox | ## TypeBoxed -public static abstract sealed class TypeBoxed
+public sealed interface TypeBoxed
permits
[TypeBoxedString](#typeboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## TypeBoxedString -public static final class TypeBoxedString
-extends [TypeBoxed](#typeboxed) +public record TypeBoxedString
+implements [TypeBoxed](#typeboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | TypeBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Type public static class Type
@@ -211,27 +216,28 @@ A schema class that validates payloads | validateAndBox | ## CodeBoxed -public static abstract sealed class CodeBoxed
+public sealed interface CodeBoxed
permits
[CodeBoxedNumber](#codeboxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## CodeBoxedNumber -public static final class CodeBoxedNumber
-extends [CodeBoxed](#codeboxed) +public record CodeBoxedNumber
+implements [CodeBoxed](#codeboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | CodeBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Code public static class Code
diff --git a/samples/client/petstore/java/docs/components/schemas/Apple.md b/samples/client/petstore/java/docs/components/schemas/Apple.md index fc7acd33e3a..816b9167ddb 100644 --- a/samples/client/petstore/java/docs/components/schemas/Apple.md +++ b/samples/client/petstore/java/docs/components/schemas/Apple.md @@ -4,7 +4,7 @@ public class Apple
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,58 +12,60 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Apple.Apple1Boxed](#apple1boxed)
abstract sealed validated payload class | -| static class | [Apple.Apple1BoxedVoid](#apple1boxedvoid)
boxed class to store validated null payloads | -| static class | [Apple.Apple1BoxedMap](#apple1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [Apple.Apple1Boxed](#apple1boxed)
sealed interface for validated payloads | +| record | [Apple.Apple1BoxedVoid](#apple1boxedvoid)
boxed class to store validated null payloads | +| record | [Apple.Apple1BoxedMap](#apple1boxedmap)
boxed class to store validated Map payloads | | static class | [Apple.Apple1](#apple1)
schema class | | static class | [Apple.AppleMapBuilder](#applemapbuilder)
builder for Map payloads | | static class | [Apple.AppleMap](#applemap)
output class for Map payloads | -| static class | [Apple.OriginBoxed](#originboxed)
abstract sealed validated payload class | -| static class | [Apple.OriginBoxedString](#originboxedstring)
boxed class to store validated String payloads | +| sealed interface | [Apple.OriginBoxed](#originboxed)
sealed interface for validated payloads | +| record | [Apple.OriginBoxedString](#originboxedstring)
boxed class to store validated String payloads | | static class | [Apple.Origin](#origin)
schema class | -| static class | [Apple.CultivarBoxed](#cultivarboxed)
abstract sealed validated payload class | -| static class | [Apple.CultivarBoxedString](#cultivarboxedstring)
boxed class to store validated String payloads | +| sealed interface | [Apple.CultivarBoxed](#cultivarboxed)
sealed interface for validated payloads | +| record | [Apple.CultivarBoxedString](#cultivarboxedstring)
boxed class to store validated String payloads | | static class | [Apple.Cultivar](#cultivar)
schema class | ## Apple1Boxed -public static abstract sealed class Apple1Boxed
+public sealed interface Apple1Boxed
permits
[Apple1BoxedVoid](#apple1boxedvoid), [Apple1BoxedMap](#apple1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Apple1BoxedVoid -public static final class Apple1BoxedVoid
-extends [Apple1Boxed](#apple1boxed) +public record Apple1BoxedVoid
+implements [Apple1Boxed](#apple1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Apple1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Apple1BoxedMap -public static final class Apple1BoxedMap
-extends [Apple1Boxed](#apple1boxed) +public record Apple1BoxedMap
+implements [Apple1Boxed](#apple1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Apple1BoxedMap([AppleMap](#applemap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [AppleMap](#applemap) | data
validated payload | +| [AppleMap](#applemap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Apple1 public static class Apple1
@@ -119,7 +121,9 @@ Apple.AppleMap validatedPayload = | [Apple1BoxedVoid](#apple1boxedvoid) | validateAndBox(Void arg, SchemaConfiguration configuration) | | [AppleMap](#applemap) | validate([Map<?, ?>](#applemapbuilder) arg, SchemaConfiguration configuration) | | [Apple1BoxedMap](#apple1boxedmap) | validateAndBox([Map<?, ?>](#applemapbuilder) arg, SchemaConfiguration configuration) | +| [Apple1Boxed](#apple1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## AppleMap0Builder public class AppleMap0Builder
builder for `Map` @@ -177,27 +181,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## OriginBoxed -public static abstract sealed class OriginBoxed
+public sealed interface OriginBoxed
permits
[OriginBoxedString](#originboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## OriginBoxedString -public static final class OriginBoxedString
-extends [OriginBoxed](#originboxed) +public record OriginBoxedString
+implements [OriginBoxed](#originboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | OriginBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Origin public static class Origin
@@ -238,29 +243,32 @@ String validatedPayload = Apple.Origin.validate( | ----------------- | ---------------------- | | String | validate(String arg, SchemaConfiguration configuration) | | [OriginBoxedString](#originboxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [OriginBoxed](#originboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## CultivarBoxed -public static abstract sealed class CultivarBoxed
+public sealed interface CultivarBoxed
permits
[CultivarBoxedString](#cultivarboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## CultivarBoxedString -public static final class CultivarBoxedString
-extends [CultivarBoxed](#cultivarboxed) +public record CultivarBoxedString
+implements [CultivarBoxed](#cultivarboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | CultivarBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Cultivar public static class Cultivar
@@ -301,5 +309,7 @@ String validatedPayload = Apple.Cultivar.validate( | ----------------- | ---------------------- | | String | validate(String arg, SchemaConfiguration configuration) | | [CultivarBoxedString](#cultivarboxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [CultivarBoxed](#cultivarboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/components/schemas/AppleReq.md b/samples/client/petstore/java/docs/components/schemas/AppleReq.md index d15684f8b60..f344a8900bd 100644 --- a/samples/client/petstore/java/docs/components/schemas/AppleReq.md +++ b/samples/client/petstore/java/docs/components/schemas/AppleReq.md @@ -4,7 +4,7 @@ public class AppleReq
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,48 +12,49 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [AppleReq.AppleReq1Boxed](#applereq1boxed)
abstract sealed validated payload class | -| static class | [AppleReq.AppleReq1BoxedMap](#applereq1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AppleReq.AppleReq1Boxed](#applereq1boxed)
sealed interface for validated payloads | +| record | [AppleReq.AppleReq1BoxedMap](#applereq1boxedmap)
boxed class to store validated Map payloads | | static class | [AppleReq.AppleReq1](#applereq1)
schema class | | static class | [AppleReq.AppleReqMapBuilder](#applereqmapbuilder)
builder for Map payloads | | static class | [AppleReq.AppleReqMap](#applereqmap)
output class for Map payloads | -| static class | [AppleReq.MealyBoxed](#mealyboxed)
abstract sealed validated payload class | -| static class | [AppleReq.MealyBoxedBoolean](#mealyboxedboolean)
boxed class to store validated boolean payloads | +| sealed interface | [AppleReq.MealyBoxed](#mealyboxed)
sealed interface for validated payloads | +| record | [AppleReq.MealyBoxedBoolean](#mealyboxedboolean)
boxed class to store validated boolean payloads | | static class | [AppleReq.Mealy](#mealy)
schema class | -| static class | [AppleReq.CultivarBoxed](#cultivarboxed)
abstract sealed validated payload class | -| static class | [AppleReq.CultivarBoxedString](#cultivarboxedstring)
boxed class to store validated String payloads | +| sealed interface | [AppleReq.CultivarBoxed](#cultivarboxed)
sealed interface for validated payloads | +| record | [AppleReq.CultivarBoxedString](#cultivarboxedstring)
boxed class to store validated String payloads | | static class | [AppleReq.Cultivar](#cultivar)
schema class | -| static class | [AppleReq.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
abstract sealed validated payload class | -| static class | [AppleReq.AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid)
boxed class to store validated null payloads | -| static class | [AppleReq.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | -| static class | [AppleReq.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | -| static class | [AppleReq.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | -| static class | [AppleReq.AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist)
boxed class to store validated List payloads | -| static class | [AppleReq.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [AppleReq.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
sealed interface for validated payloads | +| record | [AppleReq.AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid)
boxed class to store validated null payloads | +| record | [AppleReq.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | +| record | [AppleReq.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | +| record | [AppleReq.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | +| record | [AppleReq.AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist)
boxed class to store validated List payloads | +| record | [AppleReq.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | | static class | [AppleReq.AdditionalProperties](#additionalproperties)
schema class | ## AppleReq1Boxed -public static abstract sealed class AppleReq1Boxed
+public sealed interface AppleReq1Boxed
permits
[AppleReq1BoxedMap](#applereq1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AppleReq1BoxedMap -public static final class AppleReq1BoxedMap
-extends [AppleReq1Boxed](#applereq1boxed) +public record AppleReq1BoxedMap
+implements [AppleReq1Boxed](#applereq1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AppleReq1BoxedMap([AppleReqMap](#applereqmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [AppleReqMap](#applereqmap) | data
validated payload | +| [AppleReqMap](#applereqmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AppleReq1 public static class AppleReq1
@@ -102,7 +103,9 @@ AppleReq.AppleReqMap validatedPayload = | ----------------- | ---------------------- | | [AppleReqMap](#applereqmap) | validate([Map<?, ?>](#applereqmapbuilder) arg, SchemaConfiguration configuration) | | [AppleReq1BoxedMap](#applereq1boxedmap) | validateAndBox([Map<?, ?>](#applereqmapbuilder) arg, SchemaConfiguration configuration) | +| [AppleReq1Boxed](#applereq1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## AppleReqMap0Builder public class AppleReqMap0Builder
builder for `Map` @@ -150,27 +153,28 @@ A class to store validated Map payloads | boolean | mealy()
[optional] | ## MealyBoxed -public static abstract sealed class MealyBoxed
+public sealed interface MealyBoxed
permits
[MealyBoxedBoolean](#mealyboxedboolean) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## MealyBoxedBoolean -public static final class MealyBoxedBoolean
-extends [MealyBoxed](#mealyboxed) +public record MealyBoxedBoolean
+implements [MealyBoxed](#mealyboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MealyBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Mealy public static class Mealy
@@ -184,27 +188,28 @@ A schema class that validates payloads | validateAndBox | ## CultivarBoxed -public static abstract sealed class CultivarBoxed
+public sealed interface CultivarBoxed
permits
[CultivarBoxedString](#cultivarboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## CultivarBoxedString -public static final class CultivarBoxedString
-extends [CultivarBoxed](#cultivarboxed) +public record CultivarBoxedString
+implements [CultivarBoxed](#cultivarboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | CultivarBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Cultivar public static class Cultivar
@@ -218,7 +223,7 @@ A schema class that validates payloads | validateAndBox | ## AdditionalPropertiesBoxed -public static abstract sealed class AdditionalPropertiesBoxed
+public sealed interface AdditionalPropertiesBoxed
permits
[AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid), [AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean), @@ -227,103 +232,109 @@ permits
[AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist), [AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AdditionalPropertiesBoxedVoid -public static final class AdditionalPropertiesBoxedVoid
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedVoid
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedBoolean -public static final class AdditionalPropertiesBoxedBoolean
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedBoolean
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedNumber -public static final class AdditionalPropertiesBoxedNumber
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedNumber
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedString -public static final class AdditionalPropertiesBoxedString
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedString
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedList -public static final class AdditionalPropertiesBoxedList
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedList
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedMap -public static final class AdditionalPropertiesBoxedMap
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedMap
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalProperties public static class AdditionalProperties
diff --git a/samples/client/petstore/java/docs/components/schemas/ArrayHoldingAnyType.md b/samples/client/petstore/java/docs/components/schemas/ArrayHoldingAnyType.md index f2190406d23..245063e8cea 100644 --- a/samples/client/petstore/java/docs/components/schemas/ArrayHoldingAnyType.md +++ b/samples/client/petstore/java/docs/components/schemas/ArrayHoldingAnyType.md @@ -4,7 +4,7 @@ public class ArrayHoldingAnyType
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated list payloads, extends FrozenList - classes to build inputs for list payloads @@ -12,42 +12,43 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ArrayHoldingAnyType.ArrayHoldingAnyType1Boxed](#arrayholdinganytype1boxed)
abstract sealed validated payload class | -| static class | [ArrayHoldingAnyType.ArrayHoldingAnyType1BoxedList](#arrayholdinganytype1boxedlist)
boxed class to store validated List payloads | +| sealed interface | [ArrayHoldingAnyType.ArrayHoldingAnyType1Boxed](#arrayholdinganytype1boxed)
sealed interface for validated payloads | +| record | [ArrayHoldingAnyType.ArrayHoldingAnyType1BoxedList](#arrayholdinganytype1boxedlist)
boxed class to store validated List payloads | | static class | [ArrayHoldingAnyType.ArrayHoldingAnyType1](#arrayholdinganytype1)
schema class | | static class | [ArrayHoldingAnyType.ArrayHoldingAnyTypeListBuilder](#arrayholdinganytypelistbuilder)
builder for List payloads | | static class | [ArrayHoldingAnyType.ArrayHoldingAnyTypeList](#arrayholdinganytypelist)
output class for List payloads | -| static class | [ArrayHoldingAnyType.ItemsBoxed](#itemsboxed)
abstract sealed validated payload class | -| static class | [ArrayHoldingAnyType.ItemsBoxedVoid](#itemsboxedvoid)
boxed class to store validated null payloads | -| static class | [ArrayHoldingAnyType.ItemsBoxedBoolean](#itemsboxedboolean)
boxed class to store validated boolean payloads | -| static class | [ArrayHoldingAnyType.ItemsBoxedNumber](#itemsboxednumber)
boxed class to store validated Number payloads | -| static class | [ArrayHoldingAnyType.ItemsBoxedString](#itemsboxedstring)
boxed class to store validated String payloads | -| static class | [ArrayHoldingAnyType.ItemsBoxedList](#itemsboxedlist)
boxed class to store validated List payloads | -| static class | [ArrayHoldingAnyType.ItemsBoxedMap](#itemsboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ArrayHoldingAnyType.ItemsBoxed](#itemsboxed)
sealed interface for validated payloads | +| record | [ArrayHoldingAnyType.ItemsBoxedVoid](#itemsboxedvoid)
boxed class to store validated null payloads | +| record | [ArrayHoldingAnyType.ItemsBoxedBoolean](#itemsboxedboolean)
boxed class to store validated boolean payloads | +| record | [ArrayHoldingAnyType.ItemsBoxedNumber](#itemsboxednumber)
boxed class to store validated Number payloads | +| record | [ArrayHoldingAnyType.ItemsBoxedString](#itemsboxedstring)
boxed class to store validated String payloads | +| record | [ArrayHoldingAnyType.ItemsBoxedList](#itemsboxedlist)
boxed class to store validated List payloads | +| record | [ArrayHoldingAnyType.ItemsBoxedMap](#itemsboxedmap)
boxed class to store validated Map payloads | | static class | [ArrayHoldingAnyType.Items](#items)
schema class | ## ArrayHoldingAnyType1Boxed -public static abstract sealed class ArrayHoldingAnyType1Boxed
+public sealed interface ArrayHoldingAnyType1Boxed
permits
[ArrayHoldingAnyType1BoxedList](#arrayholdinganytype1boxedlist) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ArrayHoldingAnyType1BoxedList -public static final class ArrayHoldingAnyType1BoxedList
-extends [ArrayHoldingAnyType1Boxed](#arrayholdinganytype1boxed) +public record ArrayHoldingAnyType1BoxedList
+implements [ArrayHoldingAnyType1Boxed](#arrayholdinganytype1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ArrayHoldingAnyType1BoxedList([ArrayHoldingAnyTypeList](#arrayholdinganytypelist) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [ArrayHoldingAnyTypeList](#arrayholdinganytypelist) | data
validated payload | +| [ArrayHoldingAnyTypeList](#arrayholdinganytypelist) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ArrayHoldingAnyType1 public static class ArrayHoldingAnyType1
@@ -90,7 +91,9 @@ ArrayHoldingAnyType.ArrayHoldingAnyTypeList validatedPayload = | ----------------- | ---------------------- | | [ArrayHoldingAnyTypeList](#arrayholdinganytypelist) | validate([List](#arrayholdinganytypelistbuilder) arg, SchemaConfiguration configuration) | | [ArrayHoldingAnyType1BoxedList](#arrayholdinganytype1boxedlist) | validateAndBox([List](#arrayholdinganytypelistbuilder) arg, SchemaConfiguration configuration) | +| [ArrayHoldingAnyType1Boxed](#arrayholdinganytype1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ArrayHoldingAnyTypeListBuilder public class ArrayHoldingAnyTypeListBuilder
builder for `List<@Nullable Object>` @@ -129,7 +132,7 @@ A class to store validated List payloads | static [ArrayHoldingAnyTypeList](#arrayholdinganytypelist) | of([List](#arrayholdinganytypelistbuilder) arg, SchemaConfiguration configuration) | ## ItemsBoxed -public static abstract sealed class ItemsBoxed
+public sealed interface ItemsBoxed
permits
[ItemsBoxedVoid](#itemsboxedvoid), [ItemsBoxedBoolean](#itemsboxedboolean), @@ -138,103 +141,109 @@ permits
[ItemsBoxedList](#itemsboxedlist), [ItemsBoxedMap](#itemsboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ItemsBoxedVoid -public static final class ItemsBoxedVoid
-extends [ItemsBoxed](#itemsboxed) +public record ItemsBoxedVoid
+implements [ItemsBoxed](#itemsboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ItemsBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ItemsBoxedBoolean -public static final class ItemsBoxedBoolean
-extends [ItemsBoxed](#itemsboxed) +public record ItemsBoxedBoolean
+implements [ItemsBoxed](#itemsboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ItemsBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ItemsBoxedNumber -public static final class ItemsBoxedNumber
-extends [ItemsBoxed](#itemsboxed) +public record ItemsBoxedNumber
+implements [ItemsBoxed](#itemsboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ItemsBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ItemsBoxedString -public static final class ItemsBoxedString
-extends [ItemsBoxed](#itemsboxed) +public record ItemsBoxedString
+implements [ItemsBoxed](#itemsboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ItemsBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ItemsBoxedList -public static final class ItemsBoxedList
-extends [ItemsBoxed](#itemsboxed) +public record ItemsBoxedList
+implements [ItemsBoxed](#itemsboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ItemsBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ItemsBoxedMap -public static final class ItemsBoxedMap
-extends [ItemsBoxed](#itemsboxed) +public record ItemsBoxedMap
+implements [ItemsBoxed](#itemsboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ItemsBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Items public static class Items
diff --git a/samples/client/petstore/java/docs/components/schemas/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/java/docs/components/schemas/ArrayOfArrayOfNumberOnly.md index 8bdaa55f8b8..fdc459ad3af 100644 --- a/samples/client/petstore/java/docs/components/schemas/ArrayOfArrayOfNumberOnly.md +++ b/samples/client/petstore/java/docs/components/schemas/ArrayOfArrayOfNumberOnly.md @@ -4,7 +4,7 @@ public class ArrayOfArrayOfNumberOnly
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated list payloads, extends FrozenList - classes to build inputs for list payloads @@ -14,47 +14,48 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ArrayOfArrayOfNumberOnly.ArrayOfArrayOfNumberOnly1Boxed](#arrayofarrayofnumberonly1boxed)
abstract sealed validated payload class | -| static class | [ArrayOfArrayOfNumberOnly.ArrayOfArrayOfNumberOnly1BoxedMap](#arrayofarrayofnumberonly1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ArrayOfArrayOfNumberOnly.ArrayOfArrayOfNumberOnly1Boxed](#arrayofarrayofnumberonly1boxed)
sealed interface for validated payloads | +| record | [ArrayOfArrayOfNumberOnly.ArrayOfArrayOfNumberOnly1BoxedMap](#arrayofarrayofnumberonly1boxedmap)
boxed class to store validated Map payloads | | static class | [ArrayOfArrayOfNumberOnly.ArrayOfArrayOfNumberOnly1](#arrayofarrayofnumberonly1)
schema class | | static class | [ArrayOfArrayOfNumberOnly.ArrayOfArrayOfNumberOnlyMapBuilder](#arrayofarrayofnumberonlymapbuilder)
builder for Map payloads | | static class | [ArrayOfArrayOfNumberOnly.ArrayOfArrayOfNumberOnlyMap](#arrayofarrayofnumberonlymap)
output class for Map payloads | -| static class | [ArrayOfArrayOfNumberOnly.ArrayArrayNumberBoxed](#arrayarraynumberboxed)
abstract sealed validated payload class | -| static class | [ArrayOfArrayOfNumberOnly.ArrayArrayNumberBoxedList](#arrayarraynumberboxedlist)
boxed class to store validated List payloads | +| sealed interface | [ArrayOfArrayOfNumberOnly.ArrayArrayNumberBoxed](#arrayarraynumberboxed)
sealed interface for validated payloads | +| record | [ArrayOfArrayOfNumberOnly.ArrayArrayNumberBoxedList](#arrayarraynumberboxedlist)
boxed class to store validated List payloads | | static class | [ArrayOfArrayOfNumberOnly.ArrayArrayNumber](#arrayarraynumber)
schema class | | static class | [ArrayOfArrayOfNumberOnly.ArrayArrayNumberListBuilder](#arrayarraynumberlistbuilder)
builder for List payloads | | static class | [ArrayOfArrayOfNumberOnly.ArrayArrayNumberList](#arrayarraynumberlist)
output class for List payloads | -| static class | [ArrayOfArrayOfNumberOnly.ItemsBoxed](#itemsboxed)
abstract sealed validated payload class | -| static class | [ArrayOfArrayOfNumberOnly.ItemsBoxedList](#itemsboxedlist)
boxed class to store validated List payloads | +| sealed interface | [ArrayOfArrayOfNumberOnly.ItemsBoxed](#itemsboxed)
sealed interface for validated payloads | +| record | [ArrayOfArrayOfNumberOnly.ItemsBoxedList](#itemsboxedlist)
boxed class to store validated List payloads | | static class | [ArrayOfArrayOfNumberOnly.Items](#items)
schema class | | static class | [ArrayOfArrayOfNumberOnly.ItemsListBuilder](#itemslistbuilder)
builder for List payloads | | static class | [ArrayOfArrayOfNumberOnly.ItemsList](#itemslist)
output class for List payloads | -| static class | [ArrayOfArrayOfNumberOnly.Items1Boxed](#items1boxed)
abstract sealed validated payload class | -| static class | [ArrayOfArrayOfNumberOnly.Items1BoxedNumber](#items1boxednumber)
boxed class to store validated Number payloads | +| sealed interface | [ArrayOfArrayOfNumberOnly.Items1Boxed](#items1boxed)
sealed interface for validated payloads | +| record | [ArrayOfArrayOfNumberOnly.Items1BoxedNumber](#items1boxednumber)
boxed class to store validated Number payloads | | static class | [ArrayOfArrayOfNumberOnly.Items1](#items1)
schema class | ## ArrayOfArrayOfNumberOnly1Boxed -public static abstract sealed class ArrayOfArrayOfNumberOnly1Boxed
+public sealed interface ArrayOfArrayOfNumberOnly1Boxed
permits
[ArrayOfArrayOfNumberOnly1BoxedMap](#arrayofarrayofnumberonly1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ArrayOfArrayOfNumberOnly1BoxedMap -public static final class ArrayOfArrayOfNumberOnly1BoxedMap
-extends [ArrayOfArrayOfNumberOnly1Boxed](#arrayofarrayofnumberonly1boxed) +public record ArrayOfArrayOfNumberOnly1BoxedMap
+implements [ArrayOfArrayOfNumberOnly1Boxed](#arrayofarrayofnumberonly1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ArrayOfArrayOfNumberOnly1BoxedMap([ArrayOfArrayOfNumberOnlyMap](#arrayofarrayofnumberonlymap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [ArrayOfArrayOfNumberOnlyMap](#arrayofarrayofnumberonlymap) | data
validated payload | +| [ArrayOfArrayOfNumberOnlyMap](#arrayofarrayofnumberonlymap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ArrayOfArrayOfNumberOnly1 public static class ArrayOfArrayOfNumberOnly1
@@ -104,7 +105,9 @@ ArrayOfArrayOfNumberOnly.ArrayOfArrayOfNumberOnlyMap validatedPayload = | ----------------- | ---------------------- | | [ArrayOfArrayOfNumberOnlyMap](#arrayofarrayofnumberonlymap) | validate([Map<?, ?>](#arrayofarrayofnumberonlymapbuilder) arg, SchemaConfiguration configuration) | | [ArrayOfArrayOfNumberOnly1BoxedMap](#arrayofarrayofnumberonly1boxedmap) | validateAndBox([Map<?, ?>](#arrayofarrayofnumberonlymapbuilder) arg, SchemaConfiguration configuration) | +| [ArrayOfArrayOfNumberOnly1Boxed](#arrayofarrayofnumberonly1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ArrayOfArrayOfNumberOnlyMapBuilder public class ArrayOfArrayOfNumberOnlyMapBuilder
builder for `Map` @@ -145,27 +148,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## ArrayArrayNumberBoxed -public static abstract sealed class ArrayArrayNumberBoxed
+public sealed interface ArrayArrayNumberBoxed
permits
[ArrayArrayNumberBoxedList](#arrayarraynumberboxedlist) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ArrayArrayNumberBoxedList -public static final class ArrayArrayNumberBoxedList
-extends [ArrayArrayNumberBoxed](#arrayarraynumberboxed) +public record ArrayArrayNumberBoxedList
+implements [ArrayArrayNumberBoxed](#arrayarraynumberboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ArrayArrayNumberBoxedList([ArrayArrayNumberList](#arrayarraynumberlist) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [ArrayArrayNumberList](#arrayarraynumberlist) | data
validated payload | +| [ArrayArrayNumberList](#arrayarraynumberlist) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ArrayArrayNumber public static class ArrayArrayNumber
@@ -213,7 +217,9 @@ ArrayOfArrayOfNumberOnly.ArrayArrayNumberList validatedPayload = | ----------------- | ---------------------- | | [ArrayArrayNumberList](#arrayarraynumberlist) | validate([List](#arrayarraynumberlistbuilder) arg, SchemaConfiguration configuration) | | [ArrayArrayNumberBoxedList](#arrayarraynumberboxedlist) | validateAndBox([List](#arrayarraynumberlistbuilder) arg, SchemaConfiguration configuration) | +| [ArrayArrayNumberBoxed](#arrayarraynumberboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ArrayArrayNumberListBuilder public class ArrayArrayNumberListBuilder
builder for `List>` @@ -244,27 +250,28 @@ A class to store validated List payloads | static [ArrayArrayNumberList](#arrayarraynumberlist) | of([List>](#arrayarraynumberlistbuilder) arg, SchemaConfiguration configuration) | ## ItemsBoxed -public static abstract sealed class ItemsBoxed
+public sealed interface ItemsBoxed
permits
[ItemsBoxedList](#itemsboxedlist) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ItemsBoxedList -public static final class ItemsBoxedList
-extends [ItemsBoxed](#itemsboxed) +public record ItemsBoxedList
+implements [ItemsBoxed](#itemsboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ItemsBoxedList([ItemsList](#itemslist) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [ItemsList](#itemslist) | data
validated payload | +| [ItemsList](#itemslist) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Items public static class Items
@@ -309,7 +316,9 @@ ArrayOfArrayOfNumberOnly.ItemsList validatedPayload = | ----------------- | ---------------------- | | [ItemsList](#itemslist) | validate([List](#itemslistbuilder) arg, SchemaConfiguration configuration) | | [ItemsBoxedList](#itemsboxedlist) | validateAndBox([List](#itemslistbuilder) arg, SchemaConfiguration configuration) | +| [ItemsBoxed](#itemsboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ItemsListBuilder public class ItemsListBuilder
builder for `List` @@ -343,27 +352,28 @@ A class to store validated List payloads | static [ItemsList](#itemslist) | of([List](#itemslistbuilder) arg, SchemaConfiguration configuration) | ## Items1Boxed -public static abstract sealed class Items1Boxed
+public sealed interface Items1Boxed
permits
[Items1BoxedNumber](#items1boxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Items1BoxedNumber -public static final class Items1BoxedNumber
-extends [Items1Boxed](#items1boxed) +public record Items1BoxedNumber
+implements [Items1Boxed](#items1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Items1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Items1 public static class Items1
diff --git a/samples/client/petstore/java/docs/components/schemas/ArrayOfEnums.md b/samples/client/petstore/java/docs/components/schemas/ArrayOfEnums.md index 60c1e0b5d50..5733c845c7c 100644 --- a/samples/client/petstore/java/docs/components/schemas/ArrayOfEnums.md +++ b/samples/client/petstore/java/docs/components/schemas/ArrayOfEnums.md @@ -4,7 +4,7 @@ public class ArrayOfEnums
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated list payloads, extends FrozenList - classes to build inputs for list payloads @@ -12,34 +12,35 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ArrayOfEnums.ArrayOfEnums1Boxed](#arrayofenums1boxed)
abstract sealed validated payload class | -| static class | [ArrayOfEnums.ArrayOfEnums1BoxedList](#arrayofenums1boxedlist)
boxed class to store validated List payloads | +| sealed interface | [ArrayOfEnums.ArrayOfEnums1Boxed](#arrayofenums1boxed)
sealed interface for validated payloads | +| record | [ArrayOfEnums.ArrayOfEnums1BoxedList](#arrayofenums1boxedlist)
boxed class to store validated List payloads | | static class | [ArrayOfEnums.ArrayOfEnums1](#arrayofenums1)
schema class | | static class | [ArrayOfEnums.ArrayOfEnumsListBuilder](#arrayofenumslistbuilder)
builder for List payloads | | static class | [ArrayOfEnums.ArrayOfEnumsList](#arrayofenumslist)
output class for List payloads | ## ArrayOfEnums1Boxed -public static abstract sealed class ArrayOfEnums1Boxed
+public sealed interface ArrayOfEnums1Boxed
permits
[ArrayOfEnums1BoxedList](#arrayofenums1boxedlist) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ArrayOfEnums1BoxedList -public static final class ArrayOfEnums1BoxedList
-extends [ArrayOfEnums1Boxed](#arrayofenums1boxed) +public record ArrayOfEnums1BoxedList
+implements [ArrayOfEnums1Boxed](#arrayofenums1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ArrayOfEnums1BoxedList([ArrayOfEnumsList](#arrayofenumslist) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [ArrayOfEnumsList](#arrayofenumslist) | data
validated payload | +| [ArrayOfEnumsList](#arrayofenumslist) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ArrayOfEnums1 public static class ArrayOfEnums1
@@ -84,7 +85,9 @@ ArrayOfEnums.ArrayOfEnumsList validatedPayload = | ----------------- | ---------------------- | | [ArrayOfEnumsList](#arrayofenumslist) | validate([List](#arrayofenumslistbuilder) arg, SchemaConfiguration configuration) | | [ArrayOfEnums1BoxedList](#arrayofenums1boxedlist) | validateAndBox([List](#arrayofenumslistbuilder) arg, SchemaConfiguration configuration) | +| [ArrayOfEnums1Boxed](#arrayofenums1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ArrayOfEnumsListBuilder public class ArrayOfEnumsListBuilder
builder for `List<@Nullable String>` diff --git a/samples/client/petstore/java/docs/components/schemas/ArrayOfNumberOnly.md b/samples/client/petstore/java/docs/components/schemas/ArrayOfNumberOnly.md index 7e7b828e4f4..a7aa98b9795 100644 --- a/samples/client/petstore/java/docs/components/schemas/ArrayOfNumberOnly.md +++ b/samples/client/petstore/java/docs/components/schemas/ArrayOfNumberOnly.md @@ -4,7 +4,7 @@ public class ArrayOfNumberOnly
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated list payloads, extends FrozenList - classes to build inputs for list payloads @@ -14,42 +14,43 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ArrayOfNumberOnly.ArrayOfNumberOnly1Boxed](#arrayofnumberonly1boxed)
abstract sealed validated payload class | -| static class | [ArrayOfNumberOnly.ArrayOfNumberOnly1BoxedMap](#arrayofnumberonly1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ArrayOfNumberOnly.ArrayOfNumberOnly1Boxed](#arrayofnumberonly1boxed)
sealed interface for validated payloads | +| record | [ArrayOfNumberOnly.ArrayOfNumberOnly1BoxedMap](#arrayofnumberonly1boxedmap)
boxed class to store validated Map payloads | | static class | [ArrayOfNumberOnly.ArrayOfNumberOnly1](#arrayofnumberonly1)
schema class | | static class | [ArrayOfNumberOnly.ArrayOfNumberOnlyMapBuilder](#arrayofnumberonlymapbuilder)
builder for Map payloads | | static class | [ArrayOfNumberOnly.ArrayOfNumberOnlyMap](#arrayofnumberonlymap)
output class for Map payloads | -| static class | [ArrayOfNumberOnly.ArrayNumberBoxed](#arraynumberboxed)
abstract sealed validated payload class | -| static class | [ArrayOfNumberOnly.ArrayNumberBoxedList](#arraynumberboxedlist)
boxed class to store validated List payloads | +| sealed interface | [ArrayOfNumberOnly.ArrayNumberBoxed](#arraynumberboxed)
sealed interface for validated payloads | +| record | [ArrayOfNumberOnly.ArrayNumberBoxedList](#arraynumberboxedlist)
boxed class to store validated List payloads | | static class | [ArrayOfNumberOnly.ArrayNumber](#arraynumber)
schema class | | static class | [ArrayOfNumberOnly.ArrayNumberListBuilder](#arraynumberlistbuilder)
builder for List payloads | | static class | [ArrayOfNumberOnly.ArrayNumberList](#arraynumberlist)
output class for List payloads | -| static class | [ArrayOfNumberOnly.ItemsBoxed](#itemsboxed)
abstract sealed validated payload class | -| static class | [ArrayOfNumberOnly.ItemsBoxedNumber](#itemsboxednumber)
boxed class to store validated Number payloads | +| sealed interface | [ArrayOfNumberOnly.ItemsBoxed](#itemsboxed)
sealed interface for validated payloads | +| record | [ArrayOfNumberOnly.ItemsBoxedNumber](#itemsboxednumber)
boxed class to store validated Number payloads | | static class | [ArrayOfNumberOnly.Items](#items)
schema class | ## ArrayOfNumberOnly1Boxed -public static abstract sealed class ArrayOfNumberOnly1Boxed
+public sealed interface ArrayOfNumberOnly1Boxed
permits
[ArrayOfNumberOnly1BoxedMap](#arrayofnumberonly1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ArrayOfNumberOnly1BoxedMap -public static final class ArrayOfNumberOnly1BoxedMap
-extends [ArrayOfNumberOnly1Boxed](#arrayofnumberonly1boxed) +public record ArrayOfNumberOnly1BoxedMap
+implements [ArrayOfNumberOnly1Boxed](#arrayofnumberonly1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ArrayOfNumberOnly1BoxedMap([ArrayOfNumberOnlyMap](#arrayofnumberonlymap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [ArrayOfNumberOnlyMap](#arrayofnumberonlymap) | data
validated payload | +| [ArrayOfNumberOnlyMap](#arrayofnumberonlymap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ArrayOfNumberOnly1 public static class ArrayOfNumberOnly1
@@ -97,7 +98,9 @@ ArrayOfNumberOnly.ArrayOfNumberOnlyMap validatedPayload = | ----------------- | ---------------------- | | [ArrayOfNumberOnlyMap](#arrayofnumberonlymap) | validate([Map<?, ?>](#arrayofnumberonlymapbuilder) arg, SchemaConfiguration configuration) | | [ArrayOfNumberOnly1BoxedMap](#arrayofnumberonly1boxedmap) | validateAndBox([Map<?, ?>](#arrayofnumberonlymapbuilder) arg, SchemaConfiguration configuration) | +| [ArrayOfNumberOnly1Boxed](#arrayofnumberonly1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ArrayOfNumberOnlyMapBuilder public class ArrayOfNumberOnlyMapBuilder
builder for `Map` @@ -138,27 +141,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## ArrayNumberBoxed -public static abstract sealed class ArrayNumberBoxed
+public sealed interface ArrayNumberBoxed
permits
[ArrayNumberBoxedList](#arraynumberboxedlist) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ArrayNumberBoxedList -public static final class ArrayNumberBoxedList
-extends [ArrayNumberBoxed](#arraynumberboxed) +public record ArrayNumberBoxedList
+implements [ArrayNumberBoxed](#arraynumberboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ArrayNumberBoxedList([ArrayNumberList](#arraynumberlist) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [ArrayNumberList](#arraynumberlist) | data
validated payload | +| [ArrayNumberList](#arraynumberlist) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ArrayNumber public static class ArrayNumber
@@ -203,7 +207,9 @@ ArrayOfNumberOnly.ArrayNumberList validatedPayload = | ----------------- | ---------------------- | | [ArrayNumberList](#arraynumberlist) | validate([List](#arraynumberlistbuilder) arg, SchemaConfiguration configuration) | | [ArrayNumberBoxedList](#arraynumberboxedlist) | validateAndBox([List](#arraynumberlistbuilder) arg, SchemaConfiguration configuration) | +| [ArrayNumberBoxed](#arraynumberboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ArrayNumberListBuilder public class ArrayNumberListBuilder
builder for `List` @@ -237,27 +243,28 @@ A class to store validated List payloads | static [ArrayNumberList](#arraynumberlist) | of([List](#arraynumberlistbuilder) arg, SchemaConfiguration configuration) | ## ItemsBoxed -public static abstract sealed class ItemsBoxed
+public sealed interface ItemsBoxed
permits
[ItemsBoxedNumber](#itemsboxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ItemsBoxedNumber -public static final class ItemsBoxedNumber
-extends [ItemsBoxed](#itemsboxed) +public record ItemsBoxedNumber
+implements [ItemsBoxed](#itemsboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ItemsBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Items public static class Items
diff --git a/samples/client/petstore/java/docs/components/schemas/ArrayTest.md b/samples/client/petstore/java/docs/components/schemas/ArrayTest.md index fe35ce2e3a5..0dfe25e98df 100644 --- a/samples/client/petstore/java/docs/components/schemas/ArrayTest.md +++ b/samples/client/petstore/java/docs/components/schemas/ArrayTest.md @@ -4,7 +4,7 @@ public class ArrayTest
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated list payloads, extends FrozenList - classes to build inputs for list payloads @@ -14,65 +14,66 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ArrayTest.ArrayTest1Boxed](#arraytest1boxed)
abstract sealed validated payload class | -| static class | [ArrayTest.ArrayTest1BoxedMap](#arraytest1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ArrayTest.ArrayTest1Boxed](#arraytest1boxed)
sealed interface for validated payloads | +| record | [ArrayTest.ArrayTest1BoxedMap](#arraytest1boxedmap)
boxed class to store validated Map payloads | | static class | [ArrayTest.ArrayTest1](#arraytest1)
schema class | | static class | [ArrayTest.ArrayTestMapBuilder](#arraytestmapbuilder)
builder for Map payloads | | static class | [ArrayTest.ArrayTestMap](#arraytestmap)
output class for Map payloads | -| static class | [ArrayTest.ArrayArrayOfModelBoxed](#arrayarrayofmodelboxed)
abstract sealed validated payload class | -| static class | [ArrayTest.ArrayArrayOfModelBoxedList](#arrayarrayofmodelboxedlist)
boxed class to store validated List payloads | +| sealed interface | [ArrayTest.ArrayArrayOfModelBoxed](#arrayarrayofmodelboxed)
sealed interface for validated payloads | +| record | [ArrayTest.ArrayArrayOfModelBoxedList](#arrayarrayofmodelboxedlist)
boxed class to store validated List payloads | | static class | [ArrayTest.ArrayArrayOfModel](#arrayarrayofmodel)
schema class | | static class | [ArrayTest.ArrayArrayOfModelListBuilder](#arrayarrayofmodellistbuilder)
builder for List payloads | | static class | [ArrayTest.ArrayArrayOfModelList](#arrayarrayofmodellist)
output class for List payloads | -| static class | [ArrayTest.Items3Boxed](#items3boxed)
abstract sealed validated payload class | -| static class | [ArrayTest.Items3BoxedList](#items3boxedlist)
boxed class to store validated List payloads | +| sealed interface | [ArrayTest.Items3Boxed](#items3boxed)
sealed interface for validated payloads | +| record | [ArrayTest.Items3BoxedList](#items3boxedlist)
boxed class to store validated List payloads | | static class | [ArrayTest.Items3](#items3)
schema class | | static class | [ArrayTest.ItemsListBuilder1](#itemslistbuilder1)
builder for List payloads | | static class | [ArrayTest.ItemsList1](#itemslist1)
output class for List payloads | -| static class | [ArrayTest.ArrayArrayOfIntegerBoxed](#arrayarrayofintegerboxed)
abstract sealed validated payload class | -| static class | [ArrayTest.ArrayArrayOfIntegerBoxedList](#arrayarrayofintegerboxedlist)
boxed class to store validated List payloads | +| sealed interface | [ArrayTest.ArrayArrayOfIntegerBoxed](#arrayarrayofintegerboxed)
sealed interface for validated payloads | +| record | [ArrayTest.ArrayArrayOfIntegerBoxedList](#arrayarrayofintegerboxedlist)
boxed class to store validated List payloads | | static class | [ArrayTest.ArrayArrayOfInteger](#arrayarrayofinteger)
schema class | | static class | [ArrayTest.ArrayArrayOfIntegerListBuilder](#arrayarrayofintegerlistbuilder)
builder for List payloads | | static class | [ArrayTest.ArrayArrayOfIntegerList](#arrayarrayofintegerlist)
output class for List payloads | -| static class | [ArrayTest.Items1Boxed](#items1boxed)
abstract sealed validated payload class | -| static class | [ArrayTest.Items1BoxedList](#items1boxedlist)
boxed class to store validated List payloads | +| sealed interface | [ArrayTest.Items1Boxed](#items1boxed)
sealed interface for validated payloads | +| record | [ArrayTest.Items1BoxedList](#items1boxedlist)
boxed class to store validated List payloads | | static class | [ArrayTest.Items1](#items1)
schema class | | static class | [ArrayTest.ItemsListBuilder](#itemslistbuilder)
builder for List payloads | | static class | [ArrayTest.ItemsList](#itemslist)
output class for List payloads | -| static class | [ArrayTest.Items2Boxed](#items2boxed)
abstract sealed validated payload class | -| static class | [ArrayTest.Items2BoxedNumber](#items2boxednumber)
boxed class to store validated Number payloads | +| sealed interface | [ArrayTest.Items2Boxed](#items2boxed)
sealed interface for validated payloads | +| record | [ArrayTest.Items2BoxedNumber](#items2boxednumber)
boxed class to store validated Number payloads | | static class | [ArrayTest.Items2](#items2)
schema class | -| static class | [ArrayTest.ArrayOfStringBoxed](#arrayofstringboxed)
abstract sealed validated payload class | -| static class | [ArrayTest.ArrayOfStringBoxedList](#arrayofstringboxedlist)
boxed class to store validated List payloads | +| sealed interface | [ArrayTest.ArrayOfStringBoxed](#arrayofstringboxed)
sealed interface for validated payloads | +| record | [ArrayTest.ArrayOfStringBoxedList](#arrayofstringboxedlist)
boxed class to store validated List payloads | | static class | [ArrayTest.ArrayOfString](#arrayofstring)
schema class | | static class | [ArrayTest.ArrayOfStringListBuilder](#arrayofstringlistbuilder)
builder for List payloads | | static class | [ArrayTest.ArrayOfStringList](#arrayofstringlist)
output class for List payloads | -| static class | [ArrayTest.ItemsBoxed](#itemsboxed)
abstract sealed validated payload class | -| static class | [ArrayTest.ItemsBoxedString](#itemsboxedstring)
boxed class to store validated String payloads | +| sealed interface | [ArrayTest.ItemsBoxed](#itemsboxed)
sealed interface for validated payloads | +| record | [ArrayTest.ItemsBoxedString](#itemsboxedstring)
boxed class to store validated String payloads | | static class | [ArrayTest.Items](#items)
schema class | ## ArrayTest1Boxed -public static abstract sealed class ArrayTest1Boxed
+public sealed interface ArrayTest1Boxed
permits
[ArrayTest1BoxedMap](#arraytest1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ArrayTest1BoxedMap -public static final class ArrayTest1BoxedMap
-extends [ArrayTest1Boxed](#arraytest1boxed) +public record ArrayTest1BoxedMap
+implements [ArrayTest1Boxed](#arraytest1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ArrayTest1BoxedMap([ArrayTestMap](#arraytestmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [ArrayTestMap](#arraytestmap) | data
validated payload | +| [ArrayTestMap](#arraytestmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ArrayTest1 public static class ArrayTest1
@@ -143,7 +144,9 @@ ArrayTest.ArrayTestMap validatedPayload = | ----------------- | ---------------------- | | [ArrayTestMap](#arraytestmap) | validate([Map<?, ?>](#arraytestmapbuilder) arg, SchemaConfiguration configuration) | | [ArrayTest1BoxedMap](#arraytest1boxedmap) | validateAndBox([Map<?, ?>](#arraytestmapbuilder) arg, SchemaConfiguration configuration) | +| [ArrayTest1Boxed](#arraytest1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ArrayTestMapBuilder public class ArrayTestMapBuilder
builder for `Map` @@ -188,27 +191,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## ArrayArrayOfModelBoxed -public static abstract sealed class ArrayArrayOfModelBoxed
+public sealed interface ArrayArrayOfModelBoxed
permits
[ArrayArrayOfModelBoxedList](#arrayarrayofmodelboxedlist) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ArrayArrayOfModelBoxedList -public static final class ArrayArrayOfModelBoxedList
-extends [ArrayArrayOfModelBoxed](#arrayarrayofmodelboxed) +public record ArrayArrayOfModelBoxedList
+implements [ArrayArrayOfModelBoxed](#arrayarrayofmodelboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ArrayArrayOfModelBoxedList([ArrayArrayOfModelList](#arrayarrayofmodellist) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [ArrayArrayOfModelList](#arrayarrayofmodellist) | data
validated payload | +| [ArrayArrayOfModelList](#arrayarrayofmodellist) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ArrayArrayOfModel public static class ArrayArrayOfModel
@@ -265,7 +269,9 @@ ArrayTest.ArrayArrayOfModelList validatedPayload = | ----------------- | ---------------------- | | [ArrayArrayOfModelList](#arrayarrayofmodellist) | validate([List](#arrayarrayofmodellistbuilder) arg, SchemaConfiguration configuration) | | [ArrayArrayOfModelBoxedList](#arrayarrayofmodelboxedlist) | validateAndBox([List](#arrayarrayofmodellistbuilder) arg, SchemaConfiguration configuration) | +| [ArrayArrayOfModelBoxed](#arrayarrayofmodelboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ArrayArrayOfModelListBuilder public class ArrayArrayOfModelListBuilder
builder for `List>>` @@ -296,27 +302,28 @@ A class to store validated List payloads | static [ArrayArrayOfModelList](#arrayarrayofmodellist) | of([List>>](#arrayarrayofmodellistbuilder) arg, SchemaConfiguration configuration) | ## Items3Boxed -public static abstract sealed class Items3Boxed
+public sealed interface Items3Boxed
permits
[Items3BoxedList](#items3boxedlist) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Items3BoxedList -public static final class Items3BoxedList
-extends [Items3Boxed](#items3boxed) +public record Items3BoxedList
+implements [Items3Boxed](#items3boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Items3BoxedList([ItemsList1](#itemslist1) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [ItemsList1](#itemslist1) | data
validated payload | +| [ItemsList1](#itemslist1) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Items3 public static class Items3
@@ -371,7 +378,9 @@ ArrayTest.ItemsList1 validatedPayload = | ----------------- | ---------------------- | | [ItemsList1](#itemslist1) | validate([List](#itemslistbuilder1) arg, SchemaConfiguration configuration) | | [Items3BoxedList](#items3boxedlist) | validateAndBox([List](#itemslistbuilder1) arg, SchemaConfiguration configuration) | +| [Items3Boxed](#items3boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ItemsListBuilder1 public class ItemsListBuilder1
builder for `List>` @@ -402,27 +411,28 @@ A class to store validated List payloads | static [ItemsList1](#itemslist1) | of([List>](#itemslistbuilder1) arg, SchemaConfiguration configuration) | ## ArrayArrayOfIntegerBoxed -public static abstract sealed class ArrayArrayOfIntegerBoxed
+public sealed interface ArrayArrayOfIntegerBoxed
permits
[ArrayArrayOfIntegerBoxedList](#arrayarrayofintegerboxedlist) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ArrayArrayOfIntegerBoxedList -public static final class ArrayArrayOfIntegerBoxedList
-extends [ArrayArrayOfIntegerBoxed](#arrayarrayofintegerboxed) +public record ArrayArrayOfIntegerBoxedList
+implements [ArrayArrayOfIntegerBoxed](#arrayarrayofintegerboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ArrayArrayOfIntegerBoxedList([ArrayArrayOfIntegerList](#arrayarrayofintegerlist) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [ArrayArrayOfIntegerList](#arrayarrayofintegerlist) | data
validated payload | +| [ArrayArrayOfIntegerList](#arrayarrayofintegerlist) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ArrayArrayOfInteger public static class ArrayArrayOfInteger
@@ -470,7 +480,9 @@ ArrayTest.ArrayArrayOfIntegerList validatedPayload = | ----------------- | ---------------------- | | [ArrayArrayOfIntegerList](#arrayarrayofintegerlist) | validate([List](#arrayarrayofintegerlistbuilder) arg, SchemaConfiguration configuration) | | [ArrayArrayOfIntegerBoxedList](#arrayarrayofintegerboxedlist) | validateAndBox([List](#arrayarrayofintegerlistbuilder) arg, SchemaConfiguration configuration) | +| [ArrayArrayOfIntegerBoxed](#arrayarrayofintegerboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ArrayArrayOfIntegerListBuilder public class ArrayArrayOfIntegerListBuilder
builder for `List>` @@ -501,27 +513,28 @@ A class to store validated List payloads | static [ArrayArrayOfIntegerList](#arrayarrayofintegerlist) | of([List>](#arrayarrayofintegerlistbuilder) arg, SchemaConfiguration configuration) | ## Items1Boxed -public static abstract sealed class Items1Boxed
+public sealed interface Items1Boxed
permits
[Items1BoxedList](#items1boxedlist) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Items1BoxedList -public static final class Items1BoxedList
-extends [Items1Boxed](#items1boxed) +public record Items1BoxedList
+implements [Items1Boxed](#items1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Items1BoxedList([ItemsList](#itemslist) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [ItemsList](#itemslist) | data
validated payload | +| [ItemsList](#itemslist) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Items1 public static class Items1
@@ -566,7 +579,9 @@ ArrayTest.ItemsList validatedPayload = | ----------------- | ---------------------- | | [ItemsList](#itemslist) | validate([List](#itemslistbuilder) arg, SchemaConfiguration configuration) | | [Items1BoxedList](#items1boxedlist) | validateAndBox([List](#itemslistbuilder) arg, SchemaConfiguration configuration) | +| [Items1Boxed](#items1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ItemsListBuilder public class ItemsListBuilder
builder for `List` @@ -600,27 +615,28 @@ A class to store validated List payloads | static [ItemsList](#itemslist) | of([List](#itemslistbuilder) arg, SchemaConfiguration configuration) | ## Items2Boxed -public static abstract sealed class Items2Boxed
+public sealed interface Items2Boxed
permits
[Items2BoxedNumber](#items2boxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Items2BoxedNumber -public static final class Items2BoxedNumber
-extends [Items2Boxed](#items2boxed) +public record Items2BoxedNumber
+implements [Items2Boxed](#items2boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Items2BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Items2 public static class Items2
@@ -634,27 +650,28 @@ A schema class that validates payloads | validateAndBox | ## ArrayOfStringBoxed -public static abstract sealed class ArrayOfStringBoxed
+public sealed interface ArrayOfStringBoxed
permits
[ArrayOfStringBoxedList](#arrayofstringboxedlist) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ArrayOfStringBoxedList -public static final class ArrayOfStringBoxedList
-extends [ArrayOfStringBoxed](#arrayofstringboxed) +public record ArrayOfStringBoxedList
+implements [ArrayOfStringBoxed](#arrayofstringboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ArrayOfStringBoxedList([ArrayOfStringList](#arrayofstringlist) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [ArrayOfStringList](#arrayofstringlist) | data
validated payload | +| [ArrayOfStringList](#arrayofstringlist) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ArrayOfString public static class ArrayOfString
@@ -699,7 +716,9 @@ ArrayTest.ArrayOfStringList validatedPayload = | ----------------- | ---------------------- | | [ArrayOfStringList](#arrayofstringlist) | validate([List](#arrayofstringlistbuilder) arg, SchemaConfiguration configuration) | | [ArrayOfStringBoxedList](#arrayofstringboxedlist) | validateAndBox([List](#arrayofstringlistbuilder) arg, SchemaConfiguration configuration) | +| [ArrayOfStringBoxed](#arrayofstringboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ArrayOfStringListBuilder public class ArrayOfStringListBuilder
builder for `List` @@ -730,27 +749,28 @@ A class to store validated List payloads | static [ArrayOfStringList](#arrayofstringlist) | of([List](#arrayofstringlistbuilder) arg, SchemaConfiguration configuration) | ## ItemsBoxed -public static abstract sealed class ItemsBoxed
+public sealed interface ItemsBoxed
permits
[ItemsBoxedString](#itemsboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ItemsBoxedString -public static final class ItemsBoxedString
-extends [ItemsBoxed](#itemsboxed) +public record ItemsBoxedString
+implements [ItemsBoxed](#itemsboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ItemsBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Items public static class Items
diff --git a/samples/client/petstore/java/docs/components/schemas/ArrayWithValidationsInItems.md b/samples/client/petstore/java/docs/components/schemas/ArrayWithValidationsInItems.md index 0295b6eacfb..a994ab30d1e 100644 --- a/samples/client/petstore/java/docs/components/schemas/ArrayWithValidationsInItems.md +++ b/samples/client/petstore/java/docs/components/schemas/ArrayWithValidationsInItems.md @@ -4,7 +4,7 @@ public class ArrayWithValidationsInItems
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated list payloads, extends FrozenList - classes to build inputs for list payloads @@ -12,37 +12,38 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ArrayWithValidationsInItems.ArrayWithValidationsInItems1Boxed](#arraywithvalidationsinitems1boxed)
abstract sealed validated payload class | -| static class | [ArrayWithValidationsInItems.ArrayWithValidationsInItems1BoxedList](#arraywithvalidationsinitems1boxedlist)
boxed class to store validated List payloads | +| sealed interface | [ArrayWithValidationsInItems.ArrayWithValidationsInItems1Boxed](#arraywithvalidationsinitems1boxed)
sealed interface for validated payloads | +| record | [ArrayWithValidationsInItems.ArrayWithValidationsInItems1BoxedList](#arraywithvalidationsinitems1boxedlist)
boxed class to store validated List payloads | | static class | [ArrayWithValidationsInItems.ArrayWithValidationsInItems1](#arraywithvalidationsinitems1)
schema class | | static class | [ArrayWithValidationsInItems.ArrayWithValidationsInItemsListBuilder](#arraywithvalidationsinitemslistbuilder)
builder for List payloads | | static class | [ArrayWithValidationsInItems.ArrayWithValidationsInItemsList](#arraywithvalidationsinitemslist)
output class for List payloads | -| static class | [ArrayWithValidationsInItems.ItemsBoxed](#itemsboxed)
abstract sealed validated payload class | -| static class | [ArrayWithValidationsInItems.ItemsBoxedNumber](#itemsboxednumber)
boxed class to store validated Number payloads | +| sealed interface | [ArrayWithValidationsInItems.ItemsBoxed](#itemsboxed)
sealed interface for validated payloads | +| record | [ArrayWithValidationsInItems.ItemsBoxedNumber](#itemsboxednumber)
boxed class to store validated Number payloads | | static class | [ArrayWithValidationsInItems.Items](#items)
schema class | ## ArrayWithValidationsInItems1Boxed -public static abstract sealed class ArrayWithValidationsInItems1Boxed
+public sealed interface ArrayWithValidationsInItems1Boxed
permits
[ArrayWithValidationsInItems1BoxedList](#arraywithvalidationsinitems1boxedlist) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ArrayWithValidationsInItems1BoxedList -public static final class ArrayWithValidationsInItems1BoxedList
-extends [ArrayWithValidationsInItems1Boxed](#arraywithvalidationsinitems1boxed) +public record ArrayWithValidationsInItems1BoxedList
+implements [ArrayWithValidationsInItems1Boxed](#arraywithvalidationsinitems1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ArrayWithValidationsInItems1BoxedList([ArrayWithValidationsInItemsList](#arraywithvalidationsinitemslist) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [ArrayWithValidationsInItemsList](#arraywithvalidationsinitemslist) | data
validated payload | +| [ArrayWithValidationsInItemsList](#arraywithvalidationsinitemslist) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ArrayWithValidationsInItems1 public static class ArrayWithValidationsInItems1
@@ -88,7 +89,9 @@ ArrayWithValidationsInItems.ArrayWithValidationsInItemsList validatedPayload = | ----------------- | ---------------------- | | [ArrayWithValidationsInItemsList](#arraywithvalidationsinitemslist) | validate([List](#arraywithvalidationsinitemslistbuilder) arg, SchemaConfiguration configuration) | | [ArrayWithValidationsInItems1BoxedList](#arraywithvalidationsinitems1boxedlist) | validateAndBox([List](#arraywithvalidationsinitemslistbuilder) arg, SchemaConfiguration configuration) | +| [ArrayWithValidationsInItems1Boxed](#arraywithvalidationsinitems1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ArrayWithValidationsInItemsListBuilder public class ArrayWithValidationsInItemsListBuilder
builder for `List` @@ -122,27 +125,28 @@ A class to store validated List payloads | static [ArrayWithValidationsInItemsList](#arraywithvalidationsinitemslist) | of([List](#arraywithvalidationsinitemslistbuilder) arg, SchemaConfiguration configuration) | ## ItemsBoxed -public static abstract sealed class ItemsBoxed
+public sealed interface ItemsBoxed
permits
[ItemsBoxedNumber](#itemsboxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ItemsBoxedNumber -public static final class ItemsBoxedNumber
-extends [ItemsBoxed](#itemsboxed) +public record ItemsBoxedNumber
+implements [ItemsBoxed](#itemsboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ItemsBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Items public static class Items
@@ -184,5 +188,7 @@ long validatedPayload = ArrayWithValidationsInItems.Items.validate( | ----------------- | ---------------------- | | long | validate(long arg, SchemaConfiguration configuration) | | [ItemsBoxedNumber](#itemsboxednumber) | validateAndBox(Number arg, SchemaConfiguration configuration) | +| [ItemsBoxed](#itemsboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/components/schemas/Banana.md b/samples/client/petstore/java/docs/components/schemas/Banana.md index 4332912ded9..61ceba9b47b 100644 --- a/samples/client/petstore/java/docs/components/schemas/Banana.md +++ b/samples/client/petstore/java/docs/components/schemas/Banana.md @@ -4,7 +4,7 @@ public class Banana
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,37 +12,38 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Banana.Banana1Boxed](#banana1boxed)
abstract sealed validated payload class | -| static class | [Banana.Banana1BoxedMap](#banana1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [Banana.Banana1Boxed](#banana1boxed)
sealed interface for validated payloads | +| record | [Banana.Banana1BoxedMap](#banana1boxedmap)
boxed class to store validated Map payloads | | static class | [Banana.Banana1](#banana1)
schema class | | static class | [Banana.BananaMapBuilder](#bananamapbuilder)
builder for Map payloads | | static class | [Banana.BananaMap](#bananamap)
output class for Map payloads | -| static class | [Banana.LengthCmBoxed](#lengthcmboxed)
abstract sealed validated payload class | -| static class | [Banana.LengthCmBoxedNumber](#lengthcmboxednumber)
boxed class to store validated Number payloads | +| sealed interface | [Banana.LengthCmBoxed](#lengthcmboxed)
sealed interface for validated payloads | +| record | [Banana.LengthCmBoxedNumber](#lengthcmboxednumber)
boxed class to store validated Number payloads | | static class | [Banana.LengthCm](#lengthcm)
schema class | ## Banana1Boxed -public static abstract sealed class Banana1Boxed
+public sealed interface Banana1Boxed
permits
[Banana1BoxedMap](#banana1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Banana1BoxedMap -public static final class Banana1BoxedMap
-extends [Banana1Boxed](#banana1boxed) +public record Banana1BoxedMap
+implements [Banana1Boxed](#banana1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Banana1BoxedMap([BananaMap](#bananamap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [BananaMap](#bananamap) | data
validated payload | +| [BananaMap](#bananamap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Banana1 public static class Banana1
@@ -88,7 +89,9 @@ Banana.BananaMap validatedPayload = | ----------------- | ---------------------- | | [BananaMap](#bananamap) | validate([Map<?, ?>](#bananamapbuilder) arg, SchemaConfiguration configuration) | | [Banana1BoxedMap](#banana1boxedmap) | validateAndBox([Map<?, ?>](#bananamapbuilder) arg, SchemaConfiguration configuration) | +| [Banana1Boxed](#banana1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## BananaMap0Builder public class BananaMap0Builder
builder for `Map` @@ -147,27 +150,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## LengthCmBoxed -public static abstract sealed class LengthCmBoxed
+public sealed interface LengthCmBoxed
permits
[LengthCmBoxedNumber](#lengthcmboxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## LengthCmBoxedNumber -public static final class LengthCmBoxedNumber
-extends [LengthCmBoxed](#lengthcmboxed) +public record LengthCmBoxedNumber
+implements [LengthCmBoxed](#lengthcmboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | LengthCmBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## LengthCm public static class LengthCm
diff --git a/samples/client/petstore/java/docs/components/schemas/BananaReq.md b/samples/client/petstore/java/docs/components/schemas/BananaReq.md index 4790c807836..09f1c1c038a 100644 --- a/samples/client/petstore/java/docs/components/schemas/BananaReq.md +++ b/samples/client/petstore/java/docs/components/schemas/BananaReq.md @@ -4,7 +4,7 @@ public class BananaReq
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,48 +12,49 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [BananaReq.BananaReq1Boxed](#bananareq1boxed)
abstract sealed validated payload class | -| static class | [BananaReq.BananaReq1BoxedMap](#bananareq1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [BananaReq.BananaReq1Boxed](#bananareq1boxed)
sealed interface for validated payloads | +| record | [BananaReq.BananaReq1BoxedMap](#bananareq1boxedmap)
boxed class to store validated Map payloads | | static class | [BananaReq.BananaReq1](#bananareq1)
schema class | | static class | [BananaReq.BananaReqMapBuilder](#bananareqmapbuilder)
builder for Map payloads | | static class | [BananaReq.BananaReqMap](#bananareqmap)
output class for Map payloads | -| static class | [BananaReq.SweetBoxed](#sweetboxed)
abstract sealed validated payload class | -| static class | [BananaReq.SweetBoxedBoolean](#sweetboxedboolean)
boxed class to store validated boolean payloads | +| sealed interface | [BananaReq.SweetBoxed](#sweetboxed)
sealed interface for validated payloads | +| record | [BananaReq.SweetBoxedBoolean](#sweetboxedboolean)
boxed class to store validated boolean payloads | | static class | [BananaReq.Sweet](#sweet)
schema class | -| static class | [BananaReq.LengthCmBoxed](#lengthcmboxed)
abstract sealed validated payload class | -| static class | [BananaReq.LengthCmBoxedNumber](#lengthcmboxednumber)
boxed class to store validated Number payloads | +| sealed interface | [BananaReq.LengthCmBoxed](#lengthcmboxed)
sealed interface for validated payloads | +| record | [BananaReq.LengthCmBoxedNumber](#lengthcmboxednumber)
boxed class to store validated Number payloads | | static class | [BananaReq.LengthCm](#lengthcm)
schema class | -| static class | [BananaReq.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
abstract sealed validated payload class | -| static class | [BananaReq.AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid)
boxed class to store validated null payloads | -| static class | [BananaReq.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | -| static class | [BananaReq.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | -| static class | [BananaReq.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | -| static class | [BananaReq.AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist)
boxed class to store validated List payloads | -| static class | [BananaReq.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [BananaReq.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
sealed interface for validated payloads | +| record | [BananaReq.AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid)
boxed class to store validated null payloads | +| record | [BananaReq.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | +| record | [BananaReq.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | +| record | [BananaReq.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | +| record | [BananaReq.AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist)
boxed class to store validated List payloads | +| record | [BananaReq.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | | static class | [BananaReq.AdditionalProperties](#additionalproperties)
schema class | ## BananaReq1Boxed -public static abstract sealed class BananaReq1Boxed
+public sealed interface BananaReq1Boxed
permits
[BananaReq1BoxedMap](#bananareq1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## BananaReq1BoxedMap -public static final class BananaReq1BoxedMap
-extends [BananaReq1Boxed](#bananareq1boxed) +public record BananaReq1BoxedMap
+implements [BananaReq1Boxed](#bananareq1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BananaReq1BoxedMap([BananaReqMap](#bananareqmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [BananaReqMap](#bananareqmap) | data
validated payload | +| [BananaReqMap](#bananareqmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## BananaReq1 public static class BananaReq1
@@ -102,7 +103,9 @@ BananaReq.BananaReqMap validatedPayload = | ----------------- | ---------------------- | | [BananaReqMap](#bananareqmap) | validate([Map<?, ?>](#bananareqmapbuilder) arg, SchemaConfiguration configuration) | | [BananaReq1BoxedMap](#bananareq1boxedmap) | validateAndBox([Map<?, ?>](#bananareqmapbuilder) arg, SchemaConfiguration configuration) | +| [BananaReq1Boxed](#bananareq1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## BananaReqMap0Builder public class BananaReqMap0Builder
builder for `Map` @@ -153,27 +156,28 @@ A class to store validated Map payloads | boolean | sweet()
[optional] | ## SweetBoxed -public static abstract sealed class SweetBoxed
+public sealed interface SweetBoxed
permits
[SweetBoxedBoolean](#sweetboxedboolean) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## SweetBoxedBoolean -public static final class SweetBoxedBoolean
-extends [SweetBoxed](#sweetboxed) +public record SweetBoxedBoolean
+implements [SweetBoxed](#sweetboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | SweetBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Sweet public static class Sweet
@@ -187,27 +191,28 @@ A schema class that validates payloads | validateAndBox | ## LengthCmBoxed -public static abstract sealed class LengthCmBoxed
+public sealed interface LengthCmBoxed
permits
[LengthCmBoxedNumber](#lengthcmboxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## LengthCmBoxedNumber -public static final class LengthCmBoxedNumber
-extends [LengthCmBoxed](#lengthcmboxed) +public record LengthCmBoxedNumber
+implements [LengthCmBoxed](#lengthcmboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | LengthCmBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## LengthCm public static class LengthCm
@@ -221,7 +226,7 @@ A schema class that validates payloads | validateAndBox | ## AdditionalPropertiesBoxed -public static abstract sealed class AdditionalPropertiesBoxed
+public sealed interface AdditionalPropertiesBoxed
permits
[AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid), [AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean), @@ -230,103 +235,109 @@ permits
[AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist), [AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AdditionalPropertiesBoxedVoid -public static final class AdditionalPropertiesBoxedVoid
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedVoid
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedBoolean -public static final class AdditionalPropertiesBoxedBoolean
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedBoolean
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedNumber -public static final class AdditionalPropertiesBoxedNumber
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedNumber
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedString -public static final class AdditionalPropertiesBoxedString
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedString
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedList -public static final class AdditionalPropertiesBoxedList
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedList
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedMap -public static final class AdditionalPropertiesBoxedMap
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedMap
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalProperties public static class AdditionalProperties
diff --git a/samples/client/petstore/java/docs/components/schemas/Bar.md b/samples/client/petstore/java/docs/components/schemas/Bar.md index 01243da7778..e633918622c 100644 --- a/samples/client/petstore/java/docs/components/schemas/Bar.md +++ b/samples/client/petstore/java/docs/components/schemas/Bar.md @@ -4,38 +4,39 @@ public class Bar
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Bar.Bar1Boxed](#bar1boxed)
abstract sealed validated payload class | -| static class | [Bar.Bar1BoxedString](#bar1boxedstring)
boxed class to store validated String payloads | +| sealed interface | [Bar.Bar1Boxed](#bar1boxed)
sealed interface for validated payloads | +| record | [Bar.Bar1BoxedString](#bar1boxedstring)
boxed class to store validated String payloads | | static class | [Bar.Bar1](#bar1)
schema class | ## Bar1Boxed -public static abstract sealed class Bar1Boxed
+public sealed interface Bar1Boxed
permits
[Bar1BoxedString](#bar1boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Bar1BoxedString -public static final class Bar1BoxedString
-extends [Bar1Boxed](#bar1boxed) +public record Bar1BoxedString
+implements [Bar1Boxed](#bar1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Bar1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Bar1 public static class Bar1
@@ -76,5 +77,7 @@ String validatedPayload = Bar.Bar1.validate( | ----------------- | ---------------------- | | String | validate(String arg, SchemaConfiguration configuration) | | [Bar1BoxedString](#bar1boxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [Bar1Boxed](#bar1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/components/schemas/BasquePig.md b/samples/client/petstore/java/docs/components/schemas/BasquePig.md index 1a86f2b89be..a57816c8266 100644 --- a/samples/client/petstore/java/docs/components/schemas/BasquePig.md +++ b/samples/client/petstore/java/docs/components/schemas/BasquePig.md @@ -4,7 +4,7 @@ public class BasquePig
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -13,38 +13,39 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [BasquePig.BasquePig1Boxed](#basquepig1boxed)
abstract sealed validated payload class | -| static class | [BasquePig.BasquePig1BoxedMap](#basquepig1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [BasquePig.BasquePig1Boxed](#basquepig1boxed)
sealed interface for validated payloads | +| record | [BasquePig.BasquePig1BoxedMap](#basquepig1boxedmap)
boxed class to store validated Map payloads | | static class | [BasquePig.BasquePig1](#basquepig1)
schema class | | static class | [BasquePig.BasquePigMapBuilder](#basquepigmapbuilder)
builder for Map payloads | | static class | [BasquePig.BasquePigMap](#basquepigmap)
output class for Map payloads | -| static class | [BasquePig.ClassNameBoxed](#classnameboxed)
abstract sealed validated payload class | -| static class | [BasquePig.ClassNameBoxedString](#classnameboxedstring)
boxed class to store validated String payloads | +| sealed interface | [BasquePig.ClassNameBoxed](#classnameboxed)
sealed interface for validated payloads | +| record | [BasquePig.ClassNameBoxedString](#classnameboxedstring)
boxed class to store validated String payloads | | static class | [BasquePig.ClassName](#classname)
schema class | | enum | [BasquePig.StringClassNameEnums](#stringclassnameenums)
String enum | ## BasquePig1Boxed -public static abstract sealed class BasquePig1Boxed
+public sealed interface BasquePig1Boxed
permits
[BasquePig1BoxedMap](#basquepig1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## BasquePig1BoxedMap -public static final class BasquePig1BoxedMap
-extends [BasquePig1Boxed](#basquepig1boxed) +public record BasquePig1BoxedMap
+implements [BasquePig1Boxed](#basquepig1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BasquePig1BoxedMap([BasquePigMap](#basquepigmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [BasquePigMap](#basquepigmap) | data
validated payload | +| [BasquePigMap](#basquepigmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## BasquePig1 public static class BasquePig1
@@ -90,7 +91,9 @@ BasquePig.BasquePigMap validatedPayload = | ----------------- | ---------------------- | | [BasquePigMap](#basquepigmap) | validate([Map<?, ?>](#basquepigmapbuilder) arg, SchemaConfiguration configuration) | | [BasquePig1BoxedMap](#basquepig1boxedmap) | validateAndBox([Map<?, ?>](#basquepigmapbuilder) arg, SchemaConfiguration configuration) | +| [BasquePig1Boxed](#basquepig1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## BasquePigMap0Builder public class BasquePigMap0Builder
builder for `Map` @@ -147,27 +150,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## ClassNameBoxed -public static abstract sealed class ClassNameBoxed
+public sealed interface ClassNameBoxed
permits
[ClassNameBoxedString](#classnameboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ClassNameBoxedString -public static final class ClassNameBoxedString
-extends [ClassNameBoxed](#classnameboxed) +public record ClassNameBoxedString
+implements [ClassNameBoxed](#classnameboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ClassNameBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ClassName public static class ClassName
@@ -209,7 +213,9 @@ String validatedPayload = BasquePig.ClassName.validate( | String | validate(String arg, SchemaConfiguration configuration) | | String | validate([StringClassNameEnums](#stringclassnameenums) arg, SchemaConfiguration configuration) | | [ClassNameBoxedString](#classnameboxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [ClassNameBoxed](#classnameboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## StringClassNameEnums public enum StringClassNameEnums
extends `Enum` diff --git a/samples/client/petstore/java/docs/components/schemas/BooleanEnum.md b/samples/client/petstore/java/docs/components/schemas/BooleanEnum.md index 60b731c2335..15ce8e00873 100644 --- a/samples/client/petstore/java/docs/components/schemas/BooleanEnum.md +++ b/samples/client/petstore/java/docs/components/schemas/BooleanEnum.md @@ -4,40 +4,41 @@ public class BooleanEnum
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - enum classes ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [BooleanEnum.BooleanEnum1Boxed](#booleanenum1boxed)
abstract sealed validated payload class | -| static class | [BooleanEnum.BooleanEnum1BoxedBoolean](#booleanenum1boxedboolean)
boxed class to store validated boolean payloads | +| sealed interface | [BooleanEnum.BooleanEnum1Boxed](#booleanenum1boxed)
sealed interface for validated payloads | +| record | [BooleanEnum.BooleanEnum1BoxedBoolean](#booleanenum1boxedboolean)
boxed class to store validated boolean payloads | | static class | [BooleanEnum.BooleanEnum1](#booleanenum1)
schema class | | enum | [BooleanEnum.BooleanBooleanEnumEnums](#booleanbooleanenumenums)
boolean enum | ## BooleanEnum1Boxed -public static abstract sealed class BooleanEnum1Boxed
+public sealed interface BooleanEnum1Boxed
permits
[BooleanEnum1BoxedBoolean](#booleanenum1boxedboolean) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## BooleanEnum1BoxedBoolean -public static final class BooleanEnum1BoxedBoolean
-extends [BooleanEnum1Boxed](#booleanenum1boxed) +public record BooleanEnum1BoxedBoolean
+implements [BooleanEnum1Boxed](#booleanenum1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BooleanEnum1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## BooleanEnum1 public static class BooleanEnum1
@@ -79,7 +80,9 @@ boolean validatedPayload = BooleanEnum.BooleanEnum1.validate( | boolean | validate(boolean arg, SchemaConfiguration configuration) | | boolean | validate([BooleanBooleanEnumEnums](#booleanbooleanenumenums) arg, SchemaConfiguration configuration) | | [BooleanEnum1BoxedBoolean](#booleanenum1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | +| [BooleanEnum1Boxed](#booleanenum1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## BooleanBooleanEnumEnums public enum BooleanBooleanEnumEnums
extends `Enum` diff --git a/samples/client/petstore/java/docs/components/schemas/BooleanSchema.md b/samples/client/petstore/java/docs/components/schemas/BooleanSchema.md index d09b7dfe095..5f8d3d2fb27 100644 --- a/samples/client/petstore/java/docs/components/schemas/BooleanSchema.md +++ b/samples/client/petstore/java/docs/components/schemas/BooleanSchema.md @@ -4,38 +4,39 @@ public class BooleanSchema
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [BooleanSchema.BooleanSchema1Boxed](#booleanschema1boxed)
abstract sealed validated payload class | -| static class | [BooleanSchema.BooleanSchema1BoxedBoolean](#booleanschema1boxedboolean)
boxed class to store validated boolean payloads | +| sealed interface | [BooleanSchema.BooleanSchema1Boxed](#booleanschema1boxed)
sealed interface for validated payloads | +| record | [BooleanSchema.BooleanSchema1BoxedBoolean](#booleanschema1boxedboolean)
boxed class to store validated boolean payloads | | static class | [BooleanSchema.BooleanSchema1](#booleanschema1)
schema class | ## BooleanSchema1Boxed -public static abstract sealed class BooleanSchema1Boxed
+public sealed interface BooleanSchema1Boxed
permits
[BooleanSchema1BoxedBoolean](#booleanschema1boxedboolean) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## BooleanSchema1BoxedBoolean -public static final class BooleanSchema1BoxedBoolean
-extends [BooleanSchema1Boxed](#booleanschema1boxed) +public record BooleanSchema1BoxedBoolean
+implements [BooleanSchema1Boxed](#booleanschema1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BooleanSchema1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## BooleanSchema1 public static class BooleanSchema1
diff --git a/samples/client/petstore/java/docs/components/schemas/Capitalization.md b/samples/client/petstore/java/docs/components/schemas/Capitalization.md index 5dc2c209fd6..75d4d175545 100644 --- a/samples/client/petstore/java/docs/components/schemas/Capitalization.md +++ b/samples/client/petstore/java/docs/components/schemas/Capitalization.md @@ -4,7 +4,7 @@ public class Capitalization
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,52 +12,53 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Capitalization.Capitalization1Boxed](#capitalization1boxed)
abstract sealed validated payload class | -| static class | [Capitalization.Capitalization1BoxedMap](#capitalization1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [Capitalization.Capitalization1Boxed](#capitalization1boxed)
sealed interface for validated payloads | +| record | [Capitalization.Capitalization1BoxedMap](#capitalization1boxedmap)
boxed class to store validated Map payloads | | static class | [Capitalization.Capitalization1](#capitalization1)
schema class | | static class | [Capitalization.CapitalizationMapBuilder](#capitalizationmapbuilder)
builder for Map payloads | | static class | [Capitalization.CapitalizationMap](#capitalizationmap)
output class for Map payloads | -| static class | [Capitalization.ATTNAMEBoxed](#attnameboxed)
abstract sealed validated payload class | -| static class | [Capitalization.ATTNAMEBoxedString](#attnameboxedstring)
boxed class to store validated String payloads | +| sealed interface | [Capitalization.ATTNAMEBoxed](#attnameboxed)
sealed interface for validated payloads | +| record | [Capitalization.ATTNAMEBoxedString](#attnameboxedstring)
boxed class to store validated String payloads | | static class | [Capitalization.ATTNAME](#attname)
schema class | -| static class | [Capitalization.SCAETHFlowPointsBoxed](#scaethflowpointsboxed)
abstract sealed validated payload class | -| static class | [Capitalization.SCAETHFlowPointsBoxedString](#scaethflowpointsboxedstring)
boxed class to store validated String payloads | +| sealed interface | [Capitalization.SCAETHFlowPointsBoxed](#scaethflowpointsboxed)
sealed interface for validated payloads | +| record | [Capitalization.SCAETHFlowPointsBoxedString](#scaethflowpointsboxedstring)
boxed class to store validated String payloads | | static class | [Capitalization.SCAETHFlowPoints](#scaethflowpoints)
schema class | -| static class | [Capitalization.CapitalSnakeBoxed](#capitalsnakeboxed)
abstract sealed validated payload class | -| static class | [Capitalization.CapitalSnakeBoxedString](#capitalsnakeboxedstring)
boxed class to store validated String payloads | +| sealed interface | [Capitalization.CapitalSnakeBoxed](#capitalsnakeboxed)
sealed interface for validated payloads | +| record | [Capitalization.CapitalSnakeBoxedString](#capitalsnakeboxedstring)
boxed class to store validated String payloads | | static class | [Capitalization.CapitalSnake](#capitalsnake)
schema class | -| static class | [Capitalization.SmallSnakeBoxed](#smallsnakeboxed)
abstract sealed validated payload class | -| static class | [Capitalization.SmallSnakeBoxedString](#smallsnakeboxedstring)
boxed class to store validated String payloads | +| sealed interface | [Capitalization.SmallSnakeBoxed](#smallsnakeboxed)
sealed interface for validated payloads | +| record | [Capitalization.SmallSnakeBoxedString](#smallsnakeboxedstring)
boxed class to store validated String payloads | | static class | [Capitalization.SmallSnake](#smallsnake)
schema class | -| static class | [Capitalization.CapitalCamelBoxed](#capitalcamelboxed)
abstract sealed validated payload class | -| static class | [Capitalization.CapitalCamelBoxedString](#capitalcamelboxedstring)
boxed class to store validated String payloads | +| sealed interface | [Capitalization.CapitalCamelBoxed](#capitalcamelboxed)
sealed interface for validated payloads | +| record | [Capitalization.CapitalCamelBoxedString](#capitalcamelboxedstring)
boxed class to store validated String payloads | | static class | [Capitalization.CapitalCamel](#capitalcamel)
schema class | -| static class | [Capitalization.SmallCamelBoxed](#smallcamelboxed)
abstract sealed validated payload class | -| static class | [Capitalization.SmallCamelBoxedString](#smallcamelboxedstring)
boxed class to store validated String payloads | +| sealed interface | [Capitalization.SmallCamelBoxed](#smallcamelboxed)
sealed interface for validated payloads | +| record | [Capitalization.SmallCamelBoxedString](#smallcamelboxedstring)
boxed class to store validated String payloads | | static class | [Capitalization.SmallCamel](#smallcamel)
schema class | ## Capitalization1Boxed -public static abstract sealed class Capitalization1Boxed
+public sealed interface Capitalization1Boxed
permits
[Capitalization1BoxedMap](#capitalization1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Capitalization1BoxedMap -public static final class Capitalization1BoxedMap
-extends [Capitalization1Boxed](#capitalization1boxed) +public record Capitalization1BoxedMap
+implements [Capitalization1Boxed](#capitalization1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Capitalization1BoxedMap([CapitalizationMap](#capitalizationmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [CapitalizationMap](#capitalizationmap) | data
validated payload | +| [CapitalizationMap](#capitalizationmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Capitalization1 public static class Capitalization1
@@ -112,7 +113,9 @@ Capitalization.CapitalizationMap validatedPayload = | ----------------- | ---------------------- | | [CapitalizationMap](#capitalizationmap) | validate([Map<?, ?>](#capitalizationmapbuilder) arg, SchemaConfiguration configuration) | | [Capitalization1BoxedMap](#capitalization1boxedmap) | validateAndBox([Map<?, ?>](#capitalizationmapbuilder) arg, SchemaConfiguration configuration) | +| [Capitalization1Boxed](#capitalization1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## CapitalizationMapBuilder public class CapitalizationMapBuilder
builder for `Map` @@ -163,27 +166,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## ATTNAMEBoxed -public static abstract sealed class ATTNAMEBoxed
+public sealed interface ATTNAMEBoxed
permits
[ATTNAMEBoxedString](#attnameboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ATTNAMEBoxedString -public static final class ATTNAMEBoxedString
-extends [ATTNAMEBoxed](#attnameboxed) +public record ATTNAMEBoxedString
+implements [ATTNAMEBoxed](#attnameboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ATTNAMEBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ATTNAME public static class ATTNAME
@@ -200,27 +204,28 @@ Name of the pet
| validateAndBox | ## SCAETHFlowPointsBoxed -public static abstract sealed class SCAETHFlowPointsBoxed
+public sealed interface SCAETHFlowPointsBoxed
permits
[SCAETHFlowPointsBoxedString](#scaethflowpointsboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## SCAETHFlowPointsBoxedString -public static final class SCAETHFlowPointsBoxedString
-extends [SCAETHFlowPointsBoxed](#scaethflowpointsboxed) +public record SCAETHFlowPointsBoxedString
+implements [SCAETHFlowPointsBoxed](#scaethflowpointsboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | SCAETHFlowPointsBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## SCAETHFlowPoints public static class SCAETHFlowPoints
@@ -234,27 +239,28 @@ A schema class that validates payloads | validateAndBox | ## CapitalSnakeBoxed -public static abstract sealed class CapitalSnakeBoxed
+public sealed interface CapitalSnakeBoxed
permits
[CapitalSnakeBoxedString](#capitalsnakeboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## CapitalSnakeBoxedString -public static final class CapitalSnakeBoxedString
-extends [CapitalSnakeBoxed](#capitalsnakeboxed) +public record CapitalSnakeBoxedString
+implements [CapitalSnakeBoxed](#capitalsnakeboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | CapitalSnakeBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## CapitalSnake public static class CapitalSnake
@@ -268,27 +274,28 @@ A schema class that validates payloads | validateAndBox | ## SmallSnakeBoxed -public static abstract sealed class SmallSnakeBoxed
+public sealed interface SmallSnakeBoxed
permits
[SmallSnakeBoxedString](#smallsnakeboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## SmallSnakeBoxedString -public static final class SmallSnakeBoxedString
-extends [SmallSnakeBoxed](#smallsnakeboxed) +public record SmallSnakeBoxedString
+implements [SmallSnakeBoxed](#smallsnakeboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | SmallSnakeBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## SmallSnake public static class SmallSnake
@@ -302,27 +309,28 @@ A schema class that validates payloads | validateAndBox | ## CapitalCamelBoxed -public static abstract sealed class CapitalCamelBoxed
+public sealed interface CapitalCamelBoxed
permits
[CapitalCamelBoxedString](#capitalcamelboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## CapitalCamelBoxedString -public static final class CapitalCamelBoxedString
-extends [CapitalCamelBoxed](#capitalcamelboxed) +public record CapitalCamelBoxedString
+implements [CapitalCamelBoxed](#capitalcamelboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | CapitalCamelBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## CapitalCamel public static class CapitalCamel
@@ -336,27 +344,28 @@ A schema class that validates payloads | validateAndBox | ## SmallCamelBoxed -public static abstract sealed class SmallCamelBoxed
+public sealed interface SmallCamelBoxed
permits
[SmallCamelBoxedString](#smallcamelboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## SmallCamelBoxedString -public static final class SmallCamelBoxedString
-extends [SmallCamelBoxed](#smallcamelboxed) +public record SmallCamelBoxedString
+implements [SmallCamelBoxed](#smallcamelboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | SmallCamelBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## SmallCamel public static class SmallCamel
diff --git a/samples/client/petstore/java/docs/components/schemas/Cat.md b/samples/client/petstore/java/docs/components/schemas/Cat.md index a0c1cb01942..0b45115c0a9 100644 --- a/samples/client/petstore/java/docs/components/schemas/Cat.md +++ b/samples/client/petstore/java/docs/components/schemas/Cat.md @@ -4,7 +4,7 @@ public class Cat
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,25 +12,25 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Cat.Cat1Boxed](#cat1boxed)
abstract sealed validated payload class | -| static class | [Cat.Cat1BoxedVoid](#cat1boxedvoid)
boxed class to store validated null payloads | -| static class | [Cat.Cat1BoxedBoolean](#cat1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [Cat.Cat1BoxedNumber](#cat1boxednumber)
boxed class to store validated Number payloads | -| static class | [Cat.Cat1BoxedString](#cat1boxedstring)
boxed class to store validated String payloads | -| static class | [Cat.Cat1BoxedList](#cat1boxedlist)
boxed class to store validated List payloads | -| static class | [Cat.Cat1BoxedMap](#cat1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [Cat.Cat1Boxed](#cat1boxed)
sealed interface for validated payloads | +| record | [Cat.Cat1BoxedVoid](#cat1boxedvoid)
boxed class to store validated null payloads | +| record | [Cat.Cat1BoxedBoolean](#cat1boxedboolean)
boxed class to store validated boolean payloads | +| record | [Cat.Cat1BoxedNumber](#cat1boxednumber)
boxed class to store validated Number payloads | +| record | [Cat.Cat1BoxedString](#cat1boxedstring)
boxed class to store validated String payloads | +| record | [Cat.Cat1BoxedList](#cat1boxedlist)
boxed class to store validated List payloads | +| record | [Cat.Cat1BoxedMap](#cat1boxedmap)
boxed class to store validated Map payloads | | static class | [Cat.Cat1](#cat1)
schema class | -| static class | [Cat.Schema1Boxed](#schema1boxed)
abstract sealed validated payload class | -| static class | [Cat.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [Cat.Schema1Boxed](#schema1boxed)
sealed interface for validated payloads | +| record | [Cat.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | | static class | [Cat.Schema1](#schema1)
schema class | | static class | [Cat.Schema1MapBuilder](#schema1mapbuilder)
builder for Map payloads | | static class | [Cat.Schema1Map](#schema1map)
output class for Map payloads | -| static class | [Cat.DeclawedBoxed](#declawedboxed)
abstract sealed validated payload class | -| static class | [Cat.DeclawedBoxedBoolean](#declawedboxedboolean)
boxed class to store validated boolean payloads | +| sealed interface | [Cat.DeclawedBoxed](#declawedboxed)
sealed interface for validated payloads | +| record | [Cat.DeclawedBoxedBoolean](#declawedboxedboolean)
boxed class to store validated boolean payloads | | static class | [Cat.Declawed](#declawed)
schema class | ## Cat1Boxed -public static abstract sealed class Cat1Boxed
+public sealed interface Cat1Boxed
permits
[Cat1BoxedVoid](#cat1boxedvoid), [Cat1BoxedBoolean](#cat1boxedboolean), @@ -39,103 +39,109 @@ permits
[Cat1BoxedList](#cat1boxedlist), [Cat1BoxedMap](#cat1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Cat1BoxedVoid -public static final class Cat1BoxedVoid
-extends [Cat1Boxed](#cat1boxed) +public record Cat1BoxedVoid
+implements [Cat1Boxed](#cat1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Cat1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Cat1BoxedBoolean -public static final class Cat1BoxedBoolean
-extends [Cat1Boxed](#cat1boxed) +public record Cat1BoxedBoolean
+implements [Cat1Boxed](#cat1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Cat1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Cat1BoxedNumber -public static final class Cat1BoxedNumber
-extends [Cat1Boxed](#cat1boxed) +public record Cat1BoxedNumber
+implements [Cat1Boxed](#cat1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Cat1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Cat1BoxedString -public static final class Cat1BoxedString
-extends [Cat1Boxed](#cat1boxed) +public record Cat1BoxedString
+implements [Cat1Boxed](#cat1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Cat1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Cat1BoxedList -public static final class Cat1BoxedList
-extends [Cat1Boxed](#cat1boxed) +public record Cat1BoxedList
+implements [Cat1Boxed](#cat1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Cat1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Cat1BoxedMap -public static final class Cat1BoxedMap
-extends [Cat1Boxed](#cat1boxed) +public record Cat1BoxedMap
+implements [Cat1Boxed](#cat1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Cat1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Cat1 public static class Cat1
@@ -167,29 +173,32 @@ A schema class that validates payloads | [Cat1BoxedBoolean](#cat1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Cat1BoxedMap](#cat1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [Cat1BoxedList](#cat1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Cat1Boxed](#cat1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema1Boxed -public static abstract sealed class Schema1Boxed
+public sealed interface Schema1Boxed
permits
[Schema1BoxedMap](#schema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema1BoxedMap -public static final class Schema1BoxedMap
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedMap
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedMap([Schema1Map](#schema1map) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [Schema1Map](#schema1map) | data
validated payload | +| [Schema1Map](#schema1map) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1 public static class Schema1
@@ -234,7 +243,9 @@ Cat.Schema1Map validatedPayload = | ----------------- | ---------------------- | | [Schema1Map](#schema1map) | validate([Map<?, ?>](#schema1mapbuilder) arg, SchemaConfiguration configuration) | | [Schema1BoxedMap](#schema1boxedmap) | validateAndBox([Map<?, ?>](#schema1mapbuilder) arg, SchemaConfiguration configuration) | +| [Schema1Boxed](#schema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema1MapBuilder public class Schema1MapBuilder
builder for `Map` @@ -275,27 +286,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## DeclawedBoxed -public static abstract sealed class DeclawedBoxed
+public sealed interface DeclawedBoxed
permits
[DeclawedBoxedBoolean](#declawedboxedboolean) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## DeclawedBoxedBoolean -public static final class DeclawedBoxedBoolean
-extends [DeclawedBoxed](#declawedboxed) +public record DeclawedBoxedBoolean
+implements [DeclawedBoxed](#declawedboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DeclawedBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Declawed public static class Declawed
diff --git a/samples/client/petstore/java/docs/components/schemas/Category.md b/samples/client/petstore/java/docs/components/schemas/Category.md index 39fd3624b0c..a1f484ded12 100644 --- a/samples/client/petstore/java/docs/components/schemas/Category.md +++ b/samples/client/petstore/java/docs/components/schemas/Category.md @@ -4,7 +4,7 @@ public class Category
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,40 +12,41 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Category.Category1Boxed](#category1boxed)
abstract sealed validated payload class | -| static class | [Category.Category1BoxedMap](#category1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [Category.Category1Boxed](#category1boxed)
sealed interface for validated payloads | +| record | [Category.Category1BoxedMap](#category1boxedmap)
boxed class to store validated Map payloads | | static class | [Category.Category1](#category1)
schema class | | static class | [Category.CategoryMapBuilder](#categorymapbuilder)
builder for Map payloads | | static class | [Category.CategoryMap](#categorymap)
output class for Map payloads | -| static class | [Category.NameBoxed](#nameboxed)
abstract sealed validated payload class | -| static class | [Category.NameBoxedString](#nameboxedstring)
boxed class to store validated String payloads | +| sealed interface | [Category.NameBoxed](#nameboxed)
sealed interface for validated payloads | +| record | [Category.NameBoxedString](#nameboxedstring)
boxed class to store validated String payloads | | static class | [Category.Name](#name)
schema class | -| static class | [Category.IdBoxed](#idboxed)
abstract sealed validated payload class | -| static class | [Category.IdBoxedNumber](#idboxednumber)
boxed class to store validated Number payloads | +| sealed interface | [Category.IdBoxed](#idboxed)
sealed interface for validated payloads | +| record | [Category.IdBoxedNumber](#idboxednumber)
boxed class to store validated Number payloads | | static class | [Category.Id](#id)
schema class | ## Category1Boxed -public static abstract sealed class Category1Boxed
+public sealed interface Category1Boxed
permits
[Category1BoxedMap](#category1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Category1BoxedMap -public static final class Category1BoxedMap
-extends [Category1Boxed](#category1boxed) +public record Category1BoxedMap
+implements [Category1Boxed](#category1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Category1BoxedMap([CategoryMap](#categorymap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [CategoryMap](#categorymap) | data
validated payload | +| [CategoryMap](#categorymap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Category1 public static class Category1
@@ -93,7 +94,9 @@ Category.CategoryMap validatedPayload = | ----------------- | ---------------------- | | [CategoryMap](#categorymap) | validate([Map<?, ?>](#categorymapbuilder) arg, SchemaConfiguration configuration) | | [Category1BoxedMap](#category1boxedmap) | validateAndBox([Map<?, ?>](#categorymapbuilder) arg, SchemaConfiguration configuration) | +| [Category1Boxed](#category1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## CategoryMap0Builder public class CategoryMap0Builder
builder for `Map` @@ -154,27 +157,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## NameBoxed -public static abstract sealed class NameBoxed
+public sealed interface NameBoxed
permits
[NameBoxedString](#nameboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## NameBoxedString -public static final class NameBoxedString
-extends [NameBoxed](#nameboxed) +public record NameBoxedString
+implements [NameBoxed](#nameboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NameBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Name public static class Name
@@ -215,29 +219,32 @@ String validatedPayload = Category.Name.validate( | ----------------- | ---------------------- | | String | validate(String arg, SchemaConfiguration configuration) | | [NameBoxedString](#nameboxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [NameBoxed](#nameboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## IdBoxed -public static abstract sealed class IdBoxed
+public sealed interface IdBoxed
permits
[IdBoxedNumber](#idboxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## IdBoxedNumber -public static final class IdBoxedNumber
-extends [IdBoxed](#idboxed) +public record IdBoxedNumber
+implements [IdBoxed](#idboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IdBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Id public static class Id
diff --git a/samples/client/petstore/java/docs/components/schemas/ChildCat.md b/samples/client/petstore/java/docs/components/schemas/ChildCat.md index d7128ba206c..bbaacacaf67 100644 --- a/samples/client/petstore/java/docs/components/schemas/ChildCat.md +++ b/samples/client/petstore/java/docs/components/schemas/ChildCat.md @@ -4,7 +4,7 @@ public class ChildCat
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,25 +12,25 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ChildCat.ChildCat1Boxed](#childcat1boxed)
abstract sealed validated payload class | -| static class | [ChildCat.ChildCat1BoxedVoid](#childcat1boxedvoid)
boxed class to store validated null payloads | -| static class | [ChildCat.ChildCat1BoxedBoolean](#childcat1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [ChildCat.ChildCat1BoxedNumber](#childcat1boxednumber)
boxed class to store validated Number payloads | -| static class | [ChildCat.ChildCat1BoxedString](#childcat1boxedstring)
boxed class to store validated String payloads | -| static class | [ChildCat.ChildCat1BoxedList](#childcat1boxedlist)
boxed class to store validated List payloads | -| static class | [ChildCat.ChildCat1BoxedMap](#childcat1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ChildCat.ChildCat1Boxed](#childcat1boxed)
sealed interface for validated payloads | +| record | [ChildCat.ChildCat1BoxedVoid](#childcat1boxedvoid)
boxed class to store validated null payloads | +| record | [ChildCat.ChildCat1BoxedBoolean](#childcat1boxedboolean)
boxed class to store validated boolean payloads | +| record | [ChildCat.ChildCat1BoxedNumber](#childcat1boxednumber)
boxed class to store validated Number payloads | +| record | [ChildCat.ChildCat1BoxedString](#childcat1boxedstring)
boxed class to store validated String payloads | +| record | [ChildCat.ChildCat1BoxedList](#childcat1boxedlist)
boxed class to store validated List payloads | +| record | [ChildCat.ChildCat1BoxedMap](#childcat1boxedmap)
boxed class to store validated Map payloads | | static class | [ChildCat.ChildCat1](#childcat1)
schema class | -| static class | [ChildCat.Schema1Boxed](#schema1boxed)
abstract sealed validated payload class | -| static class | [ChildCat.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ChildCat.Schema1Boxed](#schema1boxed)
sealed interface for validated payloads | +| record | [ChildCat.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | | static class | [ChildCat.Schema1](#schema1)
schema class | | static class | [ChildCat.Schema1MapBuilder](#schema1mapbuilder)
builder for Map payloads | | static class | [ChildCat.Schema1Map](#schema1map)
output class for Map payloads | -| static class | [ChildCat.NameBoxed](#nameboxed)
abstract sealed validated payload class | -| static class | [ChildCat.NameBoxedString](#nameboxedstring)
boxed class to store validated String payloads | +| sealed interface | [ChildCat.NameBoxed](#nameboxed)
sealed interface for validated payloads | +| record | [ChildCat.NameBoxedString](#nameboxedstring)
boxed class to store validated String payloads | | static class | [ChildCat.Name](#name)
schema class | ## ChildCat1Boxed -public static abstract sealed class ChildCat1Boxed
+public sealed interface ChildCat1Boxed
permits
[ChildCat1BoxedVoid](#childcat1boxedvoid), [ChildCat1BoxedBoolean](#childcat1boxedboolean), @@ -39,103 +39,109 @@ permits
[ChildCat1BoxedList](#childcat1boxedlist), [ChildCat1BoxedMap](#childcat1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ChildCat1BoxedVoid -public static final class ChildCat1BoxedVoid
-extends [ChildCat1Boxed](#childcat1boxed) +public record ChildCat1BoxedVoid
+implements [ChildCat1Boxed](#childcat1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ChildCat1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ChildCat1BoxedBoolean -public static final class ChildCat1BoxedBoolean
-extends [ChildCat1Boxed](#childcat1boxed) +public record ChildCat1BoxedBoolean
+implements [ChildCat1Boxed](#childcat1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ChildCat1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ChildCat1BoxedNumber -public static final class ChildCat1BoxedNumber
-extends [ChildCat1Boxed](#childcat1boxed) +public record ChildCat1BoxedNumber
+implements [ChildCat1Boxed](#childcat1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ChildCat1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ChildCat1BoxedString -public static final class ChildCat1BoxedString
-extends [ChildCat1Boxed](#childcat1boxed) +public record ChildCat1BoxedString
+implements [ChildCat1Boxed](#childcat1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ChildCat1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ChildCat1BoxedList -public static final class ChildCat1BoxedList
-extends [ChildCat1Boxed](#childcat1boxed) +public record ChildCat1BoxedList
+implements [ChildCat1Boxed](#childcat1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ChildCat1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ChildCat1BoxedMap -public static final class ChildCat1BoxedMap
-extends [ChildCat1Boxed](#childcat1boxed) +public record ChildCat1BoxedMap
+implements [ChildCat1Boxed](#childcat1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ChildCat1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ChildCat1 public static class ChildCat1
@@ -167,29 +173,32 @@ A schema class that validates payloads | [ChildCat1BoxedBoolean](#childcat1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [ChildCat1BoxedMap](#childcat1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [ChildCat1BoxedList](#childcat1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [ChildCat1Boxed](#childcat1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema1Boxed -public static abstract sealed class Schema1Boxed
+public sealed interface Schema1Boxed
permits
[Schema1BoxedMap](#schema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema1BoxedMap -public static final class Schema1BoxedMap
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedMap
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedMap([Schema1Map](#schema1map) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [Schema1Map](#schema1map) | data
validated payload | +| [Schema1Map](#schema1map) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1 public static class Schema1
@@ -234,7 +243,9 @@ ChildCat.Schema1Map validatedPayload = | ----------------- | ---------------------- | | [Schema1Map](#schema1map) | validate([Map<?, ?>](#schema1mapbuilder) arg, SchemaConfiguration configuration) | | [Schema1BoxedMap](#schema1boxedmap) | validateAndBox([Map<?, ?>](#schema1mapbuilder) arg, SchemaConfiguration configuration) | +| [Schema1Boxed](#schema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema1MapBuilder public class Schema1MapBuilder
builder for `Map` @@ -275,27 +286,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## NameBoxed -public static abstract sealed class NameBoxed
+public sealed interface NameBoxed
permits
[NameBoxedString](#nameboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## NameBoxedString -public static final class NameBoxedString
-extends [NameBoxed](#nameboxed) +public record NameBoxedString
+implements [NameBoxed](#nameboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NameBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Name public static class Name
diff --git a/samples/client/petstore/java/docs/components/schemas/ClassModel.md b/samples/client/petstore/java/docs/components/schemas/ClassModel.md index fa27b77b2a8..1d7f1150a3b 100644 --- a/samples/client/petstore/java/docs/components/schemas/ClassModel.md +++ b/samples/client/petstore/java/docs/components/schemas/ClassModel.md @@ -4,7 +4,7 @@ public class ClassModel
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,22 +12,22 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ClassModel.ClassModel1Boxed](#classmodel1boxed)
abstract sealed validated payload class | -| static class | [ClassModel.ClassModel1BoxedVoid](#classmodel1boxedvoid)
boxed class to store validated null payloads | -| static class | [ClassModel.ClassModel1BoxedBoolean](#classmodel1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [ClassModel.ClassModel1BoxedNumber](#classmodel1boxednumber)
boxed class to store validated Number payloads | -| static class | [ClassModel.ClassModel1BoxedString](#classmodel1boxedstring)
boxed class to store validated String payloads | -| static class | [ClassModel.ClassModel1BoxedList](#classmodel1boxedlist)
boxed class to store validated List payloads | -| static class | [ClassModel.ClassModel1BoxedMap](#classmodel1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ClassModel.ClassModel1Boxed](#classmodel1boxed)
sealed interface for validated payloads | +| record | [ClassModel.ClassModel1BoxedVoid](#classmodel1boxedvoid)
boxed class to store validated null payloads | +| record | [ClassModel.ClassModel1BoxedBoolean](#classmodel1boxedboolean)
boxed class to store validated boolean payloads | +| record | [ClassModel.ClassModel1BoxedNumber](#classmodel1boxednumber)
boxed class to store validated Number payloads | +| record | [ClassModel.ClassModel1BoxedString](#classmodel1boxedstring)
boxed class to store validated String payloads | +| record | [ClassModel.ClassModel1BoxedList](#classmodel1boxedlist)
boxed class to store validated List payloads | +| record | [ClassModel.ClassModel1BoxedMap](#classmodel1boxedmap)
boxed class to store validated Map payloads | | static class | [ClassModel.ClassModel1](#classmodel1)
schema class | | static class | [ClassModel.ClassModelMapBuilder](#classmodelmapbuilder)
builder for Map payloads | | static class | [ClassModel.ClassModelMap](#classmodelmap)
output class for Map payloads | -| static class | [ClassModel.ClassSchemaBoxed](#classschemaboxed)
abstract sealed validated payload class | -| static class | [ClassModel.ClassSchemaBoxedString](#classschemaboxedstring)
boxed class to store validated String payloads | +| sealed interface | [ClassModel.ClassSchemaBoxed](#classschemaboxed)
sealed interface for validated payloads | +| record | [ClassModel.ClassSchemaBoxedString](#classschemaboxedstring)
boxed class to store validated String payloads | | static class | [ClassModel.ClassSchema](#classschema)
schema class | ## ClassModel1Boxed -public static abstract sealed class ClassModel1Boxed
+public sealed interface ClassModel1Boxed
permits
[ClassModel1BoxedVoid](#classmodel1boxedvoid), [ClassModel1BoxedBoolean](#classmodel1boxedboolean), @@ -36,103 +36,109 @@ permits
[ClassModel1BoxedList](#classmodel1boxedlist), [ClassModel1BoxedMap](#classmodel1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ClassModel1BoxedVoid -public static final class ClassModel1BoxedVoid
-extends [ClassModel1Boxed](#classmodel1boxed) +public record ClassModel1BoxedVoid
+implements [ClassModel1Boxed](#classmodel1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ClassModel1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ClassModel1BoxedBoolean -public static final class ClassModel1BoxedBoolean
-extends [ClassModel1Boxed](#classmodel1boxed) +public record ClassModel1BoxedBoolean
+implements [ClassModel1Boxed](#classmodel1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ClassModel1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ClassModel1BoxedNumber -public static final class ClassModel1BoxedNumber
-extends [ClassModel1Boxed](#classmodel1boxed) +public record ClassModel1BoxedNumber
+implements [ClassModel1Boxed](#classmodel1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ClassModel1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ClassModel1BoxedString -public static final class ClassModel1BoxedString
-extends [ClassModel1Boxed](#classmodel1boxed) +public record ClassModel1BoxedString
+implements [ClassModel1Boxed](#classmodel1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ClassModel1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ClassModel1BoxedList -public static final class ClassModel1BoxedList
-extends [ClassModel1Boxed](#classmodel1boxed) +public record ClassModel1BoxedList
+implements [ClassModel1Boxed](#classmodel1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ClassModel1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ClassModel1BoxedMap -public static final class ClassModel1BoxedMap
-extends [ClassModel1Boxed](#classmodel1boxed) +public record ClassModel1BoxedMap
+implements [ClassModel1Boxed](#classmodel1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ClassModel1BoxedMap([ClassModelMap](#classmodelmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [ClassModelMap](#classmodelmap) | data
validated payload | +| [ClassModelMap](#classmodelmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ClassModel1 public static class ClassModel1
@@ -167,7 +173,9 @@ Model for testing model with "_class" property | [ClassModel1BoxedBoolean](#classmodel1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [ClassModel1BoxedMap](#classmodel1boxedmap) | validateAndBox([Map<?, ?>](#classmodelmapbuilder) arg, SchemaConfiguration configuration) | | [ClassModel1BoxedList](#classmodel1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [ClassModel1Boxed](#classmodel1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ClassModelMapBuilder public class ClassModelMapBuilder
builder for `Map` @@ -208,27 +216,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## ClassSchemaBoxed -public static abstract sealed class ClassSchemaBoxed
+public sealed interface ClassSchemaBoxed
permits
[ClassSchemaBoxedString](#classschemaboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ClassSchemaBoxedString -public static final class ClassSchemaBoxedString
-extends [ClassSchemaBoxed](#classschemaboxed) +public record ClassSchemaBoxedString
+implements [ClassSchemaBoxed](#classschemaboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ClassSchemaBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ClassSchema public static class ClassSchema
diff --git a/samples/client/petstore/java/docs/components/schemas/Client.md b/samples/client/petstore/java/docs/components/schemas/Client.md index cab9caa2b23..e0afb353ac7 100644 --- a/samples/client/petstore/java/docs/components/schemas/Client.md +++ b/samples/client/petstore/java/docs/components/schemas/Client.md @@ -4,7 +4,7 @@ public class Client
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,37 +12,38 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Client.Client1Boxed](#client1boxed)
abstract sealed validated payload class | -| static class | [Client.Client1BoxedMap](#client1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [Client.Client1Boxed](#client1boxed)
sealed interface for validated payloads | +| record | [Client.Client1BoxedMap](#client1boxedmap)
boxed class to store validated Map payloads | | static class | [Client.Client1](#client1)
schema class | | static class | [Client.ClientMapBuilder1](#clientmapbuilder1)
builder for Map payloads | | static class | [Client.ClientMap](#clientmap)
output class for Map payloads | -| static class | [Client.Client2Boxed](#client2boxed)
abstract sealed validated payload class | -| static class | [Client.Client2BoxedString](#client2boxedstring)
boxed class to store validated String payloads | +| sealed interface | [Client.Client2Boxed](#client2boxed)
sealed interface for validated payloads | +| record | [Client.Client2BoxedString](#client2boxedstring)
boxed class to store validated String payloads | | static class | [Client.Client2](#client2)
schema class | ## Client1Boxed -public static abstract sealed class Client1Boxed
+public sealed interface Client1Boxed
permits
[Client1BoxedMap](#client1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Client1BoxedMap -public static final class Client1BoxedMap
-extends [Client1Boxed](#client1boxed) +public record Client1BoxedMap
+implements [Client1Boxed](#client1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Client1BoxedMap([ClientMap](#clientmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [ClientMap](#clientmap) | data
validated payload | +| [ClientMap](#clientmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Client1 public static class Client1
@@ -87,7 +88,9 @@ Client.ClientMap validatedPayload = | ----------------- | ---------------------- | | [ClientMap](#clientmap) | validate([Map<?, ?>](#clientmapbuilder1) arg, SchemaConfiguration configuration) | | [Client1BoxedMap](#client1boxedmap) | validateAndBox([Map<?, ?>](#clientmapbuilder1) arg, SchemaConfiguration configuration) | +| [Client1Boxed](#client1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ClientMapBuilder1 public class ClientMapBuilder1
builder for `Map` @@ -128,27 +131,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## Client2Boxed -public static abstract sealed class Client2Boxed
+public sealed interface Client2Boxed
permits
[Client2BoxedString](#client2boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Client2BoxedString -public static final class Client2BoxedString
-extends [Client2Boxed](#client2boxed) +public record Client2BoxedString
+implements [Client2Boxed](#client2boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Client2BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Client2 public static class Client2
diff --git a/samples/client/petstore/java/docs/components/schemas/ComplexQuadrilateral.md b/samples/client/petstore/java/docs/components/schemas/ComplexQuadrilateral.md index 56d65077753..465e8c9cb90 100644 --- a/samples/client/petstore/java/docs/components/schemas/ComplexQuadrilateral.md +++ b/samples/client/petstore/java/docs/components/schemas/ComplexQuadrilateral.md @@ -4,7 +4,7 @@ public class ComplexQuadrilateral
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -13,26 +13,26 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ComplexQuadrilateral.ComplexQuadrilateral1Boxed](#complexquadrilateral1boxed)
abstract sealed validated payload class | -| static class | [ComplexQuadrilateral.ComplexQuadrilateral1BoxedVoid](#complexquadrilateral1boxedvoid)
boxed class to store validated null payloads | -| static class | [ComplexQuadrilateral.ComplexQuadrilateral1BoxedBoolean](#complexquadrilateral1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [ComplexQuadrilateral.ComplexQuadrilateral1BoxedNumber](#complexquadrilateral1boxednumber)
boxed class to store validated Number payloads | -| static class | [ComplexQuadrilateral.ComplexQuadrilateral1BoxedString](#complexquadrilateral1boxedstring)
boxed class to store validated String payloads | -| static class | [ComplexQuadrilateral.ComplexQuadrilateral1BoxedList](#complexquadrilateral1boxedlist)
boxed class to store validated List payloads | -| static class | [ComplexQuadrilateral.ComplexQuadrilateral1BoxedMap](#complexquadrilateral1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ComplexQuadrilateral.ComplexQuadrilateral1Boxed](#complexquadrilateral1boxed)
sealed interface for validated payloads | +| record | [ComplexQuadrilateral.ComplexQuadrilateral1BoxedVoid](#complexquadrilateral1boxedvoid)
boxed class to store validated null payloads | +| record | [ComplexQuadrilateral.ComplexQuadrilateral1BoxedBoolean](#complexquadrilateral1boxedboolean)
boxed class to store validated boolean payloads | +| record | [ComplexQuadrilateral.ComplexQuadrilateral1BoxedNumber](#complexquadrilateral1boxednumber)
boxed class to store validated Number payloads | +| record | [ComplexQuadrilateral.ComplexQuadrilateral1BoxedString](#complexquadrilateral1boxedstring)
boxed class to store validated String payloads | +| record | [ComplexQuadrilateral.ComplexQuadrilateral1BoxedList](#complexquadrilateral1boxedlist)
boxed class to store validated List payloads | +| record | [ComplexQuadrilateral.ComplexQuadrilateral1BoxedMap](#complexquadrilateral1boxedmap)
boxed class to store validated Map payloads | | static class | [ComplexQuadrilateral.ComplexQuadrilateral1](#complexquadrilateral1)
schema class | -| static class | [ComplexQuadrilateral.Schema1Boxed](#schema1boxed)
abstract sealed validated payload class | -| static class | [ComplexQuadrilateral.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ComplexQuadrilateral.Schema1Boxed](#schema1boxed)
sealed interface for validated payloads | +| record | [ComplexQuadrilateral.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | | static class | [ComplexQuadrilateral.Schema1](#schema1)
schema class | | static class | [ComplexQuadrilateral.Schema1MapBuilder](#schema1mapbuilder)
builder for Map payloads | | static class | [ComplexQuadrilateral.Schema1Map](#schema1map)
output class for Map payloads | -| static class | [ComplexQuadrilateral.QuadrilateralTypeBoxed](#quadrilateraltypeboxed)
abstract sealed validated payload class | -| static class | [ComplexQuadrilateral.QuadrilateralTypeBoxedString](#quadrilateraltypeboxedstring)
boxed class to store validated String payloads | +| sealed interface | [ComplexQuadrilateral.QuadrilateralTypeBoxed](#quadrilateraltypeboxed)
sealed interface for validated payloads | +| record | [ComplexQuadrilateral.QuadrilateralTypeBoxedString](#quadrilateraltypeboxedstring)
boxed class to store validated String payloads | | static class | [ComplexQuadrilateral.QuadrilateralType](#quadrilateraltype)
schema class | | enum | [ComplexQuadrilateral.StringQuadrilateralTypeEnums](#stringquadrilateraltypeenums)
String enum | ## ComplexQuadrilateral1Boxed -public static abstract sealed class ComplexQuadrilateral1Boxed
+public sealed interface ComplexQuadrilateral1Boxed
permits
[ComplexQuadrilateral1BoxedVoid](#complexquadrilateral1boxedvoid), [ComplexQuadrilateral1BoxedBoolean](#complexquadrilateral1boxedboolean), @@ -41,103 +41,109 @@ permits
[ComplexQuadrilateral1BoxedList](#complexquadrilateral1boxedlist), [ComplexQuadrilateral1BoxedMap](#complexquadrilateral1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ComplexQuadrilateral1BoxedVoid -public static final class ComplexQuadrilateral1BoxedVoid
-extends [ComplexQuadrilateral1Boxed](#complexquadrilateral1boxed) +public record ComplexQuadrilateral1BoxedVoid
+implements [ComplexQuadrilateral1Boxed](#complexquadrilateral1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ComplexQuadrilateral1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ComplexQuadrilateral1BoxedBoolean -public static final class ComplexQuadrilateral1BoxedBoolean
-extends [ComplexQuadrilateral1Boxed](#complexquadrilateral1boxed) +public record ComplexQuadrilateral1BoxedBoolean
+implements [ComplexQuadrilateral1Boxed](#complexquadrilateral1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ComplexQuadrilateral1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ComplexQuadrilateral1BoxedNumber -public static final class ComplexQuadrilateral1BoxedNumber
-extends [ComplexQuadrilateral1Boxed](#complexquadrilateral1boxed) +public record ComplexQuadrilateral1BoxedNumber
+implements [ComplexQuadrilateral1Boxed](#complexquadrilateral1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ComplexQuadrilateral1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ComplexQuadrilateral1BoxedString -public static final class ComplexQuadrilateral1BoxedString
-extends [ComplexQuadrilateral1Boxed](#complexquadrilateral1boxed) +public record ComplexQuadrilateral1BoxedString
+implements [ComplexQuadrilateral1Boxed](#complexquadrilateral1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ComplexQuadrilateral1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ComplexQuadrilateral1BoxedList -public static final class ComplexQuadrilateral1BoxedList
-extends [ComplexQuadrilateral1Boxed](#complexquadrilateral1boxed) +public record ComplexQuadrilateral1BoxedList
+implements [ComplexQuadrilateral1Boxed](#complexquadrilateral1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ComplexQuadrilateral1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ComplexQuadrilateral1BoxedMap -public static final class ComplexQuadrilateral1BoxedMap
-extends [ComplexQuadrilateral1Boxed](#complexquadrilateral1boxed) +public record ComplexQuadrilateral1BoxedMap
+implements [ComplexQuadrilateral1Boxed](#complexquadrilateral1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ComplexQuadrilateral1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ComplexQuadrilateral1 public static class ComplexQuadrilateral1
@@ -169,29 +175,32 @@ A schema class that validates payloads | [ComplexQuadrilateral1BoxedBoolean](#complexquadrilateral1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [ComplexQuadrilateral1BoxedMap](#complexquadrilateral1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [ComplexQuadrilateral1BoxedList](#complexquadrilateral1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [ComplexQuadrilateral1Boxed](#complexquadrilateral1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema1Boxed -public static abstract sealed class Schema1Boxed
+public sealed interface Schema1Boxed
permits
[Schema1BoxedMap](#schema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema1BoxedMap -public static final class Schema1BoxedMap
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedMap
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedMap([Schema1Map](#schema1map) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [Schema1Map](#schema1map) | data
validated payload | +| [Schema1Map](#schema1map) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1 public static class Schema1
@@ -236,7 +245,9 @@ ComplexQuadrilateral.Schema1Map validatedPayload = | ----------------- | ---------------------- | | [Schema1Map](#schema1map) | validate([Map<?, ?>](#schema1mapbuilder) arg, SchemaConfiguration configuration) | | [Schema1BoxedMap](#schema1boxedmap) | validateAndBox([Map<?, ?>](#schema1mapbuilder) arg, SchemaConfiguration configuration) | +| [Schema1Boxed](#schema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema1MapBuilder public class Schema1MapBuilder
builder for `Map` @@ -278,27 +289,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## QuadrilateralTypeBoxed -public static abstract sealed class QuadrilateralTypeBoxed
+public sealed interface QuadrilateralTypeBoxed
permits
[QuadrilateralTypeBoxedString](#quadrilateraltypeboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## QuadrilateralTypeBoxedString -public static final class QuadrilateralTypeBoxedString
-extends [QuadrilateralTypeBoxed](#quadrilateraltypeboxed) +public record QuadrilateralTypeBoxedString
+implements [QuadrilateralTypeBoxed](#quadrilateraltypeboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | QuadrilateralTypeBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## QuadrilateralType public static class QuadrilateralType
@@ -340,7 +352,9 @@ String validatedPayload = ComplexQuadrilateral.QuadrilateralType.validate( | String | validate(String arg, SchemaConfiguration configuration) | | String | validate([StringQuadrilateralTypeEnums](#stringquadrilateraltypeenums) arg, SchemaConfiguration configuration) | | [QuadrilateralTypeBoxedString](#quadrilateraltypeboxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [QuadrilateralTypeBoxed](#quadrilateraltypeboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## StringQuadrilateralTypeEnums public enum StringQuadrilateralTypeEnums
extends `Enum` diff --git a/samples/client/petstore/java/docs/components/schemas/ComposedAnyOfDifferentTypesNoValidations.md b/samples/client/petstore/java/docs/components/schemas/ComposedAnyOfDifferentTypesNoValidations.md index d9cf3771152..85443a9923c 100644 --- a/samples/client/petstore/java/docs/components/schemas/ComposedAnyOfDifferentTypesNoValidations.md +++ b/samples/client/petstore/java/docs/components/schemas/ComposedAnyOfDifferentTypesNoValidations.md @@ -4,7 +4,7 @@ public class ComposedAnyOfDifferentTypesNoValidations
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated list payloads, extends FrozenList - classes to build inputs for list payloads @@ -12,74 +12,74 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ComposedAnyOfDifferentTypesNoValidations.ComposedAnyOfDifferentTypesNoValidations1Boxed](#composedanyofdifferenttypesnovalidations1boxed)
abstract sealed validated payload class | -| static class | [ComposedAnyOfDifferentTypesNoValidations.ComposedAnyOfDifferentTypesNoValidations1BoxedVoid](#composedanyofdifferenttypesnovalidations1boxedvoid)
boxed class to store validated null payloads | -| static class | [ComposedAnyOfDifferentTypesNoValidations.ComposedAnyOfDifferentTypesNoValidations1BoxedBoolean](#composedanyofdifferenttypesnovalidations1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [ComposedAnyOfDifferentTypesNoValidations.ComposedAnyOfDifferentTypesNoValidations1BoxedNumber](#composedanyofdifferenttypesnovalidations1boxednumber)
boxed class to store validated Number payloads | -| static class | [ComposedAnyOfDifferentTypesNoValidations.ComposedAnyOfDifferentTypesNoValidations1BoxedString](#composedanyofdifferenttypesnovalidations1boxedstring)
boxed class to store validated String payloads | -| static class | [ComposedAnyOfDifferentTypesNoValidations.ComposedAnyOfDifferentTypesNoValidations1BoxedList](#composedanyofdifferenttypesnovalidations1boxedlist)
boxed class to store validated List payloads | -| static class | [ComposedAnyOfDifferentTypesNoValidations.ComposedAnyOfDifferentTypesNoValidations1BoxedMap](#composedanyofdifferenttypesnovalidations1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ComposedAnyOfDifferentTypesNoValidations.ComposedAnyOfDifferentTypesNoValidations1Boxed](#composedanyofdifferenttypesnovalidations1boxed)
sealed interface for validated payloads | +| record | [ComposedAnyOfDifferentTypesNoValidations.ComposedAnyOfDifferentTypesNoValidations1BoxedVoid](#composedanyofdifferenttypesnovalidations1boxedvoid)
boxed class to store validated null payloads | +| record | [ComposedAnyOfDifferentTypesNoValidations.ComposedAnyOfDifferentTypesNoValidations1BoxedBoolean](#composedanyofdifferenttypesnovalidations1boxedboolean)
boxed class to store validated boolean payloads | +| record | [ComposedAnyOfDifferentTypesNoValidations.ComposedAnyOfDifferentTypesNoValidations1BoxedNumber](#composedanyofdifferenttypesnovalidations1boxednumber)
boxed class to store validated Number payloads | +| record | [ComposedAnyOfDifferentTypesNoValidations.ComposedAnyOfDifferentTypesNoValidations1BoxedString](#composedanyofdifferenttypesnovalidations1boxedstring)
boxed class to store validated String payloads | +| record | [ComposedAnyOfDifferentTypesNoValidations.ComposedAnyOfDifferentTypesNoValidations1BoxedList](#composedanyofdifferenttypesnovalidations1boxedlist)
boxed class to store validated List payloads | +| record | [ComposedAnyOfDifferentTypesNoValidations.ComposedAnyOfDifferentTypesNoValidations1BoxedMap](#composedanyofdifferenttypesnovalidations1boxedmap)
boxed class to store validated Map payloads | | static class | [ComposedAnyOfDifferentTypesNoValidations.ComposedAnyOfDifferentTypesNoValidations1](#composedanyofdifferenttypesnovalidations1)
schema class | -| static class | [ComposedAnyOfDifferentTypesNoValidations.Schema15Boxed](#schema15boxed)
abstract sealed validated payload class | -| static class | [ComposedAnyOfDifferentTypesNoValidations.Schema15BoxedNumber](#schema15boxednumber)
boxed class to store validated Number payloads | +| sealed interface | [ComposedAnyOfDifferentTypesNoValidations.Schema15Boxed](#schema15boxed)
sealed interface for validated payloads | +| record | [ComposedAnyOfDifferentTypesNoValidations.Schema15BoxedNumber](#schema15boxednumber)
boxed class to store validated Number payloads | | static class | [ComposedAnyOfDifferentTypesNoValidations.Schema15](#schema15)
schema class | -| static class | [ComposedAnyOfDifferentTypesNoValidations.Schema14Boxed](#schema14boxed)
abstract sealed validated payload class | -| static class | [ComposedAnyOfDifferentTypesNoValidations.Schema14BoxedNumber](#schema14boxednumber)
boxed class to store validated Number payloads | +| sealed interface | [ComposedAnyOfDifferentTypesNoValidations.Schema14Boxed](#schema14boxed)
sealed interface for validated payloads | +| record | [ComposedAnyOfDifferentTypesNoValidations.Schema14BoxedNumber](#schema14boxednumber)
boxed class to store validated Number payloads | | static class | [ComposedAnyOfDifferentTypesNoValidations.Schema14](#schema14)
schema class | -| static class | [ComposedAnyOfDifferentTypesNoValidations.Schema13Boxed](#schema13boxed)
abstract sealed validated payload class | -| static class | [ComposedAnyOfDifferentTypesNoValidations.Schema13BoxedNumber](#schema13boxednumber)
boxed class to store validated Number payloads | +| sealed interface | [ComposedAnyOfDifferentTypesNoValidations.Schema13Boxed](#schema13boxed)
sealed interface for validated payloads | +| record | [ComposedAnyOfDifferentTypesNoValidations.Schema13BoxedNumber](#schema13boxednumber)
boxed class to store validated Number payloads | | static class | [ComposedAnyOfDifferentTypesNoValidations.Schema13](#schema13)
schema class | -| static class | [ComposedAnyOfDifferentTypesNoValidations.Schema12Boxed](#schema12boxed)
abstract sealed validated payload class | -| static class | [ComposedAnyOfDifferentTypesNoValidations.Schema12BoxedNumber](#schema12boxednumber)
boxed class to store validated Number payloads | +| sealed interface | [ComposedAnyOfDifferentTypesNoValidations.Schema12Boxed](#schema12boxed)
sealed interface for validated payloads | +| record | [ComposedAnyOfDifferentTypesNoValidations.Schema12BoxedNumber](#schema12boxednumber)
boxed class to store validated Number payloads | | static class | [ComposedAnyOfDifferentTypesNoValidations.Schema12](#schema12)
schema class | -| static class | [ComposedAnyOfDifferentTypesNoValidations.Schema11Boxed](#schema11boxed)
abstract sealed validated payload class | -| static class | [ComposedAnyOfDifferentTypesNoValidations.Schema11BoxedNumber](#schema11boxednumber)
boxed class to store validated Number payloads | +| sealed interface | [ComposedAnyOfDifferentTypesNoValidations.Schema11Boxed](#schema11boxed)
sealed interface for validated payloads | +| record | [ComposedAnyOfDifferentTypesNoValidations.Schema11BoxedNumber](#schema11boxednumber)
boxed class to store validated Number payloads | | static class | [ComposedAnyOfDifferentTypesNoValidations.Schema11](#schema11)
schema class | -| static class | [ComposedAnyOfDifferentTypesNoValidations.Schema10Boxed](#schema10boxed)
abstract sealed validated payload class | -| static class | [ComposedAnyOfDifferentTypesNoValidations.Schema10BoxedNumber](#schema10boxednumber)
boxed class to store validated Number payloads | +| sealed interface | [ComposedAnyOfDifferentTypesNoValidations.Schema10Boxed](#schema10boxed)
sealed interface for validated payloads | +| record | [ComposedAnyOfDifferentTypesNoValidations.Schema10BoxedNumber](#schema10boxednumber)
boxed class to store validated Number payloads | | static class | [ComposedAnyOfDifferentTypesNoValidations.Schema10](#schema10)
schema class | -| static class | [ComposedAnyOfDifferentTypesNoValidations.Schema9Boxed](#schema9boxed)
abstract sealed validated payload class | -| static class | [ComposedAnyOfDifferentTypesNoValidations.Schema9BoxedList](#schema9boxedlist)
boxed class to store validated List payloads | +| sealed interface | [ComposedAnyOfDifferentTypesNoValidations.Schema9Boxed](#schema9boxed)
sealed interface for validated payloads | +| record | [ComposedAnyOfDifferentTypesNoValidations.Schema9BoxedList](#schema9boxedlist)
boxed class to store validated List payloads | | static class | [ComposedAnyOfDifferentTypesNoValidations.Schema9](#schema9)
schema class | | static class | [ComposedAnyOfDifferentTypesNoValidations.Schema9ListBuilder](#schema9listbuilder)
builder for List payloads | | static class | [ComposedAnyOfDifferentTypesNoValidations.Schema9List](#schema9list)
output class for List payloads | -| static class | [ComposedAnyOfDifferentTypesNoValidations.ItemsBoxed](#itemsboxed)
abstract sealed validated payload class | -| static class | [ComposedAnyOfDifferentTypesNoValidations.ItemsBoxedVoid](#itemsboxedvoid)
boxed class to store validated null payloads | -| static class | [ComposedAnyOfDifferentTypesNoValidations.ItemsBoxedBoolean](#itemsboxedboolean)
boxed class to store validated boolean payloads | -| static class | [ComposedAnyOfDifferentTypesNoValidations.ItemsBoxedNumber](#itemsboxednumber)
boxed class to store validated Number payloads | -| static class | [ComposedAnyOfDifferentTypesNoValidations.ItemsBoxedString](#itemsboxedstring)
boxed class to store validated String payloads | -| static class | [ComposedAnyOfDifferentTypesNoValidations.ItemsBoxedList](#itemsboxedlist)
boxed class to store validated List payloads | -| static class | [ComposedAnyOfDifferentTypesNoValidations.ItemsBoxedMap](#itemsboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ComposedAnyOfDifferentTypesNoValidations.ItemsBoxed](#itemsboxed)
sealed interface for validated payloads | +| record | [ComposedAnyOfDifferentTypesNoValidations.ItemsBoxedVoid](#itemsboxedvoid)
boxed class to store validated null payloads | +| record | [ComposedAnyOfDifferentTypesNoValidations.ItemsBoxedBoolean](#itemsboxedboolean)
boxed class to store validated boolean payloads | +| record | [ComposedAnyOfDifferentTypesNoValidations.ItemsBoxedNumber](#itemsboxednumber)
boxed class to store validated Number payloads | +| record | [ComposedAnyOfDifferentTypesNoValidations.ItemsBoxedString](#itemsboxedstring)
boxed class to store validated String payloads | +| record | [ComposedAnyOfDifferentTypesNoValidations.ItemsBoxedList](#itemsboxedlist)
boxed class to store validated List payloads | +| record | [ComposedAnyOfDifferentTypesNoValidations.ItemsBoxedMap](#itemsboxedmap)
boxed class to store validated Map payloads | | static class | [ComposedAnyOfDifferentTypesNoValidations.Items](#items)
schema class | -| static class | [ComposedAnyOfDifferentTypesNoValidations.Schema8Boxed](#schema8boxed)
abstract sealed validated payload class | -| static class | [ComposedAnyOfDifferentTypesNoValidations.Schema8BoxedVoid](#schema8boxedvoid)
boxed class to store validated null payloads | +| sealed interface | [ComposedAnyOfDifferentTypesNoValidations.Schema8Boxed](#schema8boxed)
sealed interface for validated payloads | +| record | [ComposedAnyOfDifferentTypesNoValidations.Schema8BoxedVoid](#schema8boxedvoid)
boxed class to store validated null payloads | | static class | [ComposedAnyOfDifferentTypesNoValidations.Schema8](#schema8)
schema class | -| static class | [ComposedAnyOfDifferentTypesNoValidations.Schema7Boxed](#schema7boxed)
abstract sealed validated payload class | -| static class | [ComposedAnyOfDifferentTypesNoValidations.Schema7BoxedBoolean](#schema7boxedboolean)
boxed class to store validated boolean payloads | +| sealed interface | [ComposedAnyOfDifferentTypesNoValidations.Schema7Boxed](#schema7boxed)
sealed interface for validated payloads | +| record | [ComposedAnyOfDifferentTypesNoValidations.Schema7BoxedBoolean](#schema7boxedboolean)
boxed class to store validated boolean payloads | | static class | [ComposedAnyOfDifferentTypesNoValidations.Schema7](#schema7)
schema class | -| static class | [ComposedAnyOfDifferentTypesNoValidations.Schema6Boxed](#schema6boxed)
abstract sealed validated payload class | -| static class | [ComposedAnyOfDifferentTypesNoValidations.Schema6BoxedMap](#schema6boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ComposedAnyOfDifferentTypesNoValidations.Schema6Boxed](#schema6boxed)
sealed interface for validated payloads | +| record | [ComposedAnyOfDifferentTypesNoValidations.Schema6BoxedMap](#schema6boxedmap)
boxed class to store validated Map payloads | | static class | [ComposedAnyOfDifferentTypesNoValidations.Schema6](#schema6)
schema class | -| static class | [ComposedAnyOfDifferentTypesNoValidations.Schema5Boxed](#schema5boxed)
abstract sealed validated payload class | -| static class | [ComposedAnyOfDifferentTypesNoValidations.Schema5BoxedString](#schema5boxedstring)
boxed class to store validated String payloads | +| sealed interface | [ComposedAnyOfDifferentTypesNoValidations.Schema5Boxed](#schema5boxed)
sealed interface for validated payloads | +| record | [ComposedAnyOfDifferentTypesNoValidations.Schema5BoxedString](#schema5boxedstring)
boxed class to store validated String payloads | | static class | [ComposedAnyOfDifferentTypesNoValidations.Schema5](#schema5)
schema class | -| static class | [ComposedAnyOfDifferentTypesNoValidations.Schema4Boxed](#schema4boxed)
abstract sealed validated payload class | -| static class | [ComposedAnyOfDifferentTypesNoValidations.Schema4BoxedString](#schema4boxedstring)
boxed class to store validated String payloads | +| sealed interface | [ComposedAnyOfDifferentTypesNoValidations.Schema4Boxed](#schema4boxed)
sealed interface for validated payloads | +| record | [ComposedAnyOfDifferentTypesNoValidations.Schema4BoxedString](#schema4boxedstring)
boxed class to store validated String payloads | | static class | [ComposedAnyOfDifferentTypesNoValidations.Schema4](#schema4)
schema class | -| static class | [ComposedAnyOfDifferentTypesNoValidations.Schema3Boxed](#schema3boxed)
abstract sealed validated payload class | +| sealed interface | [ComposedAnyOfDifferentTypesNoValidations.Schema3Boxed](#schema3boxed)
sealed interface for validated payloads | | static class | [ComposedAnyOfDifferentTypesNoValidations.Schema3](#schema3)
schema class | -| static class | [ComposedAnyOfDifferentTypesNoValidations.Schema2Boxed](#schema2boxed)
abstract sealed validated payload class | -| static class | [ComposedAnyOfDifferentTypesNoValidations.Schema2BoxedString](#schema2boxedstring)
boxed class to store validated String payloads | +| sealed interface | [ComposedAnyOfDifferentTypesNoValidations.Schema2Boxed](#schema2boxed)
sealed interface for validated payloads | +| record | [ComposedAnyOfDifferentTypesNoValidations.Schema2BoxedString](#schema2boxedstring)
boxed class to store validated String payloads | | static class | [ComposedAnyOfDifferentTypesNoValidations.Schema2](#schema2)
schema class | -| static class | [ComposedAnyOfDifferentTypesNoValidations.Schema1Boxed](#schema1boxed)
abstract sealed validated payload class | -| static class | [ComposedAnyOfDifferentTypesNoValidations.Schema1BoxedString](#schema1boxedstring)
boxed class to store validated String payloads | +| sealed interface | [ComposedAnyOfDifferentTypesNoValidations.Schema1Boxed](#schema1boxed)
sealed interface for validated payloads | +| record | [ComposedAnyOfDifferentTypesNoValidations.Schema1BoxedString](#schema1boxedstring)
boxed class to store validated String payloads | | static class | [ComposedAnyOfDifferentTypesNoValidations.Schema1](#schema1)
schema class | -| static class | [ComposedAnyOfDifferentTypesNoValidations.Schema0Boxed](#schema0boxed)
abstract sealed validated payload class | -| static class | [ComposedAnyOfDifferentTypesNoValidations.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ComposedAnyOfDifferentTypesNoValidations.Schema0Boxed](#schema0boxed)
sealed interface for validated payloads | +| record | [ComposedAnyOfDifferentTypesNoValidations.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | | static class | [ComposedAnyOfDifferentTypesNoValidations.Schema0](#schema0)
schema class | ## ComposedAnyOfDifferentTypesNoValidations1Boxed -public static abstract sealed class ComposedAnyOfDifferentTypesNoValidations1Boxed
+public sealed interface ComposedAnyOfDifferentTypesNoValidations1Boxed
permits
[ComposedAnyOfDifferentTypesNoValidations1BoxedVoid](#composedanyofdifferenttypesnovalidations1boxedvoid), [ComposedAnyOfDifferentTypesNoValidations1BoxedBoolean](#composedanyofdifferenttypesnovalidations1boxedboolean), @@ -88,103 +88,109 @@ permits
[ComposedAnyOfDifferentTypesNoValidations1BoxedList](#composedanyofdifferenttypesnovalidations1boxedlist), [ComposedAnyOfDifferentTypesNoValidations1BoxedMap](#composedanyofdifferenttypesnovalidations1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ComposedAnyOfDifferentTypesNoValidations1BoxedVoid -public static final class ComposedAnyOfDifferentTypesNoValidations1BoxedVoid
-extends [ComposedAnyOfDifferentTypesNoValidations1Boxed](#composedanyofdifferenttypesnovalidations1boxed) +public record ComposedAnyOfDifferentTypesNoValidations1BoxedVoid
+implements [ComposedAnyOfDifferentTypesNoValidations1Boxed](#composedanyofdifferenttypesnovalidations1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ComposedAnyOfDifferentTypesNoValidations1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ComposedAnyOfDifferentTypesNoValidations1BoxedBoolean -public static final class ComposedAnyOfDifferentTypesNoValidations1BoxedBoolean
-extends [ComposedAnyOfDifferentTypesNoValidations1Boxed](#composedanyofdifferenttypesnovalidations1boxed) +public record ComposedAnyOfDifferentTypesNoValidations1BoxedBoolean
+implements [ComposedAnyOfDifferentTypesNoValidations1Boxed](#composedanyofdifferenttypesnovalidations1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ComposedAnyOfDifferentTypesNoValidations1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ComposedAnyOfDifferentTypesNoValidations1BoxedNumber -public static final class ComposedAnyOfDifferentTypesNoValidations1BoxedNumber
-extends [ComposedAnyOfDifferentTypesNoValidations1Boxed](#composedanyofdifferenttypesnovalidations1boxed) +public record ComposedAnyOfDifferentTypesNoValidations1BoxedNumber
+implements [ComposedAnyOfDifferentTypesNoValidations1Boxed](#composedanyofdifferenttypesnovalidations1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ComposedAnyOfDifferentTypesNoValidations1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ComposedAnyOfDifferentTypesNoValidations1BoxedString -public static final class ComposedAnyOfDifferentTypesNoValidations1BoxedString
-extends [ComposedAnyOfDifferentTypesNoValidations1Boxed](#composedanyofdifferenttypesnovalidations1boxed) +public record ComposedAnyOfDifferentTypesNoValidations1BoxedString
+implements [ComposedAnyOfDifferentTypesNoValidations1Boxed](#composedanyofdifferenttypesnovalidations1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ComposedAnyOfDifferentTypesNoValidations1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ComposedAnyOfDifferentTypesNoValidations1BoxedList -public static final class ComposedAnyOfDifferentTypesNoValidations1BoxedList
-extends [ComposedAnyOfDifferentTypesNoValidations1Boxed](#composedanyofdifferenttypesnovalidations1boxed) +public record ComposedAnyOfDifferentTypesNoValidations1BoxedList
+implements [ComposedAnyOfDifferentTypesNoValidations1Boxed](#composedanyofdifferenttypesnovalidations1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ComposedAnyOfDifferentTypesNoValidations1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ComposedAnyOfDifferentTypesNoValidations1BoxedMap -public static final class ComposedAnyOfDifferentTypesNoValidations1BoxedMap
-extends [ComposedAnyOfDifferentTypesNoValidations1Boxed](#composedanyofdifferenttypesnovalidations1boxed) +public record ComposedAnyOfDifferentTypesNoValidations1BoxedMap
+implements [ComposedAnyOfDifferentTypesNoValidations1Boxed](#composedanyofdifferenttypesnovalidations1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ComposedAnyOfDifferentTypesNoValidations1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ComposedAnyOfDifferentTypesNoValidations1 public static class ComposedAnyOfDifferentTypesNoValidations1
@@ -216,29 +222,32 @@ A schema class that validates payloads | [ComposedAnyOfDifferentTypesNoValidations1BoxedBoolean](#composedanyofdifferenttypesnovalidations1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [ComposedAnyOfDifferentTypesNoValidations1BoxedMap](#composedanyofdifferenttypesnovalidations1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [ComposedAnyOfDifferentTypesNoValidations1BoxedList](#composedanyofdifferenttypesnovalidations1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [ComposedAnyOfDifferentTypesNoValidations1Boxed](#composedanyofdifferenttypesnovalidations1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema15Boxed -public static abstract sealed class Schema15Boxed
+public sealed interface Schema15Boxed
permits
[Schema15BoxedNumber](#schema15boxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema15BoxedNumber -public static final class Schema15BoxedNumber
-extends [Schema15Boxed](#schema15boxed) +public record Schema15BoxedNumber
+implements [Schema15Boxed](#schema15boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema15BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema15 public static class Schema15
@@ -252,27 +261,28 @@ A schema class that validates payloads | validateAndBox | ## Schema14Boxed -public static abstract sealed class Schema14Boxed
+public sealed interface Schema14Boxed
permits
[Schema14BoxedNumber](#schema14boxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema14BoxedNumber -public static final class Schema14BoxedNumber
-extends [Schema14Boxed](#schema14boxed) +public record Schema14BoxedNumber
+implements [Schema14Boxed](#schema14boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema14BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema14 public static class Schema14
@@ -286,27 +296,28 @@ A schema class that validates payloads | validateAndBox | ## Schema13Boxed -public static abstract sealed class Schema13Boxed
+public sealed interface Schema13Boxed
permits
[Schema13BoxedNumber](#schema13boxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema13BoxedNumber -public static final class Schema13BoxedNumber
-extends [Schema13Boxed](#schema13boxed) +public record Schema13BoxedNumber
+implements [Schema13Boxed](#schema13boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema13BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema13 public static class Schema13
@@ -320,27 +331,28 @@ A schema class that validates payloads | validateAndBox | ## Schema12Boxed -public static abstract sealed class Schema12Boxed
+public sealed interface Schema12Boxed
permits
[Schema12BoxedNumber](#schema12boxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema12BoxedNumber -public static final class Schema12BoxedNumber
-extends [Schema12Boxed](#schema12boxed) +public record Schema12BoxedNumber
+implements [Schema12Boxed](#schema12boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema12BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema12 public static class Schema12
@@ -354,27 +366,28 @@ A schema class that validates payloads | validateAndBox | ## Schema11Boxed -public static abstract sealed class Schema11Boxed
+public sealed interface Schema11Boxed
permits
[Schema11BoxedNumber](#schema11boxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema11BoxedNumber -public static final class Schema11BoxedNumber
-extends [Schema11Boxed](#schema11boxed) +public record Schema11BoxedNumber
+implements [Schema11Boxed](#schema11boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema11BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema11 public static class Schema11
@@ -388,27 +401,28 @@ A schema class that validates payloads | validateAndBox | ## Schema10Boxed -public static abstract sealed class Schema10Boxed
+public sealed interface Schema10Boxed
permits
[Schema10BoxedNumber](#schema10boxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema10BoxedNumber -public static final class Schema10BoxedNumber
-extends [Schema10Boxed](#schema10boxed) +public record Schema10BoxedNumber
+implements [Schema10Boxed](#schema10boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema10BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema10 public static class Schema10
@@ -422,27 +436,28 @@ A schema class that validates payloads | validateAndBox | ## Schema9Boxed -public static abstract sealed class Schema9Boxed
+public sealed interface Schema9Boxed
permits
[Schema9BoxedList](#schema9boxedlist) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema9BoxedList -public static final class Schema9BoxedList
-extends [Schema9Boxed](#schema9boxed) +public record Schema9BoxedList
+implements [Schema9Boxed](#schema9boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema9BoxedList([Schema9List](#schema9list) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [Schema9List](#schema9list) | data
validated payload | +| [Schema9List](#schema9list) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema9 public static class Schema9
@@ -485,7 +500,9 @@ ComposedAnyOfDifferentTypesNoValidations.Schema9List validatedPayload = | ----------------- | ---------------------- | | [Schema9List](#schema9list) | validate([List](#schema9listbuilder) arg, SchemaConfiguration configuration) | | [Schema9BoxedList](#schema9boxedlist) | validateAndBox([List](#schema9listbuilder) arg, SchemaConfiguration configuration) | +| [Schema9Boxed](#schema9boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema9ListBuilder public class Schema9ListBuilder
builder for `List<@Nullable Object>` @@ -524,7 +541,7 @@ A class to store validated List payloads | static [Schema9List](#schema9list) | of([List](#schema9listbuilder) arg, SchemaConfiguration configuration) | ## ItemsBoxed -public static abstract sealed class ItemsBoxed
+public sealed interface ItemsBoxed
permits
[ItemsBoxedVoid](#itemsboxedvoid), [ItemsBoxedBoolean](#itemsboxedboolean), @@ -533,103 +550,109 @@ permits
[ItemsBoxedList](#itemsboxedlist), [ItemsBoxedMap](#itemsboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ItemsBoxedVoid -public static final class ItemsBoxedVoid
-extends [ItemsBoxed](#itemsboxed) +public record ItemsBoxedVoid
+implements [ItemsBoxed](#itemsboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ItemsBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ItemsBoxedBoolean -public static final class ItemsBoxedBoolean
-extends [ItemsBoxed](#itemsboxed) +public record ItemsBoxedBoolean
+implements [ItemsBoxed](#itemsboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ItemsBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ItemsBoxedNumber -public static final class ItemsBoxedNumber
-extends [ItemsBoxed](#itemsboxed) +public record ItemsBoxedNumber
+implements [ItemsBoxed](#itemsboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ItemsBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ItemsBoxedString -public static final class ItemsBoxedString
-extends [ItemsBoxed](#itemsboxed) +public record ItemsBoxedString
+implements [ItemsBoxed](#itemsboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ItemsBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ItemsBoxedList -public static final class ItemsBoxedList
-extends [ItemsBoxed](#itemsboxed) +public record ItemsBoxedList
+implements [ItemsBoxed](#itemsboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ItemsBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ItemsBoxedMap -public static final class ItemsBoxedMap
-extends [ItemsBoxed](#itemsboxed) +public record ItemsBoxedMap
+implements [ItemsBoxed](#itemsboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ItemsBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Items public static class Items
@@ -643,27 +666,28 @@ A schema class that validates payloads | validateAndBox | ## Schema8Boxed -public static abstract sealed class Schema8Boxed
+public sealed interface Schema8Boxed
permits
[Schema8BoxedVoid](#schema8boxedvoid) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema8BoxedVoid -public static final class Schema8BoxedVoid
-extends [Schema8Boxed](#schema8boxed) +public record Schema8BoxedVoid
+implements [Schema8Boxed](#schema8boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema8BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema8 public static class Schema8
@@ -677,27 +701,28 @@ A schema class that validates payloads | validateAndBox | ## Schema7Boxed -public static abstract sealed class Schema7Boxed
+public sealed interface Schema7Boxed
permits
[Schema7BoxedBoolean](#schema7boxedboolean) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema7BoxedBoolean -public static final class Schema7BoxedBoolean
-extends [Schema7Boxed](#schema7boxed) +public record Schema7BoxedBoolean
+implements [Schema7Boxed](#schema7boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema7BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema7 public static class Schema7
@@ -711,27 +736,28 @@ A schema class that validates payloads | validateAndBox | ## Schema6Boxed -public static abstract sealed class Schema6Boxed
+public sealed interface Schema6Boxed
permits
[Schema6BoxedMap](#schema6boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema6BoxedMap -public static final class Schema6BoxedMap
-extends [Schema6Boxed](#schema6boxed) +public record Schema6BoxedMap
+implements [Schema6Boxed](#schema6boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema6BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema6 public static class Schema6
@@ -745,27 +771,28 @@ A schema class that validates payloads | validateAndBox | ## Schema5Boxed -public static abstract sealed class Schema5Boxed
+public sealed interface Schema5Boxed
permits
[Schema5BoxedString](#schema5boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema5BoxedString -public static final class Schema5BoxedString
-extends [Schema5Boxed](#schema5boxed) +public record Schema5BoxedString
+implements [Schema5Boxed](#schema5boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema5BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema5 public static class Schema5
@@ -779,27 +806,28 @@ A schema class that validates payloads | validateAndBox | ## Schema4Boxed -public static abstract sealed class Schema4Boxed
+public sealed interface Schema4Boxed
permits
[Schema4BoxedString](#schema4boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema4BoxedString -public static final class Schema4BoxedString
-extends [Schema4Boxed](#schema4boxed) +public record Schema4BoxedString
+implements [Schema4Boxed](#schema4boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema4BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema4 public static class Schema4
@@ -808,10 +836,10 @@ extends StringJsonSchema.StringJsonSchema1 A schema class that validates payloads ## Schema3Boxed -public static abstract sealed class Schema3Boxed
+public sealed interface Schema3Boxed
permits
-abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema3 public static class Schema3
@@ -820,27 +848,28 @@ extends JsonSchema A schema class that validates payloads ## Schema2Boxed -public static abstract sealed class Schema2Boxed
+public sealed interface Schema2Boxed
permits
[Schema2BoxedString](#schema2boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema2BoxedString -public static final class Schema2BoxedString
-extends [Schema2Boxed](#schema2boxed) +public record Schema2BoxedString
+implements [Schema2Boxed](#schema2boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema2BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema2 public static class Schema2
@@ -854,27 +883,28 @@ A schema class that validates payloads | validateAndBox | ## Schema1Boxed -public static abstract sealed class Schema1Boxed
+public sealed interface Schema1Boxed
permits
[Schema1BoxedString](#schema1boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema1BoxedString -public static final class Schema1BoxedString
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedString
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1 public static class Schema1
@@ -888,27 +918,28 @@ A schema class that validates payloads | validateAndBox | ## Schema0Boxed -public static abstract sealed class Schema0Boxed
+public sealed interface Schema0Boxed
permits
[Schema0BoxedMap](#schema0boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema0BoxedMap -public static final class Schema0BoxedMap
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedMap
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0 public static class Schema0
diff --git a/samples/client/petstore/java/docs/components/schemas/ComposedArray.md b/samples/client/petstore/java/docs/components/schemas/ComposedArray.md index 50bac4de5a3..9a84895f7a7 100644 --- a/samples/client/petstore/java/docs/components/schemas/ComposedArray.md +++ b/samples/client/petstore/java/docs/components/schemas/ComposedArray.md @@ -4,7 +4,7 @@ public class ComposedArray
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated list payloads, extends FrozenList - classes to build inputs for list payloads @@ -12,42 +12,43 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ComposedArray.ComposedArray1Boxed](#composedarray1boxed)
abstract sealed validated payload class | -| static class | [ComposedArray.ComposedArray1BoxedList](#composedarray1boxedlist)
boxed class to store validated List payloads | +| sealed interface | [ComposedArray.ComposedArray1Boxed](#composedarray1boxed)
sealed interface for validated payloads | +| record | [ComposedArray.ComposedArray1BoxedList](#composedarray1boxedlist)
boxed class to store validated List payloads | | static class | [ComposedArray.ComposedArray1](#composedarray1)
schema class | | static class | [ComposedArray.ComposedArrayListBuilder](#composedarraylistbuilder)
builder for List payloads | | static class | [ComposedArray.ComposedArrayList](#composedarraylist)
output class for List payloads | -| static class | [ComposedArray.ItemsBoxed](#itemsboxed)
abstract sealed validated payload class | -| static class | [ComposedArray.ItemsBoxedVoid](#itemsboxedvoid)
boxed class to store validated null payloads | -| static class | [ComposedArray.ItemsBoxedBoolean](#itemsboxedboolean)
boxed class to store validated boolean payloads | -| static class | [ComposedArray.ItemsBoxedNumber](#itemsboxednumber)
boxed class to store validated Number payloads | -| static class | [ComposedArray.ItemsBoxedString](#itemsboxedstring)
boxed class to store validated String payloads | -| static class | [ComposedArray.ItemsBoxedList](#itemsboxedlist)
boxed class to store validated List payloads | -| static class | [ComposedArray.ItemsBoxedMap](#itemsboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ComposedArray.ItemsBoxed](#itemsboxed)
sealed interface for validated payloads | +| record | [ComposedArray.ItemsBoxedVoid](#itemsboxedvoid)
boxed class to store validated null payloads | +| record | [ComposedArray.ItemsBoxedBoolean](#itemsboxedboolean)
boxed class to store validated boolean payloads | +| record | [ComposedArray.ItemsBoxedNumber](#itemsboxednumber)
boxed class to store validated Number payloads | +| record | [ComposedArray.ItemsBoxedString](#itemsboxedstring)
boxed class to store validated String payloads | +| record | [ComposedArray.ItemsBoxedList](#itemsboxedlist)
boxed class to store validated List payloads | +| record | [ComposedArray.ItemsBoxedMap](#itemsboxedmap)
boxed class to store validated Map payloads | | static class | [ComposedArray.Items](#items)
schema class | ## ComposedArray1Boxed -public static abstract sealed class ComposedArray1Boxed
+public sealed interface ComposedArray1Boxed
permits
[ComposedArray1BoxedList](#composedarray1boxedlist) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ComposedArray1BoxedList -public static final class ComposedArray1BoxedList
-extends [ComposedArray1Boxed](#composedarray1boxed) +public record ComposedArray1BoxedList
+implements [ComposedArray1Boxed](#composedarray1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ComposedArray1BoxedList([ComposedArrayList](#composedarraylist) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [ComposedArrayList](#composedarraylist) | data
validated payload | +| [ComposedArrayList](#composedarraylist) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ComposedArray1 public static class ComposedArray1
@@ -90,7 +91,9 @@ ComposedArray.ComposedArrayList validatedPayload = | ----------------- | ---------------------- | | [ComposedArrayList](#composedarraylist) | validate([List](#composedarraylistbuilder) arg, SchemaConfiguration configuration) | | [ComposedArray1BoxedList](#composedarray1boxedlist) | validateAndBox([List](#composedarraylistbuilder) arg, SchemaConfiguration configuration) | +| [ComposedArray1Boxed](#composedarray1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ComposedArrayListBuilder public class ComposedArrayListBuilder
builder for `List<@Nullable Object>` @@ -129,7 +132,7 @@ A class to store validated List payloads | static [ComposedArrayList](#composedarraylist) | of([List](#composedarraylistbuilder) arg, SchemaConfiguration configuration) | ## ItemsBoxed -public static abstract sealed class ItemsBoxed
+public sealed interface ItemsBoxed
permits
[ItemsBoxedVoid](#itemsboxedvoid), [ItemsBoxedBoolean](#itemsboxedboolean), @@ -138,103 +141,109 @@ permits
[ItemsBoxedList](#itemsboxedlist), [ItemsBoxedMap](#itemsboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ItemsBoxedVoid -public static final class ItemsBoxedVoid
-extends [ItemsBoxed](#itemsboxed) +public record ItemsBoxedVoid
+implements [ItemsBoxed](#itemsboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ItemsBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ItemsBoxedBoolean -public static final class ItemsBoxedBoolean
-extends [ItemsBoxed](#itemsboxed) +public record ItemsBoxedBoolean
+implements [ItemsBoxed](#itemsboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ItemsBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ItemsBoxedNumber -public static final class ItemsBoxedNumber
-extends [ItemsBoxed](#itemsboxed) +public record ItemsBoxedNumber
+implements [ItemsBoxed](#itemsboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ItemsBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ItemsBoxedString -public static final class ItemsBoxedString
-extends [ItemsBoxed](#itemsboxed) +public record ItemsBoxedString
+implements [ItemsBoxed](#itemsboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ItemsBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ItemsBoxedList -public static final class ItemsBoxedList
-extends [ItemsBoxed](#itemsboxed) +public record ItemsBoxedList
+implements [ItemsBoxed](#itemsboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ItemsBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ItemsBoxedMap -public static final class ItemsBoxedMap
-extends [ItemsBoxed](#itemsboxed) +public record ItemsBoxedMap
+implements [ItemsBoxed](#itemsboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ItemsBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Items public static class Items
diff --git a/samples/client/petstore/java/docs/components/schemas/ComposedBool.md b/samples/client/petstore/java/docs/components/schemas/ComposedBool.md index b163b0b9a3c..2927f63f5fe 100644 --- a/samples/client/petstore/java/docs/components/schemas/ComposedBool.md +++ b/samples/client/petstore/java/docs/components/schemas/ComposedBool.md @@ -4,46 +4,47 @@ public class ComposedBool
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ComposedBool.ComposedBool1Boxed](#composedbool1boxed)
abstract sealed validated payload class | -| static class | [ComposedBool.ComposedBool1BoxedBoolean](#composedbool1boxedboolean)
boxed class to store validated boolean payloads | +| sealed interface | [ComposedBool.ComposedBool1Boxed](#composedbool1boxed)
sealed interface for validated payloads | +| record | [ComposedBool.ComposedBool1BoxedBoolean](#composedbool1boxedboolean)
boxed class to store validated boolean payloads | | static class | [ComposedBool.ComposedBool1](#composedbool1)
schema class | -| static class | [ComposedBool.Schema0Boxed](#schema0boxed)
abstract sealed validated payload class | -| static class | [ComposedBool.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | -| static class | [ComposedBool.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | -| static class | [ComposedBool.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | -| static class | [ComposedBool.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | -| static class | [ComposedBool.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | -| static class | [ComposedBool.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ComposedBool.Schema0Boxed](#schema0boxed)
sealed interface for validated payloads | +| record | [ComposedBool.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | +| record | [ComposedBool.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | +| record | [ComposedBool.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | +| record | [ComposedBool.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | +| record | [ComposedBool.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | +| record | [ComposedBool.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | | static class | [ComposedBool.Schema0](#schema0)
schema class | ## ComposedBool1Boxed -public static abstract sealed class ComposedBool1Boxed
+public sealed interface ComposedBool1Boxed
permits
[ComposedBool1BoxedBoolean](#composedbool1boxedboolean) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ComposedBool1BoxedBoolean -public static final class ComposedBool1BoxedBoolean
-extends [ComposedBool1Boxed](#composedbool1boxed) +public record ComposedBool1BoxedBoolean
+implements [ComposedBool1Boxed](#composedbool1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ComposedBool1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ComposedBool1 public static class ComposedBool1
@@ -84,9 +85,11 @@ boolean validatedPayload = ComposedBool.ComposedBool1.validate( | ----------------- | ---------------------- | | boolean | validate(boolean arg, SchemaConfiguration configuration) | | [ComposedBool1BoxedBoolean](#composedbool1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | +| [ComposedBool1Boxed](#composedbool1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema0Boxed -public static abstract sealed class Schema0Boxed
+public sealed interface Schema0Boxed
permits
[Schema0BoxedVoid](#schema0boxedvoid), [Schema0BoxedBoolean](#schema0boxedboolean), @@ -95,103 +98,109 @@ permits
[Schema0BoxedList](#schema0boxedlist), [Schema0BoxedMap](#schema0boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema0BoxedVoid -public static final class Schema0BoxedVoid
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedVoid
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedBoolean -public static final class Schema0BoxedBoolean
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedBoolean
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedNumber -public static final class Schema0BoxedNumber
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedNumber
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedString -public static final class Schema0BoxedString
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedString
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedList -public static final class Schema0BoxedList
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedList
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedMap -public static final class Schema0BoxedMap
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedMap
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0 public static class Schema0
diff --git a/samples/client/petstore/java/docs/components/schemas/ComposedNone.md b/samples/client/petstore/java/docs/components/schemas/ComposedNone.md index e9bb0aa3017..5ff4b6db8c2 100644 --- a/samples/client/petstore/java/docs/components/schemas/ComposedNone.md +++ b/samples/client/petstore/java/docs/components/schemas/ComposedNone.md @@ -4,46 +4,47 @@ public class ComposedNone
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ComposedNone.ComposedNone1Boxed](#composednone1boxed)
abstract sealed validated payload class | -| static class | [ComposedNone.ComposedNone1BoxedVoid](#composednone1boxedvoid)
boxed class to store validated null payloads | +| sealed interface | [ComposedNone.ComposedNone1Boxed](#composednone1boxed)
sealed interface for validated payloads | +| record | [ComposedNone.ComposedNone1BoxedVoid](#composednone1boxedvoid)
boxed class to store validated null payloads | | static class | [ComposedNone.ComposedNone1](#composednone1)
schema class | -| static class | [ComposedNone.Schema0Boxed](#schema0boxed)
abstract sealed validated payload class | -| static class | [ComposedNone.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | -| static class | [ComposedNone.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | -| static class | [ComposedNone.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | -| static class | [ComposedNone.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | -| static class | [ComposedNone.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | -| static class | [ComposedNone.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ComposedNone.Schema0Boxed](#schema0boxed)
sealed interface for validated payloads | +| record | [ComposedNone.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | +| record | [ComposedNone.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | +| record | [ComposedNone.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | +| record | [ComposedNone.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | +| record | [ComposedNone.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | +| record | [ComposedNone.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | | static class | [ComposedNone.Schema0](#schema0)
schema class | ## ComposedNone1Boxed -public static abstract sealed class ComposedNone1Boxed
+public sealed interface ComposedNone1Boxed
permits
[ComposedNone1BoxedVoid](#composednone1boxedvoid) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ComposedNone1BoxedVoid -public static final class ComposedNone1BoxedVoid
-extends [ComposedNone1Boxed](#composednone1boxed) +public record ComposedNone1BoxedVoid
+implements [ComposedNone1Boxed](#composednone1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ComposedNone1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ComposedNone1 public static class ComposedNone1
@@ -84,9 +85,11 @@ Void validatedPayload = ComposedNone.ComposedNone1.validate( | ----------------- | ---------------------- | | Void | validate(Void arg, SchemaConfiguration configuration) | | [ComposedNone1BoxedVoid](#composednone1boxedvoid) | validateAndBox(Void arg, SchemaConfiguration configuration) | +| [ComposedNone1Boxed](#composednone1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema0Boxed -public static abstract sealed class Schema0Boxed
+public sealed interface Schema0Boxed
permits
[Schema0BoxedVoid](#schema0boxedvoid), [Schema0BoxedBoolean](#schema0boxedboolean), @@ -95,103 +98,109 @@ permits
[Schema0BoxedList](#schema0boxedlist), [Schema0BoxedMap](#schema0boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema0BoxedVoid -public static final class Schema0BoxedVoid
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedVoid
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedBoolean -public static final class Schema0BoxedBoolean
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedBoolean
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedNumber -public static final class Schema0BoxedNumber
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedNumber
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedString -public static final class Schema0BoxedString
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedString
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedList -public static final class Schema0BoxedList
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedList
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedMap -public static final class Schema0BoxedMap
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedMap
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0 public static class Schema0
diff --git a/samples/client/petstore/java/docs/components/schemas/ComposedNumber.md b/samples/client/petstore/java/docs/components/schemas/ComposedNumber.md index d7ec47925cc..443863d0d15 100644 --- a/samples/client/petstore/java/docs/components/schemas/ComposedNumber.md +++ b/samples/client/petstore/java/docs/components/schemas/ComposedNumber.md @@ -4,46 +4,47 @@ public class ComposedNumber
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ComposedNumber.ComposedNumber1Boxed](#composednumber1boxed)
abstract sealed validated payload class | -| static class | [ComposedNumber.ComposedNumber1BoxedNumber](#composednumber1boxednumber)
boxed class to store validated Number payloads | +| sealed interface | [ComposedNumber.ComposedNumber1Boxed](#composednumber1boxed)
sealed interface for validated payloads | +| record | [ComposedNumber.ComposedNumber1BoxedNumber](#composednumber1boxednumber)
boxed class to store validated Number payloads | | static class | [ComposedNumber.ComposedNumber1](#composednumber1)
schema class | -| static class | [ComposedNumber.Schema0Boxed](#schema0boxed)
abstract sealed validated payload class | -| static class | [ComposedNumber.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | -| static class | [ComposedNumber.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | -| static class | [ComposedNumber.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | -| static class | [ComposedNumber.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | -| static class | [ComposedNumber.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | -| static class | [ComposedNumber.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ComposedNumber.Schema0Boxed](#schema0boxed)
sealed interface for validated payloads | +| record | [ComposedNumber.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | +| record | [ComposedNumber.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | +| record | [ComposedNumber.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | +| record | [ComposedNumber.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | +| record | [ComposedNumber.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | +| record | [ComposedNumber.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | | static class | [ComposedNumber.Schema0](#schema0)
schema class | ## ComposedNumber1Boxed -public static abstract sealed class ComposedNumber1Boxed
+public sealed interface ComposedNumber1Boxed
permits
[ComposedNumber1BoxedNumber](#composednumber1boxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ComposedNumber1BoxedNumber -public static final class ComposedNumber1BoxedNumber
-extends [ComposedNumber1Boxed](#composednumber1boxed) +public record ComposedNumber1BoxedNumber
+implements [ComposedNumber1Boxed](#composednumber1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ComposedNumber1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ComposedNumber1 public static class ComposedNumber1
@@ -84,9 +85,11 @@ int validatedPayload = ComposedNumber.ComposedNumber1.validate( | ----------------- | ---------------------- | | Number | validate(Number arg, SchemaConfiguration configuration) | | [ComposedNumber1BoxedNumber](#composednumber1boxednumber) | validateAndBox(Number arg, SchemaConfiguration configuration) | +| [ComposedNumber1Boxed](#composednumber1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema0Boxed -public static abstract sealed class Schema0Boxed
+public sealed interface Schema0Boxed
permits
[Schema0BoxedVoid](#schema0boxedvoid), [Schema0BoxedBoolean](#schema0boxedboolean), @@ -95,103 +98,109 @@ permits
[Schema0BoxedList](#schema0boxedlist), [Schema0BoxedMap](#schema0boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema0BoxedVoid -public static final class Schema0BoxedVoid
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedVoid
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedBoolean -public static final class Schema0BoxedBoolean
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedBoolean
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedNumber -public static final class Schema0BoxedNumber
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedNumber
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedString -public static final class Schema0BoxedString
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedString
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedList -public static final class Schema0BoxedList
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedList
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedMap -public static final class Schema0BoxedMap
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedMap
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0 public static class Schema0
diff --git a/samples/client/petstore/java/docs/components/schemas/ComposedObject.md b/samples/client/petstore/java/docs/components/schemas/ComposedObject.md index 67b2f1c1a8a..a17050d34fa 100644 --- a/samples/client/petstore/java/docs/components/schemas/ComposedObject.md +++ b/samples/client/petstore/java/docs/components/schemas/ComposedObject.md @@ -4,46 +4,47 @@ public class ComposedObject
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ComposedObject.ComposedObject1Boxed](#composedobject1boxed)
abstract sealed validated payload class | -| static class | [ComposedObject.ComposedObject1BoxedMap](#composedobject1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ComposedObject.ComposedObject1Boxed](#composedobject1boxed)
sealed interface for validated payloads | +| record | [ComposedObject.ComposedObject1BoxedMap](#composedobject1boxedmap)
boxed class to store validated Map payloads | | static class | [ComposedObject.ComposedObject1](#composedobject1)
schema class | -| static class | [ComposedObject.Schema0Boxed](#schema0boxed)
abstract sealed validated payload class | -| static class | [ComposedObject.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | -| static class | [ComposedObject.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | -| static class | [ComposedObject.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | -| static class | [ComposedObject.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | -| static class | [ComposedObject.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | -| static class | [ComposedObject.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ComposedObject.Schema0Boxed](#schema0boxed)
sealed interface for validated payloads | +| record | [ComposedObject.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | +| record | [ComposedObject.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | +| record | [ComposedObject.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | +| record | [ComposedObject.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | +| record | [ComposedObject.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | +| record | [ComposedObject.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | | static class | [ComposedObject.Schema0](#schema0)
schema class | ## ComposedObject1Boxed -public static abstract sealed class ComposedObject1Boxed
+public sealed interface ComposedObject1Boxed
permits
[ComposedObject1BoxedMap](#composedobject1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ComposedObject1BoxedMap -public static final class ComposedObject1BoxedMap
-extends [ComposedObject1Boxed](#composedobject1boxed) +public record ComposedObject1BoxedMap
+implements [ComposedObject1Boxed](#composedobject1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ComposedObject1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ComposedObject1 public static class ComposedObject1
@@ -62,9 +63,11 @@ A schema class that validates payloads | ----------------- | ---------------------- | | FrozenMap | validate(Map<?, ?> arg, SchemaConfiguration configuration) | | [ComposedObject1BoxedMap](#composedobject1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | +| [ComposedObject1Boxed](#composedobject1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema0Boxed -public static abstract sealed class Schema0Boxed
+public sealed interface Schema0Boxed
permits
[Schema0BoxedVoid](#schema0boxedvoid), [Schema0BoxedBoolean](#schema0boxedboolean), @@ -73,103 +76,109 @@ permits
[Schema0BoxedList](#schema0boxedlist), [Schema0BoxedMap](#schema0boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema0BoxedVoid -public static final class Schema0BoxedVoid
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedVoid
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedBoolean -public static final class Schema0BoxedBoolean
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedBoolean
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedNumber -public static final class Schema0BoxedNumber
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedNumber
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedString -public static final class Schema0BoxedString
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedString
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedList -public static final class Schema0BoxedList
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedList
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedMap -public static final class Schema0BoxedMap
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedMap
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0 public static class Schema0
diff --git a/samples/client/petstore/java/docs/components/schemas/ComposedOneOfDifferentTypes.md b/samples/client/petstore/java/docs/components/schemas/ComposedOneOfDifferentTypes.md index 74f7ab26517..d67d8e3085b 100644 --- a/samples/client/petstore/java/docs/components/schemas/ComposedOneOfDifferentTypes.md +++ b/samples/client/petstore/java/docs/components/schemas/ComposedOneOfDifferentTypes.md @@ -4,7 +4,7 @@ public class ComposedOneOfDifferentTypes
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated list payloads, extends FrozenList - classes to build inputs for list payloads @@ -12,42 +12,42 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ComposedOneOfDifferentTypes.ComposedOneOfDifferentTypes1Boxed](#composedoneofdifferenttypes1boxed)
abstract sealed validated payload class | -| static class | [ComposedOneOfDifferentTypes.ComposedOneOfDifferentTypes1BoxedVoid](#composedoneofdifferenttypes1boxedvoid)
boxed class to store validated null payloads | -| static class | [ComposedOneOfDifferentTypes.ComposedOneOfDifferentTypes1BoxedBoolean](#composedoneofdifferenttypes1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [ComposedOneOfDifferentTypes.ComposedOneOfDifferentTypes1BoxedNumber](#composedoneofdifferenttypes1boxednumber)
boxed class to store validated Number payloads | -| static class | [ComposedOneOfDifferentTypes.ComposedOneOfDifferentTypes1BoxedString](#composedoneofdifferenttypes1boxedstring)
boxed class to store validated String payloads | -| static class | [ComposedOneOfDifferentTypes.ComposedOneOfDifferentTypes1BoxedList](#composedoneofdifferenttypes1boxedlist)
boxed class to store validated List payloads | -| static class | [ComposedOneOfDifferentTypes.ComposedOneOfDifferentTypes1BoxedMap](#composedoneofdifferenttypes1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ComposedOneOfDifferentTypes.ComposedOneOfDifferentTypes1Boxed](#composedoneofdifferenttypes1boxed)
sealed interface for validated payloads | +| record | [ComposedOneOfDifferentTypes.ComposedOneOfDifferentTypes1BoxedVoid](#composedoneofdifferenttypes1boxedvoid)
boxed class to store validated null payloads | +| record | [ComposedOneOfDifferentTypes.ComposedOneOfDifferentTypes1BoxedBoolean](#composedoneofdifferenttypes1boxedboolean)
boxed class to store validated boolean payloads | +| record | [ComposedOneOfDifferentTypes.ComposedOneOfDifferentTypes1BoxedNumber](#composedoneofdifferenttypes1boxednumber)
boxed class to store validated Number payloads | +| record | [ComposedOneOfDifferentTypes.ComposedOneOfDifferentTypes1BoxedString](#composedoneofdifferenttypes1boxedstring)
boxed class to store validated String payloads | +| record | [ComposedOneOfDifferentTypes.ComposedOneOfDifferentTypes1BoxedList](#composedoneofdifferenttypes1boxedlist)
boxed class to store validated List payloads | +| record | [ComposedOneOfDifferentTypes.ComposedOneOfDifferentTypes1BoxedMap](#composedoneofdifferenttypes1boxedmap)
boxed class to store validated Map payloads | | static class | [ComposedOneOfDifferentTypes.ComposedOneOfDifferentTypes1](#composedoneofdifferenttypes1)
schema class | -| static class | [ComposedOneOfDifferentTypes.Schema6Boxed](#schema6boxed)
abstract sealed validated payload class | -| static class | [ComposedOneOfDifferentTypes.Schema6BoxedString](#schema6boxedstring)
boxed class to store validated String payloads | +| sealed interface | [ComposedOneOfDifferentTypes.Schema6Boxed](#schema6boxed)
sealed interface for validated payloads | +| record | [ComposedOneOfDifferentTypes.Schema6BoxedString](#schema6boxedstring)
boxed class to store validated String payloads | | static class | [ComposedOneOfDifferentTypes.Schema6](#schema6)
schema class | -| static class | [ComposedOneOfDifferentTypes.Schema5Boxed](#schema5boxed)
abstract sealed validated payload class | -| static class | [ComposedOneOfDifferentTypes.Schema5BoxedList](#schema5boxedlist)
boxed class to store validated List payloads | +| sealed interface | [ComposedOneOfDifferentTypes.Schema5Boxed](#schema5boxed)
sealed interface for validated payloads | +| record | [ComposedOneOfDifferentTypes.Schema5BoxedList](#schema5boxedlist)
boxed class to store validated List payloads | | static class | [ComposedOneOfDifferentTypes.Schema5](#schema5)
schema class | | static class | [ComposedOneOfDifferentTypes.Schema5ListBuilder](#schema5listbuilder)
builder for List payloads | | static class | [ComposedOneOfDifferentTypes.Schema5List](#schema5list)
output class for List payloads | -| static class | [ComposedOneOfDifferentTypes.ItemsBoxed](#itemsboxed)
abstract sealed validated payload class | -| static class | [ComposedOneOfDifferentTypes.ItemsBoxedVoid](#itemsboxedvoid)
boxed class to store validated null payloads | -| static class | [ComposedOneOfDifferentTypes.ItemsBoxedBoolean](#itemsboxedboolean)
boxed class to store validated boolean payloads | -| static class | [ComposedOneOfDifferentTypes.ItemsBoxedNumber](#itemsboxednumber)
boxed class to store validated Number payloads | -| static class | [ComposedOneOfDifferentTypes.ItemsBoxedString](#itemsboxedstring)
boxed class to store validated String payloads | -| static class | [ComposedOneOfDifferentTypes.ItemsBoxedList](#itemsboxedlist)
boxed class to store validated List payloads | -| static class | [ComposedOneOfDifferentTypes.ItemsBoxedMap](#itemsboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ComposedOneOfDifferentTypes.ItemsBoxed](#itemsboxed)
sealed interface for validated payloads | +| record | [ComposedOneOfDifferentTypes.ItemsBoxedVoid](#itemsboxedvoid)
boxed class to store validated null payloads | +| record | [ComposedOneOfDifferentTypes.ItemsBoxedBoolean](#itemsboxedboolean)
boxed class to store validated boolean payloads | +| record | [ComposedOneOfDifferentTypes.ItemsBoxedNumber](#itemsboxednumber)
boxed class to store validated Number payloads | +| record | [ComposedOneOfDifferentTypes.ItemsBoxedString](#itemsboxedstring)
boxed class to store validated String payloads | +| record | [ComposedOneOfDifferentTypes.ItemsBoxedList](#itemsboxedlist)
boxed class to store validated List payloads | +| record | [ComposedOneOfDifferentTypes.ItemsBoxedMap](#itemsboxedmap)
boxed class to store validated Map payloads | | static class | [ComposedOneOfDifferentTypes.Items](#items)
schema class | -| static class | [ComposedOneOfDifferentTypes.Schema4Boxed](#schema4boxed)
abstract sealed validated payload class | -| static class | [ComposedOneOfDifferentTypes.Schema4BoxedMap](#schema4boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ComposedOneOfDifferentTypes.Schema4Boxed](#schema4boxed)
sealed interface for validated payloads | +| record | [ComposedOneOfDifferentTypes.Schema4BoxedMap](#schema4boxedmap)
boxed class to store validated Map payloads | | static class | [ComposedOneOfDifferentTypes.Schema4](#schema4)
schema class | -| static class | [ComposedOneOfDifferentTypes.Schema3Boxed](#schema3boxed)
abstract sealed validated payload class | -| static class | [ComposedOneOfDifferentTypes.Schema3BoxedString](#schema3boxedstring)
boxed class to store validated String payloads | +| sealed interface | [ComposedOneOfDifferentTypes.Schema3Boxed](#schema3boxed)
sealed interface for validated payloads | +| record | [ComposedOneOfDifferentTypes.Schema3BoxedString](#schema3boxedstring)
boxed class to store validated String payloads | | static class | [ComposedOneOfDifferentTypes.Schema3](#schema3)
schema class | -| static class | [ComposedOneOfDifferentTypes.Schema2Boxed](#schema2boxed)
abstract sealed validated payload class | -| static class | [ComposedOneOfDifferentTypes.Schema2BoxedVoid](#schema2boxedvoid)
boxed class to store validated null payloads | +| sealed interface | [ComposedOneOfDifferentTypes.Schema2Boxed](#schema2boxed)
sealed interface for validated payloads | +| record | [ComposedOneOfDifferentTypes.Schema2BoxedVoid](#schema2boxedvoid)
boxed class to store validated null payloads | | static class | [ComposedOneOfDifferentTypes.Schema2](#schema2)
schema class | ## ComposedOneOfDifferentTypes1Boxed -public static abstract sealed class ComposedOneOfDifferentTypes1Boxed
+public sealed interface ComposedOneOfDifferentTypes1Boxed
permits
[ComposedOneOfDifferentTypes1BoxedVoid](#composedoneofdifferenttypes1boxedvoid), [ComposedOneOfDifferentTypes1BoxedBoolean](#composedoneofdifferenttypes1boxedboolean), @@ -56,103 +56,109 @@ permits
[ComposedOneOfDifferentTypes1BoxedList](#composedoneofdifferenttypes1boxedlist), [ComposedOneOfDifferentTypes1BoxedMap](#composedoneofdifferenttypes1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ComposedOneOfDifferentTypes1BoxedVoid -public static final class ComposedOneOfDifferentTypes1BoxedVoid
-extends [ComposedOneOfDifferentTypes1Boxed](#composedoneofdifferenttypes1boxed) +public record ComposedOneOfDifferentTypes1BoxedVoid
+implements [ComposedOneOfDifferentTypes1Boxed](#composedoneofdifferenttypes1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ComposedOneOfDifferentTypes1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ComposedOneOfDifferentTypes1BoxedBoolean -public static final class ComposedOneOfDifferentTypes1BoxedBoolean
-extends [ComposedOneOfDifferentTypes1Boxed](#composedoneofdifferenttypes1boxed) +public record ComposedOneOfDifferentTypes1BoxedBoolean
+implements [ComposedOneOfDifferentTypes1Boxed](#composedoneofdifferenttypes1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ComposedOneOfDifferentTypes1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ComposedOneOfDifferentTypes1BoxedNumber -public static final class ComposedOneOfDifferentTypes1BoxedNumber
-extends [ComposedOneOfDifferentTypes1Boxed](#composedoneofdifferenttypes1boxed) +public record ComposedOneOfDifferentTypes1BoxedNumber
+implements [ComposedOneOfDifferentTypes1Boxed](#composedoneofdifferenttypes1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ComposedOneOfDifferentTypes1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ComposedOneOfDifferentTypes1BoxedString -public static final class ComposedOneOfDifferentTypes1BoxedString
-extends [ComposedOneOfDifferentTypes1Boxed](#composedoneofdifferenttypes1boxed) +public record ComposedOneOfDifferentTypes1BoxedString
+implements [ComposedOneOfDifferentTypes1Boxed](#composedoneofdifferenttypes1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ComposedOneOfDifferentTypes1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ComposedOneOfDifferentTypes1BoxedList -public static final class ComposedOneOfDifferentTypes1BoxedList
-extends [ComposedOneOfDifferentTypes1Boxed](#composedoneofdifferenttypes1boxed) +public record ComposedOneOfDifferentTypes1BoxedList
+implements [ComposedOneOfDifferentTypes1Boxed](#composedoneofdifferenttypes1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ComposedOneOfDifferentTypes1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ComposedOneOfDifferentTypes1BoxedMap -public static final class ComposedOneOfDifferentTypes1BoxedMap
-extends [ComposedOneOfDifferentTypes1Boxed](#composedoneofdifferenttypes1boxed) +public record ComposedOneOfDifferentTypes1BoxedMap
+implements [ComposedOneOfDifferentTypes1Boxed](#composedoneofdifferenttypes1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ComposedOneOfDifferentTypes1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ComposedOneOfDifferentTypes1 public static class ComposedOneOfDifferentTypes1
@@ -187,29 +193,32 @@ this is a model that allows payloads of type object or number | [ComposedOneOfDifferentTypes1BoxedBoolean](#composedoneofdifferenttypes1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [ComposedOneOfDifferentTypes1BoxedMap](#composedoneofdifferenttypes1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [ComposedOneOfDifferentTypes1BoxedList](#composedoneofdifferenttypes1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [ComposedOneOfDifferentTypes1Boxed](#composedoneofdifferenttypes1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema6Boxed -public static abstract sealed class Schema6Boxed
+public sealed interface Schema6Boxed
permits
[Schema6BoxedString](#schema6boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema6BoxedString -public static final class Schema6BoxedString
-extends [Schema6Boxed](#schema6boxed) +public record Schema6BoxedString
+implements [Schema6Boxed](#schema6boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema6BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema6 public static class Schema6
@@ -251,29 +260,32 @@ String validatedPayload = ComposedOneOfDifferentTypes.Schema6.validate( | ----------------- | ---------------------- | | String | validate(String arg, SchemaConfiguration configuration) | | [Schema6BoxedString](#schema6boxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [Schema6Boxed](#schema6boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema5Boxed -public static abstract sealed class Schema5Boxed
+public sealed interface Schema5Boxed
permits
[Schema5BoxedList](#schema5boxedlist) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema5BoxedList -public static final class Schema5BoxedList
-extends [Schema5Boxed](#schema5boxed) +public record Schema5BoxedList
+implements [Schema5Boxed](#schema5boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema5BoxedList([Schema5List](#schema5list) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [Schema5List](#schema5list) | data
validated payload | +| [Schema5List](#schema5list) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema5 public static class Schema5
@@ -318,7 +330,9 @@ ComposedOneOfDifferentTypes.Schema5List validatedPayload = | ----------------- | ---------------------- | | [Schema5List](#schema5list) | validate([List](#schema5listbuilder) arg, SchemaConfiguration configuration) | | [Schema5BoxedList](#schema5boxedlist) | validateAndBox([List](#schema5listbuilder) arg, SchemaConfiguration configuration) | +| [Schema5Boxed](#schema5boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema5ListBuilder public class Schema5ListBuilder
builder for `List<@Nullable Object>` @@ -357,7 +371,7 @@ A class to store validated List payloads | static [Schema5List](#schema5list) | of([List](#schema5listbuilder) arg, SchemaConfiguration configuration) | ## ItemsBoxed -public static abstract sealed class ItemsBoxed
+public sealed interface ItemsBoxed
permits
[ItemsBoxedVoid](#itemsboxedvoid), [ItemsBoxedBoolean](#itemsboxedboolean), @@ -366,103 +380,109 @@ permits
[ItemsBoxedList](#itemsboxedlist), [ItemsBoxedMap](#itemsboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ItemsBoxedVoid -public static final class ItemsBoxedVoid
-extends [ItemsBoxed](#itemsboxed) +public record ItemsBoxedVoid
+implements [ItemsBoxed](#itemsboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ItemsBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ItemsBoxedBoolean -public static final class ItemsBoxedBoolean
-extends [ItemsBoxed](#itemsboxed) +public record ItemsBoxedBoolean
+implements [ItemsBoxed](#itemsboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ItemsBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ItemsBoxedNumber -public static final class ItemsBoxedNumber
-extends [ItemsBoxed](#itemsboxed) +public record ItemsBoxedNumber
+implements [ItemsBoxed](#itemsboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ItemsBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ItemsBoxedString -public static final class ItemsBoxedString
-extends [ItemsBoxed](#itemsboxed) +public record ItemsBoxedString
+implements [ItemsBoxed](#itemsboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ItemsBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ItemsBoxedList -public static final class ItemsBoxedList
-extends [ItemsBoxed](#itemsboxed) +public record ItemsBoxedList
+implements [ItemsBoxed](#itemsboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ItemsBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ItemsBoxedMap -public static final class ItemsBoxedMap
-extends [ItemsBoxed](#itemsboxed) +public record ItemsBoxedMap
+implements [ItemsBoxed](#itemsboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ItemsBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Items public static class Items
@@ -476,27 +496,28 @@ A schema class that validates payloads | validateAndBox | ## Schema4Boxed -public static abstract sealed class Schema4Boxed
+public sealed interface Schema4Boxed
permits
[Schema4BoxedMap](#schema4boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema4BoxedMap -public static final class Schema4BoxedMap
-extends [Schema4Boxed](#schema4boxed) +public record Schema4BoxedMap
+implements [Schema4Boxed](#schema4boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema4BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema4 public static class Schema4
@@ -516,29 +537,32 @@ A schema class that validates payloads | ----------------- | ---------------------- | | FrozenMap | validate(Map<?, ?> arg, SchemaConfiguration configuration) | | [Schema4BoxedMap](#schema4boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | +| [Schema4Boxed](#schema4boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema3Boxed -public static abstract sealed class Schema3Boxed
+public sealed interface Schema3Boxed
permits
[Schema3BoxedString](#schema3boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema3BoxedString -public static final class Schema3BoxedString
-extends [Schema3Boxed](#schema3boxed) +public record Schema3BoxedString
+implements [Schema3Boxed](#schema3boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema3BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema3 public static class Schema3
@@ -552,27 +576,28 @@ A schema class that validates payloads | validateAndBox | ## Schema2Boxed -public static abstract sealed class Schema2Boxed
+public sealed interface Schema2Boxed
permits
[Schema2BoxedVoid](#schema2boxedvoid) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema2BoxedVoid -public static final class Schema2BoxedVoid
-extends [Schema2Boxed](#schema2boxed) +public record Schema2BoxedVoid
+implements [Schema2Boxed](#schema2boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema2BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema2 public static class Schema2
diff --git a/samples/client/petstore/java/docs/components/schemas/ComposedString.md b/samples/client/petstore/java/docs/components/schemas/ComposedString.md index 1d1497f2f2c..06da6e61df4 100644 --- a/samples/client/petstore/java/docs/components/schemas/ComposedString.md +++ b/samples/client/petstore/java/docs/components/schemas/ComposedString.md @@ -4,46 +4,47 @@ public class ComposedString
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ComposedString.ComposedString1Boxed](#composedstring1boxed)
abstract sealed validated payload class | -| static class | [ComposedString.ComposedString1BoxedString](#composedstring1boxedstring)
boxed class to store validated String payloads | +| sealed interface | [ComposedString.ComposedString1Boxed](#composedstring1boxed)
sealed interface for validated payloads | +| record | [ComposedString.ComposedString1BoxedString](#composedstring1boxedstring)
boxed class to store validated String payloads | | static class | [ComposedString.ComposedString1](#composedstring1)
schema class | -| static class | [ComposedString.Schema0Boxed](#schema0boxed)
abstract sealed validated payload class | -| static class | [ComposedString.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | -| static class | [ComposedString.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | -| static class | [ComposedString.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | -| static class | [ComposedString.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | -| static class | [ComposedString.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | -| static class | [ComposedString.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ComposedString.Schema0Boxed](#schema0boxed)
sealed interface for validated payloads | +| record | [ComposedString.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | +| record | [ComposedString.Schema0BoxedBoolean](#schema0boxedboolean)
boxed class to store validated boolean payloads | +| record | [ComposedString.Schema0BoxedNumber](#schema0boxednumber)
boxed class to store validated Number payloads | +| record | [ComposedString.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | +| record | [ComposedString.Schema0BoxedList](#schema0boxedlist)
boxed class to store validated List payloads | +| record | [ComposedString.Schema0BoxedMap](#schema0boxedmap)
boxed class to store validated Map payloads | | static class | [ComposedString.Schema0](#schema0)
schema class | ## ComposedString1Boxed -public static abstract sealed class ComposedString1Boxed
+public sealed interface ComposedString1Boxed
permits
[ComposedString1BoxedString](#composedstring1boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ComposedString1BoxedString -public static final class ComposedString1BoxedString
-extends [ComposedString1Boxed](#composedstring1boxed) +public record ComposedString1BoxedString
+implements [ComposedString1Boxed](#composedstring1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ComposedString1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ComposedString1 public static class ComposedString1
@@ -84,9 +85,11 @@ String validatedPayload = ComposedString.ComposedString1.validate( | ----------------- | ---------------------- | | String | validate(String arg, SchemaConfiguration configuration) | | [ComposedString1BoxedString](#composedstring1boxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [ComposedString1Boxed](#composedstring1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema0Boxed -public static abstract sealed class Schema0Boxed
+public sealed interface Schema0Boxed
permits
[Schema0BoxedVoid](#schema0boxedvoid), [Schema0BoxedBoolean](#schema0boxedboolean), @@ -95,103 +98,109 @@ permits
[Schema0BoxedList](#schema0boxedlist), [Schema0BoxedMap](#schema0boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema0BoxedVoid -public static final class Schema0BoxedVoid
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedVoid
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedBoolean -public static final class Schema0BoxedBoolean
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedBoolean
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedNumber -public static final class Schema0BoxedNumber
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedNumber
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedString -public static final class Schema0BoxedString
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedString
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedList -public static final class Schema0BoxedList
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedList
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0BoxedMap -public static final class Schema0BoxedMap
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedMap
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0 public static class Schema0
diff --git a/samples/client/petstore/java/docs/components/schemas/Currency.md b/samples/client/petstore/java/docs/components/schemas/Currency.md index f1ccaa53717..06de2075157 100644 --- a/samples/client/petstore/java/docs/components/schemas/Currency.md +++ b/samples/client/petstore/java/docs/components/schemas/Currency.md @@ -4,40 +4,41 @@ public class Currency
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - enum classes ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Currency.Currency1Boxed](#currency1boxed)
abstract sealed validated payload class | -| static class | [Currency.Currency1BoxedString](#currency1boxedstring)
boxed class to store validated String payloads | +| sealed interface | [Currency.Currency1Boxed](#currency1boxed)
sealed interface for validated payloads | +| record | [Currency.Currency1BoxedString](#currency1boxedstring)
boxed class to store validated String payloads | | static class | [Currency.Currency1](#currency1)
schema class | | enum | [Currency.StringCurrencyEnums](#stringcurrencyenums)
String enum | ## Currency1Boxed -public static abstract sealed class Currency1Boxed
+public sealed interface Currency1Boxed
permits
[Currency1BoxedString](#currency1boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Currency1BoxedString -public static final class Currency1BoxedString
-extends [Currency1Boxed](#currency1boxed) +public record Currency1BoxedString
+implements [Currency1Boxed](#currency1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Currency1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Currency1 public static class Currency1
@@ -79,7 +80,9 @@ String validatedPayload = Currency.Currency1.validate( | String | validate(String arg, SchemaConfiguration configuration) | | String | validate([StringCurrencyEnums](#stringcurrencyenums) arg, SchemaConfiguration configuration) | | [Currency1BoxedString](#currency1boxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [Currency1Boxed](#currency1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## StringCurrencyEnums public enum StringCurrencyEnums
extends `Enum` diff --git a/samples/client/petstore/java/docs/components/schemas/DanishPig.md b/samples/client/petstore/java/docs/components/schemas/DanishPig.md index de9edb04656..6d05b4d9f54 100644 --- a/samples/client/petstore/java/docs/components/schemas/DanishPig.md +++ b/samples/client/petstore/java/docs/components/schemas/DanishPig.md @@ -4,7 +4,7 @@ public class DanishPig
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -13,38 +13,39 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [DanishPig.DanishPig1Boxed](#danishpig1boxed)
abstract sealed validated payload class | -| static class | [DanishPig.DanishPig1BoxedMap](#danishpig1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [DanishPig.DanishPig1Boxed](#danishpig1boxed)
sealed interface for validated payloads | +| record | [DanishPig.DanishPig1BoxedMap](#danishpig1boxedmap)
boxed class to store validated Map payloads | | static class | [DanishPig.DanishPig1](#danishpig1)
schema class | | static class | [DanishPig.DanishPigMapBuilder](#danishpigmapbuilder)
builder for Map payloads | | static class | [DanishPig.DanishPigMap](#danishpigmap)
output class for Map payloads | -| static class | [DanishPig.ClassNameBoxed](#classnameboxed)
abstract sealed validated payload class | -| static class | [DanishPig.ClassNameBoxedString](#classnameboxedstring)
boxed class to store validated String payloads | +| sealed interface | [DanishPig.ClassNameBoxed](#classnameboxed)
sealed interface for validated payloads | +| record | [DanishPig.ClassNameBoxedString](#classnameboxedstring)
boxed class to store validated String payloads | | static class | [DanishPig.ClassName](#classname)
schema class | | enum | [DanishPig.StringClassNameEnums](#stringclassnameenums)
String enum | ## DanishPig1Boxed -public static abstract sealed class DanishPig1Boxed
+public sealed interface DanishPig1Boxed
permits
[DanishPig1BoxedMap](#danishpig1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## DanishPig1BoxedMap -public static final class DanishPig1BoxedMap
-extends [DanishPig1Boxed](#danishpig1boxed) +public record DanishPig1BoxedMap
+implements [DanishPig1Boxed](#danishpig1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DanishPig1BoxedMap([DanishPigMap](#danishpigmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [DanishPigMap](#danishpigmap) | data
validated payload | +| [DanishPigMap](#danishpigmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## DanishPig1 public static class DanishPig1
@@ -90,7 +91,9 @@ DanishPig.DanishPigMap validatedPayload = | ----------------- | ---------------------- | | [DanishPigMap](#danishpigmap) | validate([Map<?, ?>](#danishpigmapbuilder) arg, SchemaConfiguration configuration) | | [DanishPig1BoxedMap](#danishpig1boxedmap) | validateAndBox([Map<?, ?>](#danishpigmapbuilder) arg, SchemaConfiguration configuration) | +| [DanishPig1Boxed](#danishpig1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## DanishPigMap0Builder public class DanishPigMap0Builder
builder for `Map` @@ -147,27 +150,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## ClassNameBoxed -public static abstract sealed class ClassNameBoxed
+public sealed interface ClassNameBoxed
permits
[ClassNameBoxedString](#classnameboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ClassNameBoxedString -public static final class ClassNameBoxedString
-extends [ClassNameBoxed](#classnameboxed) +public record ClassNameBoxedString
+implements [ClassNameBoxed](#classnameboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ClassNameBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ClassName public static class ClassName
@@ -209,7 +213,9 @@ String validatedPayload = DanishPig.ClassName.validate( | String | validate(String arg, SchemaConfiguration configuration) | | String | validate([StringClassNameEnums](#stringclassnameenums) arg, SchemaConfiguration configuration) | | [ClassNameBoxedString](#classnameboxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [ClassNameBoxed](#classnameboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## StringClassNameEnums public enum StringClassNameEnums
extends `Enum` diff --git a/samples/client/petstore/java/docs/components/schemas/DateTimeTest.md b/samples/client/petstore/java/docs/components/schemas/DateTimeTest.md index 0246062becc..2568f381200 100644 --- a/samples/client/petstore/java/docs/components/schemas/DateTimeTest.md +++ b/samples/client/petstore/java/docs/components/schemas/DateTimeTest.md @@ -4,38 +4,39 @@ public class DateTimeTest
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [DateTimeTest.DateTimeTest1Boxed](#datetimetest1boxed)
abstract sealed validated payload class | -| static class | [DateTimeTest.DateTimeTest1BoxedString](#datetimetest1boxedstring)
boxed class to store validated String payloads | +| sealed interface | [DateTimeTest.DateTimeTest1Boxed](#datetimetest1boxed)
sealed interface for validated payloads | +| record | [DateTimeTest.DateTimeTest1BoxedString](#datetimetest1boxedstring)
boxed class to store validated String payloads | | static class | [DateTimeTest.DateTimeTest1](#datetimetest1)
schema class | ## DateTimeTest1Boxed -public static abstract sealed class DateTimeTest1Boxed
+public sealed interface DateTimeTest1Boxed
permits
[DateTimeTest1BoxedString](#datetimetest1boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## DateTimeTest1BoxedString -public static final class DateTimeTest1BoxedString
-extends [DateTimeTest1Boxed](#datetimetest1boxed) +public record DateTimeTest1BoxedString
+implements [DateTimeTest1Boxed](#datetimetest1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DateTimeTest1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## DateTimeTest1 public static class DateTimeTest1
@@ -77,5 +78,7 @@ String validatedPayload = DateTimeTest.DateTimeTest1.validate( | ----------------- | ---------------------- | | String | validate(String arg, SchemaConfiguration configuration) | | [DateTimeTest1BoxedString](#datetimetest1boxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [DateTimeTest1Boxed](#datetimetest1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/components/schemas/DateTimeWithValidations.md b/samples/client/petstore/java/docs/components/schemas/DateTimeWithValidations.md index 76790e6336c..643e407374b 100644 --- a/samples/client/petstore/java/docs/components/schemas/DateTimeWithValidations.md +++ b/samples/client/petstore/java/docs/components/schemas/DateTimeWithValidations.md @@ -4,38 +4,39 @@ public class DateTimeWithValidations
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [DateTimeWithValidations.DateTimeWithValidations1Boxed](#datetimewithvalidations1boxed)
abstract sealed validated payload class | -| static class | [DateTimeWithValidations.DateTimeWithValidations1BoxedString](#datetimewithvalidations1boxedstring)
boxed class to store validated String payloads | +| sealed interface | [DateTimeWithValidations.DateTimeWithValidations1Boxed](#datetimewithvalidations1boxed)
sealed interface for validated payloads | +| record | [DateTimeWithValidations.DateTimeWithValidations1BoxedString](#datetimewithvalidations1boxedstring)
boxed class to store validated String payloads | | static class | [DateTimeWithValidations.DateTimeWithValidations1](#datetimewithvalidations1)
schema class | ## DateTimeWithValidations1Boxed -public static abstract sealed class DateTimeWithValidations1Boxed
+public sealed interface DateTimeWithValidations1Boxed
permits
[DateTimeWithValidations1BoxedString](#datetimewithvalidations1boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## DateTimeWithValidations1BoxedString -public static final class DateTimeWithValidations1BoxedString
-extends [DateTimeWithValidations1Boxed](#datetimewithvalidations1boxed) +public record DateTimeWithValidations1BoxedString
+implements [DateTimeWithValidations1Boxed](#datetimewithvalidations1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DateTimeWithValidations1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## DateTimeWithValidations1 public static class DateTimeWithValidations1
@@ -77,5 +78,7 @@ String validatedPayload = DateTimeWithValidations.DateTimeWithValidations1.valid | ----------------- | ---------------------- | | String | validate(String arg, SchemaConfiguration configuration) | | [DateTimeWithValidations1BoxedString](#datetimewithvalidations1boxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [DateTimeWithValidations1Boxed](#datetimewithvalidations1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/components/schemas/DateWithValidations.md b/samples/client/petstore/java/docs/components/schemas/DateWithValidations.md index 80924b628cf..67f5bf50f85 100644 --- a/samples/client/petstore/java/docs/components/schemas/DateWithValidations.md +++ b/samples/client/petstore/java/docs/components/schemas/DateWithValidations.md @@ -4,38 +4,39 @@ public class DateWithValidations
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [DateWithValidations.DateWithValidations1Boxed](#datewithvalidations1boxed)
abstract sealed validated payload class | -| static class | [DateWithValidations.DateWithValidations1BoxedString](#datewithvalidations1boxedstring)
boxed class to store validated String payloads | +| sealed interface | [DateWithValidations.DateWithValidations1Boxed](#datewithvalidations1boxed)
sealed interface for validated payloads | +| record | [DateWithValidations.DateWithValidations1BoxedString](#datewithvalidations1boxedstring)
boxed class to store validated String payloads | | static class | [DateWithValidations.DateWithValidations1](#datewithvalidations1)
schema class | ## DateWithValidations1Boxed -public static abstract sealed class DateWithValidations1Boxed
+public sealed interface DateWithValidations1Boxed
permits
[DateWithValidations1BoxedString](#datewithvalidations1boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## DateWithValidations1BoxedString -public static final class DateWithValidations1BoxedString
-extends [DateWithValidations1Boxed](#datewithvalidations1boxed) +public record DateWithValidations1BoxedString
+implements [DateWithValidations1Boxed](#datewithvalidations1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DateWithValidations1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## DateWithValidations1 public static class DateWithValidations1
@@ -77,5 +78,7 @@ String validatedPayload = DateWithValidations.DateWithValidations1.validate( | ----------------- | ---------------------- | | String | validate(String arg, SchemaConfiguration configuration) | | [DateWithValidations1BoxedString](#datewithvalidations1boxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [DateWithValidations1Boxed](#datewithvalidations1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/components/schemas/DecimalPayload.md b/samples/client/petstore/java/docs/components/schemas/DecimalPayload.md index 3452c3f6799..d9431cd5451 100644 --- a/samples/client/petstore/java/docs/components/schemas/DecimalPayload.md +++ b/samples/client/petstore/java/docs/components/schemas/DecimalPayload.md @@ -4,38 +4,39 @@ public class DecimalPayload
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [DecimalPayload.DecimalPayload1Boxed](#decimalpayload1boxed)
abstract sealed validated payload class | -| static class | [DecimalPayload.DecimalPayload1BoxedString](#decimalpayload1boxedstring)
boxed class to store validated String payloads | +| sealed interface | [DecimalPayload.DecimalPayload1Boxed](#decimalpayload1boxed)
sealed interface for validated payloads | +| record | [DecimalPayload.DecimalPayload1BoxedString](#decimalpayload1boxedstring)
boxed class to store validated String payloads | | static class | [DecimalPayload.DecimalPayload1](#decimalpayload1)
schema class | ## DecimalPayload1Boxed -public static abstract sealed class DecimalPayload1Boxed
+public sealed interface DecimalPayload1Boxed
permits
[DecimalPayload1BoxedString](#decimalpayload1boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## DecimalPayload1BoxedString -public static final class DecimalPayload1BoxedString
-extends [DecimalPayload1Boxed](#decimalpayload1boxed) +public record DecimalPayload1BoxedString
+implements [DecimalPayload1Boxed](#decimalpayload1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DecimalPayload1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## DecimalPayload1 public static class DecimalPayload1
diff --git a/samples/client/petstore/java/docs/components/schemas/Dog.md b/samples/client/petstore/java/docs/components/schemas/Dog.md index eb2de7eb613..2b2d367c0d5 100644 --- a/samples/client/petstore/java/docs/components/schemas/Dog.md +++ b/samples/client/petstore/java/docs/components/schemas/Dog.md @@ -4,7 +4,7 @@ public class Dog
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,25 +12,25 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Dog.Dog1Boxed](#dog1boxed)
abstract sealed validated payload class | -| static class | [Dog.Dog1BoxedVoid](#dog1boxedvoid)
boxed class to store validated null payloads | -| static class | [Dog.Dog1BoxedBoolean](#dog1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [Dog.Dog1BoxedNumber](#dog1boxednumber)
boxed class to store validated Number payloads | -| static class | [Dog.Dog1BoxedString](#dog1boxedstring)
boxed class to store validated String payloads | -| static class | [Dog.Dog1BoxedList](#dog1boxedlist)
boxed class to store validated List payloads | -| static class | [Dog.Dog1BoxedMap](#dog1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [Dog.Dog1Boxed](#dog1boxed)
sealed interface for validated payloads | +| record | [Dog.Dog1BoxedVoid](#dog1boxedvoid)
boxed class to store validated null payloads | +| record | [Dog.Dog1BoxedBoolean](#dog1boxedboolean)
boxed class to store validated boolean payloads | +| record | [Dog.Dog1BoxedNumber](#dog1boxednumber)
boxed class to store validated Number payloads | +| record | [Dog.Dog1BoxedString](#dog1boxedstring)
boxed class to store validated String payloads | +| record | [Dog.Dog1BoxedList](#dog1boxedlist)
boxed class to store validated List payloads | +| record | [Dog.Dog1BoxedMap](#dog1boxedmap)
boxed class to store validated Map payloads | | static class | [Dog.Dog1](#dog1)
schema class | -| static class | [Dog.Schema1Boxed](#schema1boxed)
abstract sealed validated payload class | -| static class | [Dog.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [Dog.Schema1Boxed](#schema1boxed)
sealed interface for validated payloads | +| record | [Dog.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | | static class | [Dog.Schema1](#schema1)
schema class | | static class | [Dog.Schema1MapBuilder](#schema1mapbuilder)
builder for Map payloads | | static class | [Dog.Schema1Map](#schema1map)
output class for Map payloads | -| static class | [Dog.BreedBoxed](#breedboxed)
abstract sealed validated payload class | -| static class | [Dog.BreedBoxedString](#breedboxedstring)
boxed class to store validated String payloads | +| sealed interface | [Dog.BreedBoxed](#breedboxed)
sealed interface for validated payloads | +| record | [Dog.BreedBoxedString](#breedboxedstring)
boxed class to store validated String payloads | | static class | [Dog.Breed](#breed)
schema class | ## Dog1Boxed -public static abstract sealed class Dog1Boxed
+public sealed interface Dog1Boxed
permits
[Dog1BoxedVoid](#dog1boxedvoid), [Dog1BoxedBoolean](#dog1boxedboolean), @@ -39,103 +39,109 @@ permits
[Dog1BoxedList](#dog1boxedlist), [Dog1BoxedMap](#dog1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Dog1BoxedVoid -public static final class Dog1BoxedVoid
-extends [Dog1Boxed](#dog1boxed) +public record Dog1BoxedVoid
+implements [Dog1Boxed](#dog1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Dog1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Dog1BoxedBoolean -public static final class Dog1BoxedBoolean
-extends [Dog1Boxed](#dog1boxed) +public record Dog1BoxedBoolean
+implements [Dog1Boxed](#dog1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Dog1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Dog1BoxedNumber -public static final class Dog1BoxedNumber
-extends [Dog1Boxed](#dog1boxed) +public record Dog1BoxedNumber
+implements [Dog1Boxed](#dog1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Dog1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Dog1BoxedString -public static final class Dog1BoxedString
-extends [Dog1Boxed](#dog1boxed) +public record Dog1BoxedString
+implements [Dog1Boxed](#dog1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Dog1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Dog1BoxedList -public static final class Dog1BoxedList
-extends [Dog1Boxed](#dog1boxed) +public record Dog1BoxedList
+implements [Dog1Boxed](#dog1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Dog1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Dog1BoxedMap -public static final class Dog1BoxedMap
-extends [Dog1Boxed](#dog1boxed) +public record Dog1BoxedMap
+implements [Dog1Boxed](#dog1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Dog1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Dog1 public static class Dog1
@@ -167,29 +173,32 @@ A schema class that validates payloads | [Dog1BoxedBoolean](#dog1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Dog1BoxedMap](#dog1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [Dog1BoxedList](#dog1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Dog1Boxed](#dog1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema1Boxed -public static abstract sealed class Schema1Boxed
+public sealed interface Schema1Boxed
permits
[Schema1BoxedMap](#schema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema1BoxedMap -public static final class Schema1BoxedMap
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedMap
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedMap([Schema1Map](#schema1map) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [Schema1Map](#schema1map) | data
validated payload | +| [Schema1Map](#schema1map) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1 public static class Schema1
@@ -234,7 +243,9 @@ Dog.Schema1Map validatedPayload = | ----------------- | ---------------------- | | [Schema1Map](#schema1map) | validate([Map<?, ?>](#schema1mapbuilder) arg, SchemaConfiguration configuration) | | [Schema1BoxedMap](#schema1boxedmap) | validateAndBox([Map<?, ?>](#schema1mapbuilder) arg, SchemaConfiguration configuration) | +| [Schema1Boxed](#schema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema1MapBuilder public class Schema1MapBuilder
builder for `Map` @@ -275,27 +286,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## BreedBoxed -public static abstract sealed class BreedBoxed
+public sealed interface BreedBoxed
permits
[BreedBoxedString](#breedboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## BreedBoxedString -public static final class BreedBoxedString
-extends [BreedBoxed](#breedboxed) +public record BreedBoxedString
+implements [BreedBoxed](#breedboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BreedBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Breed public static class Breed
diff --git a/samples/client/petstore/java/docs/components/schemas/Drawing.md b/samples/client/petstore/java/docs/components/schemas/Drawing.md index aaf7a3e8018..f931c66c569 100644 --- a/samples/client/petstore/java/docs/components/schemas/Drawing.md +++ b/samples/client/petstore/java/docs/components/schemas/Drawing.md @@ -4,7 +4,7 @@ public class Drawing
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated list payloads, extends FrozenList - classes to build inputs for list payloads @@ -14,39 +14,40 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Drawing.Drawing1Boxed](#drawing1boxed)
abstract sealed validated payload class | -| static class | [Drawing.Drawing1BoxedMap](#drawing1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [Drawing.Drawing1Boxed](#drawing1boxed)
sealed interface for validated payloads | +| record | [Drawing.Drawing1BoxedMap](#drawing1boxedmap)
boxed class to store validated Map payloads | | static class | [Drawing.Drawing1](#drawing1)
schema class | | static class | [Drawing.DrawingMapBuilder](#drawingmapbuilder)
builder for Map payloads | | static class | [Drawing.DrawingMap](#drawingmap)
output class for Map payloads | -| static class | [Drawing.ShapesBoxed](#shapesboxed)
abstract sealed validated payload class | -| static class | [Drawing.ShapesBoxedList](#shapesboxedlist)
boxed class to store validated List payloads | +| sealed interface | [Drawing.ShapesBoxed](#shapesboxed)
sealed interface for validated payloads | +| record | [Drawing.ShapesBoxedList](#shapesboxedlist)
boxed class to store validated List payloads | | static class | [Drawing.Shapes](#shapes)
schema class | | static class | [Drawing.ShapesListBuilder](#shapeslistbuilder)
builder for List payloads | | static class | [Drawing.ShapesList](#shapeslist)
output class for List payloads | ## Drawing1Boxed -public static abstract sealed class Drawing1Boxed
+public sealed interface Drawing1Boxed
permits
[Drawing1BoxedMap](#drawing1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Drawing1BoxedMap -public static final class Drawing1BoxedMap
-extends [Drawing1Boxed](#drawing1boxed) +public record Drawing1BoxedMap
+implements [Drawing1Boxed](#drawing1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Drawing1BoxedMap([DrawingMap](#drawingmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [DrawingMap](#drawingmap) | data
validated payload | +| [DrawingMap](#drawingmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Drawing1 public static class Drawing1
@@ -94,7 +95,9 @@ Drawing.DrawingMap validatedPayload = | ----------------- | ---------------------- | | [DrawingMap](#drawingmap) | validate([Map<?, ?>](#drawingmapbuilder) arg, SchemaConfiguration configuration) | | [Drawing1BoxedMap](#drawing1boxedmap) | validateAndBox([Map<?, ?>](#drawingmapbuilder) arg, SchemaConfiguration configuration) | +| [Drawing1Boxed](#drawing1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## DrawingMapBuilder public class DrawingMapBuilder
builder for `Map` @@ -165,27 +168,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## ShapesBoxed -public static abstract sealed class ShapesBoxed
+public sealed interface ShapesBoxed
permits
[ShapesBoxedList](#shapesboxedlist) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ShapesBoxedList -public static final class ShapesBoxedList
-extends [ShapesBoxed](#shapesboxed) +public record ShapesBoxedList
+implements [ShapesBoxed](#shapesboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ShapesBoxedList([ShapesList](#shapeslist) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [ShapesList](#shapeslist) | data
validated payload | +| [ShapesList](#shapeslist) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Shapes public static class Shapes
@@ -228,7 +232,9 @@ Drawing.ShapesList validatedPayload = | ----------------- | ---------------------- | | [ShapesList](#shapeslist) | validate([List](#shapeslistbuilder) arg, SchemaConfiguration configuration) | | [ShapesBoxedList](#shapesboxedlist) | validateAndBox([List](#shapeslistbuilder) arg, SchemaConfiguration configuration) | +| [ShapesBoxed](#shapesboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ShapesListBuilder public class ShapesListBuilder
builder for `List<@Nullable Object>` diff --git a/samples/client/petstore/java/docs/components/schemas/EnumArrays.md b/samples/client/petstore/java/docs/components/schemas/EnumArrays.md index 983376c2f79..60e55b10c9b 100644 --- a/samples/client/petstore/java/docs/components/schemas/EnumArrays.md +++ b/samples/client/petstore/java/docs/components/schemas/EnumArrays.md @@ -4,7 +4,7 @@ public class EnumArrays
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated list payloads, extends FrozenList - classes to build inputs for list payloads @@ -15,47 +15,48 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [EnumArrays.EnumArrays1Boxed](#enumarrays1boxed)
abstract sealed validated payload class | -| static class | [EnumArrays.EnumArrays1BoxedMap](#enumarrays1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [EnumArrays.EnumArrays1Boxed](#enumarrays1boxed)
sealed interface for validated payloads | +| record | [EnumArrays.EnumArrays1BoxedMap](#enumarrays1boxedmap)
boxed class to store validated Map payloads | | static class | [EnumArrays.EnumArrays1](#enumarrays1)
schema class | | static class | [EnumArrays.EnumArraysMapBuilder](#enumarraysmapbuilder)
builder for Map payloads | | static class | [EnumArrays.EnumArraysMap](#enumarraysmap)
output class for Map payloads | -| static class | [EnumArrays.ArrayEnumBoxed](#arrayenumboxed)
abstract sealed validated payload class | -| static class | [EnumArrays.ArrayEnumBoxedList](#arrayenumboxedlist)
boxed class to store validated List payloads | +| sealed interface | [EnumArrays.ArrayEnumBoxed](#arrayenumboxed)
sealed interface for validated payloads | +| record | [EnumArrays.ArrayEnumBoxedList](#arrayenumboxedlist)
boxed class to store validated List payloads | | static class | [EnumArrays.ArrayEnum](#arrayenum)
schema class | | static class | [EnumArrays.ArrayEnumListBuilder](#arrayenumlistbuilder)
builder for List payloads | | static class | [EnumArrays.ArrayEnumList](#arrayenumlist)
output class for List payloads | -| static class | [EnumArrays.ItemsBoxed](#itemsboxed)
abstract sealed validated payload class | -| static class | [EnumArrays.ItemsBoxedString](#itemsboxedstring)
boxed class to store validated String payloads | +| sealed interface | [EnumArrays.ItemsBoxed](#itemsboxed)
sealed interface for validated payloads | +| record | [EnumArrays.ItemsBoxedString](#itemsboxedstring)
boxed class to store validated String payloads | | static class | [EnumArrays.Items](#items)
schema class | | enum | [EnumArrays.StringItemsEnums](#stringitemsenums)
String enum | -| static class | [EnumArrays.JustSymbolBoxed](#justsymbolboxed)
abstract sealed validated payload class | -| static class | [EnumArrays.JustSymbolBoxedString](#justsymbolboxedstring)
boxed class to store validated String payloads | +| sealed interface | [EnumArrays.JustSymbolBoxed](#justsymbolboxed)
sealed interface for validated payloads | +| record | [EnumArrays.JustSymbolBoxedString](#justsymbolboxedstring)
boxed class to store validated String payloads | | static class | [EnumArrays.JustSymbol](#justsymbol)
schema class | | enum | [EnumArrays.StringJustSymbolEnums](#stringjustsymbolenums)
String enum | ## EnumArrays1Boxed -public static abstract sealed class EnumArrays1Boxed
+public sealed interface EnumArrays1Boxed
permits
[EnumArrays1BoxedMap](#enumarrays1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## EnumArrays1BoxedMap -public static final class EnumArrays1BoxedMap
-extends [EnumArrays1Boxed](#enumarrays1boxed) +public record EnumArrays1BoxedMap
+implements [EnumArrays1Boxed](#enumarrays1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | EnumArrays1BoxedMap([EnumArraysMap](#enumarraysmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [EnumArraysMap](#enumarraysmap) | data
validated payload | +| [EnumArraysMap](#enumarraysmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## EnumArrays1 public static class EnumArrays1
@@ -105,7 +106,9 @@ EnumArrays.EnumArraysMap validatedPayload = | ----------------- | ---------------------- | | [EnumArraysMap](#enumarraysmap) | validate([Map<?, ?>](#enumarraysmapbuilder) arg, SchemaConfiguration configuration) | | [EnumArrays1BoxedMap](#enumarrays1boxedmap) | validateAndBox([Map<?, ?>](#enumarraysmapbuilder) arg, SchemaConfiguration configuration) | +| [EnumArrays1Boxed](#enumarrays1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## EnumArraysMapBuilder public class EnumArraysMapBuilder
builder for `Map` @@ -149,27 +152,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## ArrayEnumBoxed -public static abstract sealed class ArrayEnumBoxed
+public sealed interface ArrayEnumBoxed
permits
[ArrayEnumBoxedList](#arrayenumboxedlist) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ArrayEnumBoxedList -public static final class ArrayEnumBoxedList
-extends [ArrayEnumBoxed](#arrayenumboxed) +public record ArrayEnumBoxedList
+implements [ArrayEnumBoxed](#arrayenumboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ArrayEnumBoxedList([ArrayEnumList](#arrayenumlist) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [ArrayEnumList](#arrayenumlist) | data
validated payload | +| [ArrayEnumList](#arrayenumlist) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ArrayEnum public static class ArrayEnum
@@ -214,7 +218,9 @@ EnumArrays.ArrayEnumList validatedPayload = | ----------------- | ---------------------- | | [ArrayEnumList](#arrayenumlist) | validate([List](#arrayenumlistbuilder) arg, SchemaConfiguration configuration) | | [ArrayEnumBoxedList](#arrayenumboxedlist) | validateAndBox([List](#arrayenumlistbuilder) arg, SchemaConfiguration configuration) | +| [ArrayEnumBoxed](#arrayenumboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ArrayEnumListBuilder public class ArrayEnumListBuilder
builder for `List` @@ -246,27 +252,28 @@ A class to store validated List payloads | static [ArrayEnumList](#arrayenumlist) | of([List](#arrayenumlistbuilder) arg, SchemaConfiguration configuration) | ## ItemsBoxed -public static abstract sealed class ItemsBoxed
+public sealed interface ItemsBoxed
permits
[ItemsBoxedString](#itemsboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ItemsBoxedString -public static final class ItemsBoxedString
-extends [ItemsBoxed](#itemsboxed) +public record ItemsBoxedString
+implements [ItemsBoxed](#itemsboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ItemsBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Items public static class Items
@@ -308,7 +315,9 @@ String validatedPayload = EnumArrays.Items.validate( | String | validate(String arg, SchemaConfiguration configuration) | | String | validate([StringItemsEnums](#stringitemsenums) arg, SchemaConfiguration configuration) | | [ItemsBoxedString](#itemsboxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [ItemsBoxed](#itemsboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## StringItemsEnums public enum StringItemsEnums
extends `Enum` @@ -322,27 +331,28 @@ A class that stores String enum values | CRAB | value = "crab" | ## JustSymbolBoxed -public static abstract sealed class JustSymbolBoxed
+public sealed interface JustSymbolBoxed
permits
[JustSymbolBoxedString](#justsymbolboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## JustSymbolBoxedString -public static final class JustSymbolBoxedString
-extends [JustSymbolBoxed](#justsymbolboxed) +public record JustSymbolBoxedString
+implements [JustSymbolBoxed](#justsymbolboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | JustSymbolBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## JustSymbol public static class JustSymbol
@@ -384,7 +394,9 @@ String validatedPayload = EnumArrays.JustSymbol.validate( | String | validate(String arg, SchemaConfiguration configuration) | | String | validate([StringJustSymbolEnums](#stringjustsymbolenums) arg, SchemaConfiguration configuration) | | [JustSymbolBoxedString](#justsymbolboxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [JustSymbolBoxed](#justsymbolboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## StringJustSymbolEnums public enum StringJustSymbolEnums
extends `Enum` diff --git a/samples/client/petstore/java/docs/components/schemas/EnumClass.md b/samples/client/petstore/java/docs/components/schemas/EnumClass.md index 27c81145102..3dfb17ec91e 100644 --- a/samples/client/petstore/java/docs/components/schemas/EnumClass.md +++ b/samples/client/petstore/java/docs/components/schemas/EnumClass.md @@ -4,40 +4,41 @@ public class EnumClass
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - enum classes ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [EnumClass.EnumClass1Boxed](#enumclass1boxed)
abstract sealed validated payload class | -| static class | [EnumClass.EnumClass1BoxedString](#enumclass1boxedstring)
boxed class to store validated String payloads | +| sealed interface | [EnumClass.EnumClass1Boxed](#enumclass1boxed)
sealed interface for validated payloads | +| record | [EnumClass.EnumClass1BoxedString](#enumclass1boxedstring)
boxed class to store validated String payloads | | static class | [EnumClass.EnumClass1](#enumclass1)
schema class | | enum | [EnumClass.StringEnumClassEnums](#stringenumclassenums)
String enum | ## EnumClass1Boxed -public static abstract sealed class EnumClass1Boxed
+public sealed interface EnumClass1Boxed
permits
[EnumClass1BoxedString](#enumclass1boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## EnumClass1BoxedString -public static final class EnumClass1BoxedString
-extends [EnumClass1Boxed](#enumclass1boxed) +public record EnumClass1BoxedString
+implements [EnumClass1Boxed](#enumclass1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | EnumClass1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## EnumClass1 public static class EnumClass1
@@ -80,7 +81,9 @@ String validatedPayload = EnumClass.EnumClass1.validate( | String | validate(String arg, SchemaConfiguration configuration) | | String | validate([StringEnumClassEnums](#stringenumclassenums) arg, SchemaConfiguration configuration) | | [EnumClass1BoxedString](#enumclass1boxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [EnumClass1Boxed](#enumclass1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## StringEnumClassEnums public enum StringEnumClassEnums
extends `Enum` diff --git a/samples/client/petstore/java/docs/components/schemas/EnumTest.md b/samples/client/petstore/java/docs/components/schemas/EnumTest.md index 4675be9f71a..a69890dbfc1 100644 --- a/samples/client/petstore/java/docs/components/schemas/EnumTest.md +++ b/samples/client/petstore/java/docs/components/schemas/EnumTest.md @@ -4,7 +4,7 @@ public class EnumTest
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -13,54 +13,55 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [EnumTest.EnumTest1Boxed](#enumtest1boxed)
abstract sealed validated payload class | -| static class | [EnumTest.EnumTest1BoxedMap](#enumtest1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [EnumTest.EnumTest1Boxed](#enumtest1boxed)
sealed interface for validated payloads | +| record | [EnumTest.EnumTest1BoxedMap](#enumtest1boxedmap)
boxed class to store validated Map payloads | | static class | [EnumTest.EnumTest1](#enumtest1)
schema class | | static class | [EnumTest.EnumTestMapBuilder](#enumtestmapbuilder)
builder for Map payloads | | static class | [EnumTest.EnumTestMap](#enumtestmap)
output class for Map payloads | -| static class | [EnumTest.EnumNumberBoxed](#enumnumberboxed)
abstract sealed validated payload class | -| static class | [EnumTest.EnumNumberBoxedNumber](#enumnumberboxednumber)
boxed class to store validated Number payloads | +| sealed interface | [EnumTest.EnumNumberBoxed](#enumnumberboxed)
sealed interface for validated payloads | +| record | [EnumTest.EnumNumberBoxedNumber](#enumnumberboxednumber)
boxed class to store validated Number payloads | | static class | [EnumTest.EnumNumber](#enumnumber)
schema class | | enum | [EnumTest.DoubleEnumNumberEnums](#doubleenumnumberenums)
Double enum | | enum | [EnumTest.FloatEnumNumberEnums](#floatenumnumberenums)
Float enum | -| static class | [EnumTest.EnumIntegerBoxed](#enumintegerboxed)
abstract sealed validated payload class | -| static class | [EnumTest.EnumIntegerBoxedNumber](#enumintegerboxednumber)
boxed class to store validated Number payloads | +| sealed interface | [EnumTest.EnumIntegerBoxed](#enumintegerboxed)
sealed interface for validated payloads | +| record | [EnumTest.EnumIntegerBoxedNumber](#enumintegerboxednumber)
boxed class to store validated Number payloads | | static class | [EnumTest.EnumInteger](#enuminteger)
schema class | | enum | [EnumTest.IntegerEnumIntegerEnums](#integerenumintegerenums)
Integer enum | | enum | [EnumTest.LongEnumIntegerEnums](#longenumintegerenums)
Long enum | | enum | [EnumTest.FloatEnumIntegerEnums](#floatenumintegerenums)
Float enum | | enum | [EnumTest.DoubleEnumIntegerEnums](#doubleenumintegerenums)
Double enum | -| static class | [EnumTest.EnumStringRequiredBoxed](#enumstringrequiredboxed)
abstract sealed validated payload class | -| static class | [EnumTest.EnumStringRequiredBoxedString](#enumstringrequiredboxedstring)
boxed class to store validated String payloads | +| sealed interface | [EnumTest.EnumStringRequiredBoxed](#enumstringrequiredboxed)
sealed interface for validated payloads | +| record | [EnumTest.EnumStringRequiredBoxedString](#enumstringrequiredboxedstring)
boxed class to store validated String payloads | | static class | [EnumTest.EnumStringRequired](#enumstringrequired)
schema class | | enum | [EnumTest.StringEnumStringRequiredEnums](#stringenumstringrequiredenums)
String enum | -| static class | [EnumTest.EnumStringBoxed](#enumstringboxed)
abstract sealed validated payload class | -| static class | [EnumTest.EnumStringBoxedString](#enumstringboxedstring)
boxed class to store validated String payloads | +| sealed interface | [EnumTest.EnumStringBoxed](#enumstringboxed)
sealed interface for validated payloads | +| record | [EnumTest.EnumStringBoxedString](#enumstringboxedstring)
boxed class to store validated String payloads | | static class | [EnumTest.EnumString](#enumstring)
schema class | | enum | [EnumTest.StringEnumStringEnums](#stringenumstringenums)
String enum | ## EnumTest1Boxed -public static abstract sealed class EnumTest1Boxed
+public sealed interface EnumTest1Boxed
permits
[EnumTest1BoxedMap](#enumtest1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## EnumTest1BoxedMap -public static final class EnumTest1BoxedMap
-extends [EnumTest1Boxed](#enumtest1boxed) +public record EnumTest1BoxedMap
+implements [EnumTest1Boxed](#enumtest1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | EnumTest1BoxedMap([EnumTestMap](#enumtestmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [EnumTestMap](#enumtestmap) | data
validated payload | +| [EnumTestMap](#enumtestmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## EnumTest1 public static class EnumTest1
@@ -112,7 +113,9 @@ EnumTest.EnumTestMap validatedPayload = | ----------------- | ---------------------- | | [EnumTestMap](#enumtestmap) | validate([Map<?, ?>](#enumtestmapbuilder) arg, SchemaConfiguration configuration) | | [EnumTest1BoxedMap](#enumtest1boxedmap) | validateAndBox([Map<?, ?>](#enumtestmapbuilder) arg, SchemaConfiguration configuration) | +| [EnumTest1Boxed](#enumtest1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## EnumTestMap0Builder public class EnumTestMap0Builder
builder for `Map` @@ -221,27 +224,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## EnumNumberBoxed -public static abstract sealed class EnumNumberBoxed
+public sealed interface EnumNumberBoxed
permits
[EnumNumberBoxedNumber](#enumnumberboxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## EnumNumberBoxedNumber -public static final class EnumNumberBoxedNumber
-extends [EnumNumberBoxed](#enumnumberboxed) +public record EnumNumberBoxedNumber
+implements [EnumNumberBoxed](#enumnumberboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | EnumNumberBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## EnumNumber public static class EnumNumber
@@ -283,7 +287,9 @@ double validatedPayload = EnumTest.EnumNumber.validate( | ----------------- | ---------------------- | | double | validate(double arg, SchemaConfiguration configuration) | | [EnumNumberBoxedNumber](#enumnumberboxednumber) | validateAndBox(Number arg, SchemaConfiguration configuration) | +| [EnumNumberBoxed](#enumnumberboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## DoubleEnumNumberEnums public enum DoubleEnumNumberEnums
extends `Enum` @@ -309,27 +315,28 @@ A class that stores Float enum values | NEGATIVE_1_PT_2 | value = -1.2f | ## EnumIntegerBoxed -public static abstract sealed class EnumIntegerBoxed
+public sealed interface EnumIntegerBoxed
permits
[EnumIntegerBoxedNumber](#enumintegerboxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## EnumIntegerBoxedNumber -public static final class EnumIntegerBoxedNumber
-extends [EnumIntegerBoxed](#enumintegerboxed) +public record EnumIntegerBoxedNumber
+implements [EnumIntegerBoxed](#enumintegerboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | EnumIntegerBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## EnumInteger public static class EnumInteger
@@ -371,7 +378,9 @@ int validatedPayload = EnumTest.EnumInteger.validate( | ----------------- | ---------------------- | | int | validate(int arg, SchemaConfiguration configuration) | | [EnumIntegerBoxedNumber](#enumintegerboxednumber) | validateAndBox(Number arg, SchemaConfiguration configuration) | +| [EnumIntegerBoxed](#enumintegerboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## IntegerEnumIntegerEnums public enum IntegerEnumIntegerEnums
extends `Enum` @@ -421,27 +430,28 @@ A class that stores Double enum values | NEGATIVE_1 | value = -1.0d | ## EnumStringRequiredBoxed -public static abstract sealed class EnumStringRequiredBoxed
+public sealed interface EnumStringRequiredBoxed
permits
[EnumStringRequiredBoxedString](#enumstringrequiredboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## EnumStringRequiredBoxedString -public static final class EnumStringRequiredBoxedString
-extends [EnumStringRequiredBoxed](#enumstringrequiredboxed) +public record EnumStringRequiredBoxedString
+implements [EnumStringRequiredBoxed](#enumstringrequiredboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | EnumStringRequiredBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## EnumStringRequired public static class EnumStringRequired
@@ -483,7 +493,9 @@ String validatedPayload = EnumTest.EnumStringRequired.validate( | String | validate(String arg, SchemaConfiguration configuration) | | String | validate([StringEnumStringRequiredEnums](#stringenumstringrequiredenums) arg, SchemaConfiguration configuration) | | [EnumStringRequiredBoxedString](#enumstringrequiredboxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [EnumStringRequiredBoxed](#enumstringrequiredboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## StringEnumStringRequiredEnums public enum StringEnumStringRequiredEnums
extends `Enum` @@ -498,27 +510,28 @@ A class that stores String enum values | EMPTY | value = "" | ## EnumStringBoxed -public static abstract sealed class EnumStringBoxed
+public sealed interface EnumStringBoxed
permits
[EnumStringBoxedString](#enumstringboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## EnumStringBoxedString -public static final class EnumStringBoxedString
-extends [EnumStringBoxed](#enumstringboxed) +public record EnumStringBoxedString
+implements [EnumStringBoxed](#enumstringboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | EnumStringBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## EnumString public static class EnumString
@@ -560,7 +573,9 @@ String validatedPayload = EnumTest.EnumString.validate( | String | validate(String arg, SchemaConfiguration configuration) | | String | validate([StringEnumStringEnums](#stringenumstringenums) arg, SchemaConfiguration configuration) | | [EnumStringBoxedString](#enumstringboxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [EnumStringBoxed](#enumstringboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## StringEnumStringEnums public enum StringEnumStringEnums
extends `Enum` diff --git a/samples/client/petstore/java/docs/components/schemas/EquilateralTriangle.md b/samples/client/petstore/java/docs/components/schemas/EquilateralTriangle.md index 243be1504b0..23acc88f5c6 100644 --- a/samples/client/petstore/java/docs/components/schemas/EquilateralTriangle.md +++ b/samples/client/petstore/java/docs/components/schemas/EquilateralTriangle.md @@ -4,7 +4,7 @@ public class EquilateralTriangle
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -13,26 +13,26 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [EquilateralTriangle.EquilateralTriangle1Boxed](#equilateraltriangle1boxed)
abstract sealed validated payload class | -| static class | [EquilateralTriangle.EquilateralTriangle1BoxedVoid](#equilateraltriangle1boxedvoid)
boxed class to store validated null payloads | -| static class | [EquilateralTriangle.EquilateralTriangle1BoxedBoolean](#equilateraltriangle1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [EquilateralTriangle.EquilateralTriangle1BoxedNumber](#equilateraltriangle1boxednumber)
boxed class to store validated Number payloads | -| static class | [EquilateralTriangle.EquilateralTriangle1BoxedString](#equilateraltriangle1boxedstring)
boxed class to store validated String payloads | -| static class | [EquilateralTriangle.EquilateralTriangle1BoxedList](#equilateraltriangle1boxedlist)
boxed class to store validated List payloads | -| static class | [EquilateralTriangle.EquilateralTriangle1BoxedMap](#equilateraltriangle1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [EquilateralTriangle.EquilateralTriangle1Boxed](#equilateraltriangle1boxed)
sealed interface for validated payloads | +| record | [EquilateralTriangle.EquilateralTriangle1BoxedVoid](#equilateraltriangle1boxedvoid)
boxed class to store validated null payloads | +| record | [EquilateralTriangle.EquilateralTriangle1BoxedBoolean](#equilateraltriangle1boxedboolean)
boxed class to store validated boolean payloads | +| record | [EquilateralTriangle.EquilateralTriangle1BoxedNumber](#equilateraltriangle1boxednumber)
boxed class to store validated Number payloads | +| record | [EquilateralTriangle.EquilateralTriangle1BoxedString](#equilateraltriangle1boxedstring)
boxed class to store validated String payloads | +| record | [EquilateralTriangle.EquilateralTriangle1BoxedList](#equilateraltriangle1boxedlist)
boxed class to store validated List payloads | +| record | [EquilateralTriangle.EquilateralTriangle1BoxedMap](#equilateraltriangle1boxedmap)
boxed class to store validated Map payloads | | static class | [EquilateralTriangle.EquilateralTriangle1](#equilateraltriangle1)
schema class | -| static class | [EquilateralTriangle.Schema1Boxed](#schema1boxed)
abstract sealed validated payload class | -| static class | [EquilateralTriangle.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [EquilateralTriangle.Schema1Boxed](#schema1boxed)
sealed interface for validated payloads | +| record | [EquilateralTriangle.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | | static class | [EquilateralTriangle.Schema1](#schema1)
schema class | | static class | [EquilateralTriangle.Schema1MapBuilder](#schema1mapbuilder)
builder for Map payloads | | static class | [EquilateralTriangle.Schema1Map](#schema1map)
output class for Map payloads | -| static class | [EquilateralTriangle.TriangleTypeBoxed](#triangletypeboxed)
abstract sealed validated payload class | -| static class | [EquilateralTriangle.TriangleTypeBoxedString](#triangletypeboxedstring)
boxed class to store validated String payloads | +| sealed interface | [EquilateralTriangle.TriangleTypeBoxed](#triangletypeboxed)
sealed interface for validated payloads | +| record | [EquilateralTriangle.TriangleTypeBoxedString](#triangletypeboxedstring)
boxed class to store validated String payloads | | static class | [EquilateralTriangle.TriangleType](#triangletype)
schema class | | enum | [EquilateralTriangle.StringTriangleTypeEnums](#stringtriangletypeenums)
String enum | ## EquilateralTriangle1Boxed -public static abstract sealed class EquilateralTriangle1Boxed
+public sealed interface EquilateralTriangle1Boxed
permits
[EquilateralTriangle1BoxedVoid](#equilateraltriangle1boxedvoid), [EquilateralTriangle1BoxedBoolean](#equilateraltriangle1boxedboolean), @@ -41,103 +41,109 @@ permits
[EquilateralTriangle1BoxedList](#equilateraltriangle1boxedlist), [EquilateralTriangle1BoxedMap](#equilateraltriangle1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## EquilateralTriangle1BoxedVoid -public static final class EquilateralTriangle1BoxedVoid
-extends [EquilateralTriangle1Boxed](#equilateraltriangle1boxed) +public record EquilateralTriangle1BoxedVoid
+implements [EquilateralTriangle1Boxed](#equilateraltriangle1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | EquilateralTriangle1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## EquilateralTriangle1BoxedBoolean -public static final class EquilateralTriangle1BoxedBoolean
-extends [EquilateralTriangle1Boxed](#equilateraltriangle1boxed) +public record EquilateralTriangle1BoxedBoolean
+implements [EquilateralTriangle1Boxed](#equilateraltriangle1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | EquilateralTriangle1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## EquilateralTriangle1BoxedNumber -public static final class EquilateralTriangle1BoxedNumber
-extends [EquilateralTriangle1Boxed](#equilateraltriangle1boxed) +public record EquilateralTriangle1BoxedNumber
+implements [EquilateralTriangle1Boxed](#equilateraltriangle1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | EquilateralTriangle1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## EquilateralTriangle1BoxedString -public static final class EquilateralTriangle1BoxedString
-extends [EquilateralTriangle1Boxed](#equilateraltriangle1boxed) +public record EquilateralTriangle1BoxedString
+implements [EquilateralTriangle1Boxed](#equilateraltriangle1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | EquilateralTriangle1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## EquilateralTriangle1BoxedList -public static final class EquilateralTriangle1BoxedList
-extends [EquilateralTriangle1Boxed](#equilateraltriangle1boxed) +public record EquilateralTriangle1BoxedList
+implements [EquilateralTriangle1Boxed](#equilateraltriangle1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | EquilateralTriangle1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## EquilateralTriangle1BoxedMap -public static final class EquilateralTriangle1BoxedMap
-extends [EquilateralTriangle1Boxed](#equilateraltriangle1boxed) +public record EquilateralTriangle1BoxedMap
+implements [EquilateralTriangle1Boxed](#equilateraltriangle1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | EquilateralTriangle1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## EquilateralTriangle1 public static class EquilateralTriangle1
@@ -169,29 +175,32 @@ A schema class that validates payloads | [EquilateralTriangle1BoxedBoolean](#equilateraltriangle1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [EquilateralTriangle1BoxedMap](#equilateraltriangle1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [EquilateralTriangle1BoxedList](#equilateraltriangle1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [EquilateralTriangle1Boxed](#equilateraltriangle1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema1Boxed -public static abstract sealed class Schema1Boxed
+public sealed interface Schema1Boxed
permits
[Schema1BoxedMap](#schema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema1BoxedMap -public static final class Schema1BoxedMap
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedMap
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedMap([Schema1Map](#schema1map) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [Schema1Map](#schema1map) | data
validated payload | +| [Schema1Map](#schema1map) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1 public static class Schema1
@@ -236,7 +245,9 @@ EquilateralTriangle.Schema1Map validatedPayload = | ----------------- | ---------------------- | | [Schema1Map](#schema1map) | validate([Map<?, ?>](#schema1mapbuilder) arg, SchemaConfiguration configuration) | | [Schema1BoxedMap](#schema1boxedmap) | validateAndBox([Map<?, ?>](#schema1mapbuilder) arg, SchemaConfiguration configuration) | +| [Schema1Boxed](#schema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema1MapBuilder public class Schema1MapBuilder
builder for `Map` @@ -278,27 +289,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## TriangleTypeBoxed -public static abstract sealed class TriangleTypeBoxed
+public sealed interface TriangleTypeBoxed
permits
[TriangleTypeBoxedString](#triangletypeboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## TriangleTypeBoxedString -public static final class TriangleTypeBoxedString
-extends [TriangleTypeBoxed](#triangletypeboxed) +public record TriangleTypeBoxedString
+implements [TriangleTypeBoxed](#triangletypeboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | TriangleTypeBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## TriangleType public static class TriangleType
@@ -340,7 +352,9 @@ String validatedPayload = EquilateralTriangle.TriangleType.validate( | String | validate(String arg, SchemaConfiguration configuration) | | String | validate([StringTriangleTypeEnums](#stringtriangletypeenums) arg, SchemaConfiguration configuration) | | [TriangleTypeBoxedString](#triangletypeboxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [TriangleTypeBoxed](#triangletypeboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## StringTriangleTypeEnums public enum StringTriangleTypeEnums
extends `Enum` diff --git a/samples/client/petstore/java/docs/components/schemas/File.md b/samples/client/petstore/java/docs/components/schemas/File.md index 56e9bfc5c30..f0cf7f6e0c4 100644 --- a/samples/client/petstore/java/docs/components/schemas/File.md +++ b/samples/client/petstore/java/docs/components/schemas/File.md @@ -4,7 +4,7 @@ public class File
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,37 +12,38 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [File.File1Boxed](#file1boxed)
abstract sealed validated payload class | -| static class | [File.File1BoxedMap](#file1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [File.File1Boxed](#file1boxed)
sealed interface for validated payloads | +| record | [File.File1BoxedMap](#file1boxedmap)
boxed class to store validated Map payloads | | static class | [File.File1](#file1)
schema class | | static class | [File.FileMapBuilder](#filemapbuilder)
builder for Map payloads | | static class | [File.FileMap](#filemap)
output class for Map payloads | -| static class | [File.SourceURIBoxed](#sourceuriboxed)
abstract sealed validated payload class | -| static class | [File.SourceURIBoxedString](#sourceuriboxedstring)
boxed class to store validated String payloads | +| sealed interface | [File.SourceURIBoxed](#sourceuriboxed)
sealed interface for validated payloads | +| record | [File.SourceURIBoxedString](#sourceuriboxedstring)
boxed class to store validated String payloads | | static class | [File.SourceURI](#sourceuri)
schema class | ## File1Boxed -public static abstract sealed class File1Boxed
+public sealed interface File1Boxed
permits
[File1BoxedMap](#file1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## File1BoxedMap -public static final class File1BoxedMap
-extends [File1Boxed](#file1boxed) +public record File1BoxedMap
+implements [File1Boxed](#file1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | File1BoxedMap([FileMap](#filemap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [FileMap](#filemap) | data
validated payload | +| [FileMap](#filemap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## File1 public static class File1
@@ -90,7 +91,9 @@ File.FileMap validatedPayload = | ----------------- | ---------------------- | | [FileMap](#filemap) | validate([Map<?, ?>](#filemapbuilder) arg, SchemaConfiguration configuration) | | [File1BoxedMap](#file1boxedmap) | validateAndBox([Map<?, ?>](#filemapbuilder) arg, SchemaConfiguration configuration) | +| [File1Boxed](#file1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## FileMapBuilder public class FileMapBuilder
builder for `Map` @@ -131,27 +134,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## SourceURIBoxed -public static abstract sealed class SourceURIBoxed
+public sealed interface SourceURIBoxed
permits
[SourceURIBoxedString](#sourceuriboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## SourceURIBoxedString -public static final class SourceURIBoxedString
-extends [SourceURIBoxed](#sourceuriboxed) +public record SourceURIBoxedString
+implements [SourceURIBoxed](#sourceuriboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | SourceURIBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## SourceURI public static class SourceURI
diff --git a/samples/client/petstore/java/docs/components/schemas/FileSchemaTestClass.md b/samples/client/petstore/java/docs/components/schemas/FileSchemaTestClass.md index 429a58d9729..b1234e96acf 100644 --- a/samples/client/petstore/java/docs/components/schemas/FileSchemaTestClass.md +++ b/samples/client/petstore/java/docs/components/schemas/FileSchemaTestClass.md @@ -4,7 +4,7 @@ public class FileSchemaTestClass
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated list payloads, extends FrozenList - classes to build inputs for list payloads @@ -14,39 +14,40 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [FileSchemaTestClass.FileSchemaTestClass1Boxed](#fileschematestclass1boxed)
abstract sealed validated payload class | -| static class | [FileSchemaTestClass.FileSchemaTestClass1BoxedMap](#fileschematestclass1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [FileSchemaTestClass.FileSchemaTestClass1Boxed](#fileschematestclass1boxed)
sealed interface for validated payloads | +| record | [FileSchemaTestClass.FileSchemaTestClass1BoxedMap](#fileschematestclass1boxedmap)
boxed class to store validated Map payloads | | static class | [FileSchemaTestClass.FileSchemaTestClass1](#fileschematestclass1)
schema class | | static class | [FileSchemaTestClass.FileSchemaTestClassMapBuilder](#fileschematestclassmapbuilder)
builder for Map payloads | | static class | [FileSchemaTestClass.FileSchemaTestClassMap](#fileschematestclassmap)
output class for Map payloads | -| static class | [FileSchemaTestClass.FilesBoxed](#filesboxed)
abstract sealed validated payload class | -| static class | [FileSchemaTestClass.FilesBoxedList](#filesboxedlist)
boxed class to store validated List payloads | +| sealed interface | [FileSchemaTestClass.FilesBoxed](#filesboxed)
sealed interface for validated payloads | +| record | [FileSchemaTestClass.FilesBoxedList](#filesboxedlist)
boxed class to store validated List payloads | | static class | [FileSchemaTestClass.Files](#files)
schema class | | static class | [FileSchemaTestClass.FilesListBuilder](#fileslistbuilder)
builder for List payloads | | static class | [FileSchemaTestClass.FilesList](#fileslist)
output class for List payloads | ## FileSchemaTestClass1Boxed -public static abstract sealed class FileSchemaTestClass1Boxed
+public sealed interface FileSchemaTestClass1Boxed
permits
[FileSchemaTestClass1BoxedMap](#fileschematestclass1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## FileSchemaTestClass1BoxedMap -public static final class FileSchemaTestClass1BoxedMap
-extends [FileSchemaTestClass1Boxed](#fileschematestclass1boxed) +public record FileSchemaTestClass1BoxedMap
+implements [FileSchemaTestClass1Boxed](#fileschematestclass1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FileSchemaTestClass1BoxedMap([FileSchemaTestClassMap](#fileschematestclassmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [FileSchemaTestClassMap](#fileschematestclassmap) | data
validated payload | +| [FileSchemaTestClassMap](#fileschematestclassmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FileSchemaTestClass1 public static class FileSchemaTestClass1
@@ -93,7 +94,9 @@ FileSchemaTestClass.FileSchemaTestClassMap validatedPayload = | ----------------- | ---------------------- | | [FileSchemaTestClassMap](#fileschematestclassmap) | validate([Map<?, ?>](#fileschematestclassmapbuilder) arg, SchemaConfiguration configuration) | | [FileSchemaTestClass1BoxedMap](#fileschematestclass1boxedmap) | validateAndBox([Map<?, ?>](#fileschematestclassmapbuilder) arg, SchemaConfiguration configuration) | +| [FileSchemaTestClass1Boxed](#fileschematestclass1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## FileSchemaTestClassMapBuilder public class FileSchemaTestClassMapBuilder
builder for `Map` @@ -136,27 +139,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## FilesBoxed -public static abstract sealed class FilesBoxed
+public sealed interface FilesBoxed
permits
[FilesBoxedList](#filesboxedlist) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## FilesBoxedList -public static final class FilesBoxedList
-extends [FilesBoxed](#filesboxed) +public record FilesBoxedList
+implements [FilesBoxed](#filesboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FilesBoxedList([FilesList](#fileslist) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [FilesList](#fileslist) | data
validated payload | +| [FilesList](#fileslist) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Files public static class Files
@@ -199,7 +203,9 @@ FileSchemaTestClass.FilesList validatedPayload = | ----------------- | ---------------------- | | [FilesList](#fileslist) | validate([List](#fileslistbuilder) arg, SchemaConfiguration configuration) | | [FilesBoxedList](#filesboxedlist) | validateAndBox([List](#fileslistbuilder) arg, SchemaConfiguration configuration) | +| [FilesBoxed](#filesboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## FilesListBuilder public class FilesListBuilder
builder for `List>` diff --git a/samples/client/petstore/java/docs/components/schemas/Foo.md b/samples/client/petstore/java/docs/components/schemas/Foo.md index 764c64fc88f..7b0137b56fd 100644 --- a/samples/client/petstore/java/docs/components/schemas/Foo.md +++ b/samples/client/petstore/java/docs/components/schemas/Foo.md @@ -4,7 +4,7 @@ public class Foo
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,34 +12,35 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Foo.Foo1Boxed](#foo1boxed)
abstract sealed validated payload class | -| static class | [Foo.Foo1BoxedMap](#foo1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [Foo.Foo1Boxed](#foo1boxed)
sealed interface for validated payloads | +| record | [Foo.Foo1BoxedMap](#foo1boxedmap)
boxed class to store validated Map payloads | | static class | [Foo.Foo1](#foo1)
schema class | | static class | [Foo.FooMapBuilder](#foomapbuilder)
builder for Map payloads | | static class | [Foo.FooMap](#foomap)
output class for Map payloads | ## Foo1Boxed -public static abstract sealed class Foo1Boxed
+public sealed interface Foo1Boxed
permits
[Foo1BoxedMap](#foo1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Foo1BoxedMap -public static final class Foo1BoxedMap
-extends [Foo1Boxed](#foo1boxed) +public record Foo1BoxedMap
+implements [Foo1Boxed](#foo1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Foo1BoxedMap([FooMap](#foomap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [FooMap](#foomap) | data
validated payload | +| [FooMap](#foomap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Foo1 public static class Foo1
@@ -82,7 +83,9 @@ Foo.FooMap validatedPayload = | ----------------- | ---------------------- | | [FooMap](#foomap) | validate([Map<?, ?>](#foomapbuilder) arg, SchemaConfiguration configuration) | | [Foo1BoxedMap](#foo1boxedmap) | validateAndBox([Map<?, ?>](#foomapbuilder) arg, SchemaConfiguration configuration) | +| [Foo1Boxed](#foo1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## FooMapBuilder public class FooMapBuilder
builder for `Map` diff --git a/samples/client/petstore/java/docs/components/schemas/FormatTest.md b/samples/client/petstore/java/docs/components/schemas/FormatTest.md index d865d0b86e2..61c6c189038 100644 --- a/samples/client/petstore/java/docs/components/schemas/FormatTest.md +++ b/samples/client/petstore/java/docs/components/schemas/FormatTest.md @@ -4,7 +4,7 @@ public class FormatTest
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated list payloads, extends FrozenList - classes to build inputs for list payloads @@ -14,101 +14,102 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [FormatTest.FormatTest1Boxed](#formattest1boxed)
abstract sealed validated payload class | -| static class | [FormatTest.FormatTest1BoxedMap](#formattest1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [FormatTest.FormatTest1Boxed](#formattest1boxed)
sealed interface for validated payloads | +| record | [FormatTest.FormatTest1BoxedMap](#formattest1boxedmap)
boxed class to store validated Map payloads | | static class | [FormatTest.FormatTest1](#formattest1)
schema class | | static class | [FormatTest.FormatTestMapBuilder](#formattestmapbuilder)
builder for Map payloads | | static class | [FormatTest.FormatTestMap](#formattestmap)
output class for Map payloads | -| static class | [FormatTest.NonePropBoxed](#nonepropboxed)
abstract sealed validated payload class | -| static class | [FormatTest.NonePropBoxedVoid](#nonepropboxedvoid)
boxed class to store validated null payloads | +| sealed interface | [FormatTest.NonePropBoxed](#nonepropboxed)
sealed interface for validated payloads | +| record | [FormatTest.NonePropBoxedVoid](#nonepropboxedvoid)
boxed class to store validated null payloads | | static class | [FormatTest.NoneProp](#noneprop)
schema class | -| static class | [FormatTest.PatternWithDigitsAndDelimiterBoxed](#patternwithdigitsanddelimiterboxed)
abstract sealed validated payload class | -| static class | [FormatTest.PatternWithDigitsAndDelimiterBoxedString](#patternwithdigitsanddelimiterboxedstring)
boxed class to store validated String payloads | +| sealed interface | [FormatTest.PatternWithDigitsAndDelimiterBoxed](#patternwithdigitsanddelimiterboxed)
sealed interface for validated payloads | +| record | [FormatTest.PatternWithDigitsAndDelimiterBoxedString](#patternwithdigitsanddelimiterboxedstring)
boxed class to store validated String payloads | | static class | [FormatTest.PatternWithDigitsAndDelimiter](#patternwithdigitsanddelimiter)
schema class | -| static class | [FormatTest.PatternWithDigitsBoxed](#patternwithdigitsboxed)
abstract sealed validated payload class | -| static class | [FormatTest.PatternWithDigitsBoxedString](#patternwithdigitsboxedstring)
boxed class to store validated String payloads | +| sealed interface | [FormatTest.PatternWithDigitsBoxed](#patternwithdigitsboxed)
sealed interface for validated payloads | +| record | [FormatTest.PatternWithDigitsBoxedString](#patternwithdigitsboxedstring)
boxed class to store validated String payloads | | static class | [FormatTest.PatternWithDigits](#patternwithdigits)
schema class | -| static class | [FormatTest.PasswordBoxed](#passwordboxed)
abstract sealed validated payload class | -| static class | [FormatTest.PasswordBoxedString](#passwordboxedstring)
boxed class to store validated String payloads | +| sealed interface | [FormatTest.PasswordBoxed](#passwordboxed)
sealed interface for validated payloads | +| record | [FormatTest.PasswordBoxedString](#passwordboxedstring)
boxed class to store validated String payloads | | static class | [FormatTest.Password](#password)
schema class | -| static class | [FormatTest.UuidNoExampleBoxed](#uuidnoexampleboxed)
abstract sealed validated payload class | -| static class | [FormatTest.UuidNoExampleBoxedString](#uuidnoexampleboxedstring)
boxed class to store validated String payloads | +| sealed interface | [FormatTest.UuidNoExampleBoxed](#uuidnoexampleboxed)
sealed interface for validated payloads | +| record | [FormatTest.UuidNoExampleBoxedString](#uuidnoexampleboxedstring)
boxed class to store validated String payloads | | static class | [FormatTest.UuidNoExample](#uuidnoexample)
schema class | -| static class | [FormatTest.UuidSchemaBoxed](#uuidschemaboxed)
abstract sealed validated payload class | -| static class | [FormatTest.UuidSchemaBoxedString](#uuidschemaboxedstring)
boxed class to store validated String payloads | +| sealed interface | [FormatTest.UuidSchemaBoxed](#uuidschemaboxed)
sealed interface for validated payloads | +| record | [FormatTest.UuidSchemaBoxedString](#uuidschemaboxedstring)
boxed class to store validated String payloads | | static class | [FormatTest.UuidSchema](#uuidschema)
schema class | -| static class | [FormatTest.DateTimeBoxed](#datetimeboxed)
abstract sealed validated payload class | -| static class | [FormatTest.DateTimeBoxedString](#datetimeboxedstring)
boxed class to store validated String payloads | +| sealed interface | [FormatTest.DateTimeBoxed](#datetimeboxed)
sealed interface for validated payloads | +| record | [FormatTest.DateTimeBoxedString](#datetimeboxedstring)
boxed class to store validated String payloads | | static class | [FormatTest.DateTime](#datetime)
schema class | -| static class | [FormatTest.DateBoxed](#dateboxed)
abstract sealed validated payload class | -| static class | [FormatTest.DateBoxedString](#dateboxedstring)
boxed class to store validated String payloads | +| sealed interface | [FormatTest.DateBoxed](#dateboxed)
sealed interface for validated payloads | +| record | [FormatTest.DateBoxedString](#dateboxedstring)
boxed class to store validated String payloads | | static class | [FormatTest.Date](#date)
schema class | -| static class | [FormatTest.BinaryBoxed](#binaryboxed)
abstract sealed validated payload class | +| sealed interface | [FormatTest.BinaryBoxed](#binaryboxed)
sealed interface for validated payloads | | static class | [FormatTest.Binary](#binary)
schema class | -| static class | [FormatTest.ByteSchemaBoxed](#byteschemaboxed)
abstract sealed validated payload class | -| static class | [FormatTest.ByteSchemaBoxedString](#byteschemaboxedstring)
boxed class to store validated String payloads | +| sealed interface | [FormatTest.ByteSchemaBoxed](#byteschemaboxed)
sealed interface for validated payloads | +| record | [FormatTest.ByteSchemaBoxedString](#byteschemaboxedstring)
boxed class to store validated String payloads | | static class | [FormatTest.ByteSchema](#byteschema)
schema class | -| static class | [FormatTest.StringSchemaBoxed](#stringschemaboxed)
abstract sealed validated payload class | -| static class | [FormatTest.StringSchemaBoxedString](#stringschemaboxedstring)
boxed class to store validated String payloads | +| sealed interface | [FormatTest.StringSchemaBoxed](#stringschemaboxed)
sealed interface for validated payloads | +| record | [FormatTest.StringSchemaBoxedString](#stringschemaboxedstring)
boxed class to store validated String payloads | | static class | [FormatTest.StringSchema](#stringschema)
schema class | -| static class | [FormatTest.ArrayWithUniqueItemsBoxed](#arraywithuniqueitemsboxed)
abstract sealed validated payload class | -| static class | [FormatTest.ArrayWithUniqueItemsBoxedList](#arraywithuniqueitemsboxedlist)
boxed class to store validated List payloads | +| sealed interface | [FormatTest.ArrayWithUniqueItemsBoxed](#arraywithuniqueitemsboxed)
sealed interface for validated payloads | +| record | [FormatTest.ArrayWithUniqueItemsBoxedList](#arraywithuniqueitemsboxedlist)
boxed class to store validated List payloads | | static class | [FormatTest.ArrayWithUniqueItems](#arraywithuniqueitems)
schema class | | static class | [FormatTest.ArrayWithUniqueItemsListBuilder](#arraywithuniqueitemslistbuilder)
builder for List payloads | | static class | [FormatTest.ArrayWithUniqueItemsList](#arraywithuniqueitemslist)
output class for List payloads | -| static class | [FormatTest.ItemsBoxed](#itemsboxed)
abstract sealed validated payload class | -| static class | [FormatTest.ItemsBoxedNumber](#itemsboxednumber)
boxed class to store validated Number payloads | +| sealed interface | [FormatTest.ItemsBoxed](#itemsboxed)
sealed interface for validated payloads | +| record | [FormatTest.ItemsBoxedNumber](#itemsboxednumber)
boxed class to store validated Number payloads | | static class | [FormatTest.Items](#items)
schema class | -| static class | [FormatTest.Float64Boxed](#float64boxed)
abstract sealed validated payload class | -| static class | [FormatTest.Float64BoxedNumber](#float64boxednumber)
boxed class to store validated Number payloads | +| sealed interface | [FormatTest.Float64Boxed](#float64boxed)
sealed interface for validated payloads | +| record | [FormatTest.Float64BoxedNumber](#float64boxednumber)
boxed class to store validated Number payloads | | static class | [FormatTest.Float64](#float64)
schema class | -| static class | [FormatTest.DoubleSchemaBoxed](#doubleschemaboxed)
abstract sealed validated payload class | -| static class | [FormatTest.DoubleSchemaBoxedNumber](#doubleschemaboxednumber)
boxed class to store validated Number payloads | +| sealed interface | [FormatTest.DoubleSchemaBoxed](#doubleschemaboxed)
sealed interface for validated payloads | +| record | [FormatTest.DoubleSchemaBoxedNumber](#doubleschemaboxednumber)
boxed class to store validated Number payloads | | static class | [FormatTest.DoubleSchema](#doubleschema)
schema class | -| static class | [FormatTest.Float32Boxed](#float32boxed)
abstract sealed validated payload class | -| static class | [FormatTest.Float32BoxedNumber](#float32boxednumber)
boxed class to store validated Number payloads | +| sealed interface | [FormatTest.Float32Boxed](#float32boxed)
sealed interface for validated payloads | +| record | [FormatTest.Float32BoxedNumber](#float32boxednumber)
boxed class to store validated Number payloads | | static class | [FormatTest.Float32](#float32)
schema class | -| static class | [FormatTest.FloatSchemaBoxed](#floatschemaboxed)
abstract sealed validated payload class | -| static class | [FormatTest.FloatSchemaBoxedNumber](#floatschemaboxednumber)
boxed class to store validated Number payloads | +| sealed interface | [FormatTest.FloatSchemaBoxed](#floatschemaboxed)
sealed interface for validated payloads | +| record | [FormatTest.FloatSchemaBoxedNumber](#floatschemaboxednumber)
boxed class to store validated Number payloads | | static class | [FormatTest.FloatSchema](#floatschema)
schema class | -| static class | [FormatTest.NumberSchemaBoxed](#numberschemaboxed)
abstract sealed validated payload class | -| static class | [FormatTest.NumberSchemaBoxedNumber](#numberschemaboxednumber)
boxed class to store validated Number payloads | +| sealed interface | [FormatTest.NumberSchemaBoxed](#numberschemaboxed)
sealed interface for validated payloads | +| record | [FormatTest.NumberSchemaBoxedNumber](#numberschemaboxednumber)
boxed class to store validated Number payloads | | static class | [FormatTest.NumberSchema](#numberschema)
schema class | -| static class | [FormatTest.Int64Boxed](#int64boxed)
abstract sealed validated payload class | -| static class | [FormatTest.Int64BoxedNumber](#int64boxednumber)
boxed class to store validated Number payloads | +| sealed interface | [FormatTest.Int64Boxed](#int64boxed)
sealed interface for validated payloads | +| record | [FormatTest.Int64BoxedNumber](#int64boxednumber)
boxed class to store validated Number payloads | | static class | [FormatTest.Int64](#int64)
schema class | -| static class | [FormatTest.Int32withValidationsBoxed](#int32withvalidationsboxed)
abstract sealed validated payload class | -| static class | [FormatTest.Int32withValidationsBoxedNumber](#int32withvalidationsboxednumber)
boxed class to store validated Number payloads | +| sealed interface | [FormatTest.Int32withValidationsBoxed](#int32withvalidationsboxed)
sealed interface for validated payloads | +| record | [FormatTest.Int32withValidationsBoxedNumber](#int32withvalidationsboxednumber)
boxed class to store validated Number payloads | | static class | [FormatTest.Int32withValidations](#int32withvalidations)
schema class | -| static class | [FormatTest.Int32Boxed](#int32boxed)
abstract sealed validated payload class | -| static class | [FormatTest.Int32BoxedNumber](#int32boxednumber)
boxed class to store validated Number payloads | +| sealed interface | [FormatTest.Int32Boxed](#int32boxed)
sealed interface for validated payloads | +| record | [FormatTest.Int32BoxedNumber](#int32boxednumber)
boxed class to store validated Number payloads | | static class | [FormatTest.Int32](#int32)
schema class | -| static class | [FormatTest.IntegerSchemaBoxed](#integerschemaboxed)
abstract sealed validated payload class | -| static class | [FormatTest.IntegerSchemaBoxedNumber](#integerschemaboxednumber)
boxed class to store validated Number payloads | +| sealed interface | [FormatTest.IntegerSchemaBoxed](#integerschemaboxed)
sealed interface for validated payloads | +| record | [FormatTest.IntegerSchemaBoxedNumber](#integerschemaboxednumber)
boxed class to store validated Number payloads | | static class | [FormatTest.IntegerSchema](#integerschema)
schema class | ## FormatTest1Boxed -public static abstract sealed class FormatTest1Boxed
+public sealed interface FormatTest1Boxed
permits
[FormatTest1BoxedMap](#formattest1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## FormatTest1BoxedMap -public static final class FormatTest1BoxedMap
-extends [FormatTest1Boxed](#formattest1boxed) +public record FormatTest1BoxedMap
+implements [FormatTest1Boxed](#formattest1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FormatTest1BoxedMap([FormatTestMap](#formattestmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [FormatTestMap](#formattestmap) | data
validated payload | +| [FormatTestMap](#formattestmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FormatTest1 public static class FormatTest1
@@ -197,7 +198,9 @@ FormatTest.FormatTestMap validatedPayload = | ----------------- | ---------------------- | | [FormatTestMap](#formattestmap) | validate([Map<?, ?>](#formattestmapbuilder) arg, SchemaConfiguration configuration) | | [FormatTest1BoxedMap](#formattest1boxedmap) | validateAndBox([Map<?, ?>](#formattestmapbuilder) arg, SchemaConfiguration configuration) | +| [FormatTest1Boxed](#formattest1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## FormatTestMap0000Builder public class FormatTestMap0000Builder
builder for `Map` @@ -569,27 +572,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## NonePropBoxed -public static abstract sealed class NonePropBoxed
+public sealed interface NonePropBoxed
permits
[NonePropBoxedVoid](#nonepropboxedvoid) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## NonePropBoxedVoid -public static final class NonePropBoxedVoid
-extends [NonePropBoxed](#nonepropboxed) +public record NonePropBoxedVoid
+implements [NonePropBoxed](#nonepropboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NonePropBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NoneProp public static class NoneProp
@@ -603,27 +607,28 @@ A schema class that validates payloads | validateAndBox | ## PatternWithDigitsAndDelimiterBoxed -public static abstract sealed class PatternWithDigitsAndDelimiterBoxed
+public sealed interface PatternWithDigitsAndDelimiterBoxed
permits
[PatternWithDigitsAndDelimiterBoxedString](#patternwithdigitsanddelimiterboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## PatternWithDigitsAndDelimiterBoxedString -public static final class PatternWithDigitsAndDelimiterBoxedString
-extends [PatternWithDigitsAndDelimiterBoxed](#patternwithdigitsanddelimiterboxed) +public record PatternWithDigitsAndDelimiterBoxedString
+implements [PatternWithDigitsAndDelimiterBoxed](#patternwithdigitsanddelimiterboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PatternWithDigitsAndDelimiterBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PatternWithDigitsAndDelimiter public static class PatternWithDigitsAndDelimiter
@@ -667,29 +672,32 @@ String validatedPayload = FormatTest.PatternWithDigitsAndDelimiter.validate( | ----------------- | ---------------------- | | String | validate(String arg, SchemaConfiguration configuration) | | [PatternWithDigitsAndDelimiterBoxedString](#patternwithdigitsanddelimiterboxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [PatternWithDigitsAndDelimiterBoxed](#patternwithdigitsanddelimiterboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## PatternWithDigitsBoxed -public static abstract sealed class PatternWithDigitsBoxed
+public sealed interface PatternWithDigitsBoxed
permits
[PatternWithDigitsBoxedString](#patternwithdigitsboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## PatternWithDigitsBoxedString -public static final class PatternWithDigitsBoxedString
-extends [PatternWithDigitsBoxed](#patternwithdigitsboxed) +public record PatternWithDigitsBoxedString
+implements [PatternWithDigitsBoxed](#patternwithdigitsboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PatternWithDigitsBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PatternWithDigits public static class PatternWithDigits
@@ -733,29 +741,32 @@ String validatedPayload = FormatTest.PatternWithDigits.validate( | ----------------- | ---------------------- | | String | validate(String arg, SchemaConfiguration configuration) | | [PatternWithDigitsBoxedString](#patternwithdigitsboxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [PatternWithDigitsBoxed](#patternwithdigitsboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## PasswordBoxed -public static abstract sealed class PasswordBoxed
+public sealed interface PasswordBoxed
permits
[PasswordBoxedString](#passwordboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## PasswordBoxedString -public static final class PasswordBoxedString
-extends [PasswordBoxed](#passwordboxed) +public record PasswordBoxedString
+implements [PasswordBoxed](#passwordboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PasswordBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Password public static class Password
@@ -798,29 +809,32 @@ String validatedPayload = FormatTest.Password.validate( | ----------------- | ---------------------- | | String | validate(String arg, SchemaConfiguration configuration) | | [PasswordBoxedString](#passwordboxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [PasswordBoxed](#passwordboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## UuidNoExampleBoxed -public static abstract sealed class UuidNoExampleBoxed
+public sealed interface UuidNoExampleBoxed
permits
[UuidNoExampleBoxedString](#uuidnoexampleboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## UuidNoExampleBoxedString -public static final class UuidNoExampleBoxedString
-extends [UuidNoExampleBoxed](#uuidnoexampleboxed) +public record UuidNoExampleBoxedString
+implements [UuidNoExampleBoxed](#uuidnoexampleboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UuidNoExampleBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UuidNoExample public static class UuidNoExample
@@ -834,27 +848,28 @@ A schema class that validates payloads | validateAndBox | ## UuidSchemaBoxed -public static abstract sealed class UuidSchemaBoxed
+public sealed interface UuidSchemaBoxed
permits
[UuidSchemaBoxedString](#uuidschemaboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## UuidSchemaBoxedString -public static final class UuidSchemaBoxedString
-extends [UuidSchemaBoxed](#uuidschemaboxed) +public record UuidSchemaBoxedString
+implements [UuidSchemaBoxed](#uuidschemaboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UuidSchemaBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UuidSchema public static class UuidSchema
@@ -868,27 +883,28 @@ A schema class that validates payloads | validateAndBox | ## DateTimeBoxed -public static abstract sealed class DateTimeBoxed
+public sealed interface DateTimeBoxed
permits
[DateTimeBoxedString](#datetimeboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## DateTimeBoxedString -public static final class DateTimeBoxedString
-extends [DateTimeBoxed](#datetimeboxed) +public record DateTimeBoxedString
+implements [DateTimeBoxed](#datetimeboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DateTimeBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## DateTime public static class DateTime
@@ -902,27 +918,28 @@ A schema class that validates payloads | validateAndBox | ## DateBoxed -public static abstract sealed class DateBoxed
+public sealed interface DateBoxed
permits
[DateBoxedString](#dateboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## DateBoxedString -public static final class DateBoxedString
-extends [DateBoxed](#dateboxed) +public record DateBoxedString
+implements [DateBoxed](#dateboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DateBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Date public static class Date
@@ -936,10 +953,10 @@ A schema class that validates payloads | validateAndBox | ## BinaryBoxed -public static abstract sealed class BinaryBoxed
+public sealed interface BinaryBoxed
permits
-abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Binary public static class Binary
@@ -948,27 +965,28 @@ extends JsonSchema A schema class that validates payloads ## ByteSchemaBoxed -public static abstract sealed class ByteSchemaBoxed
+public sealed interface ByteSchemaBoxed
permits
[ByteSchemaBoxedString](#byteschemaboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ByteSchemaBoxedString -public static final class ByteSchemaBoxedString
-extends [ByteSchemaBoxed](#byteschemaboxed) +public record ByteSchemaBoxedString
+implements [ByteSchemaBoxed](#byteschemaboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ByteSchemaBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ByteSchema public static class ByteSchema
@@ -977,27 +995,28 @@ extends StringJsonSchema.StringJsonSchema1 A schema class that validates payloads ## StringSchemaBoxed -public static abstract sealed class StringSchemaBoxed
+public sealed interface StringSchemaBoxed
permits
[StringSchemaBoxedString](#stringschemaboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## StringSchemaBoxedString -public static final class StringSchemaBoxedString
-extends [StringSchemaBoxed](#stringschemaboxed) +public record StringSchemaBoxedString
+implements [StringSchemaBoxed](#stringschemaboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | StringSchemaBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## StringSchema public static class StringSchema
@@ -1038,29 +1057,32 @@ String validatedPayload = FormatTest.StringSchema.validate( | ----------------- | ---------------------- | | String | validate(String arg, SchemaConfiguration configuration) | | [StringSchemaBoxedString](#stringschemaboxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [StringSchemaBoxed](#stringschemaboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ArrayWithUniqueItemsBoxed -public static abstract sealed class ArrayWithUniqueItemsBoxed
+public sealed interface ArrayWithUniqueItemsBoxed
permits
[ArrayWithUniqueItemsBoxedList](#arraywithuniqueitemsboxedlist) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ArrayWithUniqueItemsBoxedList -public static final class ArrayWithUniqueItemsBoxedList
-extends [ArrayWithUniqueItemsBoxed](#arraywithuniqueitemsboxed) +public record ArrayWithUniqueItemsBoxedList
+implements [ArrayWithUniqueItemsBoxed](#arraywithuniqueitemsboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ArrayWithUniqueItemsBoxedList([ArrayWithUniqueItemsList](#arraywithuniqueitemslist) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [ArrayWithUniqueItemsList](#arraywithuniqueitemslist) | data
validated payload | +| [ArrayWithUniqueItemsList](#arraywithuniqueitemslist) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ArrayWithUniqueItems public static class ArrayWithUniqueItems
@@ -1106,7 +1128,9 @@ FormatTest.ArrayWithUniqueItemsList validatedPayload = | ----------------- | ---------------------- | | [ArrayWithUniqueItemsList](#arraywithuniqueitemslist) | validate([List](#arraywithuniqueitemslistbuilder) arg, SchemaConfiguration configuration) | | [ArrayWithUniqueItemsBoxedList](#arraywithuniqueitemsboxedlist) | validateAndBox([List](#arraywithuniqueitemslistbuilder) arg, SchemaConfiguration configuration) | +| [ArrayWithUniqueItemsBoxed](#arraywithuniqueitemsboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ArrayWithUniqueItemsListBuilder public class ArrayWithUniqueItemsListBuilder
builder for `List` @@ -1140,27 +1164,28 @@ A class to store validated List payloads | static [ArrayWithUniqueItemsList](#arraywithuniqueitemslist) | of([List](#arraywithuniqueitemslistbuilder) arg, SchemaConfiguration configuration) | ## ItemsBoxed -public static abstract sealed class ItemsBoxed
+public sealed interface ItemsBoxed
permits
[ItemsBoxedNumber](#itemsboxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ItemsBoxedNumber -public static final class ItemsBoxedNumber
-extends [ItemsBoxed](#itemsboxed) +public record ItemsBoxedNumber
+implements [ItemsBoxed](#itemsboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ItemsBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Items public static class Items
@@ -1174,27 +1199,28 @@ A schema class that validates payloads | validateAndBox | ## Float64Boxed -public static abstract sealed class Float64Boxed
+public sealed interface Float64Boxed
permits
[Float64BoxedNumber](#float64boxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Float64BoxedNumber -public static final class Float64BoxedNumber
-extends [Float64Boxed](#float64boxed) +public record Float64BoxedNumber
+implements [Float64Boxed](#float64boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Float64BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Float64 public static class Float64
@@ -1208,27 +1234,28 @@ A schema class that validates payloads | validateAndBox | ## DoubleSchemaBoxed -public static abstract sealed class DoubleSchemaBoxed
+public sealed interface DoubleSchemaBoxed
permits
[DoubleSchemaBoxedNumber](#doubleschemaboxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## DoubleSchemaBoxedNumber -public static final class DoubleSchemaBoxedNumber
-extends [DoubleSchemaBoxed](#doubleschemaboxed) +public record DoubleSchemaBoxedNumber
+implements [DoubleSchemaBoxed](#doubleschemaboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DoubleSchemaBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## DoubleSchema public static class DoubleSchema
@@ -1271,29 +1298,32 @@ double validatedPayload = FormatTest.DoubleSchema.validate( | ----------------- | ---------------------- | | double | validate(double arg, SchemaConfiguration configuration) | | [DoubleSchemaBoxedNumber](#doubleschemaboxednumber) | validateAndBox(Number arg, SchemaConfiguration configuration) | +| [DoubleSchemaBoxed](#doubleschemaboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Float32Boxed -public static abstract sealed class Float32Boxed
+public sealed interface Float32Boxed
permits
[Float32BoxedNumber](#float32boxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Float32BoxedNumber -public static final class Float32BoxedNumber
-extends [Float32Boxed](#float32boxed) +public record Float32BoxedNumber
+implements [Float32Boxed](#float32boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Float32BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Float32 public static class Float32
@@ -1307,27 +1337,28 @@ A schema class that validates payloads | validateAndBox | ## FloatSchemaBoxed -public static abstract sealed class FloatSchemaBoxed
+public sealed interface FloatSchemaBoxed
permits
[FloatSchemaBoxedNumber](#floatschemaboxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## FloatSchemaBoxedNumber -public static final class FloatSchemaBoxedNumber
-extends [FloatSchemaBoxed](#floatschemaboxed) +public record FloatSchemaBoxedNumber
+implements [FloatSchemaBoxed](#floatschemaboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FloatSchemaBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FloatSchema public static class FloatSchema
@@ -1373,29 +1404,32 @@ float validatedPayload = FormatTest.FloatSchema.validate( | ----------------- | ---------------------- | | float | validate(float arg, SchemaConfiguration configuration) | | [FloatSchemaBoxedNumber](#floatschemaboxednumber) | validateAndBox(Number arg, SchemaConfiguration configuration) | +| [FloatSchemaBoxed](#floatschemaboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## NumberSchemaBoxed -public static abstract sealed class NumberSchemaBoxed
+public sealed interface NumberSchemaBoxed
permits
[NumberSchemaBoxedNumber](#numberschemaboxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## NumberSchemaBoxedNumber -public static final class NumberSchemaBoxedNumber
-extends [NumberSchemaBoxed](#numberschemaboxed) +public record NumberSchemaBoxedNumber
+implements [NumberSchemaBoxed](#numberschemaboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NumberSchemaBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NumberSchema public static class NumberSchema
@@ -1438,29 +1472,32 @@ int validatedPayload = FormatTest.NumberSchema.validate( | ----------------- | ---------------------- | | Number | validate(Number arg, SchemaConfiguration configuration) | | [NumberSchemaBoxedNumber](#numberschemaboxednumber) | validateAndBox(Number arg, SchemaConfiguration configuration) | +| [NumberSchemaBoxed](#numberschemaboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Int64Boxed -public static abstract sealed class Int64Boxed
+public sealed interface Int64Boxed
permits
[Int64BoxedNumber](#int64boxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Int64BoxedNumber -public static final class Int64BoxedNumber
-extends [Int64Boxed](#int64boxed) +public record Int64BoxedNumber
+implements [Int64Boxed](#int64boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Int64BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Int64 public static class Int64
@@ -1474,27 +1511,28 @@ A schema class that validates payloads | validateAndBox | ## Int32withValidationsBoxed -public static abstract sealed class Int32withValidationsBoxed
+public sealed interface Int32withValidationsBoxed
permits
[Int32withValidationsBoxedNumber](#int32withvalidationsboxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Int32withValidationsBoxedNumber -public static final class Int32withValidationsBoxedNumber
-extends [Int32withValidationsBoxed](#int32withvalidationsboxed) +public record Int32withValidationsBoxedNumber
+implements [Int32withValidationsBoxed](#int32withvalidationsboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Int32withValidationsBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Int32withValidations public static class Int32withValidations
@@ -1537,29 +1575,32 @@ int validatedPayload = FormatTest.Int32withValidations.validate( | ----------------- | ---------------------- | | int | validate(int arg, SchemaConfiguration configuration) | | [Int32withValidationsBoxedNumber](#int32withvalidationsboxednumber) | validateAndBox(Number arg, SchemaConfiguration configuration) | +| [Int32withValidationsBoxed](#int32withvalidationsboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Int32Boxed -public static abstract sealed class Int32Boxed
+public sealed interface Int32Boxed
permits
[Int32BoxedNumber](#int32boxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Int32BoxedNumber -public static final class Int32BoxedNumber
-extends [Int32Boxed](#int32boxed) +public record Int32BoxedNumber
+implements [Int32Boxed](#int32boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Int32BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Int32 public static class Int32
@@ -1573,27 +1614,28 @@ A schema class that validates payloads | validateAndBox | ## IntegerSchemaBoxed -public static abstract sealed class IntegerSchemaBoxed
+public sealed interface IntegerSchemaBoxed
permits
[IntegerSchemaBoxedNumber](#integerschemaboxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## IntegerSchemaBoxedNumber -public static final class IntegerSchemaBoxedNumber
-extends [IntegerSchemaBoxed](#integerschemaboxed) +public record IntegerSchemaBoxedNumber
+implements [IntegerSchemaBoxed](#integerschemaboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IntegerSchemaBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IntegerSchema public static class IntegerSchema
@@ -1637,5 +1679,7 @@ int validatedPayload = FormatTest.IntegerSchema.validate( | ----------------- | ---------------------- | | long | validate(long arg, SchemaConfiguration configuration) | | [IntegerSchemaBoxedNumber](#integerschemaboxednumber) | validateAndBox(Number arg, SchemaConfiguration configuration) | +| [IntegerSchemaBoxed](#integerschemaboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/components/schemas/FromSchema.md b/samples/client/petstore/java/docs/components/schemas/FromSchema.md index 77b978331d8..e6be61ce494 100644 --- a/samples/client/petstore/java/docs/components/schemas/FromSchema.md +++ b/samples/client/petstore/java/docs/components/schemas/FromSchema.md @@ -4,7 +4,7 @@ public class FromSchema
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,40 +12,41 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [FromSchema.FromSchema1Boxed](#fromschema1boxed)
abstract sealed validated payload class | -| static class | [FromSchema.FromSchema1BoxedMap](#fromschema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [FromSchema.FromSchema1Boxed](#fromschema1boxed)
sealed interface for validated payloads | +| record | [FromSchema.FromSchema1BoxedMap](#fromschema1boxedmap)
boxed class to store validated Map payloads | | static class | [FromSchema.FromSchema1](#fromschema1)
schema class | | static class | [FromSchema.FromSchemaMapBuilder](#fromschemamapbuilder)
builder for Map payloads | | static class | [FromSchema.FromSchemaMap](#fromschemamap)
output class for Map payloads | -| static class | [FromSchema.IdBoxed](#idboxed)
abstract sealed validated payload class | -| static class | [FromSchema.IdBoxedNumber](#idboxednumber)
boxed class to store validated Number payloads | +| sealed interface | [FromSchema.IdBoxed](#idboxed)
sealed interface for validated payloads | +| record | [FromSchema.IdBoxedNumber](#idboxednumber)
boxed class to store validated Number payloads | | static class | [FromSchema.Id](#id)
schema class | -| static class | [FromSchema.DataBoxed](#databoxed)
abstract sealed validated payload class | -| static class | [FromSchema.DataBoxedString](#databoxedstring)
boxed class to store validated String payloads | +| sealed interface | [FromSchema.DataBoxed](#databoxed)
sealed interface for validated payloads | +| record | [FromSchema.DataBoxedString](#databoxedstring)
boxed class to store validated String payloads | | static class | [FromSchema.Data](#data)
schema class | ## FromSchema1Boxed -public static abstract sealed class FromSchema1Boxed
+public sealed interface FromSchema1Boxed
permits
[FromSchema1BoxedMap](#fromschema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## FromSchema1BoxedMap -public static final class FromSchema1BoxedMap
-extends [FromSchema1Boxed](#fromschema1boxed) +public record FromSchema1BoxedMap
+implements [FromSchema1Boxed](#fromschema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FromSchema1BoxedMap([FromSchemaMap](#fromschemamap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [FromSchemaMap](#fromschemamap) | data
validated payload | +| [FromSchemaMap](#fromschemamap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FromSchema1 public static class FromSchema1
@@ -92,7 +93,9 @@ FromSchema.FromSchemaMap validatedPayload = | ----------------- | ---------------------- | | [FromSchemaMap](#fromschemamap) | validate([Map<?, ?>](#fromschemamapbuilder) arg, SchemaConfiguration configuration) | | [FromSchema1BoxedMap](#fromschema1boxedmap) | validateAndBox([Map<?, ?>](#fromschemamapbuilder) arg, SchemaConfiguration configuration) | +| [FromSchema1Boxed](#fromschema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## FromSchemaMapBuilder public class FromSchemaMapBuilder
builder for `Map` @@ -138,27 +141,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## IdBoxed -public static abstract sealed class IdBoxed
+public sealed interface IdBoxed
permits
[IdBoxedNumber](#idboxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## IdBoxedNumber -public static final class IdBoxedNumber
-extends [IdBoxed](#idboxed) +public record IdBoxedNumber
+implements [IdBoxed](#idboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IdBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Id public static class Id
@@ -172,27 +176,28 @@ A schema class that validates payloads | validateAndBox | ## DataBoxed -public static abstract sealed class DataBoxed
+public sealed interface DataBoxed
permits
[DataBoxedString](#databoxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## DataBoxedString -public static final class DataBoxedString
-extends [DataBoxed](#databoxed) +public record DataBoxedString
+implements [DataBoxed](#databoxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DataBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Data public static class Data
diff --git a/samples/client/petstore/java/docs/components/schemas/Fruit.md b/samples/client/petstore/java/docs/components/schemas/Fruit.md index 31d666a29ce..b360a78c165 100644 --- a/samples/client/petstore/java/docs/components/schemas/Fruit.md +++ b/samples/client/petstore/java/docs/components/schemas/Fruit.md @@ -4,7 +4,7 @@ public class Fruit
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,22 +12,22 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Fruit.Fruit1Boxed](#fruit1boxed)
abstract sealed validated payload class | -| static class | [Fruit.Fruit1BoxedVoid](#fruit1boxedvoid)
boxed class to store validated null payloads | -| static class | [Fruit.Fruit1BoxedBoolean](#fruit1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [Fruit.Fruit1BoxedNumber](#fruit1boxednumber)
boxed class to store validated Number payloads | -| static class | [Fruit.Fruit1BoxedString](#fruit1boxedstring)
boxed class to store validated String payloads | -| static class | [Fruit.Fruit1BoxedList](#fruit1boxedlist)
boxed class to store validated List payloads | -| static class | [Fruit.Fruit1BoxedMap](#fruit1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [Fruit.Fruit1Boxed](#fruit1boxed)
sealed interface for validated payloads | +| record | [Fruit.Fruit1BoxedVoid](#fruit1boxedvoid)
boxed class to store validated null payloads | +| record | [Fruit.Fruit1BoxedBoolean](#fruit1boxedboolean)
boxed class to store validated boolean payloads | +| record | [Fruit.Fruit1BoxedNumber](#fruit1boxednumber)
boxed class to store validated Number payloads | +| record | [Fruit.Fruit1BoxedString](#fruit1boxedstring)
boxed class to store validated String payloads | +| record | [Fruit.Fruit1BoxedList](#fruit1boxedlist)
boxed class to store validated List payloads | +| record | [Fruit.Fruit1BoxedMap](#fruit1boxedmap)
boxed class to store validated Map payloads | | static class | [Fruit.Fruit1](#fruit1)
schema class | | static class | [Fruit.FruitMapBuilder](#fruitmapbuilder)
builder for Map payloads | | static class | [Fruit.FruitMap](#fruitmap)
output class for Map payloads | -| static class | [Fruit.ColorBoxed](#colorboxed)
abstract sealed validated payload class | -| static class | [Fruit.ColorBoxedString](#colorboxedstring)
boxed class to store validated String payloads | +| sealed interface | [Fruit.ColorBoxed](#colorboxed)
sealed interface for validated payloads | +| record | [Fruit.ColorBoxedString](#colorboxedstring)
boxed class to store validated String payloads | | static class | [Fruit.Color](#color)
schema class | ## Fruit1Boxed -public static abstract sealed class Fruit1Boxed
+public sealed interface Fruit1Boxed
permits
[Fruit1BoxedVoid](#fruit1boxedvoid), [Fruit1BoxedBoolean](#fruit1boxedboolean), @@ -36,103 +36,109 @@ permits
[Fruit1BoxedList](#fruit1boxedlist), [Fruit1BoxedMap](#fruit1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Fruit1BoxedVoid -public static final class Fruit1BoxedVoid
-extends [Fruit1Boxed](#fruit1boxed) +public record Fruit1BoxedVoid
+implements [Fruit1Boxed](#fruit1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Fruit1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Fruit1BoxedBoolean -public static final class Fruit1BoxedBoolean
-extends [Fruit1Boxed](#fruit1boxed) +public record Fruit1BoxedBoolean
+implements [Fruit1Boxed](#fruit1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Fruit1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Fruit1BoxedNumber -public static final class Fruit1BoxedNumber
-extends [Fruit1Boxed](#fruit1boxed) +public record Fruit1BoxedNumber
+implements [Fruit1Boxed](#fruit1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Fruit1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Fruit1BoxedString -public static final class Fruit1BoxedString
-extends [Fruit1Boxed](#fruit1boxed) +public record Fruit1BoxedString
+implements [Fruit1Boxed](#fruit1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Fruit1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Fruit1BoxedList -public static final class Fruit1BoxedList
-extends [Fruit1Boxed](#fruit1boxed) +public record Fruit1BoxedList
+implements [Fruit1Boxed](#fruit1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Fruit1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Fruit1BoxedMap -public static final class Fruit1BoxedMap
-extends [Fruit1Boxed](#fruit1boxed) +public record Fruit1BoxedMap
+implements [Fruit1Boxed](#fruit1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Fruit1BoxedMap([FruitMap](#fruitmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [FruitMap](#fruitmap) | data
validated payload | +| [FruitMap](#fruitmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Fruit1 public static class Fruit1
@@ -165,7 +171,9 @@ A schema class that validates payloads | [Fruit1BoxedBoolean](#fruit1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Fruit1BoxedMap](#fruit1boxedmap) | validateAndBox([Map<?, ?>](#fruitmapbuilder) arg, SchemaConfiguration configuration) | | [Fruit1BoxedList](#fruit1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Fruit1Boxed](#fruit1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## FruitMapBuilder public class FruitMapBuilder
builder for `Map` @@ -206,27 +214,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## ColorBoxed -public static abstract sealed class ColorBoxed
+public sealed interface ColorBoxed
permits
[ColorBoxedString](#colorboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ColorBoxedString -public static final class ColorBoxedString
-extends [ColorBoxed](#colorboxed) +public record ColorBoxedString
+implements [ColorBoxed](#colorboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ColorBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Color public static class Color
diff --git a/samples/client/petstore/java/docs/components/schemas/FruitReq.md b/samples/client/petstore/java/docs/components/schemas/FruitReq.md index 2b422ed401f..c99ad7f6113 100644 --- a/samples/client/petstore/java/docs/components/schemas/FruitReq.md +++ b/samples/client/petstore/java/docs/components/schemas/FruitReq.md @@ -4,26 +4,26 @@ public class FruitReq
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [FruitReq.FruitReq1Boxed](#fruitreq1boxed)
abstract sealed validated payload class | -| static class | [FruitReq.FruitReq1BoxedVoid](#fruitreq1boxedvoid)
boxed class to store validated null payloads | -| static class | [FruitReq.FruitReq1BoxedBoolean](#fruitreq1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [FruitReq.FruitReq1BoxedNumber](#fruitreq1boxednumber)
boxed class to store validated Number payloads | -| static class | [FruitReq.FruitReq1BoxedString](#fruitreq1boxedstring)
boxed class to store validated String payloads | -| static class | [FruitReq.FruitReq1BoxedList](#fruitreq1boxedlist)
boxed class to store validated List payloads | -| static class | [FruitReq.FruitReq1BoxedMap](#fruitreq1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [FruitReq.FruitReq1Boxed](#fruitreq1boxed)
sealed interface for validated payloads | +| record | [FruitReq.FruitReq1BoxedVoid](#fruitreq1boxedvoid)
boxed class to store validated null payloads | +| record | [FruitReq.FruitReq1BoxedBoolean](#fruitreq1boxedboolean)
boxed class to store validated boolean payloads | +| record | [FruitReq.FruitReq1BoxedNumber](#fruitreq1boxednumber)
boxed class to store validated Number payloads | +| record | [FruitReq.FruitReq1BoxedString](#fruitreq1boxedstring)
boxed class to store validated String payloads | +| record | [FruitReq.FruitReq1BoxedList](#fruitreq1boxedlist)
boxed class to store validated List payloads | +| record | [FruitReq.FruitReq1BoxedMap](#fruitreq1boxedmap)
boxed class to store validated Map payloads | | static class | [FruitReq.FruitReq1](#fruitreq1)
schema class | -| static class | [FruitReq.Schema0Boxed](#schema0boxed)
abstract sealed validated payload class | -| static class | [FruitReq.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | +| sealed interface | [FruitReq.Schema0Boxed](#schema0boxed)
sealed interface for validated payloads | +| record | [FruitReq.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | | static class | [FruitReq.Schema0](#schema0)
schema class | ## FruitReq1Boxed -public static abstract sealed class FruitReq1Boxed
+public sealed interface FruitReq1Boxed
permits
[FruitReq1BoxedVoid](#fruitreq1boxedvoid), [FruitReq1BoxedBoolean](#fruitreq1boxedboolean), @@ -32,103 +32,109 @@ permits
[FruitReq1BoxedList](#fruitreq1boxedlist), [FruitReq1BoxedMap](#fruitreq1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## FruitReq1BoxedVoid -public static final class FruitReq1BoxedVoid
-extends [FruitReq1Boxed](#fruitreq1boxed) +public record FruitReq1BoxedVoid
+implements [FruitReq1Boxed](#fruitreq1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FruitReq1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FruitReq1BoxedBoolean -public static final class FruitReq1BoxedBoolean
-extends [FruitReq1Boxed](#fruitreq1boxed) +public record FruitReq1BoxedBoolean
+implements [FruitReq1Boxed](#fruitreq1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FruitReq1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FruitReq1BoxedNumber -public static final class FruitReq1BoxedNumber
-extends [FruitReq1Boxed](#fruitreq1boxed) +public record FruitReq1BoxedNumber
+implements [FruitReq1Boxed](#fruitreq1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FruitReq1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FruitReq1BoxedString -public static final class FruitReq1BoxedString
-extends [FruitReq1Boxed](#fruitreq1boxed) +public record FruitReq1BoxedString
+implements [FruitReq1Boxed](#fruitreq1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FruitReq1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FruitReq1BoxedList -public static final class FruitReq1BoxedList
-extends [FruitReq1Boxed](#fruitreq1boxed) +public record FruitReq1BoxedList
+implements [FruitReq1Boxed](#fruitreq1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FruitReq1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FruitReq1BoxedMap -public static final class FruitReq1BoxedMap
-extends [FruitReq1Boxed](#fruitreq1boxed) +public record FruitReq1BoxedMap
+implements [FruitReq1Boxed](#fruitreq1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FruitReq1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FruitReq1 public static class FruitReq1
@@ -160,29 +166,32 @@ A schema class that validates payloads | [FruitReq1BoxedBoolean](#fruitreq1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [FruitReq1BoxedMap](#fruitreq1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [FruitReq1BoxedList](#fruitreq1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [FruitReq1Boxed](#fruitreq1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema0Boxed -public static abstract sealed class Schema0Boxed
+public sealed interface Schema0Boxed
permits
[Schema0BoxedVoid](#schema0boxedvoid) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema0BoxedVoid -public static final class Schema0BoxedVoid
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedVoid
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0 public static class Schema0
diff --git a/samples/client/petstore/java/docs/components/schemas/GmFruit.md b/samples/client/petstore/java/docs/components/schemas/GmFruit.md index 5c2f8daf0f5..1a164719714 100644 --- a/samples/client/petstore/java/docs/components/schemas/GmFruit.md +++ b/samples/client/petstore/java/docs/components/schemas/GmFruit.md @@ -4,7 +4,7 @@ public class GmFruit
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,22 +12,22 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [GmFruit.GmFruit1Boxed](#gmfruit1boxed)
abstract sealed validated payload class | -| static class | [GmFruit.GmFruit1BoxedVoid](#gmfruit1boxedvoid)
boxed class to store validated null payloads | -| static class | [GmFruit.GmFruit1BoxedBoolean](#gmfruit1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [GmFruit.GmFruit1BoxedNumber](#gmfruit1boxednumber)
boxed class to store validated Number payloads | -| static class | [GmFruit.GmFruit1BoxedString](#gmfruit1boxedstring)
boxed class to store validated String payloads | -| static class | [GmFruit.GmFruit1BoxedList](#gmfruit1boxedlist)
boxed class to store validated List payloads | -| static class | [GmFruit.GmFruit1BoxedMap](#gmfruit1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [GmFruit.GmFruit1Boxed](#gmfruit1boxed)
sealed interface for validated payloads | +| record | [GmFruit.GmFruit1BoxedVoid](#gmfruit1boxedvoid)
boxed class to store validated null payloads | +| record | [GmFruit.GmFruit1BoxedBoolean](#gmfruit1boxedboolean)
boxed class to store validated boolean payloads | +| record | [GmFruit.GmFruit1BoxedNumber](#gmfruit1boxednumber)
boxed class to store validated Number payloads | +| record | [GmFruit.GmFruit1BoxedString](#gmfruit1boxedstring)
boxed class to store validated String payloads | +| record | [GmFruit.GmFruit1BoxedList](#gmfruit1boxedlist)
boxed class to store validated List payloads | +| record | [GmFruit.GmFruit1BoxedMap](#gmfruit1boxedmap)
boxed class to store validated Map payloads | | static class | [GmFruit.GmFruit1](#gmfruit1)
schema class | | static class | [GmFruit.GmFruitMapBuilder](#gmfruitmapbuilder)
builder for Map payloads | | static class | [GmFruit.GmFruitMap](#gmfruitmap)
output class for Map payloads | -| static class | [GmFruit.ColorBoxed](#colorboxed)
abstract sealed validated payload class | -| static class | [GmFruit.ColorBoxedString](#colorboxedstring)
boxed class to store validated String payloads | +| sealed interface | [GmFruit.ColorBoxed](#colorboxed)
sealed interface for validated payloads | +| record | [GmFruit.ColorBoxedString](#colorboxedstring)
boxed class to store validated String payloads | | static class | [GmFruit.Color](#color)
schema class | ## GmFruit1Boxed -public static abstract sealed class GmFruit1Boxed
+public sealed interface GmFruit1Boxed
permits
[GmFruit1BoxedVoid](#gmfruit1boxedvoid), [GmFruit1BoxedBoolean](#gmfruit1boxedboolean), @@ -36,103 +36,109 @@ permits
[GmFruit1BoxedList](#gmfruit1boxedlist), [GmFruit1BoxedMap](#gmfruit1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## GmFruit1BoxedVoid -public static final class GmFruit1BoxedVoid
-extends [GmFruit1Boxed](#gmfruit1boxed) +public record GmFruit1BoxedVoid
+implements [GmFruit1Boxed](#gmfruit1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | GmFruit1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## GmFruit1BoxedBoolean -public static final class GmFruit1BoxedBoolean
-extends [GmFruit1Boxed](#gmfruit1boxed) +public record GmFruit1BoxedBoolean
+implements [GmFruit1Boxed](#gmfruit1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | GmFruit1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## GmFruit1BoxedNumber -public static final class GmFruit1BoxedNumber
-extends [GmFruit1Boxed](#gmfruit1boxed) +public record GmFruit1BoxedNumber
+implements [GmFruit1Boxed](#gmfruit1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | GmFruit1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## GmFruit1BoxedString -public static final class GmFruit1BoxedString
-extends [GmFruit1Boxed](#gmfruit1boxed) +public record GmFruit1BoxedString
+implements [GmFruit1Boxed](#gmfruit1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | GmFruit1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## GmFruit1BoxedList -public static final class GmFruit1BoxedList
-extends [GmFruit1Boxed](#gmfruit1boxed) +public record GmFruit1BoxedList
+implements [GmFruit1Boxed](#gmfruit1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | GmFruit1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## GmFruit1BoxedMap -public static final class GmFruit1BoxedMap
-extends [GmFruit1Boxed](#gmfruit1boxed) +public record GmFruit1BoxedMap
+implements [GmFruit1Boxed](#gmfruit1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | GmFruit1BoxedMap([GmFruitMap](#gmfruitmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [GmFruitMap](#gmfruitmap) | data
validated payload | +| [GmFruitMap](#gmfruitmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## GmFruit1 public static class GmFruit1
@@ -165,7 +171,9 @@ A schema class that validates payloads | [GmFruit1BoxedBoolean](#gmfruit1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [GmFruit1BoxedMap](#gmfruit1boxedmap) | validateAndBox([Map<?, ?>](#gmfruitmapbuilder) arg, SchemaConfiguration configuration) | | [GmFruit1BoxedList](#gmfruit1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [GmFruit1Boxed](#gmfruit1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## GmFruitMapBuilder public class GmFruitMapBuilder
builder for `Map` @@ -206,27 +214,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## ColorBoxed -public static abstract sealed class ColorBoxed
+public sealed interface ColorBoxed
permits
[ColorBoxedString](#colorboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ColorBoxedString -public static final class ColorBoxedString
-extends [ColorBoxed](#colorboxed) +public record ColorBoxedString
+implements [ColorBoxed](#colorboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ColorBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Color public static class Color
diff --git a/samples/client/petstore/java/docs/components/schemas/GrandparentAnimal.md b/samples/client/petstore/java/docs/components/schemas/GrandparentAnimal.md index 0f1b2669d4b..9e6701c2180 100644 --- a/samples/client/petstore/java/docs/components/schemas/GrandparentAnimal.md +++ b/samples/client/petstore/java/docs/components/schemas/GrandparentAnimal.md @@ -4,7 +4,7 @@ public class GrandparentAnimal
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,37 +12,38 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [GrandparentAnimal.GrandparentAnimal1Boxed](#grandparentanimal1boxed)
abstract sealed validated payload class | -| static class | [GrandparentAnimal.GrandparentAnimal1BoxedMap](#grandparentanimal1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [GrandparentAnimal.GrandparentAnimal1Boxed](#grandparentanimal1boxed)
sealed interface for validated payloads | +| record | [GrandparentAnimal.GrandparentAnimal1BoxedMap](#grandparentanimal1boxedmap)
boxed class to store validated Map payloads | | static class | [GrandparentAnimal.GrandparentAnimal1](#grandparentanimal1)
schema class | | static class | [GrandparentAnimal.GrandparentAnimalMapBuilder](#grandparentanimalmapbuilder)
builder for Map payloads | | static class | [GrandparentAnimal.GrandparentAnimalMap](#grandparentanimalmap)
output class for Map payloads | -| static class | [GrandparentAnimal.PetTypeBoxed](#pettypeboxed)
abstract sealed validated payload class | -| static class | [GrandparentAnimal.PetTypeBoxedString](#pettypeboxedstring)
boxed class to store validated String payloads | +| sealed interface | [GrandparentAnimal.PetTypeBoxed](#pettypeboxed)
sealed interface for validated payloads | +| record | [GrandparentAnimal.PetTypeBoxedString](#pettypeboxedstring)
boxed class to store validated String payloads | | static class | [GrandparentAnimal.PetType](#pettype)
schema class | ## GrandparentAnimal1Boxed -public static abstract sealed class GrandparentAnimal1Boxed
+public sealed interface GrandparentAnimal1Boxed
permits
[GrandparentAnimal1BoxedMap](#grandparentanimal1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## GrandparentAnimal1BoxedMap -public static final class GrandparentAnimal1BoxedMap
-extends [GrandparentAnimal1Boxed](#grandparentanimal1boxed) +public record GrandparentAnimal1BoxedMap
+implements [GrandparentAnimal1Boxed](#grandparentanimal1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | GrandparentAnimal1BoxedMap([GrandparentAnimalMap](#grandparentanimalmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [GrandparentAnimalMap](#grandparentanimalmap) | data
validated payload | +| [GrandparentAnimalMap](#grandparentanimalmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## GrandparentAnimal1 public static class GrandparentAnimal1
@@ -88,7 +89,9 @@ GrandparentAnimal.GrandparentAnimalMap validatedPayload = | ----------------- | ---------------------- | | [GrandparentAnimalMap](#grandparentanimalmap) | validate([Map<?, ?>](#grandparentanimalmapbuilder) arg, SchemaConfiguration configuration) | | [GrandparentAnimal1BoxedMap](#grandparentanimal1boxedmap) | validateAndBox([Map<?, ?>](#grandparentanimalmapbuilder) arg, SchemaConfiguration configuration) | +| [GrandparentAnimal1Boxed](#grandparentanimal1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## GrandparentAnimalMap0Builder public class GrandparentAnimalMap0Builder
builder for `Map` @@ -144,27 +147,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## PetTypeBoxed -public static abstract sealed class PetTypeBoxed
+public sealed interface PetTypeBoxed
permits
[PetTypeBoxedString](#pettypeboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## PetTypeBoxedString -public static final class PetTypeBoxedString
-extends [PetTypeBoxed](#pettypeboxed) +public record PetTypeBoxedString
+implements [PetTypeBoxed](#pettypeboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PetTypeBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PetType public static class PetType
diff --git a/samples/client/petstore/java/docs/components/schemas/HasOnlyReadOnly.md b/samples/client/petstore/java/docs/components/schemas/HasOnlyReadOnly.md index 28264de49f3..252bc0f7629 100644 --- a/samples/client/petstore/java/docs/components/schemas/HasOnlyReadOnly.md +++ b/samples/client/petstore/java/docs/components/schemas/HasOnlyReadOnly.md @@ -4,7 +4,7 @@ public class HasOnlyReadOnly
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,40 +12,41 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [HasOnlyReadOnly.HasOnlyReadOnly1Boxed](#hasonlyreadonly1boxed)
abstract sealed validated payload class | -| static class | [HasOnlyReadOnly.HasOnlyReadOnly1BoxedMap](#hasonlyreadonly1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [HasOnlyReadOnly.HasOnlyReadOnly1Boxed](#hasonlyreadonly1boxed)
sealed interface for validated payloads | +| record | [HasOnlyReadOnly.HasOnlyReadOnly1BoxedMap](#hasonlyreadonly1boxedmap)
boxed class to store validated Map payloads | | static class | [HasOnlyReadOnly.HasOnlyReadOnly1](#hasonlyreadonly1)
schema class | | static class | [HasOnlyReadOnly.HasOnlyReadOnlyMapBuilder](#hasonlyreadonlymapbuilder)
builder for Map payloads | | static class | [HasOnlyReadOnly.HasOnlyReadOnlyMap](#hasonlyreadonlymap)
output class for Map payloads | -| static class | [HasOnlyReadOnly.FooBoxed](#fooboxed)
abstract sealed validated payload class | -| static class | [HasOnlyReadOnly.FooBoxedString](#fooboxedstring)
boxed class to store validated String payloads | +| sealed interface | [HasOnlyReadOnly.FooBoxed](#fooboxed)
sealed interface for validated payloads | +| record | [HasOnlyReadOnly.FooBoxedString](#fooboxedstring)
boxed class to store validated String payloads | | static class | [HasOnlyReadOnly.Foo](#foo)
schema class | -| static class | [HasOnlyReadOnly.BarBoxed](#barboxed)
abstract sealed validated payload class | -| static class | [HasOnlyReadOnly.BarBoxedString](#barboxedstring)
boxed class to store validated String payloads | +| sealed interface | [HasOnlyReadOnly.BarBoxed](#barboxed)
sealed interface for validated payloads | +| record | [HasOnlyReadOnly.BarBoxedString](#barboxedstring)
boxed class to store validated String payloads | | static class | [HasOnlyReadOnly.Bar](#bar)
schema class | ## HasOnlyReadOnly1Boxed -public static abstract sealed class HasOnlyReadOnly1Boxed
+public sealed interface HasOnlyReadOnly1Boxed
permits
[HasOnlyReadOnly1BoxedMap](#hasonlyreadonly1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## HasOnlyReadOnly1BoxedMap -public static final class HasOnlyReadOnly1BoxedMap
-extends [HasOnlyReadOnly1Boxed](#hasonlyreadonly1boxed) +public record HasOnlyReadOnly1BoxedMap
+implements [HasOnlyReadOnly1Boxed](#hasonlyreadonly1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | HasOnlyReadOnly1BoxedMap([HasOnlyReadOnlyMap](#hasonlyreadonlymap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [HasOnlyReadOnlyMap](#hasonlyreadonlymap) | data
validated payload | +| [HasOnlyReadOnlyMap](#hasonlyreadonlymap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## HasOnlyReadOnly1 public static class HasOnlyReadOnly1
@@ -92,7 +93,9 @@ HasOnlyReadOnly.HasOnlyReadOnlyMap validatedPayload = | ----------------- | ---------------------- | | [HasOnlyReadOnlyMap](#hasonlyreadonlymap) | validate([Map<?, ?>](#hasonlyreadonlymapbuilder) arg, SchemaConfiguration configuration) | | [HasOnlyReadOnly1BoxedMap](#hasonlyreadonly1boxedmap) | validateAndBox([Map<?, ?>](#hasonlyreadonlymapbuilder) arg, SchemaConfiguration configuration) | +| [HasOnlyReadOnly1Boxed](#hasonlyreadonly1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## HasOnlyReadOnlyMapBuilder public class HasOnlyReadOnlyMapBuilder
builder for `Map` @@ -135,27 +138,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## FooBoxed -public static abstract sealed class FooBoxed
+public sealed interface FooBoxed
permits
[FooBoxedString](#fooboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## FooBoxedString -public static final class FooBoxedString
-extends [FooBoxed](#fooboxed) +public record FooBoxedString
+implements [FooBoxed](#fooboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FooBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Foo public static class Foo
@@ -169,27 +173,28 @@ A schema class that validates payloads | validateAndBox | ## BarBoxed -public static abstract sealed class BarBoxed
+public sealed interface BarBoxed
permits
[BarBoxedString](#barboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## BarBoxedString -public static final class BarBoxedString
-extends [BarBoxed](#barboxed) +public record BarBoxedString
+implements [BarBoxed](#barboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BarBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Bar public static class Bar
diff --git a/samples/client/petstore/java/docs/components/schemas/HealthCheckResult.md b/samples/client/petstore/java/docs/components/schemas/HealthCheckResult.md index e670d2ec230..a61f82783c7 100644 --- a/samples/client/petstore/java/docs/components/schemas/HealthCheckResult.md +++ b/samples/client/petstore/java/docs/components/schemas/HealthCheckResult.md @@ -4,7 +4,7 @@ public class HealthCheckResult
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,38 +12,39 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [HealthCheckResult.HealthCheckResult1Boxed](#healthcheckresult1boxed)
abstract sealed validated payload class | -| static class | [HealthCheckResult.HealthCheckResult1BoxedMap](#healthcheckresult1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [HealthCheckResult.HealthCheckResult1Boxed](#healthcheckresult1boxed)
sealed interface for validated payloads | +| record | [HealthCheckResult.HealthCheckResult1BoxedMap](#healthcheckresult1boxedmap)
boxed class to store validated Map payloads | | static class | [HealthCheckResult.HealthCheckResult1](#healthcheckresult1)
schema class | | static class | [HealthCheckResult.HealthCheckResultMapBuilder](#healthcheckresultmapbuilder)
builder for Map payloads | | static class | [HealthCheckResult.HealthCheckResultMap](#healthcheckresultmap)
output class for Map payloads | -| static class | [HealthCheckResult.NullableMessageBoxed](#nullablemessageboxed)
abstract sealed validated payload class | -| static class | [HealthCheckResult.NullableMessageBoxedVoid](#nullablemessageboxedvoid)
boxed class to store validated null payloads | -| static class | [HealthCheckResult.NullableMessageBoxedString](#nullablemessageboxedstring)
boxed class to store validated String payloads | +| sealed interface | [HealthCheckResult.NullableMessageBoxed](#nullablemessageboxed)
sealed interface for validated payloads | +| record | [HealthCheckResult.NullableMessageBoxedVoid](#nullablemessageboxedvoid)
boxed class to store validated null payloads | +| record | [HealthCheckResult.NullableMessageBoxedString](#nullablemessageboxedstring)
boxed class to store validated String payloads | | static class | [HealthCheckResult.NullableMessage](#nullablemessage)
schema class | ## HealthCheckResult1Boxed -public static abstract sealed class HealthCheckResult1Boxed
+public sealed interface HealthCheckResult1Boxed
permits
[HealthCheckResult1BoxedMap](#healthcheckresult1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## HealthCheckResult1BoxedMap -public static final class HealthCheckResult1BoxedMap
-extends [HealthCheckResult1Boxed](#healthcheckresult1boxed) +public record HealthCheckResult1BoxedMap
+implements [HealthCheckResult1Boxed](#healthcheckresult1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | HealthCheckResult1BoxedMap([HealthCheckResultMap](#healthcheckresultmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [HealthCheckResultMap](#healthcheckresultmap) | data
validated payload | +| [HealthCheckResultMap](#healthcheckresultmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## HealthCheckResult1 public static class HealthCheckResult1
@@ -91,7 +92,9 @@ HealthCheckResult.HealthCheckResultMap validatedPayload = | ----------------- | ---------------------- | | [HealthCheckResultMap](#healthcheckresultmap) | validate([Map<?, ?>](#healthcheckresultmapbuilder) arg, SchemaConfiguration configuration) | | [HealthCheckResult1BoxedMap](#healthcheckresult1boxedmap) | validateAndBox([Map<?, ?>](#healthcheckresultmapbuilder) arg, SchemaConfiguration configuration) | +| [HealthCheckResult1Boxed](#healthcheckresult1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## HealthCheckResultMapBuilder public class HealthCheckResultMapBuilder
builder for `Map` @@ -133,44 +136,46 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## NullableMessageBoxed -public static abstract sealed class NullableMessageBoxed
+public sealed interface NullableMessageBoxed
permits
[NullableMessageBoxedVoid](#nullablemessageboxedvoid), [NullableMessageBoxedString](#nullablemessageboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## NullableMessageBoxedVoid -public static final class NullableMessageBoxedVoid
-extends [NullableMessageBoxed](#nullablemessageboxed) +public record NullableMessageBoxedVoid
+implements [NullableMessageBoxed](#nullablemessageboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NullableMessageBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NullableMessageBoxedString -public static final class NullableMessageBoxedString
-extends [NullableMessageBoxed](#nullablemessageboxed) +public record NullableMessageBoxedString
+implements [NullableMessageBoxed](#nullablemessageboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NullableMessageBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NullableMessage public static class NullableMessage
@@ -218,5 +223,7 @@ String validatedPayload = HealthCheckResult.NullableMessage.validate( | [NullableMessageBoxedVoid](#nullablemessageboxedvoid) | validateAndBox(Void arg, SchemaConfiguration configuration) | | String | validate(String arg, SchemaConfiguration configuration) | | [NullableMessageBoxedString](#nullablemessageboxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [NullableMessageBoxed](#nullablemessageboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/components/schemas/IntegerEnum.md b/samples/client/petstore/java/docs/components/schemas/IntegerEnum.md index e77221ae961..888d394e7b7 100644 --- a/samples/client/petstore/java/docs/components/schemas/IntegerEnum.md +++ b/samples/client/petstore/java/docs/components/schemas/IntegerEnum.md @@ -4,15 +4,15 @@ public class IntegerEnum
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - enum classes ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [IntegerEnum.IntegerEnum1Boxed](#integerenum1boxed)
abstract sealed validated payload class | -| static class | [IntegerEnum.IntegerEnum1BoxedNumber](#integerenum1boxednumber)
boxed class to store validated Number payloads | +| sealed interface | [IntegerEnum.IntegerEnum1Boxed](#integerenum1boxed)
sealed interface for validated payloads | +| record | [IntegerEnum.IntegerEnum1BoxedNumber](#integerenum1boxednumber)
boxed class to store validated Number payloads | | static class | [IntegerEnum.IntegerEnum1](#integerenum1)
schema class | | enum | [IntegerEnum.IntegerIntegerEnumEnums](#integerintegerenumenums)
Integer enum | | enum | [IntegerEnum.LongIntegerEnumEnums](#longintegerenumenums)
Long enum | @@ -20,27 +20,28 @@ A class that contains necessary nested | enum | [IntegerEnum.DoubleIntegerEnumEnums](#doubleintegerenumenums)
Double enum | ## IntegerEnum1Boxed -public static abstract sealed class IntegerEnum1Boxed
+public sealed interface IntegerEnum1Boxed
permits
[IntegerEnum1BoxedNumber](#integerenum1boxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## IntegerEnum1BoxedNumber -public static final class IntegerEnum1BoxedNumber
-extends [IntegerEnum1Boxed](#integerenum1boxed) +public record IntegerEnum1BoxedNumber
+implements [IntegerEnum1Boxed](#integerenum1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IntegerEnum1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IntegerEnum1 public static class IntegerEnum1
@@ -82,7 +83,9 @@ int validatedPayload = IntegerEnum.IntegerEnum1.validate( | ----------------- | ---------------------- | | long | validate(long arg, SchemaConfiguration configuration) | | [IntegerEnum1BoxedNumber](#integerenum1boxednumber) | validateAndBox(Number arg, SchemaConfiguration configuration) | +| [IntegerEnum1Boxed](#integerenum1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## IntegerIntegerEnumEnums public enum IntegerIntegerEnumEnums
extends `Enum` diff --git a/samples/client/petstore/java/docs/components/schemas/IntegerEnumBig.md b/samples/client/petstore/java/docs/components/schemas/IntegerEnumBig.md index fd20c6306fa..058b350ebd3 100644 --- a/samples/client/petstore/java/docs/components/schemas/IntegerEnumBig.md +++ b/samples/client/petstore/java/docs/components/schemas/IntegerEnumBig.md @@ -4,15 +4,15 @@ public class IntegerEnumBig
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - enum classes ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [IntegerEnumBig.IntegerEnumBig1Boxed](#integerenumbig1boxed)
abstract sealed validated payload class | -| static class | [IntegerEnumBig.IntegerEnumBig1BoxedNumber](#integerenumbig1boxednumber)
boxed class to store validated Number payloads | +| sealed interface | [IntegerEnumBig.IntegerEnumBig1Boxed](#integerenumbig1boxed)
sealed interface for validated payloads | +| record | [IntegerEnumBig.IntegerEnumBig1BoxedNumber](#integerenumbig1boxednumber)
boxed class to store validated Number payloads | | static class | [IntegerEnumBig.IntegerEnumBig1](#integerenumbig1)
schema class | | enum | [IntegerEnumBig.IntegerIntegerEnumBigEnums](#integerintegerenumbigenums)
Integer enum | | enum | [IntegerEnumBig.LongIntegerEnumBigEnums](#longintegerenumbigenums)
Long enum | @@ -20,27 +20,28 @@ A class that contains necessary nested | enum | [IntegerEnumBig.DoubleIntegerEnumBigEnums](#doubleintegerenumbigenums)
Double enum | ## IntegerEnumBig1Boxed -public static abstract sealed class IntegerEnumBig1Boxed
+public sealed interface IntegerEnumBig1Boxed
permits
[IntegerEnumBig1BoxedNumber](#integerenumbig1boxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## IntegerEnumBig1BoxedNumber -public static final class IntegerEnumBig1BoxedNumber
-extends [IntegerEnumBig1Boxed](#integerenumbig1boxed) +public record IntegerEnumBig1BoxedNumber
+implements [IntegerEnumBig1Boxed](#integerenumbig1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IntegerEnumBig1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IntegerEnumBig1 public static class IntegerEnumBig1
@@ -82,7 +83,9 @@ int validatedPayload = IntegerEnumBig.IntegerEnumBig1.validate( | ----------------- | ---------------------- | | long | validate(long arg, SchemaConfiguration configuration) | | [IntegerEnumBig1BoxedNumber](#integerenumbig1boxednumber) | validateAndBox(Number arg, SchemaConfiguration configuration) | +| [IntegerEnumBig1Boxed](#integerenumbig1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## IntegerIntegerEnumBigEnums public enum IntegerIntegerEnumBigEnums
extends `Enum` diff --git a/samples/client/petstore/java/docs/components/schemas/IntegerEnumOneValue.md b/samples/client/petstore/java/docs/components/schemas/IntegerEnumOneValue.md index 5a5b80bd0bc..15dbdcd914a 100644 --- a/samples/client/petstore/java/docs/components/schemas/IntegerEnumOneValue.md +++ b/samples/client/petstore/java/docs/components/schemas/IntegerEnumOneValue.md @@ -4,15 +4,15 @@ public class IntegerEnumOneValue
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - enum classes ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [IntegerEnumOneValue.IntegerEnumOneValue1Boxed](#integerenumonevalue1boxed)
abstract sealed validated payload class | -| static class | [IntegerEnumOneValue.IntegerEnumOneValue1BoxedNumber](#integerenumonevalue1boxednumber)
boxed class to store validated Number payloads | +| sealed interface | [IntegerEnumOneValue.IntegerEnumOneValue1Boxed](#integerenumonevalue1boxed)
sealed interface for validated payloads | +| record | [IntegerEnumOneValue.IntegerEnumOneValue1BoxedNumber](#integerenumonevalue1boxednumber)
boxed class to store validated Number payloads | | static class | [IntegerEnumOneValue.IntegerEnumOneValue1](#integerenumonevalue1)
schema class | | enum | [IntegerEnumOneValue.IntegerIntegerEnumOneValueEnums](#integerintegerenumonevalueenums)
Integer enum | | enum | [IntegerEnumOneValue.LongIntegerEnumOneValueEnums](#longintegerenumonevalueenums)
Long enum | @@ -20,27 +20,28 @@ A class that contains necessary nested | enum | [IntegerEnumOneValue.DoubleIntegerEnumOneValueEnums](#doubleintegerenumonevalueenums)
Double enum | ## IntegerEnumOneValue1Boxed -public static abstract sealed class IntegerEnumOneValue1Boxed
+public sealed interface IntegerEnumOneValue1Boxed
permits
[IntegerEnumOneValue1BoxedNumber](#integerenumonevalue1boxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## IntegerEnumOneValue1BoxedNumber -public static final class IntegerEnumOneValue1BoxedNumber
-extends [IntegerEnumOneValue1Boxed](#integerenumonevalue1boxed) +public record IntegerEnumOneValue1BoxedNumber
+implements [IntegerEnumOneValue1Boxed](#integerenumonevalue1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IntegerEnumOneValue1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IntegerEnumOneValue1 public static class IntegerEnumOneValue1
@@ -82,7 +83,9 @@ int validatedPayload = IntegerEnumOneValue.IntegerEnumOneValue1.validate( | ----------------- | ---------------------- | | long | validate(long arg, SchemaConfiguration configuration) | | [IntegerEnumOneValue1BoxedNumber](#integerenumonevalue1boxednumber) | validateAndBox(Number arg, SchemaConfiguration configuration) | +| [IntegerEnumOneValue1Boxed](#integerenumonevalue1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## IntegerIntegerEnumOneValueEnums public enum IntegerIntegerEnumOneValueEnums
extends `Enum` diff --git a/samples/client/petstore/java/docs/components/schemas/IntegerEnumWithDefaultValue.md b/samples/client/petstore/java/docs/components/schemas/IntegerEnumWithDefaultValue.md index c6082581724..f26a7573a3b 100644 --- a/samples/client/petstore/java/docs/components/schemas/IntegerEnumWithDefaultValue.md +++ b/samples/client/petstore/java/docs/components/schemas/IntegerEnumWithDefaultValue.md @@ -4,15 +4,15 @@ public class IntegerEnumWithDefaultValue
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - enum classes ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [IntegerEnumWithDefaultValue.IntegerEnumWithDefaultValue1Boxed](#integerenumwithdefaultvalue1boxed)
abstract sealed validated payload class | -| static class | [IntegerEnumWithDefaultValue.IntegerEnumWithDefaultValue1BoxedNumber](#integerenumwithdefaultvalue1boxednumber)
boxed class to store validated Number payloads | +| sealed interface | [IntegerEnumWithDefaultValue.IntegerEnumWithDefaultValue1Boxed](#integerenumwithdefaultvalue1boxed)
sealed interface for validated payloads | +| record | [IntegerEnumWithDefaultValue.IntegerEnumWithDefaultValue1BoxedNumber](#integerenumwithdefaultvalue1boxednumber)
boxed class to store validated Number payloads | | static class | [IntegerEnumWithDefaultValue.IntegerEnumWithDefaultValue1](#integerenumwithdefaultvalue1)
schema class | | enum | [IntegerEnumWithDefaultValue.IntegerIntegerEnumWithDefaultValueEnums](#integerintegerenumwithdefaultvalueenums)
Integer enum | | enum | [IntegerEnumWithDefaultValue.LongIntegerEnumWithDefaultValueEnums](#longintegerenumwithdefaultvalueenums)
Long enum | @@ -20,27 +20,28 @@ A class that contains necessary nested | enum | [IntegerEnumWithDefaultValue.DoubleIntegerEnumWithDefaultValueEnums](#doubleintegerenumwithdefaultvalueenums)
Double enum | ## IntegerEnumWithDefaultValue1Boxed -public static abstract sealed class IntegerEnumWithDefaultValue1Boxed
+public sealed interface IntegerEnumWithDefaultValue1Boxed
permits
[IntegerEnumWithDefaultValue1BoxedNumber](#integerenumwithdefaultvalue1boxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## IntegerEnumWithDefaultValue1BoxedNumber -public static final class IntegerEnumWithDefaultValue1BoxedNumber
-extends [IntegerEnumWithDefaultValue1Boxed](#integerenumwithdefaultvalue1boxed) +public record IntegerEnumWithDefaultValue1BoxedNumber
+implements [IntegerEnumWithDefaultValue1Boxed](#integerenumwithdefaultvalue1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IntegerEnumWithDefaultValue1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IntegerEnumWithDefaultValue1 public static class IntegerEnumWithDefaultValue1
@@ -83,7 +84,9 @@ int validatedPayload = IntegerEnumWithDefaultValue.IntegerEnumWithDefaultValue1. | ----------------- | ---------------------- | | long | validate(long arg, SchemaConfiguration configuration) | | [IntegerEnumWithDefaultValue1BoxedNumber](#integerenumwithdefaultvalue1boxednumber) | validateAndBox(Number arg, SchemaConfiguration configuration) | +| [IntegerEnumWithDefaultValue1Boxed](#integerenumwithdefaultvalue1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## IntegerIntegerEnumWithDefaultValueEnums public enum IntegerIntegerEnumWithDefaultValueEnums
extends `Enum` diff --git a/samples/client/petstore/java/docs/components/schemas/IntegerMax10.md b/samples/client/petstore/java/docs/components/schemas/IntegerMax10.md index a6224f3591a..808d7df25b6 100644 --- a/samples/client/petstore/java/docs/components/schemas/IntegerMax10.md +++ b/samples/client/petstore/java/docs/components/schemas/IntegerMax10.md @@ -4,38 +4,39 @@ public class IntegerMax10
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [IntegerMax10.IntegerMax101Boxed](#integermax101boxed)
abstract sealed validated payload class | -| static class | [IntegerMax10.IntegerMax101BoxedNumber](#integermax101boxednumber)
boxed class to store validated Number payloads | +| sealed interface | [IntegerMax10.IntegerMax101Boxed](#integermax101boxed)
sealed interface for validated payloads | +| record | [IntegerMax10.IntegerMax101BoxedNumber](#integermax101boxednumber)
boxed class to store validated Number payloads | | static class | [IntegerMax10.IntegerMax101](#integermax101)
schema class | ## IntegerMax101Boxed -public static abstract sealed class IntegerMax101Boxed
+public sealed interface IntegerMax101Boxed
permits
[IntegerMax101BoxedNumber](#integermax101boxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## IntegerMax101BoxedNumber -public static final class IntegerMax101BoxedNumber
-extends [IntegerMax101Boxed](#integermax101boxed) +public record IntegerMax101BoxedNumber
+implements [IntegerMax101Boxed](#integermax101boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IntegerMax101BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IntegerMax101 public static class IntegerMax101
@@ -77,5 +78,7 @@ long validatedPayload = IntegerMax10.IntegerMax101.validate( | ----------------- | ---------------------- | | long | validate(long arg, SchemaConfiguration configuration) | | [IntegerMax101BoxedNumber](#integermax101boxednumber) | validateAndBox(Number arg, SchemaConfiguration configuration) | +| [IntegerMax101Boxed](#integermax101boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/components/schemas/IntegerMin15.md b/samples/client/petstore/java/docs/components/schemas/IntegerMin15.md index b2101538e87..2576aa21b9d 100644 --- a/samples/client/petstore/java/docs/components/schemas/IntegerMin15.md +++ b/samples/client/petstore/java/docs/components/schemas/IntegerMin15.md @@ -4,38 +4,39 @@ public class IntegerMin15
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [IntegerMin15.IntegerMin151Boxed](#integermin151boxed)
abstract sealed validated payload class | -| static class | [IntegerMin15.IntegerMin151BoxedNumber](#integermin151boxednumber)
boxed class to store validated Number payloads | +| sealed interface | [IntegerMin15.IntegerMin151Boxed](#integermin151boxed)
sealed interface for validated payloads | +| record | [IntegerMin15.IntegerMin151BoxedNumber](#integermin151boxednumber)
boxed class to store validated Number payloads | | static class | [IntegerMin15.IntegerMin151](#integermin151)
schema class | ## IntegerMin151Boxed -public static abstract sealed class IntegerMin151Boxed
+public sealed interface IntegerMin151Boxed
permits
[IntegerMin151BoxedNumber](#integermin151boxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## IntegerMin151BoxedNumber -public static final class IntegerMin151BoxedNumber
-extends [IntegerMin151Boxed](#integermin151boxed) +public record IntegerMin151BoxedNumber
+implements [IntegerMin151Boxed](#integermin151boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IntegerMin151BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IntegerMin151 public static class IntegerMin151
@@ -77,5 +78,7 @@ long validatedPayload = IntegerMin15.IntegerMin151.validate( | ----------------- | ---------------------- | | long | validate(long arg, SchemaConfiguration configuration) | | [IntegerMin151BoxedNumber](#integermin151boxednumber) | validateAndBox(Number arg, SchemaConfiguration configuration) | +| [IntegerMin151Boxed](#integermin151boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/components/schemas/IsoscelesTriangle.md b/samples/client/petstore/java/docs/components/schemas/IsoscelesTriangle.md index d8810eb1ccc..5719763bd79 100644 --- a/samples/client/petstore/java/docs/components/schemas/IsoscelesTriangle.md +++ b/samples/client/petstore/java/docs/components/schemas/IsoscelesTriangle.md @@ -4,7 +4,7 @@ public class IsoscelesTriangle
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -13,26 +13,26 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [IsoscelesTriangle.IsoscelesTriangle1Boxed](#isoscelestriangle1boxed)
abstract sealed validated payload class | -| static class | [IsoscelesTriangle.IsoscelesTriangle1BoxedVoid](#isoscelestriangle1boxedvoid)
boxed class to store validated null payloads | -| static class | [IsoscelesTriangle.IsoscelesTriangle1BoxedBoolean](#isoscelestriangle1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [IsoscelesTriangle.IsoscelesTriangle1BoxedNumber](#isoscelestriangle1boxednumber)
boxed class to store validated Number payloads | -| static class | [IsoscelesTriangle.IsoscelesTriangle1BoxedString](#isoscelestriangle1boxedstring)
boxed class to store validated String payloads | -| static class | [IsoscelesTriangle.IsoscelesTriangle1BoxedList](#isoscelestriangle1boxedlist)
boxed class to store validated List payloads | -| static class | [IsoscelesTriangle.IsoscelesTriangle1BoxedMap](#isoscelestriangle1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [IsoscelesTriangle.IsoscelesTriangle1Boxed](#isoscelestriangle1boxed)
sealed interface for validated payloads | +| record | [IsoscelesTriangle.IsoscelesTriangle1BoxedVoid](#isoscelestriangle1boxedvoid)
boxed class to store validated null payloads | +| record | [IsoscelesTriangle.IsoscelesTriangle1BoxedBoolean](#isoscelestriangle1boxedboolean)
boxed class to store validated boolean payloads | +| record | [IsoscelesTriangle.IsoscelesTriangle1BoxedNumber](#isoscelestriangle1boxednumber)
boxed class to store validated Number payloads | +| record | [IsoscelesTriangle.IsoscelesTriangle1BoxedString](#isoscelestriangle1boxedstring)
boxed class to store validated String payloads | +| record | [IsoscelesTriangle.IsoscelesTriangle1BoxedList](#isoscelestriangle1boxedlist)
boxed class to store validated List payloads | +| record | [IsoscelesTriangle.IsoscelesTriangle1BoxedMap](#isoscelestriangle1boxedmap)
boxed class to store validated Map payloads | | static class | [IsoscelesTriangle.IsoscelesTriangle1](#isoscelestriangle1)
schema class | -| static class | [IsoscelesTriangle.Schema1Boxed](#schema1boxed)
abstract sealed validated payload class | -| static class | [IsoscelesTriangle.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [IsoscelesTriangle.Schema1Boxed](#schema1boxed)
sealed interface for validated payloads | +| record | [IsoscelesTriangle.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | | static class | [IsoscelesTriangle.Schema1](#schema1)
schema class | | static class | [IsoscelesTriangle.Schema1MapBuilder](#schema1mapbuilder)
builder for Map payloads | | static class | [IsoscelesTriangle.Schema1Map](#schema1map)
output class for Map payloads | -| static class | [IsoscelesTriangle.TriangleTypeBoxed](#triangletypeboxed)
abstract sealed validated payload class | -| static class | [IsoscelesTriangle.TriangleTypeBoxedString](#triangletypeboxedstring)
boxed class to store validated String payloads | +| sealed interface | [IsoscelesTriangle.TriangleTypeBoxed](#triangletypeboxed)
sealed interface for validated payloads | +| record | [IsoscelesTriangle.TriangleTypeBoxedString](#triangletypeboxedstring)
boxed class to store validated String payloads | | static class | [IsoscelesTriangle.TriangleType](#triangletype)
schema class | | enum | [IsoscelesTriangle.StringTriangleTypeEnums](#stringtriangletypeenums)
String enum | ## IsoscelesTriangle1Boxed -public static abstract sealed class IsoscelesTriangle1Boxed
+public sealed interface IsoscelesTriangle1Boxed
permits
[IsoscelesTriangle1BoxedVoid](#isoscelestriangle1boxedvoid), [IsoscelesTriangle1BoxedBoolean](#isoscelestriangle1boxedboolean), @@ -41,103 +41,109 @@ permits
[IsoscelesTriangle1BoxedList](#isoscelestriangle1boxedlist), [IsoscelesTriangle1BoxedMap](#isoscelestriangle1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## IsoscelesTriangle1BoxedVoid -public static final class IsoscelesTriangle1BoxedVoid
-extends [IsoscelesTriangle1Boxed](#isoscelestriangle1boxed) +public record IsoscelesTriangle1BoxedVoid
+implements [IsoscelesTriangle1Boxed](#isoscelestriangle1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IsoscelesTriangle1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IsoscelesTriangle1BoxedBoolean -public static final class IsoscelesTriangle1BoxedBoolean
-extends [IsoscelesTriangle1Boxed](#isoscelestriangle1boxed) +public record IsoscelesTriangle1BoxedBoolean
+implements [IsoscelesTriangle1Boxed](#isoscelestriangle1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IsoscelesTriangle1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IsoscelesTriangle1BoxedNumber -public static final class IsoscelesTriangle1BoxedNumber
-extends [IsoscelesTriangle1Boxed](#isoscelestriangle1boxed) +public record IsoscelesTriangle1BoxedNumber
+implements [IsoscelesTriangle1Boxed](#isoscelestriangle1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IsoscelesTriangle1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IsoscelesTriangle1BoxedString -public static final class IsoscelesTriangle1BoxedString
-extends [IsoscelesTriangle1Boxed](#isoscelestriangle1boxed) +public record IsoscelesTriangle1BoxedString
+implements [IsoscelesTriangle1Boxed](#isoscelestriangle1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IsoscelesTriangle1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IsoscelesTriangle1BoxedList -public static final class IsoscelesTriangle1BoxedList
-extends [IsoscelesTriangle1Boxed](#isoscelestriangle1boxed) +public record IsoscelesTriangle1BoxedList
+implements [IsoscelesTriangle1Boxed](#isoscelestriangle1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IsoscelesTriangle1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IsoscelesTriangle1BoxedMap -public static final class IsoscelesTriangle1BoxedMap
-extends [IsoscelesTriangle1Boxed](#isoscelestriangle1boxed) +public record IsoscelesTriangle1BoxedMap
+implements [IsoscelesTriangle1Boxed](#isoscelestriangle1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IsoscelesTriangle1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IsoscelesTriangle1 public static class IsoscelesTriangle1
@@ -169,29 +175,32 @@ A schema class that validates payloads | [IsoscelesTriangle1BoxedBoolean](#isoscelestriangle1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [IsoscelesTriangle1BoxedMap](#isoscelestriangle1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [IsoscelesTriangle1BoxedList](#isoscelestriangle1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [IsoscelesTriangle1Boxed](#isoscelestriangle1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema1Boxed -public static abstract sealed class Schema1Boxed
+public sealed interface Schema1Boxed
permits
[Schema1BoxedMap](#schema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema1BoxedMap -public static final class Schema1BoxedMap
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedMap
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedMap([Schema1Map](#schema1map) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [Schema1Map](#schema1map) | data
validated payload | +| [Schema1Map](#schema1map) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1 public static class Schema1
@@ -236,7 +245,9 @@ IsoscelesTriangle.Schema1Map validatedPayload = | ----------------- | ---------------------- | | [Schema1Map](#schema1map) | validate([Map<?, ?>](#schema1mapbuilder) arg, SchemaConfiguration configuration) | | [Schema1BoxedMap](#schema1boxedmap) | validateAndBox([Map<?, ?>](#schema1mapbuilder) arg, SchemaConfiguration configuration) | +| [Schema1Boxed](#schema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema1MapBuilder public class Schema1MapBuilder
builder for `Map` @@ -278,27 +289,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## TriangleTypeBoxed -public static abstract sealed class TriangleTypeBoxed
+public sealed interface TriangleTypeBoxed
permits
[TriangleTypeBoxedString](#triangletypeboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## TriangleTypeBoxedString -public static final class TriangleTypeBoxedString
-extends [TriangleTypeBoxed](#triangletypeboxed) +public record TriangleTypeBoxedString
+implements [TriangleTypeBoxed](#triangletypeboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | TriangleTypeBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## TriangleType public static class TriangleType
@@ -340,7 +352,9 @@ String validatedPayload = IsoscelesTriangle.TriangleType.validate( | String | validate(String arg, SchemaConfiguration configuration) | | String | validate([StringTriangleTypeEnums](#stringtriangletypeenums) arg, SchemaConfiguration configuration) | | [TriangleTypeBoxedString](#triangletypeboxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [TriangleTypeBoxed](#triangletypeboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## StringTriangleTypeEnums public enum StringTriangleTypeEnums
extends `Enum` diff --git a/samples/client/petstore/java/docs/components/schemas/Items.md b/samples/client/petstore/java/docs/components/schemas/Items.md index 48718978f46..195123915d3 100644 --- a/samples/client/petstore/java/docs/components/schemas/Items.md +++ b/samples/client/petstore/java/docs/components/schemas/Items.md @@ -4,7 +4,7 @@ public class Items
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated list payloads, extends FrozenList - classes to build inputs for list payloads @@ -12,37 +12,38 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Items.Items1Boxed](#items1boxed)
abstract sealed validated payload class | -| static class | [Items.Items1BoxedList](#items1boxedlist)
boxed class to store validated List payloads | +| sealed interface | [Items.Items1Boxed](#items1boxed)
sealed interface for validated payloads | +| record | [Items.Items1BoxedList](#items1boxedlist)
boxed class to store validated List payloads | | static class | [Items.Items1](#items1)
schema class | | static class | [Items.ItemsListBuilder](#itemslistbuilder)
builder for List payloads | | static class | [Items.ItemsList](#itemslist)
output class for List payloads | -| static class | [Items.Items2Boxed](#items2boxed)
abstract sealed validated payload class | -| static class | [Items.Items2BoxedMap](#items2boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [Items.Items2Boxed](#items2boxed)
sealed interface for validated payloads | +| record | [Items.Items2BoxedMap](#items2boxedmap)
boxed class to store validated Map payloads | | static class | [Items.Items2](#items2)
schema class | ## Items1Boxed -public static abstract sealed class Items1Boxed
+public sealed interface Items1Boxed
permits
[Items1BoxedList](#items1boxedlist) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Items1BoxedList -public static final class Items1BoxedList
-extends [Items1Boxed](#items1boxed) +public record Items1BoxedList
+implements [Items1Boxed](#items1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Items1BoxedList([ItemsList](#itemslist) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [ItemsList](#itemslist) | data
validated payload | +| [ItemsList](#itemslist) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Items1 public static class Items1
@@ -88,7 +89,9 @@ Items.ItemsList validatedPayload = | ----------------- | ---------------------- | | [ItemsList](#itemslist) | validate([List](#itemslistbuilder) arg, SchemaConfiguration configuration) | | [Items1BoxedList](#items1boxedlist) | validateAndBox([List](#itemslistbuilder) arg, SchemaConfiguration configuration) | +| [Items1Boxed](#items1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ItemsListBuilder public class ItemsListBuilder
builder for `List>` @@ -119,27 +122,28 @@ A class to store validated List payloads | static [ItemsList](#itemslist) | of([List>](#itemslistbuilder) arg, SchemaConfiguration configuration) | ## Items2Boxed -public static abstract sealed class Items2Boxed
+public sealed interface Items2Boxed
permits
[Items2BoxedMap](#items2boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Items2BoxedMap -public static final class Items2BoxedMap
-extends [Items2Boxed](#items2boxed) +public record Items2BoxedMap
+implements [Items2Boxed](#items2boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Items2BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Items2 public static class Items2
diff --git a/samples/client/petstore/java/docs/components/schemas/JSONPatchRequest.md b/samples/client/petstore/java/docs/components/schemas/JSONPatchRequest.md index a62187a6bd0..9f5b99e6121 100644 --- a/samples/client/petstore/java/docs/components/schemas/JSONPatchRequest.md +++ b/samples/client/petstore/java/docs/components/schemas/JSONPatchRequest.md @@ -4,7 +4,7 @@ public class JSONPatchRequest
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated list payloads, extends FrozenList - classes to build inputs for list payloads @@ -12,42 +12,43 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [JSONPatchRequest.JSONPatchRequest1Boxed](#jsonpatchrequest1boxed)
abstract sealed validated payload class | -| static class | [JSONPatchRequest.JSONPatchRequest1BoxedList](#jsonpatchrequest1boxedlist)
boxed class to store validated List payloads | +| sealed interface | [JSONPatchRequest.JSONPatchRequest1Boxed](#jsonpatchrequest1boxed)
sealed interface for validated payloads | +| record | [JSONPatchRequest.JSONPatchRequest1BoxedList](#jsonpatchrequest1boxedlist)
boxed class to store validated List payloads | | static class | [JSONPatchRequest.JSONPatchRequest1](#jsonpatchrequest1)
schema class | | static class | [JSONPatchRequest.JSONPatchRequestListBuilder](#jsonpatchrequestlistbuilder)
builder for List payloads | | static class | [JSONPatchRequest.JSONPatchRequestList](#jsonpatchrequestlist)
output class for List payloads | -| static class | [JSONPatchRequest.ItemsBoxed](#itemsboxed)
abstract sealed validated payload class | -| static class | [JSONPatchRequest.ItemsBoxedVoid](#itemsboxedvoid)
boxed class to store validated null payloads | -| static class | [JSONPatchRequest.ItemsBoxedBoolean](#itemsboxedboolean)
boxed class to store validated boolean payloads | -| static class | [JSONPatchRequest.ItemsBoxedNumber](#itemsboxednumber)
boxed class to store validated Number payloads | -| static class | [JSONPatchRequest.ItemsBoxedString](#itemsboxedstring)
boxed class to store validated String payloads | -| static class | [JSONPatchRequest.ItemsBoxedList](#itemsboxedlist)
boxed class to store validated List payloads | -| static class | [JSONPatchRequest.ItemsBoxedMap](#itemsboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [JSONPatchRequest.ItemsBoxed](#itemsboxed)
sealed interface for validated payloads | +| record | [JSONPatchRequest.ItemsBoxedVoid](#itemsboxedvoid)
boxed class to store validated null payloads | +| record | [JSONPatchRequest.ItemsBoxedBoolean](#itemsboxedboolean)
boxed class to store validated boolean payloads | +| record | [JSONPatchRequest.ItemsBoxedNumber](#itemsboxednumber)
boxed class to store validated Number payloads | +| record | [JSONPatchRequest.ItemsBoxedString](#itemsboxedstring)
boxed class to store validated String payloads | +| record | [JSONPatchRequest.ItemsBoxedList](#itemsboxedlist)
boxed class to store validated List payloads | +| record | [JSONPatchRequest.ItemsBoxedMap](#itemsboxedmap)
boxed class to store validated Map payloads | | static class | [JSONPatchRequest.Items](#items)
schema class | ## JSONPatchRequest1Boxed -public static abstract sealed class JSONPatchRequest1Boxed
+public sealed interface JSONPatchRequest1Boxed
permits
[JSONPatchRequest1BoxedList](#jsonpatchrequest1boxedlist) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## JSONPatchRequest1BoxedList -public static final class JSONPatchRequest1BoxedList
-extends [JSONPatchRequest1Boxed](#jsonpatchrequest1boxed) +public record JSONPatchRequest1BoxedList
+implements [JSONPatchRequest1Boxed](#jsonpatchrequest1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | JSONPatchRequest1BoxedList([JSONPatchRequestList](#jsonpatchrequestlist) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [JSONPatchRequestList](#jsonpatchrequestlist) | data
validated payload | +| [JSONPatchRequestList](#jsonpatchrequestlist) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## JSONPatchRequest1 public static class JSONPatchRequest1
@@ -90,7 +91,9 @@ JSONPatchRequest.JSONPatchRequestList validatedPayload = | ----------------- | ---------------------- | | [JSONPatchRequestList](#jsonpatchrequestlist) | validate([List](#jsonpatchrequestlistbuilder) arg, SchemaConfiguration configuration) | | [JSONPatchRequest1BoxedList](#jsonpatchrequest1boxedlist) | validateAndBox([List](#jsonpatchrequestlistbuilder) arg, SchemaConfiguration configuration) | +| [JSONPatchRequest1Boxed](#jsonpatchrequest1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## JSONPatchRequestListBuilder public class JSONPatchRequestListBuilder
builder for `List<@Nullable Object>` @@ -129,7 +132,7 @@ A class to store validated List payloads | static [JSONPatchRequestList](#jsonpatchrequestlist) | of([List](#jsonpatchrequestlistbuilder) arg, SchemaConfiguration configuration) | ## ItemsBoxed -public static abstract sealed class ItemsBoxed
+public sealed interface ItemsBoxed
permits
[ItemsBoxedVoid](#itemsboxedvoid), [ItemsBoxedBoolean](#itemsboxedboolean), @@ -138,103 +141,109 @@ permits
[ItemsBoxedList](#itemsboxedlist), [ItemsBoxedMap](#itemsboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ItemsBoxedVoid -public static final class ItemsBoxedVoid
-extends [ItemsBoxed](#itemsboxed) +public record ItemsBoxedVoid
+implements [ItemsBoxed](#itemsboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ItemsBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ItemsBoxedBoolean -public static final class ItemsBoxedBoolean
-extends [ItemsBoxed](#itemsboxed) +public record ItemsBoxedBoolean
+implements [ItemsBoxed](#itemsboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ItemsBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ItemsBoxedNumber -public static final class ItemsBoxedNumber
-extends [ItemsBoxed](#itemsboxed) +public record ItemsBoxedNumber
+implements [ItemsBoxed](#itemsboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ItemsBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ItemsBoxedString -public static final class ItemsBoxedString
-extends [ItemsBoxed](#itemsboxed) +public record ItemsBoxedString
+implements [ItemsBoxed](#itemsboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ItemsBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ItemsBoxedList -public static final class ItemsBoxedList
-extends [ItemsBoxed](#itemsboxed) +public record ItemsBoxedList
+implements [ItemsBoxed](#itemsboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ItemsBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ItemsBoxedMap -public static final class ItemsBoxedMap
-extends [ItemsBoxed](#itemsboxed) +public record ItemsBoxedMap
+implements [ItemsBoxed](#itemsboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ItemsBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Items public static class Items
@@ -266,5 +275,7 @@ A schema class that validates payloads | [ItemsBoxedBoolean](#itemsboxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [ItemsBoxedMap](#itemsboxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [ItemsBoxedList](#itemsboxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [ItemsBoxed](#itemsboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/components/schemas/JSONPatchRequestAddReplaceTest.md b/samples/client/petstore/java/docs/components/schemas/JSONPatchRequestAddReplaceTest.md index 6d2f692e2bb..843fc456221 100644 --- a/samples/client/petstore/java/docs/components/schemas/JSONPatchRequestAddReplaceTest.md +++ b/samples/client/petstore/java/docs/components/schemas/JSONPatchRequestAddReplaceTest.md @@ -4,7 +4,7 @@ public class JSONPatchRequestAddReplaceTest
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -13,57 +13,58 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [JSONPatchRequestAddReplaceTest.JSONPatchRequestAddReplaceTest1Boxed](#jsonpatchrequestaddreplacetest1boxed)
abstract sealed validated payload class | -| static class | [JSONPatchRequestAddReplaceTest.JSONPatchRequestAddReplaceTest1BoxedMap](#jsonpatchrequestaddreplacetest1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [JSONPatchRequestAddReplaceTest.JSONPatchRequestAddReplaceTest1Boxed](#jsonpatchrequestaddreplacetest1boxed)
sealed interface for validated payloads | +| record | [JSONPatchRequestAddReplaceTest.JSONPatchRequestAddReplaceTest1BoxedMap](#jsonpatchrequestaddreplacetest1boxedmap)
boxed class to store validated Map payloads | | static class | [JSONPatchRequestAddReplaceTest.JSONPatchRequestAddReplaceTest1](#jsonpatchrequestaddreplacetest1)
schema class | | static class | [JSONPatchRequestAddReplaceTest.JSONPatchRequestAddReplaceTestMapBuilder](#jsonpatchrequestaddreplacetestmapbuilder)
builder for Map payloads | | static class | [JSONPatchRequestAddReplaceTest.JSONPatchRequestAddReplaceTestMap](#jsonpatchrequestaddreplacetestmap)
output class for Map payloads | -| static class | [JSONPatchRequestAddReplaceTest.OpBoxed](#opboxed)
abstract sealed validated payload class | -| static class | [JSONPatchRequestAddReplaceTest.OpBoxedString](#opboxedstring)
boxed class to store validated String payloads | +| sealed interface | [JSONPatchRequestAddReplaceTest.OpBoxed](#opboxed)
sealed interface for validated payloads | +| record | [JSONPatchRequestAddReplaceTest.OpBoxedString](#opboxedstring)
boxed class to store validated String payloads | | static class | [JSONPatchRequestAddReplaceTest.Op](#op)
schema class | | enum | [JSONPatchRequestAddReplaceTest.StringOpEnums](#stringopenums)
String enum | -| static class | [JSONPatchRequestAddReplaceTest.ValueBoxed](#valueboxed)
abstract sealed validated payload class | -| static class | [JSONPatchRequestAddReplaceTest.ValueBoxedVoid](#valueboxedvoid)
boxed class to store validated null payloads | -| static class | [JSONPatchRequestAddReplaceTest.ValueBoxedBoolean](#valueboxedboolean)
boxed class to store validated boolean payloads | -| static class | [JSONPatchRequestAddReplaceTest.ValueBoxedNumber](#valueboxednumber)
boxed class to store validated Number payloads | -| static class | [JSONPatchRequestAddReplaceTest.ValueBoxedString](#valueboxedstring)
boxed class to store validated String payloads | -| static class | [JSONPatchRequestAddReplaceTest.ValueBoxedList](#valueboxedlist)
boxed class to store validated List payloads | -| static class | [JSONPatchRequestAddReplaceTest.ValueBoxedMap](#valueboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [JSONPatchRequestAddReplaceTest.ValueBoxed](#valueboxed)
sealed interface for validated payloads | +| record | [JSONPatchRequestAddReplaceTest.ValueBoxedVoid](#valueboxedvoid)
boxed class to store validated null payloads | +| record | [JSONPatchRequestAddReplaceTest.ValueBoxedBoolean](#valueboxedboolean)
boxed class to store validated boolean payloads | +| record | [JSONPatchRequestAddReplaceTest.ValueBoxedNumber](#valueboxednumber)
boxed class to store validated Number payloads | +| record | [JSONPatchRequestAddReplaceTest.ValueBoxedString](#valueboxedstring)
boxed class to store validated String payloads | +| record | [JSONPatchRequestAddReplaceTest.ValueBoxedList](#valueboxedlist)
boxed class to store validated List payloads | +| record | [JSONPatchRequestAddReplaceTest.ValueBoxedMap](#valueboxedmap)
boxed class to store validated Map payloads | | static class | [JSONPatchRequestAddReplaceTest.Value](#value)
schema class | -| static class | [JSONPatchRequestAddReplaceTest.PathBoxed](#pathboxed)
abstract sealed validated payload class | -| static class | [JSONPatchRequestAddReplaceTest.PathBoxedString](#pathboxedstring)
boxed class to store validated String payloads | +| sealed interface | [JSONPatchRequestAddReplaceTest.PathBoxed](#pathboxed)
sealed interface for validated payloads | +| record | [JSONPatchRequestAddReplaceTest.PathBoxedString](#pathboxedstring)
boxed class to store validated String payloads | | static class | [JSONPatchRequestAddReplaceTest.Path](#path)
schema class | -| static class | [JSONPatchRequestAddReplaceTest.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
abstract sealed validated payload class | -| static class | [JSONPatchRequestAddReplaceTest.AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid)
boxed class to store validated null payloads | -| static class | [JSONPatchRequestAddReplaceTest.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | -| static class | [JSONPatchRequestAddReplaceTest.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | -| static class | [JSONPatchRequestAddReplaceTest.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | -| static class | [JSONPatchRequestAddReplaceTest.AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist)
boxed class to store validated List payloads | -| static class | [JSONPatchRequestAddReplaceTest.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [JSONPatchRequestAddReplaceTest.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
sealed interface for validated payloads | +| record | [JSONPatchRequestAddReplaceTest.AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid)
boxed class to store validated null payloads | +| record | [JSONPatchRequestAddReplaceTest.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | +| record | [JSONPatchRequestAddReplaceTest.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | +| record | [JSONPatchRequestAddReplaceTest.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | +| record | [JSONPatchRequestAddReplaceTest.AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist)
boxed class to store validated List payloads | +| record | [JSONPatchRequestAddReplaceTest.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | | static class | [JSONPatchRequestAddReplaceTest.AdditionalProperties](#additionalproperties)
schema class | ## JSONPatchRequestAddReplaceTest1Boxed -public static abstract sealed class JSONPatchRequestAddReplaceTest1Boxed
+public sealed interface JSONPatchRequestAddReplaceTest1Boxed
permits
[JSONPatchRequestAddReplaceTest1BoxedMap](#jsonpatchrequestaddreplacetest1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## JSONPatchRequestAddReplaceTest1BoxedMap -public static final class JSONPatchRequestAddReplaceTest1BoxedMap
-extends [JSONPatchRequestAddReplaceTest1Boxed](#jsonpatchrequestaddreplacetest1boxed) +public record JSONPatchRequestAddReplaceTest1BoxedMap
+implements [JSONPatchRequestAddReplaceTest1Boxed](#jsonpatchrequestaddreplacetest1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | JSONPatchRequestAddReplaceTest1BoxedMap([JSONPatchRequestAddReplaceTestMap](#jsonpatchrequestaddreplacetestmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [JSONPatchRequestAddReplaceTestMap](#jsonpatchrequestaddreplacetestmap) | data
validated payload | +| [JSONPatchRequestAddReplaceTestMap](#jsonpatchrequestaddreplacetestmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## JSONPatchRequestAddReplaceTest1 public static class JSONPatchRequestAddReplaceTest1
@@ -112,7 +113,9 @@ JSONPatchRequestAddReplaceTest.JSONPatchRequestAddReplaceTestMap validatedPayloa | ----------------- | ---------------------- | | [JSONPatchRequestAddReplaceTestMap](#jsonpatchrequestaddreplacetestmap) | validate([Map<?, ?>](#jsonpatchrequestaddreplacetestmapbuilder) arg, SchemaConfiguration configuration) | | [JSONPatchRequestAddReplaceTest1BoxedMap](#jsonpatchrequestaddreplacetest1boxedmap) | validateAndBox([Map<?, ?>](#jsonpatchrequestaddreplacetestmapbuilder) arg, SchemaConfiguration configuration) | +| [JSONPatchRequestAddReplaceTest1Boxed](#jsonpatchrequestaddreplacetest1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## JSONPatchRequestAddReplaceTestMap000Builder public class JSONPatchRequestAddReplaceTestMap000Builder
builder for `Map` @@ -297,27 +300,28 @@ A class to store validated Map payloads | @Nullable Object | value()
| ## OpBoxed -public static abstract sealed class OpBoxed
+public sealed interface OpBoxed
permits
[OpBoxedString](#opboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## OpBoxedString -public static final class OpBoxedString
-extends [OpBoxed](#opboxed) +public record OpBoxedString
+implements [OpBoxed](#opboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | OpBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Op public static class Op
@@ -362,7 +366,9 @@ String validatedPayload = JSONPatchRequestAddReplaceTest.Op.validate( | String | validate(String arg, SchemaConfiguration configuration) | | String | validate([StringOpEnums](#stringopenums) arg, SchemaConfiguration configuration) | | [OpBoxedString](#opboxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [OpBoxed](#opboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## StringOpEnums public enum StringOpEnums
extends `Enum` @@ -377,7 +383,7 @@ A class that stores String enum values | TEST | value = "test" | ## ValueBoxed -public static abstract sealed class ValueBoxed
+public sealed interface ValueBoxed
permits
[ValueBoxedVoid](#valueboxedvoid), [ValueBoxedBoolean](#valueboxedboolean), @@ -386,103 +392,109 @@ permits
[ValueBoxedList](#valueboxedlist), [ValueBoxedMap](#valueboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ValueBoxedVoid -public static final class ValueBoxedVoid
-extends [ValueBoxed](#valueboxed) +public record ValueBoxedVoid
+implements [ValueBoxed](#valueboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ValueBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ValueBoxedBoolean -public static final class ValueBoxedBoolean
-extends [ValueBoxed](#valueboxed) +public record ValueBoxedBoolean
+implements [ValueBoxed](#valueboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ValueBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ValueBoxedNumber -public static final class ValueBoxedNumber
-extends [ValueBoxed](#valueboxed) +public record ValueBoxedNumber
+implements [ValueBoxed](#valueboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ValueBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ValueBoxedString -public static final class ValueBoxedString
-extends [ValueBoxed](#valueboxed) +public record ValueBoxedString
+implements [ValueBoxed](#valueboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ValueBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ValueBoxedList -public static final class ValueBoxedList
-extends [ValueBoxed](#valueboxed) +public record ValueBoxedList
+implements [ValueBoxed](#valueboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ValueBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ValueBoxedMap -public static final class ValueBoxedMap
-extends [ValueBoxed](#valueboxed) +public record ValueBoxedMap
+implements [ValueBoxed](#valueboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ValueBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Value public static class Value
@@ -499,27 +511,28 @@ The value to add, replace or test. | validateAndBox | ## PathBoxed -public static abstract sealed class PathBoxed
+public sealed interface PathBoxed
permits
[PathBoxedString](#pathboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## PathBoxedString -public static final class PathBoxedString
-extends [PathBoxed](#pathboxed) +public record PathBoxedString
+implements [PathBoxed](#pathboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PathBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Path public static class Path
@@ -536,7 +549,7 @@ A JSON Pointer path. | validateAndBox | ## AdditionalPropertiesBoxed -public static abstract sealed class AdditionalPropertiesBoxed
+public sealed interface AdditionalPropertiesBoxed
permits
[AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid), [AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean), @@ -545,103 +558,109 @@ permits
[AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist), [AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AdditionalPropertiesBoxedVoid -public static final class AdditionalPropertiesBoxedVoid
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedVoid
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedBoolean -public static final class AdditionalPropertiesBoxedBoolean
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedBoolean
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedNumber -public static final class AdditionalPropertiesBoxedNumber
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedNumber
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedString -public static final class AdditionalPropertiesBoxedString
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedString
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedList -public static final class AdditionalPropertiesBoxedList
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedList
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedMap -public static final class AdditionalPropertiesBoxedMap
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedMap
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalProperties public static class AdditionalProperties
diff --git a/samples/client/petstore/java/docs/components/schemas/JSONPatchRequestMoveCopy.md b/samples/client/petstore/java/docs/components/schemas/JSONPatchRequestMoveCopy.md index 28864cf1acf..2acf51d43d9 100644 --- a/samples/client/petstore/java/docs/components/schemas/JSONPatchRequestMoveCopy.md +++ b/samples/client/petstore/java/docs/components/schemas/JSONPatchRequestMoveCopy.md @@ -4,7 +4,7 @@ public class JSONPatchRequestMoveCopy
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -13,52 +13,53 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [JSONPatchRequestMoveCopy.JSONPatchRequestMoveCopy1Boxed](#jsonpatchrequestmovecopy1boxed)
abstract sealed validated payload class | -| static class | [JSONPatchRequestMoveCopy.JSONPatchRequestMoveCopy1BoxedMap](#jsonpatchrequestmovecopy1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [JSONPatchRequestMoveCopy.JSONPatchRequestMoveCopy1Boxed](#jsonpatchrequestmovecopy1boxed)
sealed interface for validated payloads | +| record | [JSONPatchRequestMoveCopy.JSONPatchRequestMoveCopy1BoxedMap](#jsonpatchrequestmovecopy1boxedmap)
boxed class to store validated Map payloads | | static class | [JSONPatchRequestMoveCopy.JSONPatchRequestMoveCopy1](#jsonpatchrequestmovecopy1)
schema class | | static class | [JSONPatchRequestMoveCopy.JSONPatchRequestMoveCopyMapBuilder](#jsonpatchrequestmovecopymapbuilder)
builder for Map payloads | | static class | [JSONPatchRequestMoveCopy.JSONPatchRequestMoveCopyMap](#jsonpatchrequestmovecopymap)
output class for Map payloads | -| static class | [JSONPatchRequestMoveCopy.OpBoxed](#opboxed)
abstract sealed validated payload class | -| static class | [JSONPatchRequestMoveCopy.OpBoxedString](#opboxedstring)
boxed class to store validated String payloads | +| sealed interface | [JSONPatchRequestMoveCopy.OpBoxed](#opboxed)
sealed interface for validated payloads | +| record | [JSONPatchRequestMoveCopy.OpBoxedString](#opboxedstring)
boxed class to store validated String payloads | | static class | [JSONPatchRequestMoveCopy.Op](#op)
schema class | | enum | [JSONPatchRequestMoveCopy.StringOpEnums](#stringopenums)
String enum | -| static class | [JSONPatchRequestMoveCopy.PathBoxed](#pathboxed)
abstract sealed validated payload class | -| static class | [JSONPatchRequestMoveCopy.PathBoxedString](#pathboxedstring)
boxed class to store validated String payloads | +| sealed interface | [JSONPatchRequestMoveCopy.PathBoxed](#pathboxed)
sealed interface for validated payloads | +| record | [JSONPatchRequestMoveCopy.PathBoxedString](#pathboxedstring)
boxed class to store validated String payloads | | static class | [JSONPatchRequestMoveCopy.Path](#path)
schema class | -| static class | [JSONPatchRequestMoveCopy.FromBoxed](#fromboxed)
abstract sealed validated payload class | -| static class | [JSONPatchRequestMoveCopy.FromBoxedString](#fromboxedstring)
boxed class to store validated String payloads | +| sealed interface | [JSONPatchRequestMoveCopy.FromBoxed](#fromboxed)
sealed interface for validated payloads | +| record | [JSONPatchRequestMoveCopy.FromBoxedString](#fromboxedstring)
boxed class to store validated String payloads | | static class | [JSONPatchRequestMoveCopy.From](#from)
schema class | -| static class | [JSONPatchRequestMoveCopy.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
abstract sealed validated payload class | -| static class | [JSONPatchRequestMoveCopy.AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid)
boxed class to store validated null payloads | -| static class | [JSONPatchRequestMoveCopy.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | -| static class | [JSONPatchRequestMoveCopy.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | -| static class | [JSONPatchRequestMoveCopy.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | -| static class | [JSONPatchRequestMoveCopy.AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist)
boxed class to store validated List payloads | -| static class | [JSONPatchRequestMoveCopy.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [JSONPatchRequestMoveCopy.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
sealed interface for validated payloads | +| record | [JSONPatchRequestMoveCopy.AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid)
boxed class to store validated null payloads | +| record | [JSONPatchRequestMoveCopy.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | +| record | [JSONPatchRequestMoveCopy.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | +| record | [JSONPatchRequestMoveCopy.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | +| record | [JSONPatchRequestMoveCopy.AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist)
boxed class to store validated List payloads | +| record | [JSONPatchRequestMoveCopy.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | | static class | [JSONPatchRequestMoveCopy.AdditionalProperties](#additionalproperties)
schema class | ## JSONPatchRequestMoveCopy1Boxed -public static abstract sealed class JSONPatchRequestMoveCopy1Boxed
+public sealed interface JSONPatchRequestMoveCopy1Boxed
permits
[JSONPatchRequestMoveCopy1BoxedMap](#jsonpatchrequestmovecopy1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## JSONPatchRequestMoveCopy1BoxedMap -public static final class JSONPatchRequestMoveCopy1BoxedMap
-extends [JSONPatchRequestMoveCopy1Boxed](#jsonpatchrequestmovecopy1boxed) +public record JSONPatchRequestMoveCopy1BoxedMap
+implements [JSONPatchRequestMoveCopy1Boxed](#jsonpatchrequestmovecopy1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | JSONPatchRequestMoveCopy1BoxedMap([JSONPatchRequestMoveCopyMap](#jsonpatchrequestmovecopymap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [JSONPatchRequestMoveCopyMap](#jsonpatchrequestmovecopymap) | data
validated payload | +| [JSONPatchRequestMoveCopyMap](#jsonpatchrequestmovecopymap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## JSONPatchRequestMoveCopy1 public static class JSONPatchRequestMoveCopy1
@@ -109,7 +110,9 @@ JSONPatchRequestMoveCopy.JSONPatchRequestMoveCopyMap validatedPayload = | ----------------- | ---------------------- | | [JSONPatchRequestMoveCopyMap](#jsonpatchrequestmovecopymap) | validate([Map<?, ?>](#jsonpatchrequestmovecopymapbuilder) arg, SchemaConfiguration configuration) | | [JSONPatchRequestMoveCopy1BoxedMap](#jsonpatchrequestmovecopy1boxedmap) | validateAndBox([Map<?, ?>](#jsonpatchrequestmovecopymapbuilder) arg, SchemaConfiguration configuration) | +| [JSONPatchRequestMoveCopy1Boxed](#jsonpatchrequestmovecopy1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## JSONPatchRequestMoveCopyMap000Builder public class JSONPatchRequestMoveCopyMap000Builder
builder for `Map` @@ -262,27 +265,28 @@ A class to store validated Map payloads | String | path()
| ## OpBoxed -public static abstract sealed class OpBoxed
+public sealed interface OpBoxed
permits
[OpBoxedString](#opboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## OpBoxedString -public static final class OpBoxedString
-extends [OpBoxed](#opboxed) +public record OpBoxedString
+implements [OpBoxed](#opboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | OpBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Op public static class Op
@@ -327,7 +331,9 @@ String validatedPayload = JSONPatchRequestMoveCopy.Op.validate( | String | validate(String arg, SchemaConfiguration configuration) | | String | validate([StringOpEnums](#stringopenums) arg, SchemaConfiguration configuration) | | [OpBoxedString](#opboxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [OpBoxed](#opboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## StringOpEnums public enum StringOpEnums
extends `Enum` @@ -341,27 +347,28 @@ A class that stores String enum values | COPY | value = "copy" | ## PathBoxed -public static abstract sealed class PathBoxed
+public sealed interface PathBoxed
permits
[PathBoxedString](#pathboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## PathBoxedString -public static final class PathBoxedString
-extends [PathBoxed](#pathboxed) +public record PathBoxedString
+implements [PathBoxed](#pathboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PathBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Path public static class Path
@@ -378,27 +385,28 @@ A JSON Pointer path. | validateAndBox | ## FromBoxed -public static abstract sealed class FromBoxed
+public sealed interface FromBoxed
permits
[FromBoxedString](#fromboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## FromBoxedString -public static final class FromBoxedString
-extends [FromBoxed](#fromboxed) +public record FromBoxedString
+implements [FromBoxed](#fromboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FromBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## From public static class From
@@ -415,7 +423,7 @@ A JSON Pointer path. | validateAndBox | ## AdditionalPropertiesBoxed -public static abstract sealed class AdditionalPropertiesBoxed
+public sealed interface AdditionalPropertiesBoxed
permits
[AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid), [AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean), @@ -424,103 +432,109 @@ permits
[AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist), [AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AdditionalPropertiesBoxedVoid -public static final class AdditionalPropertiesBoxedVoid
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedVoid
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedBoolean -public static final class AdditionalPropertiesBoxedBoolean
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedBoolean
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedNumber -public static final class AdditionalPropertiesBoxedNumber
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedNumber
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedString -public static final class AdditionalPropertiesBoxedString
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedString
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedList -public static final class AdditionalPropertiesBoxedList
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedList
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedMap -public static final class AdditionalPropertiesBoxedMap
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedMap
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalProperties public static class AdditionalProperties
diff --git a/samples/client/petstore/java/docs/components/schemas/JSONPatchRequestRemove.md b/samples/client/petstore/java/docs/components/schemas/JSONPatchRequestRemove.md index 963598cc7d5..f3289e59bb6 100644 --- a/samples/client/petstore/java/docs/components/schemas/JSONPatchRequestRemove.md +++ b/samples/client/petstore/java/docs/components/schemas/JSONPatchRequestRemove.md @@ -4,7 +4,7 @@ public class JSONPatchRequestRemove
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -13,49 +13,50 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [JSONPatchRequestRemove.JSONPatchRequestRemove1Boxed](#jsonpatchrequestremove1boxed)
abstract sealed validated payload class | -| static class | [JSONPatchRequestRemove.JSONPatchRequestRemove1BoxedMap](#jsonpatchrequestremove1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [JSONPatchRequestRemove.JSONPatchRequestRemove1Boxed](#jsonpatchrequestremove1boxed)
sealed interface for validated payloads | +| record | [JSONPatchRequestRemove.JSONPatchRequestRemove1BoxedMap](#jsonpatchrequestremove1boxedmap)
boxed class to store validated Map payloads | | static class | [JSONPatchRequestRemove.JSONPatchRequestRemove1](#jsonpatchrequestremove1)
schema class | | static class | [JSONPatchRequestRemove.JSONPatchRequestRemoveMapBuilder](#jsonpatchrequestremovemapbuilder)
builder for Map payloads | | static class | [JSONPatchRequestRemove.JSONPatchRequestRemoveMap](#jsonpatchrequestremovemap)
output class for Map payloads | -| static class | [JSONPatchRequestRemove.OpBoxed](#opboxed)
abstract sealed validated payload class | -| static class | [JSONPatchRequestRemove.OpBoxedString](#opboxedstring)
boxed class to store validated String payloads | +| sealed interface | [JSONPatchRequestRemove.OpBoxed](#opboxed)
sealed interface for validated payloads | +| record | [JSONPatchRequestRemove.OpBoxedString](#opboxedstring)
boxed class to store validated String payloads | | static class | [JSONPatchRequestRemove.Op](#op)
schema class | | enum | [JSONPatchRequestRemove.StringOpEnums](#stringopenums)
String enum | -| static class | [JSONPatchRequestRemove.PathBoxed](#pathboxed)
abstract sealed validated payload class | -| static class | [JSONPatchRequestRemove.PathBoxedString](#pathboxedstring)
boxed class to store validated String payloads | +| sealed interface | [JSONPatchRequestRemove.PathBoxed](#pathboxed)
sealed interface for validated payloads | +| record | [JSONPatchRequestRemove.PathBoxedString](#pathboxedstring)
boxed class to store validated String payloads | | static class | [JSONPatchRequestRemove.Path](#path)
schema class | -| static class | [JSONPatchRequestRemove.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
abstract sealed validated payload class | -| static class | [JSONPatchRequestRemove.AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid)
boxed class to store validated null payloads | -| static class | [JSONPatchRequestRemove.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | -| static class | [JSONPatchRequestRemove.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | -| static class | [JSONPatchRequestRemove.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | -| static class | [JSONPatchRequestRemove.AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist)
boxed class to store validated List payloads | -| static class | [JSONPatchRequestRemove.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [JSONPatchRequestRemove.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
sealed interface for validated payloads | +| record | [JSONPatchRequestRemove.AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid)
boxed class to store validated null payloads | +| record | [JSONPatchRequestRemove.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | +| record | [JSONPatchRequestRemove.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | +| record | [JSONPatchRequestRemove.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | +| record | [JSONPatchRequestRemove.AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist)
boxed class to store validated List payloads | +| record | [JSONPatchRequestRemove.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | | static class | [JSONPatchRequestRemove.AdditionalProperties](#additionalproperties)
schema class | ## JSONPatchRequestRemove1Boxed -public static abstract sealed class JSONPatchRequestRemove1Boxed
+public sealed interface JSONPatchRequestRemove1Boxed
permits
[JSONPatchRequestRemove1BoxedMap](#jsonpatchrequestremove1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## JSONPatchRequestRemove1BoxedMap -public static final class JSONPatchRequestRemove1BoxedMap
-extends [JSONPatchRequestRemove1Boxed](#jsonpatchrequestremove1boxed) +public record JSONPatchRequestRemove1BoxedMap
+implements [JSONPatchRequestRemove1Boxed](#jsonpatchrequestremove1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | JSONPatchRequestRemove1BoxedMap([JSONPatchRequestRemoveMap](#jsonpatchrequestremovemap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [JSONPatchRequestRemoveMap](#jsonpatchrequestremovemap) | data
validated payload | +| [JSONPatchRequestRemoveMap](#jsonpatchrequestremovemap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## JSONPatchRequestRemove1 public static class JSONPatchRequestRemove1
@@ -104,7 +105,9 @@ JSONPatchRequestRemove.JSONPatchRequestRemoveMap validatedPayload = | ----------------- | ---------------------- | | [JSONPatchRequestRemoveMap](#jsonpatchrequestremovemap) | validate([Map<?, ?>](#jsonpatchrequestremovemapbuilder) arg, SchemaConfiguration configuration) | | [JSONPatchRequestRemove1BoxedMap](#jsonpatchrequestremove1boxedmap) | validateAndBox([Map<?, ?>](#jsonpatchrequestremovemapbuilder) arg, SchemaConfiguration configuration) | +| [JSONPatchRequestRemove1Boxed](#jsonpatchrequestremove1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## JSONPatchRequestRemoveMap00Builder public class JSONPatchRequestRemoveMap00Builder
builder for `Map` @@ -186,27 +189,28 @@ A class to store validated Map payloads | String | path()
| ## OpBoxed -public static abstract sealed class OpBoxed
+public sealed interface OpBoxed
permits
[OpBoxedString](#opboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## OpBoxedString -public static final class OpBoxedString
-extends [OpBoxed](#opboxed) +public record OpBoxedString
+implements [OpBoxed](#opboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | OpBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Op public static class Op
@@ -251,7 +255,9 @@ String validatedPayload = JSONPatchRequestRemove.Op.validate( | String | validate(String arg, SchemaConfiguration configuration) | | String | validate([StringOpEnums](#stringopenums) arg, SchemaConfiguration configuration) | | [OpBoxedString](#opboxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [OpBoxed](#opboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## StringOpEnums public enum StringOpEnums
extends `Enum` @@ -264,27 +270,28 @@ A class that stores String enum values | REMOVE | value = "remove" | ## PathBoxed -public static abstract sealed class PathBoxed
+public sealed interface PathBoxed
permits
[PathBoxedString](#pathboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## PathBoxedString -public static final class PathBoxedString
-extends [PathBoxed](#pathboxed) +public record PathBoxedString
+implements [PathBoxed](#pathboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PathBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Path public static class Path
@@ -301,7 +308,7 @@ A JSON Pointer path. | validateAndBox | ## AdditionalPropertiesBoxed -public static abstract sealed class AdditionalPropertiesBoxed
+public sealed interface AdditionalPropertiesBoxed
permits
[AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid), [AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean), @@ -310,103 +317,109 @@ permits
[AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist), [AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AdditionalPropertiesBoxedVoid -public static final class AdditionalPropertiesBoxedVoid
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedVoid
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedBoolean -public static final class AdditionalPropertiesBoxedBoolean
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedBoolean
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedNumber -public static final class AdditionalPropertiesBoxedNumber
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedNumber
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedString -public static final class AdditionalPropertiesBoxedString
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedString
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedList -public static final class AdditionalPropertiesBoxedList
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedList
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedMap -public static final class AdditionalPropertiesBoxedMap
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedMap
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalProperties public static class AdditionalProperties
diff --git a/samples/client/petstore/java/docs/components/schemas/Mammal.md b/samples/client/petstore/java/docs/components/schemas/Mammal.md index 8bc4662dc66..4b5b161e041 100644 --- a/samples/client/petstore/java/docs/components/schemas/Mammal.md +++ b/samples/client/petstore/java/docs/components/schemas/Mammal.md @@ -4,23 +4,23 @@ public class Mammal
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Mammal.Mammal1Boxed](#mammal1boxed)
abstract sealed validated payload class | -| static class | [Mammal.Mammal1BoxedVoid](#mammal1boxedvoid)
boxed class to store validated null payloads | -| static class | [Mammal.Mammal1BoxedBoolean](#mammal1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [Mammal.Mammal1BoxedNumber](#mammal1boxednumber)
boxed class to store validated Number payloads | -| static class | [Mammal.Mammal1BoxedString](#mammal1boxedstring)
boxed class to store validated String payloads | -| static class | [Mammal.Mammal1BoxedList](#mammal1boxedlist)
boxed class to store validated List payloads | -| static class | [Mammal.Mammal1BoxedMap](#mammal1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [Mammal.Mammal1Boxed](#mammal1boxed)
sealed interface for validated payloads | +| record | [Mammal.Mammal1BoxedVoid](#mammal1boxedvoid)
boxed class to store validated null payloads | +| record | [Mammal.Mammal1BoxedBoolean](#mammal1boxedboolean)
boxed class to store validated boolean payloads | +| record | [Mammal.Mammal1BoxedNumber](#mammal1boxednumber)
boxed class to store validated Number payloads | +| record | [Mammal.Mammal1BoxedString](#mammal1boxedstring)
boxed class to store validated String payloads | +| record | [Mammal.Mammal1BoxedList](#mammal1boxedlist)
boxed class to store validated List payloads | +| record | [Mammal.Mammal1BoxedMap](#mammal1boxedmap)
boxed class to store validated Map payloads | | static class | [Mammal.Mammal1](#mammal1)
schema class | ## Mammal1Boxed -public static abstract sealed class Mammal1Boxed
+public sealed interface Mammal1Boxed
permits
[Mammal1BoxedVoid](#mammal1boxedvoid), [Mammal1BoxedBoolean](#mammal1boxedboolean), @@ -29,103 +29,109 @@ permits
[Mammal1BoxedList](#mammal1boxedlist), [Mammal1BoxedMap](#mammal1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Mammal1BoxedVoid -public static final class Mammal1BoxedVoid
-extends [Mammal1Boxed](#mammal1boxed) +public record Mammal1BoxedVoid
+implements [Mammal1Boxed](#mammal1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Mammal1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Mammal1BoxedBoolean -public static final class Mammal1BoxedBoolean
-extends [Mammal1Boxed](#mammal1boxed) +public record Mammal1BoxedBoolean
+implements [Mammal1Boxed](#mammal1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Mammal1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Mammal1BoxedNumber -public static final class Mammal1BoxedNumber
-extends [Mammal1Boxed](#mammal1boxed) +public record Mammal1BoxedNumber
+implements [Mammal1Boxed](#mammal1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Mammal1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Mammal1BoxedString -public static final class Mammal1BoxedString
-extends [Mammal1Boxed](#mammal1boxed) +public record Mammal1BoxedString
+implements [Mammal1Boxed](#mammal1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Mammal1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Mammal1BoxedList -public static final class Mammal1BoxedList
-extends [Mammal1Boxed](#mammal1boxed) +public record Mammal1BoxedList
+implements [Mammal1Boxed](#mammal1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Mammal1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Mammal1BoxedMap -public static final class Mammal1BoxedMap
-extends [Mammal1Boxed](#mammal1boxed) +public record Mammal1BoxedMap
+implements [Mammal1Boxed](#mammal1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Mammal1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Mammal1 public static class Mammal1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [Mammal1BoxedBoolean](#mammal1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Mammal1BoxedMap](#mammal1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [Mammal1BoxedList](#mammal1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Mammal1Boxed](#mammal1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/components/schemas/MapTest.md b/samples/client/petstore/java/docs/components/schemas/MapTest.md index cf45c4135aa..ff662290d07 100644 --- a/samples/client/petstore/java/docs/components/schemas/MapTest.md +++ b/samples/client/petstore/java/docs/components/schemas/MapTest.md @@ -4,7 +4,7 @@ public class MapTest
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -13,64 +13,65 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [MapTest.MapTest1Boxed](#maptest1boxed)
abstract sealed validated payload class | -| static class | [MapTest.MapTest1BoxedMap](#maptest1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [MapTest.MapTest1Boxed](#maptest1boxed)
sealed interface for validated payloads | +| record | [MapTest.MapTest1BoxedMap](#maptest1boxedmap)
boxed class to store validated Map payloads | | static class | [MapTest.MapTest1](#maptest1)
schema class | | static class | [MapTest.MapTestMapBuilder](#maptestmapbuilder)
builder for Map payloads | | static class | [MapTest.MapTestMap](#maptestmap)
output class for Map payloads | -| static class | [MapTest.DirectMapBoxed](#directmapboxed)
abstract sealed validated payload class | -| static class | [MapTest.DirectMapBoxedMap](#directmapboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [MapTest.DirectMapBoxed](#directmapboxed)
sealed interface for validated payloads | +| record | [MapTest.DirectMapBoxedMap](#directmapboxedmap)
boxed class to store validated Map payloads | | static class | [MapTest.DirectMap](#directmap)
schema class | | static class | [MapTest.DirectMapMapBuilder](#directmapmapbuilder)
builder for Map payloads | | static class | [MapTest.DirectMapMap](#directmapmap)
output class for Map payloads | -| static class | [MapTest.AdditionalProperties3Boxed](#additionalproperties3boxed)
abstract sealed validated payload class | -| static class | [MapTest.AdditionalProperties3BoxedBoolean](#additionalproperties3boxedboolean)
boxed class to store validated boolean payloads | +| sealed interface | [MapTest.AdditionalProperties3Boxed](#additionalproperties3boxed)
sealed interface for validated payloads | +| record | [MapTest.AdditionalProperties3BoxedBoolean](#additionalproperties3boxedboolean)
boxed class to store validated boolean payloads | | static class | [MapTest.AdditionalProperties3](#additionalproperties3)
schema class | -| static class | [MapTest.MapOfEnumStringBoxed](#mapofenumstringboxed)
abstract sealed validated payload class | -| static class | [MapTest.MapOfEnumStringBoxedMap](#mapofenumstringboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [MapTest.MapOfEnumStringBoxed](#mapofenumstringboxed)
sealed interface for validated payloads | +| record | [MapTest.MapOfEnumStringBoxedMap](#mapofenumstringboxedmap)
boxed class to store validated Map payloads | | static class | [MapTest.MapOfEnumString](#mapofenumstring)
schema class | | static class | [MapTest.MapOfEnumStringMapBuilder](#mapofenumstringmapbuilder)
builder for Map payloads | | static class | [MapTest.MapOfEnumStringMap](#mapofenumstringmap)
output class for Map payloads | -| static class | [MapTest.AdditionalProperties2Boxed](#additionalproperties2boxed)
abstract sealed validated payload class | -| static class | [MapTest.AdditionalProperties2BoxedString](#additionalproperties2boxedstring)
boxed class to store validated String payloads | +| sealed interface | [MapTest.AdditionalProperties2Boxed](#additionalproperties2boxed)
sealed interface for validated payloads | +| record | [MapTest.AdditionalProperties2BoxedString](#additionalproperties2boxedstring)
boxed class to store validated String payloads | | static class | [MapTest.AdditionalProperties2](#additionalproperties2)
schema class | | enum | [MapTest.StringAdditionalPropertiesEnums](#stringadditionalpropertiesenums)
String enum | -| static class | [MapTest.MapMapOfStringBoxed](#mapmapofstringboxed)
abstract sealed validated payload class | -| static class | [MapTest.MapMapOfStringBoxedMap](#mapmapofstringboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [MapTest.MapMapOfStringBoxed](#mapmapofstringboxed)
sealed interface for validated payloads | +| record | [MapTest.MapMapOfStringBoxedMap](#mapmapofstringboxedmap)
boxed class to store validated Map payloads | | static class | [MapTest.MapMapOfString](#mapmapofstring)
schema class | | static class | [MapTest.MapMapOfStringMapBuilder](#mapmapofstringmapbuilder)
builder for Map payloads | | static class | [MapTest.MapMapOfStringMap](#mapmapofstringmap)
output class for Map payloads | -| static class | [MapTest.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
abstract sealed validated payload class | -| static class | [MapTest.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [MapTest.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
sealed interface for validated payloads | +| record | [MapTest.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | | static class | [MapTest.AdditionalProperties](#additionalproperties)
schema class | | static class | [MapTest.AdditionalPropertiesMapBuilder1](#additionalpropertiesmapbuilder1)
builder for Map payloads | | static class | [MapTest.AdditionalPropertiesMap](#additionalpropertiesmap)
output class for Map payloads | -| static class | [MapTest.AdditionalProperties1Boxed](#additionalproperties1boxed)
abstract sealed validated payload class | -| static class | [MapTest.AdditionalProperties1BoxedString](#additionalproperties1boxedstring)
boxed class to store validated String payloads | +| sealed interface | [MapTest.AdditionalProperties1Boxed](#additionalproperties1boxed)
sealed interface for validated payloads | +| record | [MapTest.AdditionalProperties1BoxedString](#additionalproperties1boxedstring)
boxed class to store validated String payloads | | static class | [MapTest.AdditionalProperties1](#additionalproperties1)
schema class | ## MapTest1Boxed -public static abstract sealed class MapTest1Boxed
+public sealed interface MapTest1Boxed
permits
[MapTest1BoxedMap](#maptest1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## MapTest1BoxedMap -public static final class MapTest1BoxedMap
-extends [MapTest1Boxed](#maptest1boxed) +public record MapTest1BoxedMap
+implements [MapTest1Boxed](#maptest1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MapTest1BoxedMap([MapTestMap](#maptestmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [MapTestMap](#maptestmap) | data
validated payload | +| [MapTestMap](#maptestmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MapTest1 public static class MapTest1
@@ -142,7 +143,9 @@ MapTest.MapTestMap validatedPayload = | ----------------- | ---------------------- | | [MapTestMap](#maptestmap) | validate([Map<?, ?>](#maptestmapbuilder) arg, SchemaConfiguration configuration) | | [MapTest1BoxedMap](#maptest1boxedmap) | validateAndBox([Map<?, ?>](#maptestmapbuilder) arg, SchemaConfiguration configuration) | +| [MapTest1Boxed](#maptest1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## MapTestMapBuilder public class MapTestMapBuilder
builder for `Map` @@ -189,27 +192,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## DirectMapBoxed -public static abstract sealed class DirectMapBoxed
+public sealed interface DirectMapBoxed
permits
[DirectMapBoxedMap](#directmapboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## DirectMapBoxedMap -public static final class DirectMapBoxedMap
-extends [DirectMapBoxed](#directmapboxed) +public record DirectMapBoxedMap
+implements [DirectMapBoxed](#directmapboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DirectMapBoxedMap([DirectMapMap](#directmapmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [DirectMapMap](#directmapmap) | data
validated payload | +| [DirectMapMap](#directmapmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## DirectMap public static class DirectMap
@@ -254,7 +258,9 @@ MapTest.DirectMapMap validatedPayload = | ----------------- | ---------------------- | | [DirectMapMap](#directmapmap) | validate([Map<?, ?>](#directmapmapbuilder) arg, SchemaConfiguration configuration) | | [DirectMapBoxedMap](#directmapboxedmap) | validateAndBox([Map<?, ?>](#directmapmapbuilder) arg, SchemaConfiguration configuration) | +| [DirectMapBoxed](#directmapboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## DirectMapMapBuilder public class DirectMapMapBuilder
builder for `Map` @@ -285,27 +291,28 @@ A class to store validated Map payloads | boolean | getAdditionalProperty(String name)
provides type safety for additional properties | ## AdditionalProperties3Boxed -public static abstract sealed class AdditionalProperties3Boxed
+public sealed interface AdditionalProperties3Boxed
permits
[AdditionalProperties3BoxedBoolean](#additionalproperties3boxedboolean) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AdditionalProperties3BoxedBoolean -public static final class AdditionalProperties3BoxedBoolean
-extends [AdditionalProperties3Boxed](#additionalproperties3boxed) +public record AdditionalProperties3BoxedBoolean
+implements [AdditionalProperties3Boxed](#additionalproperties3boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalProperties3BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalProperties3 public static class AdditionalProperties3
@@ -319,27 +326,28 @@ A schema class that validates payloads | validateAndBox | ## MapOfEnumStringBoxed -public static abstract sealed class MapOfEnumStringBoxed
+public sealed interface MapOfEnumStringBoxed
permits
[MapOfEnumStringBoxedMap](#mapofenumstringboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## MapOfEnumStringBoxedMap -public static final class MapOfEnumStringBoxedMap
-extends [MapOfEnumStringBoxed](#mapofenumstringboxed) +public record MapOfEnumStringBoxedMap
+implements [MapOfEnumStringBoxed](#mapofenumstringboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MapOfEnumStringBoxedMap([MapOfEnumStringMap](#mapofenumstringmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [MapOfEnumStringMap](#mapofenumstringmap) | data
validated payload | +| [MapOfEnumStringMap](#mapofenumstringmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MapOfEnumString public static class MapOfEnumString
@@ -384,7 +392,9 @@ MapTest.MapOfEnumStringMap validatedPayload = | ----------------- | ---------------------- | | [MapOfEnumStringMap](#mapofenumstringmap) | validate([Map<?, ?>](#mapofenumstringmapbuilder) arg, SchemaConfiguration configuration) | | [MapOfEnumStringBoxedMap](#mapofenumstringboxedmap) | validateAndBox([Map<?, ?>](#mapofenumstringmapbuilder) arg, SchemaConfiguration configuration) | +| [MapOfEnumStringBoxed](#mapofenumstringboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## MapOfEnumStringMapBuilder public class MapOfEnumStringMapBuilder
builder for `Map` @@ -416,27 +426,28 @@ A class to store validated Map payloads | String | getAdditionalProperty(String name)
provides type safety for additional properties | ## AdditionalProperties2Boxed -public static abstract sealed class AdditionalProperties2Boxed
+public sealed interface AdditionalProperties2Boxed
permits
[AdditionalProperties2BoxedString](#additionalproperties2boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AdditionalProperties2BoxedString -public static final class AdditionalProperties2BoxedString
-extends [AdditionalProperties2Boxed](#additionalproperties2boxed) +public record AdditionalProperties2BoxedString
+implements [AdditionalProperties2Boxed](#additionalproperties2boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalProperties2BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalProperties2 public static class AdditionalProperties2
@@ -478,7 +489,9 @@ String validatedPayload = MapTest.AdditionalProperties2.validate( | String | validate(String arg, SchemaConfiguration configuration) | | String | validate([StringAdditionalPropertiesEnums](#stringadditionalpropertiesenums) arg, SchemaConfiguration configuration) | | [AdditionalProperties2BoxedString](#additionalproperties2boxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [AdditionalProperties2Boxed](#additionalproperties2boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## StringAdditionalPropertiesEnums public enum StringAdditionalPropertiesEnums
extends `Enum` @@ -492,27 +505,28 @@ A class that stores String enum values | LOWER | value = "lower" | ## MapMapOfStringBoxed -public static abstract sealed class MapMapOfStringBoxed
+public sealed interface MapMapOfStringBoxed
permits
[MapMapOfStringBoxedMap](#mapmapofstringboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## MapMapOfStringBoxedMap -public static final class MapMapOfStringBoxedMap
-extends [MapMapOfStringBoxed](#mapmapofstringboxed) +public record MapMapOfStringBoxedMap
+implements [MapMapOfStringBoxed](#mapmapofstringboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MapMapOfStringBoxedMap([MapMapOfStringMap](#mapmapofstringmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [MapMapOfStringMap](#mapmapofstringmap) | data
validated payload | +| [MapMapOfStringMap](#mapmapofstringmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MapMapOfString public static class MapMapOfString
@@ -564,7 +578,9 @@ MapTest.MapMapOfStringMap validatedPayload = | ----------------- | ---------------------- | | [MapMapOfStringMap](#mapmapofstringmap) | validate([Map<?, ?>](#mapmapofstringmapbuilder) arg, SchemaConfiguration configuration) | | [MapMapOfStringBoxedMap](#mapmapofstringboxedmap) | validateAndBox([Map<?, ?>](#mapmapofstringmapbuilder) arg, SchemaConfiguration configuration) | +| [MapMapOfStringBoxed](#mapmapofstringboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## MapMapOfStringMapBuilder public class MapMapOfStringMapBuilder
builder for `Map>` @@ -595,27 +611,28 @@ A class to store validated Map payloads | [AdditionalPropertiesMap](#additionalpropertiesmap) | getAdditionalProperty(String name)
provides type safety for additional properties | ## AdditionalPropertiesBoxed -public static abstract sealed class AdditionalPropertiesBoxed
+public sealed interface AdditionalPropertiesBoxed
permits
[AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AdditionalPropertiesBoxedMap -public static final class AdditionalPropertiesBoxedMap
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedMap
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedMap([AdditionalPropertiesMap](#additionalpropertiesmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [AdditionalPropertiesMap](#additionalpropertiesmap) | data
validated payload | +| [AdditionalPropertiesMap](#additionalpropertiesmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalProperties public static class AdditionalProperties
@@ -660,7 +677,9 @@ MapTest.AdditionalPropertiesMap validatedPayload = | ----------------- | ---------------------- | | [AdditionalPropertiesMap](#additionalpropertiesmap) | validate([Map<?, ?>](#additionalpropertiesmapbuilder1) arg, SchemaConfiguration configuration) | | [AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap) | validateAndBox([Map<?, ?>](#additionalpropertiesmapbuilder1) arg, SchemaConfiguration configuration) | +| [AdditionalPropertiesBoxed](#additionalpropertiesboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## AdditionalPropertiesMapBuilder1 public class AdditionalPropertiesMapBuilder1
builder for `Map` @@ -691,27 +710,28 @@ A class to store validated Map payloads | String | getAdditionalProperty(String name)
provides type safety for additional properties | ## AdditionalProperties1Boxed -public static abstract sealed class AdditionalProperties1Boxed
+public sealed interface AdditionalProperties1Boxed
permits
[AdditionalProperties1BoxedString](#additionalproperties1boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AdditionalProperties1BoxedString -public static final class AdditionalProperties1BoxedString
-extends [AdditionalProperties1Boxed](#additionalproperties1boxed) +public record AdditionalProperties1BoxedString
+implements [AdditionalProperties1Boxed](#additionalproperties1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalProperties1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalProperties1 public static class AdditionalProperties1
diff --git a/samples/client/petstore/java/docs/components/schemas/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/java/docs/components/schemas/MixedPropertiesAndAdditionalPropertiesClass.md index 6f6146ee976..91ff71cf3f0 100644 --- a/samples/client/petstore/java/docs/components/schemas/MixedPropertiesAndAdditionalPropertiesClass.md +++ b/samples/client/petstore/java/docs/components/schemas/MixedPropertiesAndAdditionalPropertiesClass.md @@ -4,7 +4,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,45 +12,46 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [MixedPropertiesAndAdditionalPropertiesClass.MixedPropertiesAndAdditionalPropertiesClass1Boxed](#mixedpropertiesandadditionalpropertiesclass1boxed)
abstract sealed validated payload class | -| static class | [MixedPropertiesAndAdditionalPropertiesClass.MixedPropertiesAndAdditionalPropertiesClass1BoxedMap](#mixedpropertiesandadditionalpropertiesclass1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [MixedPropertiesAndAdditionalPropertiesClass.MixedPropertiesAndAdditionalPropertiesClass1Boxed](#mixedpropertiesandadditionalpropertiesclass1boxed)
sealed interface for validated payloads | +| record | [MixedPropertiesAndAdditionalPropertiesClass.MixedPropertiesAndAdditionalPropertiesClass1BoxedMap](#mixedpropertiesandadditionalpropertiesclass1boxedmap)
boxed class to store validated Map payloads | | static class | [MixedPropertiesAndAdditionalPropertiesClass.MixedPropertiesAndAdditionalPropertiesClass1](#mixedpropertiesandadditionalpropertiesclass1)
schema class | | static class | [MixedPropertiesAndAdditionalPropertiesClass.MixedPropertiesAndAdditionalPropertiesClassMapBuilder](#mixedpropertiesandadditionalpropertiesclassmapbuilder)
builder for Map payloads | | static class | [MixedPropertiesAndAdditionalPropertiesClass.MixedPropertiesAndAdditionalPropertiesClassMap](#mixedpropertiesandadditionalpropertiesclassmap)
output class for Map payloads | -| static class | [MixedPropertiesAndAdditionalPropertiesClass.MapSchemaBoxed](#mapschemaboxed)
abstract sealed validated payload class | -| static class | [MixedPropertiesAndAdditionalPropertiesClass.MapSchemaBoxedMap](#mapschemaboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [MixedPropertiesAndAdditionalPropertiesClass.MapSchemaBoxed](#mapschemaboxed)
sealed interface for validated payloads | +| record | [MixedPropertiesAndAdditionalPropertiesClass.MapSchemaBoxedMap](#mapschemaboxedmap)
boxed class to store validated Map payloads | | static class | [MixedPropertiesAndAdditionalPropertiesClass.MapSchema](#mapschema)
schema class | | static class | [MixedPropertiesAndAdditionalPropertiesClass.MapMapBuilder](#mapmapbuilder)
builder for Map payloads | | static class | [MixedPropertiesAndAdditionalPropertiesClass.MapMap](#mapmap)
output class for Map payloads | -| static class | [MixedPropertiesAndAdditionalPropertiesClass.DateTimeBoxed](#datetimeboxed)
abstract sealed validated payload class | -| static class | [MixedPropertiesAndAdditionalPropertiesClass.DateTimeBoxedString](#datetimeboxedstring)
boxed class to store validated String payloads | +| sealed interface | [MixedPropertiesAndAdditionalPropertiesClass.DateTimeBoxed](#datetimeboxed)
sealed interface for validated payloads | +| record | [MixedPropertiesAndAdditionalPropertiesClass.DateTimeBoxedString](#datetimeboxedstring)
boxed class to store validated String payloads | | static class | [MixedPropertiesAndAdditionalPropertiesClass.DateTime](#datetime)
schema class | -| static class | [MixedPropertiesAndAdditionalPropertiesClass.UuidSchemaBoxed](#uuidschemaboxed)
abstract sealed validated payload class | -| static class | [MixedPropertiesAndAdditionalPropertiesClass.UuidSchemaBoxedString](#uuidschemaboxedstring)
boxed class to store validated String payloads | +| sealed interface | [MixedPropertiesAndAdditionalPropertiesClass.UuidSchemaBoxed](#uuidschemaboxed)
sealed interface for validated payloads | +| record | [MixedPropertiesAndAdditionalPropertiesClass.UuidSchemaBoxedString](#uuidschemaboxedstring)
boxed class to store validated String payloads | | static class | [MixedPropertiesAndAdditionalPropertiesClass.UuidSchema](#uuidschema)
schema class | ## MixedPropertiesAndAdditionalPropertiesClass1Boxed -public static abstract sealed class MixedPropertiesAndAdditionalPropertiesClass1Boxed
+public sealed interface MixedPropertiesAndAdditionalPropertiesClass1Boxed
permits
[MixedPropertiesAndAdditionalPropertiesClass1BoxedMap](#mixedpropertiesandadditionalpropertiesclass1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## MixedPropertiesAndAdditionalPropertiesClass1BoxedMap -public static final class MixedPropertiesAndAdditionalPropertiesClass1BoxedMap
-extends [MixedPropertiesAndAdditionalPropertiesClass1Boxed](#mixedpropertiesandadditionalpropertiesclass1boxed) +public record MixedPropertiesAndAdditionalPropertiesClass1BoxedMap
+implements [MixedPropertiesAndAdditionalPropertiesClass1Boxed](#mixedpropertiesandadditionalpropertiesclass1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MixedPropertiesAndAdditionalPropertiesClass1BoxedMap([MixedPropertiesAndAdditionalPropertiesClassMap](#mixedpropertiesandadditionalpropertiesclassmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [MixedPropertiesAndAdditionalPropertiesClassMap](#mixedpropertiesandadditionalpropertiesclassmap) | data
validated payload | +| [MixedPropertiesAndAdditionalPropertiesClassMap](#mixedpropertiesandadditionalpropertiesclassmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MixedPropertiesAndAdditionalPropertiesClass1 public static class MixedPropertiesAndAdditionalPropertiesClass1
@@ -114,7 +115,9 @@ MixedPropertiesAndAdditionalPropertiesClass.MixedPropertiesAndAdditionalProperti | ----------------- | ---------------------- | | [MixedPropertiesAndAdditionalPropertiesClassMap](#mixedpropertiesandadditionalpropertiesclassmap) | validate([Map<?, ?>](#mixedpropertiesandadditionalpropertiesclassmapbuilder) arg, SchemaConfiguration configuration) | | [MixedPropertiesAndAdditionalPropertiesClass1BoxedMap](#mixedpropertiesandadditionalpropertiesclass1boxedmap) | validateAndBox([Map<?, ?>](#mixedpropertiesandadditionalpropertiesclassmapbuilder) arg, SchemaConfiguration configuration) | +| [MixedPropertiesAndAdditionalPropertiesClass1Boxed](#mixedpropertiesandadditionalpropertiesclass1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## MixedPropertiesAndAdditionalPropertiesClassMapBuilder public class MixedPropertiesAndAdditionalPropertiesClassMapBuilder
builder for `Map` @@ -158,27 +161,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## MapSchemaBoxed -public static abstract sealed class MapSchemaBoxed
+public sealed interface MapSchemaBoxed
permits
[MapSchemaBoxedMap](#mapschemaboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## MapSchemaBoxedMap -public static final class MapSchemaBoxedMap
-extends [MapSchemaBoxed](#mapschemaboxed) +public record MapSchemaBoxedMap
+implements [MapSchemaBoxed](#mapschemaboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MapSchemaBoxedMap([MapMap](#mapmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [MapMap](#mapmap) | data
validated payload | +| [MapMap](#mapmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MapSchema public static class MapSchema
@@ -234,7 +238,9 @@ MixedPropertiesAndAdditionalPropertiesClass.MapMap validatedPayload = | ----------------- | ---------------------- | | [MapMap](#mapmap) | validate([Map<?, ?>](#mapmapbuilder) arg, SchemaConfiguration configuration) | | [MapSchemaBoxedMap](#mapschemaboxedmap) | validateAndBox([Map<?, ?>](#mapmapbuilder) arg, SchemaConfiguration configuration) | +| [MapSchemaBoxed](#mapschemaboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## MapMapBuilder public class MapMapBuilder
builder for `Map>` @@ -265,27 +271,28 @@ A class to store validated Map payloads | [Animal.AnimalMap](../../components/schemas/Animal.md#animalmap) | getAdditionalProperty(String name)
provides type safety for additional properties | ## DateTimeBoxed -public static abstract sealed class DateTimeBoxed
+public sealed interface DateTimeBoxed
permits
[DateTimeBoxedString](#datetimeboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## DateTimeBoxedString -public static final class DateTimeBoxedString
-extends [DateTimeBoxed](#datetimeboxed) +public record DateTimeBoxedString
+implements [DateTimeBoxed](#datetimeboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DateTimeBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## DateTime public static class DateTime
@@ -299,27 +306,28 @@ A schema class that validates payloads | validateAndBox | ## UuidSchemaBoxed -public static abstract sealed class UuidSchemaBoxed
+public sealed interface UuidSchemaBoxed
permits
[UuidSchemaBoxedString](#uuidschemaboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## UuidSchemaBoxedString -public static final class UuidSchemaBoxedString
-extends [UuidSchemaBoxed](#uuidschemaboxed) +public record UuidSchemaBoxedString
+implements [UuidSchemaBoxed](#uuidschemaboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UuidSchemaBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UuidSchema public static class UuidSchema
diff --git a/samples/client/petstore/java/docs/components/schemas/Money.md b/samples/client/petstore/java/docs/components/schemas/Money.md index 7717346e26d..ca65db5c9f9 100644 --- a/samples/client/petstore/java/docs/components/schemas/Money.md +++ b/samples/client/petstore/java/docs/components/schemas/Money.md @@ -4,7 +4,7 @@ public class Money
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,45 +12,46 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Money.Money1Boxed](#money1boxed)
abstract sealed validated payload class | -| static class | [Money.Money1BoxedMap](#money1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [Money.Money1Boxed](#money1boxed)
sealed interface for validated payloads | +| record | [Money.Money1BoxedMap](#money1boxedmap)
boxed class to store validated Map payloads | | static class | [Money.Money1](#money1)
schema class | | static class | [Money.MoneyMapBuilder](#moneymapbuilder)
builder for Map payloads | | static class | [Money.MoneyMap](#moneymap)
output class for Map payloads | -| static class | [Money.AmountBoxed](#amountboxed)
abstract sealed validated payload class | -| static class | [Money.AmountBoxedString](#amountboxedstring)
boxed class to store validated String payloads | +| sealed interface | [Money.AmountBoxed](#amountboxed)
sealed interface for validated payloads | +| record | [Money.AmountBoxedString](#amountboxedstring)
boxed class to store validated String payloads | | static class | [Money.Amount](#amount)
schema class | -| static class | [Money.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
abstract sealed validated payload class | -| static class | [Money.AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid)
boxed class to store validated null payloads | -| static class | [Money.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | -| static class | [Money.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | -| static class | [Money.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | -| static class | [Money.AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist)
boxed class to store validated List payloads | -| static class | [Money.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [Money.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
sealed interface for validated payloads | +| record | [Money.AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid)
boxed class to store validated null payloads | +| record | [Money.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | +| record | [Money.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | +| record | [Money.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | +| record | [Money.AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist)
boxed class to store validated List payloads | +| record | [Money.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | | static class | [Money.AdditionalProperties](#additionalproperties)
schema class | ## Money1Boxed -public static abstract sealed class Money1Boxed
+public sealed interface Money1Boxed
permits
[Money1BoxedMap](#money1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Money1BoxedMap -public static final class Money1BoxedMap
-extends [Money1Boxed](#money1boxed) +public record Money1BoxedMap
+implements [Money1Boxed](#money1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Money1BoxedMap([MoneyMap](#moneymap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [MoneyMap](#moneymap) | data
validated payload | +| [MoneyMap](#moneymap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Money1 public static class Money1
@@ -99,7 +100,9 @@ Money.MoneyMap validatedPayload = | ----------------- | ---------------------- | | [MoneyMap](#moneymap) | validate([Map<?, ?>](#moneymapbuilder) arg, SchemaConfiguration configuration) | | [Money1BoxedMap](#money1boxedmap) | validateAndBox([Map<?, ?>](#moneymapbuilder) arg, SchemaConfiguration configuration) | +| [Money1Boxed](#money1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## MoneyMap00Builder public class MoneyMap00Builder
builder for `Map` @@ -181,27 +184,28 @@ A class to store validated Map payloads | String | currency()
| ## AmountBoxed -public static abstract sealed class AmountBoxed
+public sealed interface AmountBoxed
permits
[AmountBoxedString](#amountboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AmountBoxedString -public static final class AmountBoxedString
-extends [AmountBoxed](#amountboxed) +public record AmountBoxedString
+implements [AmountBoxed](#amountboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AmountBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Amount public static class Amount
@@ -215,7 +219,7 @@ A schema class that validates payloads | validateAndBox | ## AdditionalPropertiesBoxed -public static abstract sealed class AdditionalPropertiesBoxed
+public sealed interface AdditionalPropertiesBoxed
permits
[AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid), [AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean), @@ -224,103 +228,109 @@ permits
[AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist), [AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AdditionalPropertiesBoxedVoid -public static final class AdditionalPropertiesBoxedVoid
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedVoid
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedBoolean -public static final class AdditionalPropertiesBoxedBoolean
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedBoolean
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedNumber -public static final class AdditionalPropertiesBoxedNumber
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedNumber
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedString -public static final class AdditionalPropertiesBoxedString
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedString
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedList -public static final class AdditionalPropertiesBoxedList
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedList
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedMap -public static final class AdditionalPropertiesBoxedMap
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedMap
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalProperties public static class AdditionalProperties
diff --git a/samples/client/petstore/java/docs/components/schemas/MyObjectDto.md b/samples/client/petstore/java/docs/components/schemas/MyObjectDto.md index 7571738dbe8..ae1ecabc9e5 100644 --- a/samples/client/petstore/java/docs/components/schemas/MyObjectDto.md +++ b/samples/client/petstore/java/docs/components/schemas/MyObjectDto.md @@ -4,7 +4,7 @@ public class MyObjectDto
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,45 +12,46 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [MyObjectDto.MyObjectDto1Boxed](#myobjectdto1boxed)
abstract sealed validated payload class | -| static class | [MyObjectDto.MyObjectDto1BoxedMap](#myobjectdto1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [MyObjectDto.MyObjectDto1Boxed](#myobjectdto1boxed)
sealed interface for validated payloads | +| record | [MyObjectDto.MyObjectDto1BoxedMap](#myobjectdto1boxedmap)
boxed class to store validated Map payloads | | static class | [MyObjectDto.MyObjectDto1](#myobjectdto1)
schema class | | static class | [MyObjectDto.MyObjectDtoMapBuilder](#myobjectdtomapbuilder)
builder for Map payloads | | static class | [MyObjectDto.MyObjectDtoMap](#myobjectdtomap)
output class for Map payloads | -| static class | [MyObjectDto.IdBoxed](#idboxed)
abstract sealed validated payload class | -| static class | [MyObjectDto.IdBoxedString](#idboxedstring)
boxed class to store validated String payloads | +| sealed interface | [MyObjectDto.IdBoxed](#idboxed)
sealed interface for validated payloads | +| record | [MyObjectDto.IdBoxedString](#idboxedstring)
boxed class to store validated String payloads | | static class | [MyObjectDto.Id](#id)
schema class | -| static class | [MyObjectDto.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
abstract sealed validated payload class | -| static class | [MyObjectDto.AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid)
boxed class to store validated null payloads | -| static class | [MyObjectDto.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | -| static class | [MyObjectDto.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | -| static class | [MyObjectDto.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | -| static class | [MyObjectDto.AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist)
boxed class to store validated List payloads | -| static class | [MyObjectDto.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [MyObjectDto.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
sealed interface for validated payloads | +| record | [MyObjectDto.AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid)
boxed class to store validated null payloads | +| record | [MyObjectDto.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | +| record | [MyObjectDto.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | +| record | [MyObjectDto.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | +| record | [MyObjectDto.AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist)
boxed class to store validated List payloads | +| record | [MyObjectDto.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | | static class | [MyObjectDto.AdditionalProperties](#additionalproperties)
schema class | ## MyObjectDto1Boxed -public static abstract sealed class MyObjectDto1Boxed
+public sealed interface MyObjectDto1Boxed
permits
[MyObjectDto1BoxedMap](#myobjectdto1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## MyObjectDto1BoxedMap -public static final class MyObjectDto1BoxedMap
-extends [MyObjectDto1Boxed](#myobjectdto1boxed) +public record MyObjectDto1BoxedMap
+implements [MyObjectDto1Boxed](#myobjectdto1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MyObjectDto1BoxedMap([MyObjectDtoMap](#myobjectdtomap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [MyObjectDtoMap](#myobjectdtomap) | data
validated payload | +| [MyObjectDtoMap](#myobjectdtomap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MyObjectDto1 public static class MyObjectDto1
@@ -96,7 +97,9 @@ MyObjectDto.MyObjectDtoMap validatedPayload = | ----------------- | ---------------------- | | [MyObjectDtoMap](#myobjectdtomap) | validate([Map<?, ?>](#myobjectdtomapbuilder) arg, SchemaConfiguration configuration) | | [MyObjectDto1BoxedMap](#myobjectdto1boxedmap) | validateAndBox([Map<?, ?>](#myobjectdtomapbuilder) arg, SchemaConfiguration configuration) | +| [MyObjectDto1Boxed](#myobjectdto1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## MyObjectDtoMapBuilder public class MyObjectDtoMapBuilder
builder for `Map` @@ -127,27 +130,28 @@ A class to store validated Map payloads | String | id()
[optional] value must be a uuid | ## IdBoxed -public static abstract sealed class IdBoxed
+public sealed interface IdBoxed
permits
[IdBoxedString](#idboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## IdBoxedString -public static final class IdBoxedString
-extends [IdBoxed](#idboxed) +public record IdBoxedString
+implements [IdBoxed](#idboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IdBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Id public static class Id
@@ -161,7 +165,7 @@ A schema class that validates payloads | validateAndBox | ## AdditionalPropertiesBoxed -public static abstract sealed class AdditionalPropertiesBoxed
+public sealed interface AdditionalPropertiesBoxed
permits
[AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid), [AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean), @@ -170,103 +174,109 @@ permits
[AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist), [AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AdditionalPropertiesBoxedVoid -public static final class AdditionalPropertiesBoxedVoid
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedVoid
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedBoolean -public static final class AdditionalPropertiesBoxedBoolean
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedBoolean
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedNumber -public static final class AdditionalPropertiesBoxedNumber
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedNumber
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedString -public static final class AdditionalPropertiesBoxedString
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedString
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedList -public static final class AdditionalPropertiesBoxedList
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedList
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedMap -public static final class AdditionalPropertiesBoxedMap
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedMap
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalProperties public static class AdditionalProperties
diff --git a/samples/client/petstore/java/docs/components/schemas/Name.md b/samples/client/petstore/java/docs/components/schemas/Name.md index b50bf174b3b..2d150ddbe8a 100644 --- a/samples/client/petstore/java/docs/components/schemas/Name.md +++ b/samples/client/petstore/java/docs/components/schemas/Name.md @@ -4,7 +4,7 @@ public class Name
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,28 +12,28 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Name.Name1Boxed](#name1boxed)
abstract sealed validated payload class | -| static class | [Name.Name1BoxedVoid](#name1boxedvoid)
boxed class to store validated null payloads | -| static class | [Name.Name1BoxedBoolean](#name1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [Name.Name1BoxedNumber](#name1boxednumber)
boxed class to store validated Number payloads | -| static class | [Name.Name1BoxedString](#name1boxedstring)
boxed class to store validated String payloads | -| static class | [Name.Name1BoxedList](#name1boxedlist)
boxed class to store validated List payloads | -| static class | [Name.Name1BoxedMap](#name1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [Name.Name1Boxed](#name1boxed)
sealed interface for validated payloads | +| record | [Name.Name1BoxedVoid](#name1boxedvoid)
boxed class to store validated null payloads | +| record | [Name.Name1BoxedBoolean](#name1boxedboolean)
boxed class to store validated boolean payloads | +| record | [Name.Name1BoxedNumber](#name1boxednumber)
boxed class to store validated Number payloads | +| record | [Name.Name1BoxedString](#name1boxedstring)
boxed class to store validated String payloads | +| record | [Name.Name1BoxedList](#name1boxedlist)
boxed class to store validated List payloads | +| record | [Name.Name1BoxedMap](#name1boxedmap)
boxed class to store validated Map payloads | | static class | [Name.Name1](#name1)
schema class | | static class | [Name.NameMapBuilder1](#namemapbuilder1)
builder for Map payloads | | static class | [Name.NameMap](#namemap)
output class for Map payloads | -| static class | [Name.PropertyBoxed](#propertyboxed)
abstract sealed validated payload class | -| static class | [Name.PropertyBoxedString](#propertyboxedstring)
boxed class to store validated String payloads | +| sealed interface | [Name.PropertyBoxed](#propertyboxed)
sealed interface for validated payloads | +| record | [Name.PropertyBoxedString](#propertyboxedstring)
boxed class to store validated String payloads | | static class | [Name.Property](#property)
schema class | -| static class | [Name.SnakeCaseBoxed](#snakecaseboxed)
abstract sealed validated payload class | -| static class | [Name.SnakeCaseBoxedNumber](#snakecaseboxednumber)
boxed class to store validated Number payloads | +| sealed interface | [Name.SnakeCaseBoxed](#snakecaseboxed)
sealed interface for validated payloads | +| record | [Name.SnakeCaseBoxedNumber](#snakecaseboxednumber)
boxed class to store validated Number payloads | | static class | [Name.SnakeCase](#snakecase)
schema class | -| static class | [Name.Name2Boxed](#name2boxed)
abstract sealed validated payload class | -| static class | [Name.Name2BoxedNumber](#name2boxednumber)
boxed class to store validated Number payloads | +| sealed interface | [Name.Name2Boxed](#name2boxed)
sealed interface for validated payloads | +| record | [Name.Name2BoxedNumber](#name2boxednumber)
boxed class to store validated Number payloads | | static class | [Name.Name2](#name2)
schema class | ## Name1Boxed -public static abstract sealed class Name1Boxed
+public sealed interface Name1Boxed
permits
[Name1BoxedVoid](#name1boxedvoid), [Name1BoxedBoolean](#name1boxedboolean), @@ -42,103 +42,109 @@ permits
[Name1BoxedList](#name1boxedlist), [Name1BoxedMap](#name1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Name1BoxedVoid -public static final class Name1BoxedVoid
-extends [Name1Boxed](#name1boxed) +public record Name1BoxedVoid
+implements [Name1Boxed](#name1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Name1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Name1BoxedBoolean -public static final class Name1BoxedBoolean
-extends [Name1Boxed](#name1boxed) +public record Name1BoxedBoolean
+implements [Name1Boxed](#name1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Name1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Name1BoxedNumber -public static final class Name1BoxedNumber
-extends [Name1Boxed](#name1boxed) +public record Name1BoxedNumber
+implements [Name1Boxed](#name1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Name1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Name1BoxedString -public static final class Name1BoxedString
-extends [Name1Boxed](#name1boxed) +public record Name1BoxedString
+implements [Name1Boxed](#name1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Name1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Name1BoxedList -public static final class Name1BoxedList
-extends [Name1Boxed](#name1boxed) +public record Name1BoxedList
+implements [Name1Boxed](#name1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Name1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Name1BoxedMap -public static final class Name1BoxedMap
-extends [Name1Boxed](#name1boxed) +public record Name1BoxedMap
+implements [Name1Boxed](#name1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Name1BoxedMap([NameMap](#namemap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [NameMap](#namemap) | data
validated payload | +| [NameMap](#namemap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Name1 public static class Name1
@@ -174,7 +180,9 @@ Model for testing model name same as property name | [Name1BoxedBoolean](#name1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Name1BoxedMap](#name1boxedmap) | validateAndBox([Map<?, ?>](#namemapbuilder1) arg, SchemaConfiguration configuration) | | [Name1BoxedList](#name1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Name1Boxed](#name1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## NameMap0Builder public class NameMap0Builder
builder for `Map` @@ -236,27 +244,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## PropertyBoxed -public static abstract sealed class PropertyBoxed
+public sealed interface PropertyBoxed
permits
[PropertyBoxedString](#propertyboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## PropertyBoxedString -public static final class PropertyBoxedString
-extends [PropertyBoxed](#propertyboxed) +public record PropertyBoxedString
+implements [PropertyBoxed](#propertyboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PropertyBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Property public static class Property
@@ -273,27 +282,28 @@ this is a reserved python keyword | validateAndBox | ## SnakeCaseBoxed -public static abstract sealed class SnakeCaseBoxed
+public sealed interface SnakeCaseBoxed
permits
[SnakeCaseBoxedNumber](#snakecaseboxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## SnakeCaseBoxedNumber -public static final class SnakeCaseBoxedNumber
-extends [SnakeCaseBoxed](#snakecaseboxed) +public record SnakeCaseBoxedNumber
+implements [SnakeCaseBoxed](#snakecaseboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | SnakeCaseBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## SnakeCase public static class SnakeCase
@@ -307,27 +317,28 @@ A schema class that validates payloads | validateAndBox | ## Name2Boxed -public static abstract sealed class Name2Boxed
+public sealed interface Name2Boxed
permits
[Name2BoxedNumber](#name2boxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Name2BoxedNumber -public static final class Name2BoxedNumber
-extends [Name2Boxed](#name2boxed) +public record Name2BoxedNumber
+implements [Name2Boxed](#name2boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Name2BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Name2 public static class Name2
diff --git a/samples/client/petstore/java/docs/components/schemas/NoAdditionalProperties.md b/samples/client/petstore/java/docs/components/schemas/NoAdditionalProperties.md index 590e1f00365..a9d60fd14e2 100644 --- a/samples/client/petstore/java/docs/components/schemas/NoAdditionalProperties.md +++ b/samples/client/petstore/java/docs/components/schemas/NoAdditionalProperties.md @@ -4,7 +4,7 @@ public class NoAdditionalProperties
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,48 +12,49 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [NoAdditionalProperties.NoAdditionalProperties1Boxed](#noadditionalproperties1boxed)
abstract sealed validated payload class | -| static class | [NoAdditionalProperties.NoAdditionalProperties1BoxedMap](#noadditionalproperties1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [NoAdditionalProperties.NoAdditionalProperties1Boxed](#noadditionalproperties1boxed)
sealed interface for validated payloads | +| record | [NoAdditionalProperties.NoAdditionalProperties1BoxedMap](#noadditionalproperties1boxedmap)
boxed class to store validated Map payloads | | static class | [NoAdditionalProperties.NoAdditionalProperties1](#noadditionalproperties1)
schema class | | static class | [NoAdditionalProperties.NoAdditionalPropertiesMapBuilder](#noadditionalpropertiesmapbuilder)
builder for Map payloads | | static class | [NoAdditionalProperties.NoAdditionalPropertiesMap](#noadditionalpropertiesmap)
output class for Map payloads | -| static class | [NoAdditionalProperties.PetIdBoxed](#petidboxed)
abstract sealed validated payload class | -| static class | [NoAdditionalProperties.PetIdBoxedNumber](#petidboxednumber)
boxed class to store validated Number payloads | +| sealed interface | [NoAdditionalProperties.PetIdBoxed](#petidboxed)
sealed interface for validated payloads | +| record | [NoAdditionalProperties.PetIdBoxedNumber](#petidboxednumber)
boxed class to store validated Number payloads | | static class | [NoAdditionalProperties.PetId](#petid)
schema class | -| static class | [NoAdditionalProperties.IdBoxed](#idboxed)
abstract sealed validated payload class | -| static class | [NoAdditionalProperties.IdBoxedNumber](#idboxednumber)
boxed class to store validated Number payloads | +| sealed interface | [NoAdditionalProperties.IdBoxed](#idboxed)
sealed interface for validated payloads | +| record | [NoAdditionalProperties.IdBoxedNumber](#idboxednumber)
boxed class to store validated Number payloads | | static class | [NoAdditionalProperties.Id](#id)
schema class | -| static class | [NoAdditionalProperties.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
abstract sealed validated payload class | -| static class | [NoAdditionalProperties.AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid)
boxed class to store validated null payloads | -| static class | [NoAdditionalProperties.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | -| static class | [NoAdditionalProperties.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | -| static class | [NoAdditionalProperties.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | -| static class | [NoAdditionalProperties.AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist)
boxed class to store validated List payloads | -| static class | [NoAdditionalProperties.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [NoAdditionalProperties.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
sealed interface for validated payloads | +| record | [NoAdditionalProperties.AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid)
boxed class to store validated null payloads | +| record | [NoAdditionalProperties.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | +| record | [NoAdditionalProperties.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | +| record | [NoAdditionalProperties.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | +| record | [NoAdditionalProperties.AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist)
boxed class to store validated List payloads | +| record | [NoAdditionalProperties.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | | static class | [NoAdditionalProperties.AdditionalProperties](#additionalproperties)
schema class | ## NoAdditionalProperties1Boxed -public static abstract sealed class NoAdditionalProperties1Boxed
+public sealed interface NoAdditionalProperties1Boxed
permits
[NoAdditionalProperties1BoxedMap](#noadditionalproperties1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## NoAdditionalProperties1BoxedMap -public static final class NoAdditionalProperties1BoxedMap
-extends [NoAdditionalProperties1Boxed](#noadditionalproperties1boxed) +public record NoAdditionalProperties1BoxedMap
+implements [NoAdditionalProperties1Boxed](#noadditionalproperties1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NoAdditionalProperties1BoxedMap([NoAdditionalPropertiesMap](#noadditionalpropertiesmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [NoAdditionalPropertiesMap](#noadditionalpropertiesmap) | data
validated payload | +| [NoAdditionalPropertiesMap](#noadditionalpropertiesmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NoAdditionalProperties1 public static class NoAdditionalProperties1
@@ -102,7 +103,9 @@ NoAdditionalProperties.NoAdditionalPropertiesMap validatedPayload = | ----------------- | ---------------------- | | [NoAdditionalPropertiesMap](#noadditionalpropertiesmap) | validate([Map<?, ?>](#noadditionalpropertiesmapbuilder) arg, SchemaConfiguration configuration) | | [NoAdditionalProperties1BoxedMap](#noadditionalproperties1boxedmap) | validateAndBox([Map<?, ?>](#noadditionalpropertiesmapbuilder) arg, SchemaConfiguration configuration) | +| [NoAdditionalProperties1Boxed](#noadditionalproperties1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## NoAdditionalPropertiesMap0Builder public class NoAdditionalPropertiesMap0Builder
builder for `Map` @@ -156,27 +159,28 @@ A class to store validated Map payloads | Number | petId()
[optional] value must be a 64 bit integer | ## PetIdBoxed -public static abstract sealed class PetIdBoxed
+public sealed interface PetIdBoxed
permits
[PetIdBoxedNumber](#petidboxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## PetIdBoxedNumber -public static final class PetIdBoxedNumber
-extends [PetIdBoxed](#petidboxed) +public record PetIdBoxedNumber
+implements [PetIdBoxed](#petidboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PetIdBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PetId public static class PetId
@@ -190,27 +194,28 @@ A schema class that validates payloads | validateAndBox | ## IdBoxed -public static abstract sealed class IdBoxed
+public sealed interface IdBoxed
permits
[IdBoxedNumber](#idboxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## IdBoxedNumber -public static final class IdBoxedNumber
-extends [IdBoxed](#idboxed) +public record IdBoxedNumber
+implements [IdBoxed](#idboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IdBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Id public static class Id
@@ -224,7 +229,7 @@ A schema class that validates payloads | validateAndBox | ## AdditionalPropertiesBoxed -public static abstract sealed class AdditionalPropertiesBoxed
+public sealed interface AdditionalPropertiesBoxed
permits
[AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid), [AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean), @@ -233,103 +238,109 @@ permits
[AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist), [AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AdditionalPropertiesBoxedVoid -public static final class AdditionalPropertiesBoxedVoid
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedVoid
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedBoolean -public static final class AdditionalPropertiesBoxedBoolean
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedBoolean
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedNumber -public static final class AdditionalPropertiesBoxedNumber
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedNumber
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedString -public static final class AdditionalPropertiesBoxedString
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedString
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedList -public static final class AdditionalPropertiesBoxedList
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedList
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedMap -public static final class AdditionalPropertiesBoxedMap
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedMap
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalProperties public static class AdditionalProperties
diff --git a/samples/client/petstore/java/docs/components/schemas/NullableClass.md b/samples/client/petstore/java/docs/components/schemas/NullableClass.md index 58eeb49f3b6..ac31e51544e 100644 --- a/samples/client/petstore/java/docs/components/schemas/NullableClass.md +++ b/samples/client/petstore/java/docs/components/schemas/NullableClass.md @@ -4,7 +4,7 @@ public class NullableClass
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated list payloads, extends FrozenList - classes to build inputs for list payloads @@ -14,118 +14,119 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [NullableClass.NullableClass1Boxed](#nullableclass1boxed)
abstract sealed validated payload class | -| static class | [NullableClass.NullableClass1BoxedMap](#nullableclass1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [NullableClass.NullableClass1Boxed](#nullableclass1boxed)
sealed interface for validated payloads | +| record | [NullableClass.NullableClass1BoxedMap](#nullableclass1boxedmap)
boxed class to store validated Map payloads | | static class | [NullableClass.NullableClass1](#nullableclass1)
schema class | | static class | [NullableClass.NullableClassMapBuilder](#nullableclassmapbuilder)
builder for Map payloads | | static class | [NullableClass.NullableClassMap](#nullableclassmap)
output class for Map payloads | -| static class | [NullableClass.ObjectItemsNullableBoxed](#objectitemsnullableboxed)
abstract sealed validated payload class | -| static class | [NullableClass.ObjectItemsNullableBoxedMap](#objectitemsnullableboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [NullableClass.ObjectItemsNullableBoxed](#objectitemsnullableboxed)
sealed interface for validated payloads | +| record | [NullableClass.ObjectItemsNullableBoxedMap](#objectitemsnullableboxedmap)
boxed class to store validated Map payloads | | static class | [NullableClass.ObjectItemsNullable](#objectitemsnullable)
schema class | | static class | [NullableClass.ObjectItemsNullableMapBuilder](#objectitemsnullablemapbuilder)
builder for Map payloads | | static class | [NullableClass.ObjectItemsNullableMap](#objectitemsnullablemap)
output class for Map payloads | -| static class | [NullableClass.AdditionalProperties2Boxed](#additionalproperties2boxed)
abstract sealed validated payload class | -| static class | [NullableClass.AdditionalProperties2BoxedVoid](#additionalproperties2boxedvoid)
boxed class to store validated null payloads | -| static class | [NullableClass.AdditionalProperties2BoxedMap](#additionalproperties2boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [NullableClass.AdditionalProperties2Boxed](#additionalproperties2boxed)
sealed interface for validated payloads | +| record | [NullableClass.AdditionalProperties2BoxedVoid](#additionalproperties2boxedvoid)
boxed class to store validated null payloads | +| record | [NullableClass.AdditionalProperties2BoxedMap](#additionalproperties2boxedmap)
boxed class to store validated Map payloads | | static class | [NullableClass.AdditionalProperties2](#additionalproperties2)
schema class | -| static class | [NullableClass.ObjectAndItemsNullablePropBoxed](#objectanditemsnullablepropboxed)
abstract sealed validated payload class | -| static class | [NullableClass.ObjectAndItemsNullablePropBoxedVoid](#objectanditemsnullablepropboxedvoid)
boxed class to store validated null payloads | -| static class | [NullableClass.ObjectAndItemsNullablePropBoxedMap](#objectanditemsnullablepropboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [NullableClass.ObjectAndItemsNullablePropBoxed](#objectanditemsnullablepropboxed)
sealed interface for validated payloads | +| record | [NullableClass.ObjectAndItemsNullablePropBoxedVoid](#objectanditemsnullablepropboxedvoid)
boxed class to store validated null payloads | +| record | [NullableClass.ObjectAndItemsNullablePropBoxedMap](#objectanditemsnullablepropboxedmap)
boxed class to store validated Map payloads | | static class | [NullableClass.ObjectAndItemsNullableProp](#objectanditemsnullableprop)
schema class | | static class | [NullableClass.ObjectAndItemsNullablePropMapBuilder](#objectanditemsnullablepropmapbuilder)
builder for Map payloads | | static class | [NullableClass.ObjectAndItemsNullablePropMap](#objectanditemsnullablepropmap)
output class for Map payloads | -| static class | [NullableClass.AdditionalProperties1Boxed](#additionalproperties1boxed)
abstract sealed validated payload class | -| static class | [NullableClass.AdditionalProperties1BoxedVoid](#additionalproperties1boxedvoid)
boxed class to store validated null payloads | -| static class | [NullableClass.AdditionalProperties1BoxedMap](#additionalproperties1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [NullableClass.AdditionalProperties1Boxed](#additionalproperties1boxed)
sealed interface for validated payloads | +| record | [NullableClass.AdditionalProperties1BoxedVoid](#additionalproperties1boxedvoid)
boxed class to store validated null payloads | +| record | [NullableClass.AdditionalProperties1BoxedMap](#additionalproperties1boxedmap)
boxed class to store validated Map payloads | | static class | [NullableClass.AdditionalProperties1](#additionalproperties1)
schema class | -| static class | [NullableClass.ObjectNullablePropBoxed](#objectnullablepropboxed)
abstract sealed validated payload class | -| static class | [NullableClass.ObjectNullablePropBoxedVoid](#objectnullablepropboxedvoid)
boxed class to store validated null payloads | -| static class | [NullableClass.ObjectNullablePropBoxedMap](#objectnullablepropboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [NullableClass.ObjectNullablePropBoxed](#objectnullablepropboxed)
sealed interface for validated payloads | +| record | [NullableClass.ObjectNullablePropBoxedVoid](#objectnullablepropboxedvoid)
boxed class to store validated null payloads | +| record | [NullableClass.ObjectNullablePropBoxedMap](#objectnullablepropboxedmap)
boxed class to store validated Map payloads | | static class | [NullableClass.ObjectNullableProp](#objectnullableprop)
schema class | | static class | [NullableClass.ObjectNullablePropMapBuilder](#objectnullablepropmapbuilder)
builder for Map payloads | | static class | [NullableClass.ObjectNullablePropMap](#objectnullablepropmap)
output class for Map payloads | -| static class | [NullableClass.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
abstract sealed validated payload class | -| static class | [NullableClass.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [NullableClass.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
sealed interface for validated payloads | +| record | [NullableClass.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | | static class | [NullableClass.AdditionalProperties](#additionalproperties)
schema class | -| static class | [NullableClass.ArrayItemsNullableBoxed](#arrayitemsnullableboxed)
abstract sealed validated payload class | -| static class | [NullableClass.ArrayItemsNullableBoxedList](#arrayitemsnullableboxedlist)
boxed class to store validated List payloads | +| sealed interface | [NullableClass.ArrayItemsNullableBoxed](#arrayitemsnullableboxed)
sealed interface for validated payloads | +| record | [NullableClass.ArrayItemsNullableBoxedList](#arrayitemsnullableboxedlist)
boxed class to store validated List payloads | | static class | [NullableClass.ArrayItemsNullable](#arrayitemsnullable)
schema class | | static class | [NullableClass.ArrayItemsNullableListBuilder](#arrayitemsnullablelistbuilder)
builder for List payloads | | static class | [NullableClass.ArrayItemsNullableList](#arrayitemsnullablelist)
output class for List payloads | -| static class | [NullableClass.Items2Boxed](#items2boxed)
abstract sealed validated payload class | -| static class | [NullableClass.Items2BoxedVoid](#items2boxedvoid)
boxed class to store validated null payloads | -| static class | [NullableClass.Items2BoxedMap](#items2boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [NullableClass.Items2Boxed](#items2boxed)
sealed interface for validated payloads | +| record | [NullableClass.Items2BoxedVoid](#items2boxedvoid)
boxed class to store validated null payloads | +| record | [NullableClass.Items2BoxedMap](#items2boxedmap)
boxed class to store validated Map payloads | | static class | [NullableClass.Items2](#items2)
schema class | -| static class | [NullableClass.ArrayAndItemsNullablePropBoxed](#arrayanditemsnullablepropboxed)
abstract sealed validated payload class | -| static class | [NullableClass.ArrayAndItemsNullablePropBoxedVoid](#arrayanditemsnullablepropboxedvoid)
boxed class to store validated null payloads | -| static class | [NullableClass.ArrayAndItemsNullablePropBoxedList](#arrayanditemsnullablepropboxedlist)
boxed class to store validated List payloads | +| sealed interface | [NullableClass.ArrayAndItemsNullablePropBoxed](#arrayanditemsnullablepropboxed)
sealed interface for validated payloads | +| record | [NullableClass.ArrayAndItemsNullablePropBoxedVoid](#arrayanditemsnullablepropboxedvoid)
boxed class to store validated null payloads | +| record | [NullableClass.ArrayAndItemsNullablePropBoxedList](#arrayanditemsnullablepropboxedlist)
boxed class to store validated List payloads | | static class | [NullableClass.ArrayAndItemsNullableProp](#arrayanditemsnullableprop)
schema class | | static class | [NullableClass.ArrayAndItemsNullablePropListBuilder](#arrayanditemsnullableproplistbuilder)
builder for List payloads | | static class | [NullableClass.ArrayAndItemsNullablePropList](#arrayanditemsnullableproplist)
output class for List payloads | -| static class | [NullableClass.Items1Boxed](#items1boxed)
abstract sealed validated payload class | -| static class | [NullableClass.Items1BoxedVoid](#items1boxedvoid)
boxed class to store validated null payloads | -| static class | [NullableClass.Items1BoxedMap](#items1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [NullableClass.Items1Boxed](#items1boxed)
sealed interface for validated payloads | +| record | [NullableClass.Items1BoxedVoid](#items1boxedvoid)
boxed class to store validated null payloads | +| record | [NullableClass.Items1BoxedMap](#items1boxedmap)
boxed class to store validated Map payloads | | static class | [NullableClass.Items1](#items1)
schema class | -| static class | [NullableClass.ArrayNullablePropBoxed](#arraynullablepropboxed)
abstract sealed validated payload class | -| static class | [NullableClass.ArrayNullablePropBoxedVoid](#arraynullablepropboxedvoid)
boxed class to store validated null payloads | -| static class | [NullableClass.ArrayNullablePropBoxedList](#arraynullablepropboxedlist)
boxed class to store validated List payloads | +| sealed interface | [NullableClass.ArrayNullablePropBoxed](#arraynullablepropboxed)
sealed interface for validated payloads | +| record | [NullableClass.ArrayNullablePropBoxedVoid](#arraynullablepropboxedvoid)
boxed class to store validated null payloads | +| record | [NullableClass.ArrayNullablePropBoxedList](#arraynullablepropboxedlist)
boxed class to store validated List payloads | | static class | [NullableClass.ArrayNullableProp](#arraynullableprop)
schema class | | static class | [NullableClass.ArrayNullablePropListBuilder](#arraynullableproplistbuilder)
builder for List payloads | | static class | [NullableClass.ArrayNullablePropList](#arraynullableproplist)
output class for List payloads | -| static class | [NullableClass.ItemsBoxed](#itemsboxed)
abstract sealed validated payload class | -| static class | [NullableClass.ItemsBoxedMap](#itemsboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [NullableClass.ItemsBoxed](#itemsboxed)
sealed interface for validated payloads | +| record | [NullableClass.ItemsBoxedMap](#itemsboxedmap)
boxed class to store validated Map payloads | | static class | [NullableClass.Items](#items)
schema class | -| static class | [NullableClass.DatetimePropBoxed](#datetimepropboxed)
abstract sealed validated payload class | -| static class | [NullableClass.DatetimePropBoxedVoid](#datetimepropboxedvoid)
boxed class to store validated null payloads | -| static class | [NullableClass.DatetimePropBoxedString](#datetimepropboxedstring)
boxed class to store validated String payloads | +| sealed interface | [NullableClass.DatetimePropBoxed](#datetimepropboxed)
sealed interface for validated payloads | +| record | [NullableClass.DatetimePropBoxedVoid](#datetimepropboxedvoid)
boxed class to store validated null payloads | +| record | [NullableClass.DatetimePropBoxedString](#datetimepropboxedstring)
boxed class to store validated String payloads | | static class | [NullableClass.DatetimeProp](#datetimeprop)
schema class | -| static class | [NullableClass.DatePropBoxed](#datepropboxed)
abstract sealed validated payload class | -| static class | [NullableClass.DatePropBoxedVoid](#datepropboxedvoid)
boxed class to store validated null payloads | -| static class | [NullableClass.DatePropBoxedString](#datepropboxedstring)
boxed class to store validated String payloads | +| sealed interface | [NullableClass.DatePropBoxed](#datepropboxed)
sealed interface for validated payloads | +| record | [NullableClass.DatePropBoxedVoid](#datepropboxedvoid)
boxed class to store validated null payloads | +| record | [NullableClass.DatePropBoxedString](#datepropboxedstring)
boxed class to store validated String payloads | | static class | [NullableClass.DateProp](#dateprop)
schema class | -| static class | [NullableClass.StringPropBoxed](#stringpropboxed)
abstract sealed validated payload class | -| static class | [NullableClass.StringPropBoxedVoid](#stringpropboxedvoid)
boxed class to store validated null payloads | -| static class | [NullableClass.StringPropBoxedString](#stringpropboxedstring)
boxed class to store validated String payloads | +| sealed interface | [NullableClass.StringPropBoxed](#stringpropboxed)
sealed interface for validated payloads | +| record | [NullableClass.StringPropBoxedVoid](#stringpropboxedvoid)
boxed class to store validated null payloads | +| record | [NullableClass.StringPropBoxedString](#stringpropboxedstring)
boxed class to store validated String payloads | | static class | [NullableClass.StringProp](#stringprop)
schema class | -| static class | [NullableClass.BooleanPropBoxed](#booleanpropboxed)
abstract sealed validated payload class | -| static class | [NullableClass.BooleanPropBoxedVoid](#booleanpropboxedvoid)
boxed class to store validated null payloads | -| static class | [NullableClass.BooleanPropBoxedBoolean](#booleanpropboxedboolean)
boxed class to store validated boolean payloads | +| sealed interface | [NullableClass.BooleanPropBoxed](#booleanpropboxed)
sealed interface for validated payloads | +| record | [NullableClass.BooleanPropBoxedVoid](#booleanpropboxedvoid)
boxed class to store validated null payloads | +| record | [NullableClass.BooleanPropBoxedBoolean](#booleanpropboxedboolean)
boxed class to store validated boolean payloads | | static class | [NullableClass.BooleanProp](#booleanprop)
schema class | -| static class | [NullableClass.NumberPropBoxed](#numberpropboxed)
abstract sealed validated payload class | -| static class | [NullableClass.NumberPropBoxedVoid](#numberpropboxedvoid)
boxed class to store validated null payloads | -| static class | [NullableClass.NumberPropBoxedNumber](#numberpropboxednumber)
boxed class to store validated Number payloads | +| sealed interface | [NullableClass.NumberPropBoxed](#numberpropboxed)
sealed interface for validated payloads | +| record | [NullableClass.NumberPropBoxedVoid](#numberpropboxedvoid)
boxed class to store validated null payloads | +| record | [NullableClass.NumberPropBoxedNumber](#numberpropboxednumber)
boxed class to store validated Number payloads | | static class | [NullableClass.NumberProp](#numberprop)
schema class | -| static class | [NullableClass.IntegerPropBoxed](#integerpropboxed)
abstract sealed validated payload class | -| static class | [NullableClass.IntegerPropBoxedVoid](#integerpropboxedvoid)
boxed class to store validated null payloads | -| static class | [NullableClass.IntegerPropBoxedNumber](#integerpropboxednumber)
boxed class to store validated Number payloads | +| sealed interface | [NullableClass.IntegerPropBoxed](#integerpropboxed)
sealed interface for validated payloads | +| record | [NullableClass.IntegerPropBoxedVoid](#integerpropboxedvoid)
boxed class to store validated null payloads | +| record | [NullableClass.IntegerPropBoxedNumber](#integerpropboxednumber)
boxed class to store validated Number payloads | | static class | [NullableClass.IntegerProp](#integerprop)
schema class | -| static class | [NullableClass.AdditionalProperties3Boxed](#additionalproperties3boxed)
abstract sealed validated payload class | -| static class | [NullableClass.AdditionalProperties3BoxedVoid](#additionalproperties3boxedvoid)
boxed class to store validated null payloads | -| static class | [NullableClass.AdditionalProperties3BoxedMap](#additionalproperties3boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [NullableClass.AdditionalProperties3Boxed](#additionalproperties3boxed)
sealed interface for validated payloads | +| record | [NullableClass.AdditionalProperties3BoxedVoid](#additionalproperties3boxedvoid)
boxed class to store validated null payloads | +| record | [NullableClass.AdditionalProperties3BoxedMap](#additionalproperties3boxedmap)
boxed class to store validated Map payloads | | static class | [NullableClass.AdditionalProperties3](#additionalproperties3)
schema class | ## NullableClass1Boxed -public static abstract sealed class NullableClass1Boxed
+public sealed interface NullableClass1Boxed
permits
[NullableClass1BoxedMap](#nullableclass1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## NullableClass1BoxedMap -public static final class NullableClass1BoxedMap
-extends [NullableClass1Boxed](#nullableclass1boxed) +public record NullableClass1BoxedMap
+implements [NullableClass1Boxed](#nullableclass1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NullableClass1BoxedMap([NullableClassMap](#nullableclassmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [NullableClassMap](#nullableclassmap) | data
validated payload | +| [NullableClassMap](#nullableclassmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NullableClass1 public static class NullableClass1
@@ -204,7 +205,9 @@ NullableClass.NullableClassMap validatedPayload = | ----------------- | ---------------------- | | [NullableClassMap](#nullableclassmap) | validate([Map<?, ?>](#nullableclassmapbuilder) arg, SchemaConfiguration configuration) | | [NullableClass1BoxedMap](#nullableclass1boxedmap) | validateAndBox([Map<?, ?>](#nullableclassmapbuilder) arg, SchemaConfiguration configuration) | +| [NullableClass1Boxed](#nullableclass1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## NullableClassMapBuilder public class NullableClassMapBuilder
builder for `Map` @@ -276,27 +279,28 @@ A class to store validated Map payloads | @Nullable FrozenMap | getAdditionalProperty(String name)
provides type safety for additional properties | ## ObjectItemsNullableBoxed -public static abstract sealed class ObjectItemsNullableBoxed
+public sealed interface ObjectItemsNullableBoxed
permits
[ObjectItemsNullableBoxedMap](#objectitemsnullableboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ObjectItemsNullableBoxedMap -public static final class ObjectItemsNullableBoxedMap
-extends [ObjectItemsNullableBoxed](#objectitemsnullableboxed) +public record ObjectItemsNullableBoxedMap
+implements [ObjectItemsNullableBoxed](#objectitemsnullableboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ObjectItemsNullableBoxedMap([ObjectItemsNullableMap](#objectitemsnullablemap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [ObjectItemsNullableMap](#objectitemsnullablemap) | data
validated payload | +| [ObjectItemsNullableMap](#objectitemsnullablemap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ObjectItemsNullable public static class ObjectItemsNullable
@@ -341,7 +345,9 @@ NullableClass.ObjectItemsNullableMap validatedPayload = | ----------------- | ---------------------- | | [ObjectItemsNullableMap](#objectitemsnullablemap) | validate([Map<?, ?>](#objectitemsnullablemapbuilder) arg, SchemaConfiguration configuration) | | [ObjectItemsNullableBoxedMap](#objectitemsnullableboxedmap) | validateAndBox([Map<?, ?>](#objectitemsnullablemapbuilder) arg, SchemaConfiguration configuration) | +| [ObjectItemsNullableBoxed](#objectitemsnullableboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ObjectItemsNullableMapBuilder public class ObjectItemsNullableMapBuilder
builder for `Map>` @@ -373,44 +379,46 @@ A class to store validated Map payloads | @Nullable FrozenMap | getAdditionalProperty(String name)
provides type safety for additional properties | ## AdditionalProperties2Boxed -public static abstract sealed class AdditionalProperties2Boxed
+public sealed interface AdditionalProperties2Boxed
permits
[AdditionalProperties2BoxedVoid](#additionalproperties2boxedvoid), [AdditionalProperties2BoxedMap](#additionalproperties2boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AdditionalProperties2BoxedVoid -public static final class AdditionalProperties2BoxedVoid
-extends [AdditionalProperties2Boxed](#additionalproperties2boxed) +public record AdditionalProperties2BoxedVoid
+implements [AdditionalProperties2Boxed](#additionalproperties2boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalProperties2BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalProperties2BoxedMap -public static final class AdditionalProperties2BoxedMap
-extends [AdditionalProperties2Boxed](#additionalproperties2boxed) +public record AdditionalProperties2BoxedMap
+implements [AdditionalProperties2Boxed](#additionalproperties2boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalProperties2BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalProperties2 public static class AdditionalProperties2
@@ -452,46 +460,50 @@ Void validatedPayload = NullableClass.AdditionalProperties2.validate( | [AdditionalProperties2BoxedVoid](#additionalproperties2boxedvoid) | validateAndBox(Void arg, SchemaConfiguration configuration) | | FrozenMap | validate(Map<?, ?> arg, SchemaConfiguration configuration) | | [AdditionalProperties2BoxedMap](#additionalproperties2boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | +| [AdditionalProperties2Boxed](#additionalproperties2boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ObjectAndItemsNullablePropBoxed -public static abstract sealed class ObjectAndItemsNullablePropBoxed
+public sealed interface ObjectAndItemsNullablePropBoxed
permits
[ObjectAndItemsNullablePropBoxedVoid](#objectanditemsnullablepropboxedvoid), [ObjectAndItemsNullablePropBoxedMap](#objectanditemsnullablepropboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ObjectAndItemsNullablePropBoxedVoid -public static final class ObjectAndItemsNullablePropBoxedVoid
-extends [ObjectAndItemsNullablePropBoxed](#objectanditemsnullablepropboxed) +public record ObjectAndItemsNullablePropBoxedVoid
+implements [ObjectAndItemsNullablePropBoxed](#objectanditemsnullablepropboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ObjectAndItemsNullablePropBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ObjectAndItemsNullablePropBoxedMap -public static final class ObjectAndItemsNullablePropBoxedMap
-extends [ObjectAndItemsNullablePropBoxed](#objectanditemsnullablepropboxed) +public record ObjectAndItemsNullablePropBoxedMap
+implements [ObjectAndItemsNullablePropBoxed](#objectanditemsnullablepropboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ObjectAndItemsNullablePropBoxedMap([ObjectAndItemsNullablePropMap](#objectanditemsnullablepropmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [ObjectAndItemsNullablePropMap](#objectanditemsnullablepropmap) | data
validated payload | +| [ObjectAndItemsNullablePropMap](#objectanditemsnullablepropmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ObjectAndItemsNullableProp public static class ObjectAndItemsNullableProp
@@ -544,7 +556,9 @@ NullableClass.ObjectAndItemsNullablePropMap validatedPayload = | [ObjectAndItemsNullablePropBoxedVoid](#objectanditemsnullablepropboxedvoid) | validateAndBox(Void arg, SchemaConfiguration configuration) | | [ObjectAndItemsNullablePropMap](#objectanditemsnullablepropmap) | validate([Map<?, ?>](#objectanditemsnullablepropmapbuilder) arg, SchemaConfiguration configuration) | | [ObjectAndItemsNullablePropBoxedMap](#objectanditemsnullablepropboxedmap) | validateAndBox([Map<?, ?>](#objectanditemsnullablepropmapbuilder) arg, SchemaConfiguration configuration) | +| [ObjectAndItemsNullablePropBoxed](#objectanditemsnullablepropboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ObjectAndItemsNullablePropMapBuilder public class ObjectAndItemsNullablePropMapBuilder
builder for `Map>` @@ -576,44 +590,46 @@ A class to store validated Map payloads | @Nullable FrozenMap | getAdditionalProperty(String name)
provides type safety for additional properties | ## AdditionalProperties1Boxed -public static abstract sealed class AdditionalProperties1Boxed
+public sealed interface AdditionalProperties1Boxed
permits
[AdditionalProperties1BoxedVoid](#additionalproperties1boxedvoid), [AdditionalProperties1BoxedMap](#additionalproperties1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AdditionalProperties1BoxedVoid -public static final class AdditionalProperties1BoxedVoid
-extends [AdditionalProperties1Boxed](#additionalproperties1boxed) +public record AdditionalProperties1BoxedVoid
+implements [AdditionalProperties1Boxed](#additionalproperties1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalProperties1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalProperties1BoxedMap -public static final class AdditionalProperties1BoxedMap
-extends [AdditionalProperties1Boxed](#additionalproperties1boxed) +public record AdditionalProperties1BoxedMap
+implements [AdditionalProperties1Boxed](#additionalproperties1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalProperties1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalProperties1 public static class AdditionalProperties1
@@ -655,46 +671,50 @@ Void validatedPayload = NullableClass.AdditionalProperties1.validate( | [AdditionalProperties1BoxedVoid](#additionalproperties1boxedvoid) | validateAndBox(Void arg, SchemaConfiguration configuration) | | FrozenMap | validate(Map<?, ?> arg, SchemaConfiguration configuration) | | [AdditionalProperties1BoxedMap](#additionalproperties1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | +| [AdditionalProperties1Boxed](#additionalproperties1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ObjectNullablePropBoxed -public static abstract sealed class ObjectNullablePropBoxed
+public sealed interface ObjectNullablePropBoxed
permits
[ObjectNullablePropBoxedVoid](#objectnullablepropboxedvoid), [ObjectNullablePropBoxedMap](#objectnullablepropboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ObjectNullablePropBoxedVoid -public static final class ObjectNullablePropBoxedVoid
-extends [ObjectNullablePropBoxed](#objectnullablepropboxed) +public record ObjectNullablePropBoxedVoid
+implements [ObjectNullablePropBoxed](#objectnullablepropboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ObjectNullablePropBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ObjectNullablePropBoxedMap -public static final class ObjectNullablePropBoxedMap
-extends [ObjectNullablePropBoxed](#objectnullablepropboxed) +public record ObjectNullablePropBoxedMap
+implements [ObjectNullablePropBoxed](#objectnullablepropboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ObjectNullablePropBoxedMap([ObjectNullablePropMap](#objectnullablepropmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [ObjectNullablePropMap](#objectnullablepropmap) | data
validated payload | +| [ObjectNullablePropMap](#objectnullablepropmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ObjectNullableProp public static class ObjectNullableProp
@@ -745,7 +765,9 @@ NullableClass.ObjectNullablePropMap validatedPayload = | [ObjectNullablePropBoxedVoid](#objectnullablepropboxedvoid) | validateAndBox(Void arg, SchemaConfiguration configuration) | | [ObjectNullablePropMap](#objectnullablepropmap) | validate([Map<?, ?>](#objectnullablepropmapbuilder) arg, SchemaConfiguration configuration) | | [ObjectNullablePropBoxedMap](#objectnullablepropboxedmap) | validateAndBox([Map<?, ?>](#objectnullablepropmapbuilder) arg, SchemaConfiguration configuration) | +| [ObjectNullablePropBoxed](#objectnullablepropboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ObjectNullablePropMapBuilder public class ObjectNullablePropMapBuilder
builder for `Map>` @@ -776,27 +798,28 @@ A class to store validated Map payloads | FrozenMap | getAdditionalProperty(String name)
provides type safety for additional properties | ## AdditionalPropertiesBoxed -public static abstract sealed class AdditionalPropertiesBoxed
+public sealed interface AdditionalPropertiesBoxed
permits
[AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AdditionalPropertiesBoxedMap -public static final class AdditionalPropertiesBoxedMap
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedMap
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalProperties public static class AdditionalProperties
@@ -810,27 +833,28 @@ A schema class that validates payloads | validateAndBox | ## ArrayItemsNullableBoxed -public static abstract sealed class ArrayItemsNullableBoxed
+public sealed interface ArrayItemsNullableBoxed
permits
[ArrayItemsNullableBoxedList](#arrayitemsnullableboxedlist) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ArrayItemsNullableBoxedList -public static final class ArrayItemsNullableBoxedList
-extends [ArrayItemsNullableBoxed](#arrayitemsnullableboxed) +public record ArrayItemsNullableBoxedList
+implements [ArrayItemsNullableBoxed](#arrayitemsnullableboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ArrayItemsNullableBoxedList([ArrayItemsNullableList](#arrayitemsnullablelist) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [ArrayItemsNullableList](#arrayitemsnullablelist) | data
validated payload | +| [ArrayItemsNullableList](#arrayitemsnullablelist) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ArrayItemsNullable public static class ArrayItemsNullable
@@ -875,7 +899,9 @@ NullableClass.ArrayItemsNullableList validatedPayload = | ----------------- | ---------------------- | | [ArrayItemsNullableList](#arrayitemsnullablelist) | validate([List](#arrayitemsnullablelistbuilder) arg, SchemaConfiguration configuration) | | [ArrayItemsNullableBoxedList](#arrayitemsnullableboxedlist) | validateAndBox([List](#arrayitemsnullablelistbuilder) arg, SchemaConfiguration configuration) | +| [ArrayItemsNullableBoxed](#arrayitemsnullableboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ArrayItemsNullableListBuilder public class ArrayItemsNullableListBuilder
builder for `List<@Nullable Map>` @@ -907,44 +933,46 @@ A class to store validated List payloads | static [ArrayItemsNullableList](#arrayitemsnullablelist) | of([List>](#arrayitemsnullablelistbuilder) arg, SchemaConfiguration configuration) | ## Items2Boxed -public static abstract sealed class Items2Boxed
+public sealed interface Items2Boxed
permits
[Items2BoxedVoid](#items2boxedvoid), [Items2BoxedMap](#items2boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Items2BoxedVoid -public static final class Items2BoxedVoid
-extends [Items2Boxed](#items2boxed) +public record Items2BoxedVoid
+implements [Items2Boxed](#items2boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Items2BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Items2BoxedMap -public static final class Items2BoxedMap
-extends [Items2Boxed](#items2boxed) +public record Items2BoxedMap
+implements [Items2Boxed](#items2boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Items2BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Items2 public static class Items2
@@ -986,46 +1014,50 @@ Void validatedPayload = NullableClass.Items2.validate( | [Items2BoxedVoid](#items2boxedvoid) | validateAndBox(Void arg, SchemaConfiguration configuration) | | FrozenMap | validate(Map<?, ?> arg, SchemaConfiguration configuration) | | [Items2BoxedMap](#items2boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | +| [Items2Boxed](#items2boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ArrayAndItemsNullablePropBoxed -public static abstract sealed class ArrayAndItemsNullablePropBoxed
+public sealed interface ArrayAndItemsNullablePropBoxed
permits
[ArrayAndItemsNullablePropBoxedVoid](#arrayanditemsnullablepropboxedvoid), [ArrayAndItemsNullablePropBoxedList](#arrayanditemsnullablepropboxedlist) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ArrayAndItemsNullablePropBoxedVoid -public static final class ArrayAndItemsNullablePropBoxedVoid
-extends [ArrayAndItemsNullablePropBoxed](#arrayanditemsnullablepropboxed) +public record ArrayAndItemsNullablePropBoxedVoid
+implements [ArrayAndItemsNullablePropBoxed](#arrayanditemsnullablepropboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ArrayAndItemsNullablePropBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ArrayAndItemsNullablePropBoxedList -public static final class ArrayAndItemsNullablePropBoxedList
-extends [ArrayAndItemsNullablePropBoxed](#arrayanditemsnullablepropboxed) +public record ArrayAndItemsNullablePropBoxedList
+implements [ArrayAndItemsNullablePropBoxed](#arrayanditemsnullablepropboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ArrayAndItemsNullablePropBoxedList([ArrayAndItemsNullablePropList](#arrayanditemsnullableproplist) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [ArrayAndItemsNullablePropList](#arrayanditemsnullableproplist) | data
validated payload | +| [ArrayAndItemsNullablePropList](#arrayanditemsnullableproplist) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ArrayAndItemsNullableProp public static class ArrayAndItemsNullableProp
@@ -1078,7 +1110,9 @@ NullableClass.ArrayAndItemsNullablePropList validatedPayload = | [ArrayAndItemsNullablePropBoxedVoid](#arrayanditemsnullablepropboxedvoid) | validateAndBox(Void arg, SchemaConfiguration configuration) | | [ArrayAndItemsNullablePropList](#arrayanditemsnullableproplist) | validate([List](#arrayanditemsnullableproplistbuilder) arg, SchemaConfiguration configuration) | | [ArrayAndItemsNullablePropBoxedList](#arrayanditemsnullablepropboxedlist) | validateAndBox([List](#arrayanditemsnullableproplistbuilder) arg, SchemaConfiguration configuration) | +| [ArrayAndItemsNullablePropBoxed](#arrayanditemsnullablepropboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ArrayAndItemsNullablePropListBuilder public class ArrayAndItemsNullablePropListBuilder
builder for `List<@Nullable Map>` @@ -1110,44 +1144,46 @@ A class to store validated List payloads | static [ArrayAndItemsNullablePropList](#arrayanditemsnullableproplist) | of([List>](#arrayanditemsnullableproplistbuilder) arg, SchemaConfiguration configuration) | ## Items1Boxed -public static abstract sealed class Items1Boxed
+public sealed interface Items1Boxed
permits
[Items1BoxedVoid](#items1boxedvoid), [Items1BoxedMap](#items1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Items1BoxedVoid -public static final class Items1BoxedVoid
-extends [Items1Boxed](#items1boxed) +public record Items1BoxedVoid
+implements [Items1Boxed](#items1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Items1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Items1BoxedMap -public static final class Items1BoxedMap
-extends [Items1Boxed](#items1boxed) +public record Items1BoxedMap
+implements [Items1Boxed](#items1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Items1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Items1 public static class Items1
@@ -1189,46 +1225,50 @@ Void validatedPayload = NullableClass.Items1.validate( | [Items1BoxedVoid](#items1boxedvoid) | validateAndBox(Void arg, SchemaConfiguration configuration) | | FrozenMap | validate(Map<?, ?> arg, SchemaConfiguration configuration) | | [Items1BoxedMap](#items1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | +| [Items1Boxed](#items1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ArrayNullablePropBoxed -public static abstract sealed class ArrayNullablePropBoxed
+public sealed interface ArrayNullablePropBoxed
permits
[ArrayNullablePropBoxedVoid](#arraynullablepropboxedvoid), [ArrayNullablePropBoxedList](#arraynullablepropboxedlist) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ArrayNullablePropBoxedVoid -public static final class ArrayNullablePropBoxedVoid
-extends [ArrayNullablePropBoxed](#arraynullablepropboxed) +public record ArrayNullablePropBoxedVoid
+implements [ArrayNullablePropBoxed](#arraynullablepropboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ArrayNullablePropBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ArrayNullablePropBoxedList -public static final class ArrayNullablePropBoxedList
-extends [ArrayNullablePropBoxed](#arraynullablepropboxed) +public record ArrayNullablePropBoxedList
+implements [ArrayNullablePropBoxed](#arraynullablepropboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ArrayNullablePropBoxedList([ArrayNullablePropList](#arraynullableproplist) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [ArrayNullablePropList](#arraynullableproplist) | data
validated payload | +| [ArrayNullablePropList](#arraynullableproplist) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ArrayNullableProp public static class ArrayNullableProp
@@ -1279,7 +1319,9 @@ NullableClass.ArrayNullablePropList validatedPayload = | [ArrayNullablePropBoxedVoid](#arraynullablepropboxedvoid) | validateAndBox(Void arg, SchemaConfiguration configuration) | | [ArrayNullablePropList](#arraynullableproplist) | validate([List](#arraynullableproplistbuilder) arg, SchemaConfiguration configuration) | | [ArrayNullablePropBoxedList](#arraynullablepropboxedlist) | validateAndBox([List](#arraynullableproplistbuilder) arg, SchemaConfiguration configuration) | +| [ArrayNullablePropBoxed](#arraynullablepropboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ArrayNullablePropListBuilder public class ArrayNullablePropListBuilder
builder for `List>` @@ -1310,27 +1352,28 @@ A class to store validated List payloads | static [ArrayNullablePropList](#arraynullableproplist) | of([List>](#arraynullableproplistbuilder) arg, SchemaConfiguration configuration) | ## ItemsBoxed -public static abstract sealed class ItemsBoxed
+public sealed interface ItemsBoxed
permits
[ItemsBoxedMap](#itemsboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ItemsBoxedMap -public static final class ItemsBoxedMap
-extends [ItemsBoxed](#itemsboxed) +public record ItemsBoxedMap
+implements [ItemsBoxed](#itemsboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ItemsBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Items public static class Items
@@ -1344,44 +1387,46 @@ A schema class that validates payloads | validateAndBox | ## DatetimePropBoxed -public static abstract sealed class DatetimePropBoxed
+public sealed interface DatetimePropBoxed
permits
[DatetimePropBoxedVoid](#datetimepropboxedvoid), [DatetimePropBoxedString](#datetimepropboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## DatetimePropBoxedVoid -public static final class DatetimePropBoxedVoid
-extends [DatetimePropBoxed](#datetimepropboxed) +public record DatetimePropBoxedVoid
+implements [DatetimePropBoxed](#datetimepropboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DatetimePropBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## DatetimePropBoxedString -public static final class DatetimePropBoxedString
-extends [DatetimePropBoxed](#datetimepropboxed) +public record DatetimePropBoxedString
+implements [DatetimePropBoxed](#datetimepropboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DatetimePropBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## DatetimeProp public static class DatetimeProp
@@ -1430,46 +1475,50 @@ String validatedPayload = NullableClass.DatetimeProp.validate( | [DatetimePropBoxedVoid](#datetimepropboxedvoid) | validateAndBox(Void arg, SchemaConfiguration configuration) | | String | validate(String arg, SchemaConfiguration configuration) | | [DatetimePropBoxedString](#datetimepropboxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [DatetimePropBoxed](#datetimepropboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## DatePropBoxed -public static abstract sealed class DatePropBoxed
+public sealed interface DatePropBoxed
permits
[DatePropBoxedVoid](#datepropboxedvoid), [DatePropBoxedString](#datepropboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## DatePropBoxedVoid -public static final class DatePropBoxedVoid
-extends [DatePropBoxed](#datepropboxed) +public record DatePropBoxedVoid
+implements [DatePropBoxed](#datepropboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DatePropBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## DatePropBoxedString -public static final class DatePropBoxedString
-extends [DatePropBoxed](#datepropboxed) +public record DatePropBoxedString
+implements [DatePropBoxed](#datepropboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | DatePropBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## DateProp public static class DateProp
@@ -1518,46 +1567,50 @@ String validatedPayload = NullableClass.DateProp.validate( | [DatePropBoxedVoid](#datepropboxedvoid) | validateAndBox(Void arg, SchemaConfiguration configuration) | | String | validate(String arg, SchemaConfiguration configuration) | | [DatePropBoxedString](#datepropboxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [DatePropBoxed](#datepropboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## StringPropBoxed -public static abstract sealed class StringPropBoxed
+public sealed interface StringPropBoxed
permits
[StringPropBoxedVoid](#stringpropboxedvoid), [StringPropBoxedString](#stringpropboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## StringPropBoxedVoid -public static final class StringPropBoxedVoid
-extends [StringPropBoxed](#stringpropboxed) +public record StringPropBoxedVoid
+implements [StringPropBoxed](#stringpropboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | StringPropBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## StringPropBoxedString -public static final class StringPropBoxedString
-extends [StringPropBoxed](#stringpropboxed) +public record StringPropBoxedString
+implements [StringPropBoxed](#stringpropboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | StringPropBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## StringProp public static class StringProp
@@ -1605,46 +1658,50 @@ String validatedPayload = NullableClass.StringProp.validate( | [StringPropBoxedVoid](#stringpropboxedvoid) | validateAndBox(Void arg, SchemaConfiguration configuration) | | String | validate(String arg, SchemaConfiguration configuration) | | [StringPropBoxedString](#stringpropboxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [StringPropBoxed](#stringpropboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## BooleanPropBoxed -public static abstract sealed class BooleanPropBoxed
+public sealed interface BooleanPropBoxed
permits
[BooleanPropBoxedVoid](#booleanpropboxedvoid), [BooleanPropBoxedBoolean](#booleanpropboxedboolean) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## BooleanPropBoxedVoid -public static final class BooleanPropBoxedVoid
-extends [BooleanPropBoxed](#booleanpropboxed) +public record BooleanPropBoxedVoid
+implements [BooleanPropBoxed](#booleanpropboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BooleanPropBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## BooleanPropBoxedBoolean -public static final class BooleanPropBoxedBoolean
-extends [BooleanPropBoxed](#booleanpropboxed) +public record BooleanPropBoxedBoolean
+implements [BooleanPropBoxed](#booleanpropboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BooleanPropBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## BooleanProp public static class BooleanProp
@@ -1692,46 +1749,50 @@ boolean validatedPayload = NullableClass.BooleanProp.validate( | [BooleanPropBoxedVoid](#booleanpropboxedvoid) | validateAndBox(Void arg, SchemaConfiguration configuration) | | boolean | validate(boolean arg, SchemaConfiguration configuration) | | [BooleanPropBoxedBoolean](#booleanpropboxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | +| [BooleanPropBoxed](#booleanpropboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## NumberPropBoxed -public static abstract sealed class NumberPropBoxed
+public sealed interface NumberPropBoxed
permits
[NumberPropBoxedVoid](#numberpropboxedvoid), [NumberPropBoxedNumber](#numberpropboxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## NumberPropBoxedVoid -public static final class NumberPropBoxedVoid
-extends [NumberPropBoxed](#numberpropboxed) +public record NumberPropBoxedVoid
+implements [NumberPropBoxed](#numberpropboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NumberPropBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NumberPropBoxedNumber -public static final class NumberPropBoxedNumber
-extends [NumberPropBoxed](#numberpropboxed) +public record NumberPropBoxedNumber
+implements [NumberPropBoxed](#numberpropboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NumberPropBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NumberProp public static class NumberProp
@@ -1779,46 +1840,50 @@ int validatedPayload = NullableClass.NumberProp.validate( | [NumberPropBoxedVoid](#numberpropboxedvoid) | validateAndBox(Void arg, SchemaConfiguration configuration) | | Number | validate(Number arg, SchemaConfiguration configuration) | | [NumberPropBoxedNumber](#numberpropboxednumber) | validateAndBox(Number arg, SchemaConfiguration configuration) | +| [NumberPropBoxed](#numberpropboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## IntegerPropBoxed -public static abstract sealed class IntegerPropBoxed
+public sealed interface IntegerPropBoxed
permits
[IntegerPropBoxedVoid](#integerpropboxedvoid), [IntegerPropBoxedNumber](#integerpropboxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## IntegerPropBoxedVoid -public static final class IntegerPropBoxedVoid
-extends [IntegerPropBoxed](#integerpropboxed) +public record IntegerPropBoxedVoid
+implements [IntegerPropBoxed](#integerpropboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IntegerPropBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IntegerPropBoxedNumber -public static final class IntegerPropBoxedNumber
-extends [IntegerPropBoxed](#integerpropboxed) +public record IntegerPropBoxedNumber
+implements [IntegerPropBoxed](#integerpropboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IntegerPropBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## IntegerProp public static class IntegerProp
@@ -1867,46 +1932,50 @@ int validatedPayload = NullableClass.IntegerProp.validate( | [IntegerPropBoxedVoid](#integerpropboxedvoid) | validateAndBox(Void arg, SchemaConfiguration configuration) | | long | validate(long arg, SchemaConfiguration configuration) | | [IntegerPropBoxedNumber](#integerpropboxednumber) | validateAndBox(Number arg, SchemaConfiguration configuration) | +| [IntegerPropBoxed](#integerpropboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## AdditionalProperties3Boxed -public static abstract sealed class AdditionalProperties3Boxed
+public sealed interface AdditionalProperties3Boxed
permits
[AdditionalProperties3BoxedVoid](#additionalproperties3boxedvoid), [AdditionalProperties3BoxedMap](#additionalproperties3boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AdditionalProperties3BoxedVoid -public static final class AdditionalProperties3BoxedVoid
-extends [AdditionalProperties3Boxed](#additionalproperties3boxed) +public record AdditionalProperties3BoxedVoid
+implements [AdditionalProperties3Boxed](#additionalproperties3boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalProperties3BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalProperties3BoxedMap -public static final class AdditionalProperties3BoxedMap
-extends [AdditionalProperties3Boxed](#additionalproperties3boxed) +public record AdditionalProperties3BoxedMap
+implements [AdditionalProperties3Boxed](#additionalproperties3boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalProperties3BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalProperties3 public static class AdditionalProperties3
@@ -1948,5 +2017,7 @@ Void validatedPayload = NullableClass.AdditionalProperties3.validate( | [AdditionalProperties3BoxedVoid](#additionalproperties3boxedvoid) | validateAndBox(Void arg, SchemaConfiguration configuration) | | FrozenMap | validate(Map<?, ?> arg, SchemaConfiguration configuration) | | [AdditionalProperties3BoxedMap](#additionalproperties3boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | +| [AdditionalProperties3Boxed](#additionalproperties3boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/components/schemas/NullableShape.md b/samples/client/petstore/java/docs/components/schemas/NullableShape.md index aeebe3de091..7fce16177b0 100644 --- a/samples/client/petstore/java/docs/components/schemas/NullableShape.md +++ b/samples/client/petstore/java/docs/components/schemas/NullableShape.md @@ -4,26 +4,26 @@ public class NullableShape
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [NullableShape.NullableShape1Boxed](#nullableshape1boxed)
abstract sealed validated payload class | -| static class | [NullableShape.NullableShape1BoxedVoid](#nullableshape1boxedvoid)
boxed class to store validated null payloads | -| static class | [NullableShape.NullableShape1BoxedBoolean](#nullableshape1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [NullableShape.NullableShape1BoxedNumber](#nullableshape1boxednumber)
boxed class to store validated Number payloads | -| static class | [NullableShape.NullableShape1BoxedString](#nullableshape1boxedstring)
boxed class to store validated String payloads | -| static class | [NullableShape.NullableShape1BoxedList](#nullableshape1boxedlist)
boxed class to store validated List payloads | -| static class | [NullableShape.NullableShape1BoxedMap](#nullableshape1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [NullableShape.NullableShape1Boxed](#nullableshape1boxed)
sealed interface for validated payloads | +| record | [NullableShape.NullableShape1BoxedVoid](#nullableshape1boxedvoid)
boxed class to store validated null payloads | +| record | [NullableShape.NullableShape1BoxedBoolean](#nullableshape1boxedboolean)
boxed class to store validated boolean payloads | +| record | [NullableShape.NullableShape1BoxedNumber](#nullableshape1boxednumber)
boxed class to store validated Number payloads | +| record | [NullableShape.NullableShape1BoxedString](#nullableshape1boxedstring)
boxed class to store validated String payloads | +| record | [NullableShape.NullableShape1BoxedList](#nullableshape1boxedlist)
boxed class to store validated List payloads | +| record | [NullableShape.NullableShape1BoxedMap](#nullableshape1boxedmap)
boxed class to store validated Map payloads | | static class | [NullableShape.NullableShape1](#nullableshape1)
schema class | -| static class | [NullableShape.Schema2Boxed](#schema2boxed)
abstract sealed validated payload class | -| static class | [NullableShape.Schema2BoxedVoid](#schema2boxedvoid)
boxed class to store validated null payloads | +| sealed interface | [NullableShape.Schema2Boxed](#schema2boxed)
sealed interface for validated payloads | +| record | [NullableShape.Schema2BoxedVoid](#schema2boxedvoid)
boxed class to store validated null payloads | | static class | [NullableShape.Schema2](#schema2)
schema class | ## NullableShape1Boxed -public static abstract sealed class NullableShape1Boxed
+public sealed interface NullableShape1Boxed
permits
[NullableShape1BoxedVoid](#nullableshape1boxedvoid), [NullableShape1BoxedBoolean](#nullableshape1boxedboolean), @@ -32,103 +32,109 @@ permits
[NullableShape1BoxedList](#nullableshape1boxedlist), [NullableShape1BoxedMap](#nullableshape1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## NullableShape1BoxedVoid -public static final class NullableShape1BoxedVoid
-extends [NullableShape1Boxed](#nullableshape1boxed) +public record NullableShape1BoxedVoid
+implements [NullableShape1Boxed](#nullableshape1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NullableShape1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NullableShape1BoxedBoolean -public static final class NullableShape1BoxedBoolean
-extends [NullableShape1Boxed](#nullableshape1boxed) +public record NullableShape1BoxedBoolean
+implements [NullableShape1Boxed](#nullableshape1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NullableShape1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NullableShape1BoxedNumber -public static final class NullableShape1BoxedNumber
-extends [NullableShape1Boxed](#nullableshape1boxed) +public record NullableShape1BoxedNumber
+implements [NullableShape1Boxed](#nullableshape1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NullableShape1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NullableShape1BoxedString -public static final class NullableShape1BoxedString
-extends [NullableShape1Boxed](#nullableshape1boxed) +public record NullableShape1BoxedString
+implements [NullableShape1Boxed](#nullableshape1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NullableShape1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NullableShape1BoxedList -public static final class NullableShape1BoxedList
-extends [NullableShape1Boxed](#nullableshape1boxed) +public record NullableShape1BoxedList
+implements [NullableShape1Boxed](#nullableshape1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NullableShape1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NullableShape1BoxedMap -public static final class NullableShape1BoxedMap
-extends [NullableShape1Boxed](#nullableshape1boxed) +public record NullableShape1BoxedMap
+implements [NullableShape1Boxed](#nullableshape1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NullableShape1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NullableShape1 public static class NullableShape1
@@ -163,29 +169,32 @@ The value may be a shape or the 'null' value. For a composed schema to | [NullableShape1BoxedBoolean](#nullableshape1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [NullableShape1BoxedMap](#nullableshape1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [NullableShape1BoxedList](#nullableshape1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [NullableShape1Boxed](#nullableshape1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema2Boxed -public static abstract sealed class Schema2Boxed
+public sealed interface Schema2Boxed
permits
[Schema2BoxedVoid](#schema2boxedvoid) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema2BoxedVoid -public static final class Schema2BoxedVoid
-extends [Schema2Boxed](#schema2boxed) +public record Schema2BoxedVoid
+implements [Schema2Boxed](#schema2boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema2BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema2 public static class Schema2
diff --git a/samples/client/petstore/java/docs/components/schemas/NullableString.md b/samples/client/petstore/java/docs/components/schemas/NullableString.md index c6adf001863..2477ee32c1a 100644 --- a/samples/client/petstore/java/docs/components/schemas/NullableString.md +++ b/samples/client/petstore/java/docs/components/schemas/NullableString.md @@ -4,56 +4,58 @@ public class NullableString
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [NullableString.NullableString1Boxed](#nullablestring1boxed)
abstract sealed validated payload class | -| static class | [NullableString.NullableString1BoxedVoid](#nullablestring1boxedvoid)
boxed class to store validated null payloads | -| static class | [NullableString.NullableString1BoxedString](#nullablestring1boxedstring)
boxed class to store validated String payloads | +| sealed interface | [NullableString.NullableString1Boxed](#nullablestring1boxed)
sealed interface for validated payloads | +| record | [NullableString.NullableString1BoxedVoid](#nullablestring1boxedvoid)
boxed class to store validated null payloads | +| record | [NullableString.NullableString1BoxedString](#nullablestring1boxedstring)
boxed class to store validated String payloads | | static class | [NullableString.NullableString1](#nullablestring1)
schema class | ## NullableString1Boxed -public static abstract sealed class NullableString1Boxed
+public sealed interface NullableString1Boxed
permits
[NullableString1BoxedVoid](#nullablestring1boxedvoid), [NullableString1BoxedString](#nullablestring1boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## NullableString1BoxedVoid -public static final class NullableString1BoxedVoid
-extends [NullableString1Boxed](#nullablestring1boxed) +public record NullableString1BoxedVoid
+implements [NullableString1Boxed](#nullablestring1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NullableString1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NullableString1BoxedString -public static final class NullableString1BoxedString
-extends [NullableString1Boxed](#nullablestring1boxed) +public record NullableString1BoxedString
+implements [NullableString1Boxed](#nullablestring1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NullableString1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NullableString1 public static class NullableString1
@@ -101,5 +103,7 @@ String validatedPayload = NullableString.NullableString1.validate( | [NullableString1BoxedVoid](#nullablestring1boxedvoid) | validateAndBox(Void arg, SchemaConfiguration configuration) | | String | validate(String arg, SchemaConfiguration configuration) | | [NullableString1BoxedString](#nullablestring1boxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [NullableString1Boxed](#nullablestring1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/components/schemas/NumberOnly.md b/samples/client/petstore/java/docs/components/schemas/NumberOnly.md index 2302266c4f4..911aa304bbc 100644 --- a/samples/client/petstore/java/docs/components/schemas/NumberOnly.md +++ b/samples/client/petstore/java/docs/components/schemas/NumberOnly.md @@ -4,7 +4,7 @@ public class NumberOnly
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,37 +12,38 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [NumberOnly.NumberOnly1Boxed](#numberonly1boxed)
abstract sealed validated payload class | -| static class | [NumberOnly.NumberOnly1BoxedMap](#numberonly1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [NumberOnly.NumberOnly1Boxed](#numberonly1boxed)
sealed interface for validated payloads | +| record | [NumberOnly.NumberOnly1BoxedMap](#numberonly1boxedmap)
boxed class to store validated Map payloads | | static class | [NumberOnly.NumberOnly1](#numberonly1)
schema class | | static class | [NumberOnly.NumberOnlyMapBuilder](#numberonlymapbuilder)
builder for Map payloads | | static class | [NumberOnly.NumberOnlyMap](#numberonlymap)
output class for Map payloads | -| static class | [NumberOnly.JustNumberBoxed](#justnumberboxed)
abstract sealed validated payload class | -| static class | [NumberOnly.JustNumberBoxedNumber](#justnumberboxednumber)
boxed class to store validated Number payloads | +| sealed interface | [NumberOnly.JustNumberBoxed](#justnumberboxed)
sealed interface for validated payloads | +| record | [NumberOnly.JustNumberBoxedNumber](#justnumberboxednumber)
boxed class to store validated Number payloads | | static class | [NumberOnly.JustNumber](#justnumber)
schema class | ## NumberOnly1Boxed -public static abstract sealed class NumberOnly1Boxed
+public sealed interface NumberOnly1Boxed
permits
[NumberOnly1BoxedMap](#numberonly1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## NumberOnly1BoxedMap -public static final class NumberOnly1BoxedMap
-extends [NumberOnly1Boxed](#numberonly1boxed) +public record NumberOnly1BoxedMap
+implements [NumberOnly1Boxed](#numberonly1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NumberOnly1BoxedMap([NumberOnlyMap](#numberonlymap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [NumberOnlyMap](#numberonlymap) | data
validated payload | +| [NumberOnlyMap](#numberonlymap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NumberOnly1 public static class NumberOnly1
@@ -87,7 +88,9 @@ NumberOnly.NumberOnlyMap validatedPayload = | ----------------- | ---------------------- | | [NumberOnlyMap](#numberonlymap) | validate([Map<?, ?>](#numberonlymapbuilder) arg, SchemaConfiguration configuration) | | [NumberOnly1BoxedMap](#numberonly1boxedmap) | validateAndBox([Map<?, ?>](#numberonlymapbuilder) arg, SchemaConfiguration configuration) | +| [NumberOnly1Boxed](#numberonly1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## NumberOnlyMapBuilder public class NumberOnlyMapBuilder
builder for `Map` @@ -131,27 +134,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## JustNumberBoxed -public static abstract sealed class JustNumberBoxed
+public sealed interface JustNumberBoxed
permits
[JustNumberBoxedNumber](#justnumberboxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## JustNumberBoxedNumber -public static final class JustNumberBoxedNumber
-extends [JustNumberBoxed](#justnumberboxed) +public record JustNumberBoxedNumber
+implements [JustNumberBoxed](#justnumberboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | JustNumberBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## JustNumber public static class JustNumber
diff --git a/samples/client/petstore/java/docs/components/schemas/NumberSchema.md b/samples/client/petstore/java/docs/components/schemas/NumberSchema.md index 36b29fe501b..8ebd5d4cb08 100644 --- a/samples/client/petstore/java/docs/components/schemas/NumberSchema.md +++ b/samples/client/petstore/java/docs/components/schemas/NumberSchema.md @@ -4,38 +4,39 @@ public class NumberSchema
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [NumberSchema.NumberSchema1Boxed](#numberschema1boxed)
abstract sealed validated payload class | -| static class | [NumberSchema.NumberSchema1BoxedNumber](#numberschema1boxednumber)
boxed class to store validated Number payloads | +| sealed interface | [NumberSchema.NumberSchema1Boxed](#numberschema1boxed)
sealed interface for validated payloads | +| record | [NumberSchema.NumberSchema1BoxedNumber](#numberschema1boxednumber)
boxed class to store validated Number payloads | | static class | [NumberSchema.NumberSchema1](#numberschema1)
schema class | ## NumberSchema1Boxed -public static abstract sealed class NumberSchema1Boxed
+public sealed interface NumberSchema1Boxed
permits
[NumberSchema1BoxedNumber](#numberschema1boxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## NumberSchema1BoxedNumber -public static final class NumberSchema1BoxedNumber
-extends [NumberSchema1Boxed](#numberschema1boxed) +public record NumberSchema1BoxedNumber
+implements [NumberSchema1Boxed](#numberschema1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NumberSchema1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NumberSchema1 public static class NumberSchema1
diff --git a/samples/client/petstore/java/docs/components/schemas/NumberWithExclusiveMinMax.md b/samples/client/petstore/java/docs/components/schemas/NumberWithExclusiveMinMax.md index cd04a0db19d..1a9a3c37885 100644 --- a/samples/client/petstore/java/docs/components/schemas/NumberWithExclusiveMinMax.md +++ b/samples/client/petstore/java/docs/components/schemas/NumberWithExclusiveMinMax.md @@ -4,38 +4,39 @@ public class NumberWithExclusiveMinMax
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [NumberWithExclusiveMinMax.NumberWithExclusiveMinMax1Boxed](#numberwithexclusiveminmax1boxed)
abstract sealed validated payload class | -| static class | [NumberWithExclusiveMinMax.NumberWithExclusiveMinMax1BoxedNumber](#numberwithexclusiveminmax1boxednumber)
boxed class to store validated Number payloads | +| sealed interface | [NumberWithExclusiveMinMax.NumberWithExclusiveMinMax1Boxed](#numberwithexclusiveminmax1boxed)
sealed interface for validated payloads | +| record | [NumberWithExclusiveMinMax.NumberWithExclusiveMinMax1BoxedNumber](#numberwithexclusiveminmax1boxednumber)
boxed class to store validated Number payloads | | static class | [NumberWithExclusiveMinMax.NumberWithExclusiveMinMax1](#numberwithexclusiveminmax1)
schema class | ## NumberWithExclusiveMinMax1Boxed -public static abstract sealed class NumberWithExclusiveMinMax1Boxed
+public sealed interface NumberWithExclusiveMinMax1Boxed
permits
[NumberWithExclusiveMinMax1BoxedNumber](#numberwithexclusiveminmax1boxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## NumberWithExclusiveMinMax1BoxedNumber -public static final class NumberWithExclusiveMinMax1BoxedNumber
-extends [NumberWithExclusiveMinMax1Boxed](#numberwithexclusiveminmax1boxed) +public record NumberWithExclusiveMinMax1BoxedNumber
+implements [NumberWithExclusiveMinMax1Boxed](#numberwithexclusiveminmax1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NumberWithExclusiveMinMax1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NumberWithExclusiveMinMax1 public static class NumberWithExclusiveMinMax1
@@ -77,5 +78,7 @@ int validatedPayload = NumberWithExclusiveMinMax.NumberWithExclusiveMinMax1.vali | ----------------- | ---------------------- | | Number | validate(Number arg, SchemaConfiguration configuration) | | [NumberWithExclusiveMinMax1BoxedNumber](#numberwithexclusiveminmax1boxednumber) | validateAndBox(Number arg, SchemaConfiguration configuration) | +| [NumberWithExclusiveMinMax1Boxed](#numberwithexclusiveminmax1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/components/schemas/NumberWithValidations.md b/samples/client/petstore/java/docs/components/schemas/NumberWithValidations.md index 60cde216513..864598184d2 100644 --- a/samples/client/petstore/java/docs/components/schemas/NumberWithValidations.md +++ b/samples/client/petstore/java/docs/components/schemas/NumberWithValidations.md @@ -4,38 +4,39 @@ public class NumberWithValidations
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [NumberWithValidations.NumberWithValidations1Boxed](#numberwithvalidations1boxed)
abstract sealed validated payload class | -| static class | [NumberWithValidations.NumberWithValidations1BoxedNumber](#numberwithvalidations1boxednumber)
boxed class to store validated Number payloads | +| sealed interface | [NumberWithValidations.NumberWithValidations1Boxed](#numberwithvalidations1boxed)
sealed interface for validated payloads | +| record | [NumberWithValidations.NumberWithValidations1BoxedNumber](#numberwithvalidations1boxednumber)
boxed class to store validated Number payloads | | static class | [NumberWithValidations.NumberWithValidations1](#numberwithvalidations1)
schema class | ## NumberWithValidations1Boxed -public static abstract sealed class NumberWithValidations1Boxed
+public sealed interface NumberWithValidations1Boxed
permits
[NumberWithValidations1BoxedNumber](#numberwithvalidations1boxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## NumberWithValidations1BoxedNumber -public static final class NumberWithValidations1BoxedNumber
-extends [NumberWithValidations1Boxed](#numberwithvalidations1boxed) +public record NumberWithValidations1BoxedNumber
+implements [NumberWithValidations1Boxed](#numberwithvalidations1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NumberWithValidations1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## NumberWithValidations1 public static class NumberWithValidations1
@@ -77,5 +78,7 @@ int validatedPayload = NumberWithValidations.NumberWithValidations1.validate( | ----------------- | ---------------------- | | Number | validate(Number arg, SchemaConfiguration configuration) | | [NumberWithValidations1BoxedNumber](#numberwithvalidations1boxednumber) | validateAndBox(Number arg, SchemaConfiguration configuration) | +| [NumberWithValidations1Boxed](#numberwithvalidations1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/components/schemas/ObjWithRequiredProps.md b/samples/client/petstore/java/docs/components/schemas/ObjWithRequiredProps.md index 0ffd15cd55d..63c7b82d26d 100644 --- a/samples/client/petstore/java/docs/components/schemas/ObjWithRequiredProps.md +++ b/samples/client/petstore/java/docs/components/schemas/ObjWithRequiredProps.md @@ -4,7 +4,7 @@ public class ObjWithRequiredProps
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,37 +12,38 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ObjWithRequiredProps.ObjWithRequiredProps1Boxed](#objwithrequiredprops1boxed)
abstract sealed validated payload class | -| static class | [ObjWithRequiredProps.ObjWithRequiredProps1BoxedMap](#objwithrequiredprops1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ObjWithRequiredProps.ObjWithRequiredProps1Boxed](#objwithrequiredprops1boxed)
sealed interface for validated payloads | +| record | [ObjWithRequiredProps.ObjWithRequiredProps1BoxedMap](#objwithrequiredprops1boxedmap)
boxed class to store validated Map payloads | | static class | [ObjWithRequiredProps.ObjWithRequiredProps1](#objwithrequiredprops1)
schema class | | static class | [ObjWithRequiredProps.ObjWithRequiredPropsMapBuilder](#objwithrequiredpropsmapbuilder)
builder for Map payloads | | static class | [ObjWithRequiredProps.ObjWithRequiredPropsMap](#objwithrequiredpropsmap)
output class for Map payloads | -| static class | [ObjWithRequiredProps.ABoxed](#aboxed)
abstract sealed validated payload class | -| static class | [ObjWithRequiredProps.ABoxedString](#aboxedstring)
boxed class to store validated String payloads | +| sealed interface | [ObjWithRequiredProps.ABoxed](#aboxed)
sealed interface for validated payloads | +| record | [ObjWithRequiredProps.ABoxedString](#aboxedstring)
boxed class to store validated String payloads | | static class | [ObjWithRequiredProps.A](#a)
schema class | ## ObjWithRequiredProps1Boxed -public static abstract sealed class ObjWithRequiredProps1Boxed
+public sealed interface ObjWithRequiredProps1Boxed
permits
[ObjWithRequiredProps1BoxedMap](#objwithrequiredprops1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ObjWithRequiredProps1BoxedMap -public static final class ObjWithRequiredProps1BoxedMap
-extends [ObjWithRequiredProps1Boxed](#objwithrequiredprops1boxed) +public record ObjWithRequiredProps1BoxedMap
+implements [ObjWithRequiredProps1Boxed](#objwithrequiredprops1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ObjWithRequiredProps1BoxedMap([ObjWithRequiredPropsMap](#objwithrequiredpropsmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [ObjWithRequiredPropsMap](#objwithrequiredpropsmap) | data
validated payload | +| [ObjWithRequiredPropsMap](#objwithrequiredpropsmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ObjWithRequiredProps1 public static class ObjWithRequiredProps1
@@ -89,7 +90,9 @@ ObjWithRequiredProps.ObjWithRequiredPropsMap validatedPayload = | ----------------- | ---------------------- | | [ObjWithRequiredPropsMap](#objwithrequiredpropsmap) | validate([Map<?, ?>](#objwithrequiredpropsmapbuilder) arg, SchemaConfiguration configuration) | | [ObjWithRequiredProps1BoxedMap](#objwithrequiredprops1boxedmap) | validateAndBox([Map<?, ?>](#objwithrequiredpropsmapbuilder) arg, SchemaConfiguration configuration) | +| [ObjWithRequiredProps1Boxed](#objwithrequiredprops1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ObjWithRequiredPropsMap0Builder public class ObjWithRequiredPropsMap0Builder
builder for `Map` @@ -145,27 +148,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## ABoxed -public static abstract sealed class ABoxed
+public sealed interface ABoxed
permits
[ABoxedString](#aboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ABoxedString -public static final class ABoxedString
-extends [ABoxed](#aboxed) +public record ABoxedString
+implements [ABoxed](#aboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ABoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## A public static class A
diff --git a/samples/client/petstore/java/docs/components/schemas/ObjWithRequiredPropsBase.md b/samples/client/petstore/java/docs/components/schemas/ObjWithRequiredPropsBase.md index c57d893796a..3a42f109752 100644 --- a/samples/client/petstore/java/docs/components/schemas/ObjWithRequiredPropsBase.md +++ b/samples/client/petstore/java/docs/components/schemas/ObjWithRequiredPropsBase.md @@ -4,7 +4,7 @@ public class ObjWithRequiredPropsBase
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,37 +12,38 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ObjWithRequiredPropsBase.ObjWithRequiredPropsBase1Boxed](#objwithrequiredpropsbase1boxed)
abstract sealed validated payload class | -| static class | [ObjWithRequiredPropsBase.ObjWithRequiredPropsBase1BoxedMap](#objwithrequiredpropsbase1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ObjWithRequiredPropsBase.ObjWithRequiredPropsBase1Boxed](#objwithrequiredpropsbase1boxed)
sealed interface for validated payloads | +| record | [ObjWithRequiredPropsBase.ObjWithRequiredPropsBase1BoxedMap](#objwithrequiredpropsbase1boxedmap)
boxed class to store validated Map payloads | | static class | [ObjWithRequiredPropsBase.ObjWithRequiredPropsBase1](#objwithrequiredpropsbase1)
schema class | | static class | [ObjWithRequiredPropsBase.ObjWithRequiredPropsBaseMapBuilder](#objwithrequiredpropsbasemapbuilder)
builder for Map payloads | | static class | [ObjWithRequiredPropsBase.ObjWithRequiredPropsBaseMap](#objwithrequiredpropsbasemap)
output class for Map payloads | -| static class | [ObjWithRequiredPropsBase.BBoxed](#bboxed)
abstract sealed validated payload class | -| static class | [ObjWithRequiredPropsBase.BBoxedString](#bboxedstring)
boxed class to store validated String payloads | +| sealed interface | [ObjWithRequiredPropsBase.BBoxed](#bboxed)
sealed interface for validated payloads | +| record | [ObjWithRequiredPropsBase.BBoxedString](#bboxedstring)
boxed class to store validated String payloads | | static class | [ObjWithRequiredPropsBase.B](#b)
schema class | ## ObjWithRequiredPropsBase1Boxed -public static abstract sealed class ObjWithRequiredPropsBase1Boxed
+public sealed interface ObjWithRequiredPropsBase1Boxed
permits
[ObjWithRequiredPropsBase1BoxedMap](#objwithrequiredpropsbase1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ObjWithRequiredPropsBase1BoxedMap -public static final class ObjWithRequiredPropsBase1BoxedMap
-extends [ObjWithRequiredPropsBase1Boxed](#objwithrequiredpropsbase1boxed) +public record ObjWithRequiredPropsBase1BoxedMap
+implements [ObjWithRequiredPropsBase1Boxed](#objwithrequiredpropsbase1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ObjWithRequiredPropsBase1BoxedMap([ObjWithRequiredPropsBaseMap](#objwithrequiredpropsbasemap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [ObjWithRequiredPropsBaseMap](#objwithrequiredpropsbasemap) | data
validated payload | +| [ObjWithRequiredPropsBaseMap](#objwithrequiredpropsbasemap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ObjWithRequiredPropsBase1 public static class ObjWithRequiredPropsBase1
@@ -88,7 +89,9 @@ ObjWithRequiredPropsBase.ObjWithRequiredPropsBaseMap validatedPayload = | ----------------- | ---------------------- | | [ObjWithRequiredPropsBaseMap](#objwithrequiredpropsbasemap) | validate([Map<?, ?>](#objwithrequiredpropsbasemapbuilder) arg, SchemaConfiguration configuration) | | [ObjWithRequiredPropsBase1BoxedMap](#objwithrequiredpropsbase1boxedmap) | validateAndBox([Map<?, ?>](#objwithrequiredpropsbasemapbuilder) arg, SchemaConfiguration configuration) | +| [ObjWithRequiredPropsBase1Boxed](#objwithrequiredpropsbase1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ObjWithRequiredPropsBaseMap0Builder public class ObjWithRequiredPropsBaseMap0Builder
builder for `Map` @@ -144,27 +147,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## BBoxed -public static abstract sealed class BBoxed
+public sealed interface BBoxed
permits
[BBoxedString](#bboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## BBoxedString -public static final class BBoxedString
-extends [BBoxed](#bboxed) +public record BBoxedString
+implements [BBoxed](#bboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## B public static class B
diff --git a/samples/client/petstore/java/docs/components/schemas/ObjectInterface.md b/samples/client/petstore/java/docs/components/schemas/ObjectInterface.md index 871c9193384..b838c721b58 100644 --- a/samples/client/petstore/java/docs/components/schemas/ObjectInterface.md +++ b/samples/client/petstore/java/docs/components/schemas/ObjectInterface.md @@ -4,38 +4,39 @@ public class ObjectInterface
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ObjectInterface.ObjectInterface1Boxed](#objectinterface1boxed)
abstract sealed validated payload class | -| static class | [ObjectInterface.ObjectInterface1BoxedMap](#objectinterface1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ObjectInterface.ObjectInterface1Boxed](#objectinterface1boxed)
sealed interface for validated payloads | +| record | [ObjectInterface.ObjectInterface1BoxedMap](#objectinterface1boxedmap)
boxed class to store validated Map payloads | | static class | [ObjectInterface.ObjectInterface1](#objectinterface1)
schema class | ## ObjectInterface1Boxed -public static abstract sealed class ObjectInterface1Boxed
+public sealed interface ObjectInterface1Boxed
permits
[ObjectInterface1BoxedMap](#objectinterface1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ObjectInterface1BoxedMap -public static final class ObjectInterface1BoxedMap
-extends [ObjectInterface1Boxed](#objectinterface1boxed) +public record ObjectInterface1BoxedMap
+implements [ObjectInterface1Boxed](#objectinterface1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ObjectInterface1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ObjectInterface1 public static class ObjectInterface1
diff --git a/samples/client/petstore/java/docs/components/schemas/ObjectModelWithArgAndArgsProperties.md b/samples/client/petstore/java/docs/components/schemas/ObjectModelWithArgAndArgsProperties.md index 368b53e70fa..af6dd1a1b14 100644 --- a/samples/client/petstore/java/docs/components/schemas/ObjectModelWithArgAndArgsProperties.md +++ b/samples/client/petstore/java/docs/components/schemas/ObjectModelWithArgAndArgsProperties.md @@ -4,7 +4,7 @@ public class ObjectModelWithArgAndArgsProperties
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,40 +12,41 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ObjectModelWithArgAndArgsProperties.ObjectModelWithArgAndArgsProperties1Boxed](#objectmodelwithargandargsproperties1boxed)
abstract sealed validated payload class | -| static class | [ObjectModelWithArgAndArgsProperties.ObjectModelWithArgAndArgsProperties1BoxedMap](#objectmodelwithargandargsproperties1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ObjectModelWithArgAndArgsProperties.ObjectModelWithArgAndArgsProperties1Boxed](#objectmodelwithargandargsproperties1boxed)
sealed interface for validated payloads | +| record | [ObjectModelWithArgAndArgsProperties.ObjectModelWithArgAndArgsProperties1BoxedMap](#objectmodelwithargandargsproperties1boxedmap)
boxed class to store validated Map payloads | | static class | [ObjectModelWithArgAndArgsProperties.ObjectModelWithArgAndArgsProperties1](#objectmodelwithargandargsproperties1)
schema class | | static class | [ObjectModelWithArgAndArgsProperties.ObjectModelWithArgAndArgsPropertiesMapBuilder](#objectmodelwithargandargspropertiesmapbuilder)
builder for Map payloads | | static class | [ObjectModelWithArgAndArgsProperties.ObjectModelWithArgAndArgsPropertiesMap](#objectmodelwithargandargspropertiesmap)
output class for Map payloads | -| static class | [ObjectModelWithArgAndArgsProperties.ArgsBoxed](#argsboxed)
abstract sealed validated payload class | -| static class | [ObjectModelWithArgAndArgsProperties.ArgsBoxedString](#argsboxedstring)
boxed class to store validated String payloads | +| sealed interface | [ObjectModelWithArgAndArgsProperties.ArgsBoxed](#argsboxed)
sealed interface for validated payloads | +| record | [ObjectModelWithArgAndArgsProperties.ArgsBoxedString](#argsboxedstring)
boxed class to store validated String payloads | | static class | [ObjectModelWithArgAndArgsProperties.Args](#args)
schema class | -| static class | [ObjectModelWithArgAndArgsProperties.ArgBoxed](#argboxed)
abstract sealed validated payload class | -| static class | [ObjectModelWithArgAndArgsProperties.ArgBoxedString](#argboxedstring)
boxed class to store validated String payloads | +| sealed interface | [ObjectModelWithArgAndArgsProperties.ArgBoxed](#argboxed)
sealed interface for validated payloads | +| record | [ObjectModelWithArgAndArgsProperties.ArgBoxedString](#argboxedstring)
boxed class to store validated String payloads | | static class | [ObjectModelWithArgAndArgsProperties.Arg](#arg)
schema class | ## ObjectModelWithArgAndArgsProperties1Boxed -public static abstract sealed class ObjectModelWithArgAndArgsProperties1Boxed
+public sealed interface ObjectModelWithArgAndArgsProperties1Boxed
permits
[ObjectModelWithArgAndArgsProperties1BoxedMap](#objectmodelwithargandargsproperties1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ObjectModelWithArgAndArgsProperties1BoxedMap -public static final class ObjectModelWithArgAndArgsProperties1BoxedMap
-extends [ObjectModelWithArgAndArgsProperties1Boxed](#objectmodelwithargandargsproperties1boxed) +public record ObjectModelWithArgAndArgsProperties1BoxedMap
+implements [ObjectModelWithArgAndArgsProperties1Boxed](#objectmodelwithargandargsproperties1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ObjectModelWithArgAndArgsProperties1BoxedMap([ObjectModelWithArgAndArgsPropertiesMap](#objectmodelwithargandargspropertiesmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [ObjectModelWithArgAndArgsPropertiesMap](#objectmodelwithargandargspropertiesmap) | data
validated payload | +| [ObjectModelWithArgAndArgsPropertiesMap](#objectmodelwithargandargspropertiesmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ObjectModelWithArgAndArgsProperties1 public static class ObjectModelWithArgAndArgsProperties1
@@ -93,7 +94,9 @@ ObjectModelWithArgAndArgsProperties.ObjectModelWithArgAndArgsPropertiesMap valid | ----------------- | ---------------------- | | [ObjectModelWithArgAndArgsPropertiesMap](#objectmodelwithargandargspropertiesmap) | validate([Map<?, ?>](#objectmodelwithargandargspropertiesmapbuilder) arg, SchemaConfiguration configuration) | | [ObjectModelWithArgAndArgsProperties1BoxedMap](#objectmodelwithargandargsproperties1boxedmap) | validateAndBox([Map<?, ?>](#objectmodelwithargandargspropertiesmapbuilder) arg, SchemaConfiguration configuration) | +| [ObjectModelWithArgAndArgsProperties1Boxed](#objectmodelwithargandargsproperties1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ObjectModelWithArgAndArgsPropertiesMap00Builder public class ObjectModelWithArgAndArgsPropertiesMap00Builder
builder for `Map` @@ -183,27 +186,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## ArgsBoxed -public static abstract sealed class ArgsBoxed
+public sealed interface ArgsBoxed
permits
[ArgsBoxedString](#argsboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ArgsBoxedString -public static final class ArgsBoxedString
-extends [ArgsBoxed](#argsboxed) +public record ArgsBoxedString
+implements [ArgsBoxed](#argsboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ArgsBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Args public static class Args
@@ -217,27 +221,28 @@ A schema class that validates payloads | validateAndBox | ## ArgBoxed -public static abstract sealed class ArgBoxed
+public sealed interface ArgBoxed
permits
[ArgBoxedString](#argboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ArgBoxedString -public static final class ArgBoxedString
-extends [ArgBoxed](#argboxed) +public record ArgBoxedString
+implements [ArgBoxed](#argboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ArgBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Arg public static class Arg
diff --git a/samples/client/petstore/java/docs/components/schemas/ObjectModelWithRefProps.md b/samples/client/petstore/java/docs/components/schemas/ObjectModelWithRefProps.md index 6bcfab2ad65..2730512d9a6 100644 --- a/samples/client/petstore/java/docs/components/schemas/ObjectModelWithRefProps.md +++ b/samples/client/petstore/java/docs/components/schemas/ObjectModelWithRefProps.md @@ -4,7 +4,7 @@ public class ObjectModelWithRefProps
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,34 +12,35 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ObjectModelWithRefProps.ObjectModelWithRefProps1Boxed](#objectmodelwithrefprops1boxed)
abstract sealed validated payload class | -| static class | [ObjectModelWithRefProps.ObjectModelWithRefProps1BoxedMap](#objectmodelwithrefprops1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ObjectModelWithRefProps.ObjectModelWithRefProps1Boxed](#objectmodelwithrefprops1boxed)
sealed interface for validated payloads | +| record | [ObjectModelWithRefProps.ObjectModelWithRefProps1BoxedMap](#objectmodelwithrefprops1boxedmap)
boxed class to store validated Map payloads | | static class | [ObjectModelWithRefProps.ObjectModelWithRefProps1](#objectmodelwithrefprops1)
schema class | | static class | [ObjectModelWithRefProps.ObjectModelWithRefPropsMapBuilder](#objectmodelwithrefpropsmapbuilder)
builder for Map payloads | | static class | [ObjectModelWithRefProps.ObjectModelWithRefPropsMap](#objectmodelwithrefpropsmap)
output class for Map payloads | ## ObjectModelWithRefProps1Boxed -public static abstract sealed class ObjectModelWithRefProps1Boxed
+public sealed interface ObjectModelWithRefProps1Boxed
permits
[ObjectModelWithRefProps1BoxedMap](#objectmodelwithrefprops1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ObjectModelWithRefProps1BoxedMap -public static final class ObjectModelWithRefProps1BoxedMap
-extends [ObjectModelWithRefProps1Boxed](#objectmodelwithrefprops1boxed) +public record ObjectModelWithRefProps1BoxedMap
+implements [ObjectModelWithRefProps1Boxed](#objectmodelwithrefprops1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ObjectModelWithRefProps1BoxedMap([ObjectModelWithRefPropsMap](#objectmodelwithrefpropsmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [ObjectModelWithRefPropsMap](#objectmodelwithrefpropsmap) | data
validated payload | +| [ObjectModelWithRefPropsMap](#objectmodelwithrefpropsmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ObjectModelWithRefProps1 public static class ObjectModelWithRefProps1
@@ -85,7 +86,9 @@ ObjectModelWithRefProps.ObjectModelWithRefPropsMap validatedPayload = | ----------------- | ---------------------- | | [ObjectModelWithRefPropsMap](#objectmodelwithrefpropsmap) | validate([Map<?, ?>](#objectmodelwithrefpropsmapbuilder) arg, SchemaConfiguration configuration) | | [ObjectModelWithRefProps1BoxedMap](#objectmodelwithrefprops1boxedmap) | validateAndBox([Map<?, ?>](#objectmodelwithrefpropsmapbuilder) arg, SchemaConfiguration configuration) | +| [ObjectModelWithRefProps1Boxed](#objectmodelwithrefprops1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ObjectModelWithRefPropsMapBuilder public class ObjectModelWithRefPropsMapBuilder
builder for `Map` diff --git a/samples/client/petstore/java/docs/components/schemas/ObjectWithAllOfWithReqTestPropFromUnsetAddProp.md b/samples/client/petstore/java/docs/components/schemas/ObjectWithAllOfWithReqTestPropFromUnsetAddProp.md index 91be7703b4a..96d88f2c453 100644 --- a/samples/client/petstore/java/docs/components/schemas/ObjectWithAllOfWithReqTestPropFromUnsetAddProp.md +++ b/samples/client/petstore/java/docs/components/schemas/ObjectWithAllOfWithReqTestPropFromUnsetAddProp.md @@ -4,7 +4,7 @@ public class ObjectWithAllOfWithReqTestPropFromUnsetAddProp
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,25 +12,25 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ObjectWithAllOfWithReqTestPropFromUnsetAddProp.ObjectWithAllOfWithReqTestPropFromUnsetAddProp1Boxed](#objectwithallofwithreqtestpropfromunsetaddprop1boxed)
abstract sealed validated payload class | -| static class | [ObjectWithAllOfWithReqTestPropFromUnsetAddProp.ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedVoid](#objectwithallofwithreqtestpropfromunsetaddprop1boxedvoid)
boxed class to store validated null payloads | -| static class | [ObjectWithAllOfWithReqTestPropFromUnsetAddProp.ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedBoolean](#objectwithallofwithreqtestpropfromunsetaddprop1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [ObjectWithAllOfWithReqTestPropFromUnsetAddProp.ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedNumber](#objectwithallofwithreqtestpropfromunsetaddprop1boxednumber)
boxed class to store validated Number payloads | -| static class | [ObjectWithAllOfWithReqTestPropFromUnsetAddProp.ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedString](#objectwithallofwithreqtestpropfromunsetaddprop1boxedstring)
boxed class to store validated String payloads | -| static class | [ObjectWithAllOfWithReqTestPropFromUnsetAddProp.ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedList](#objectwithallofwithreqtestpropfromunsetaddprop1boxedlist)
boxed class to store validated List payloads | -| static class | [ObjectWithAllOfWithReqTestPropFromUnsetAddProp.ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedMap](#objectwithallofwithreqtestpropfromunsetaddprop1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ObjectWithAllOfWithReqTestPropFromUnsetAddProp.ObjectWithAllOfWithReqTestPropFromUnsetAddProp1Boxed](#objectwithallofwithreqtestpropfromunsetaddprop1boxed)
sealed interface for validated payloads | +| record | [ObjectWithAllOfWithReqTestPropFromUnsetAddProp.ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedVoid](#objectwithallofwithreqtestpropfromunsetaddprop1boxedvoid)
boxed class to store validated null payloads | +| record | [ObjectWithAllOfWithReqTestPropFromUnsetAddProp.ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedBoolean](#objectwithallofwithreqtestpropfromunsetaddprop1boxedboolean)
boxed class to store validated boolean payloads | +| record | [ObjectWithAllOfWithReqTestPropFromUnsetAddProp.ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedNumber](#objectwithallofwithreqtestpropfromunsetaddprop1boxednumber)
boxed class to store validated Number payloads | +| record | [ObjectWithAllOfWithReqTestPropFromUnsetAddProp.ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedString](#objectwithallofwithreqtestpropfromunsetaddprop1boxedstring)
boxed class to store validated String payloads | +| record | [ObjectWithAllOfWithReqTestPropFromUnsetAddProp.ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedList](#objectwithallofwithreqtestpropfromunsetaddprop1boxedlist)
boxed class to store validated List payloads | +| record | [ObjectWithAllOfWithReqTestPropFromUnsetAddProp.ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedMap](#objectwithallofwithreqtestpropfromunsetaddprop1boxedmap)
boxed class to store validated Map payloads | | static class | [ObjectWithAllOfWithReqTestPropFromUnsetAddProp.ObjectWithAllOfWithReqTestPropFromUnsetAddProp1](#objectwithallofwithreqtestpropfromunsetaddprop1)
schema class | -| static class | [ObjectWithAllOfWithReqTestPropFromUnsetAddProp.Schema1Boxed](#schema1boxed)
abstract sealed validated payload class | -| static class | [ObjectWithAllOfWithReqTestPropFromUnsetAddProp.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ObjectWithAllOfWithReqTestPropFromUnsetAddProp.Schema1Boxed](#schema1boxed)
sealed interface for validated payloads | +| record | [ObjectWithAllOfWithReqTestPropFromUnsetAddProp.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | | static class | [ObjectWithAllOfWithReqTestPropFromUnsetAddProp.Schema1](#schema1)
schema class | | static class | [ObjectWithAllOfWithReqTestPropFromUnsetAddProp.Schema1MapBuilder](#schema1mapbuilder)
builder for Map payloads | | static class | [ObjectWithAllOfWithReqTestPropFromUnsetAddProp.Schema1Map](#schema1map)
output class for Map payloads | -| static class | [ObjectWithAllOfWithReqTestPropFromUnsetAddProp.NameBoxed](#nameboxed)
abstract sealed validated payload class | -| static class | [ObjectWithAllOfWithReqTestPropFromUnsetAddProp.NameBoxedString](#nameboxedstring)
boxed class to store validated String payloads | +| sealed interface | [ObjectWithAllOfWithReqTestPropFromUnsetAddProp.NameBoxed](#nameboxed)
sealed interface for validated payloads | +| record | [ObjectWithAllOfWithReqTestPropFromUnsetAddProp.NameBoxedString](#nameboxedstring)
boxed class to store validated String payloads | | static class | [ObjectWithAllOfWithReqTestPropFromUnsetAddProp.Name](#name)
schema class | ## ObjectWithAllOfWithReqTestPropFromUnsetAddProp1Boxed -public static abstract sealed class ObjectWithAllOfWithReqTestPropFromUnsetAddProp1Boxed
+public sealed interface ObjectWithAllOfWithReqTestPropFromUnsetAddProp1Boxed
permits
[ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedVoid](#objectwithallofwithreqtestpropfromunsetaddprop1boxedvoid), [ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedBoolean](#objectwithallofwithreqtestpropfromunsetaddprop1boxedboolean), @@ -39,103 +39,109 @@ permits
[ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedList](#objectwithallofwithreqtestpropfromunsetaddprop1boxedlist), [ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedMap](#objectwithallofwithreqtestpropfromunsetaddprop1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedVoid -public static final class ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedVoid
-extends [ObjectWithAllOfWithReqTestPropFromUnsetAddProp1Boxed](#objectwithallofwithreqtestpropfromunsetaddprop1boxed) +public record ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedVoid
+implements [ObjectWithAllOfWithReqTestPropFromUnsetAddProp1Boxed](#objectwithallofwithreqtestpropfromunsetaddprop1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedBoolean -public static final class ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedBoolean
-extends [ObjectWithAllOfWithReqTestPropFromUnsetAddProp1Boxed](#objectwithallofwithreqtestpropfromunsetaddprop1boxed) +public record ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedBoolean
+implements [ObjectWithAllOfWithReqTestPropFromUnsetAddProp1Boxed](#objectwithallofwithreqtestpropfromunsetaddprop1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedNumber -public static final class ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedNumber
-extends [ObjectWithAllOfWithReqTestPropFromUnsetAddProp1Boxed](#objectwithallofwithreqtestpropfromunsetaddprop1boxed) +public record ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedNumber
+implements [ObjectWithAllOfWithReqTestPropFromUnsetAddProp1Boxed](#objectwithallofwithreqtestpropfromunsetaddprop1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedString -public static final class ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedString
-extends [ObjectWithAllOfWithReqTestPropFromUnsetAddProp1Boxed](#objectwithallofwithreqtestpropfromunsetaddprop1boxed) +public record ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedString
+implements [ObjectWithAllOfWithReqTestPropFromUnsetAddProp1Boxed](#objectwithallofwithreqtestpropfromunsetaddprop1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedList -public static final class ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedList
-extends [ObjectWithAllOfWithReqTestPropFromUnsetAddProp1Boxed](#objectwithallofwithreqtestpropfromunsetaddprop1boxed) +public record ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedList
+implements [ObjectWithAllOfWithReqTestPropFromUnsetAddProp1Boxed](#objectwithallofwithreqtestpropfromunsetaddprop1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedMap -public static final class ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedMap
-extends [ObjectWithAllOfWithReqTestPropFromUnsetAddProp1Boxed](#objectwithallofwithreqtestpropfromunsetaddprop1boxed) +public record ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedMap
+implements [ObjectWithAllOfWithReqTestPropFromUnsetAddProp1Boxed](#objectwithallofwithreqtestpropfromunsetaddprop1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ObjectWithAllOfWithReqTestPropFromUnsetAddProp1 public static class ObjectWithAllOfWithReqTestPropFromUnsetAddProp1
@@ -167,29 +173,32 @@ A schema class that validates payloads | [ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedBoolean](#objectwithallofwithreqtestpropfromunsetaddprop1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedMap](#objectwithallofwithreqtestpropfromunsetaddprop1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedList](#objectwithallofwithreqtestpropfromunsetaddprop1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [ObjectWithAllOfWithReqTestPropFromUnsetAddProp1Boxed](#objectwithallofwithreqtestpropfromunsetaddprop1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema1Boxed -public static abstract sealed class Schema1Boxed
+public sealed interface Schema1Boxed
permits
[Schema1BoxedMap](#schema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema1BoxedMap -public static final class Schema1BoxedMap
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedMap
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedMap([Schema1Map](#schema1map) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [Schema1Map](#schema1map) | data
validated payload | +| [Schema1Map](#schema1map) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1 public static class Schema1
@@ -235,7 +244,9 @@ ObjectWithAllOfWithReqTestPropFromUnsetAddProp.Schema1Map validatedPayload = | ----------------- | ---------------------- | | [Schema1Map](#schema1map) | validate([Map<?, ?>](#schema1mapbuilder) arg, SchemaConfiguration configuration) | | [Schema1BoxedMap](#schema1boxedmap) | validateAndBox([Map<?, ?>](#schema1mapbuilder) arg, SchemaConfiguration configuration) | +| [Schema1Boxed](#schema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema1Map0Builder public class Schema1Map0Builder
builder for `Map` @@ -301,27 +312,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## NameBoxed -public static abstract sealed class NameBoxed
+public sealed interface NameBoxed
permits
[NameBoxedString](#nameboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## NameBoxedString -public static final class NameBoxedString
-extends [NameBoxed](#nameboxed) +public record NameBoxedString
+implements [NameBoxed](#nameboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NameBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Name public static class Name
diff --git a/samples/client/petstore/java/docs/components/schemas/ObjectWithCollidingProperties.md b/samples/client/petstore/java/docs/components/schemas/ObjectWithCollidingProperties.md index 3ec248081b5..dee16fb8cd6 100644 --- a/samples/client/petstore/java/docs/components/schemas/ObjectWithCollidingProperties.md +++ b/samples/client/petstore/java/docs/components/schemas/ObjectWithCollidingProperties.md @@ -4,7 +4,7 @@ public class ObjectWithCollidingProperties
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,40 +12,41 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ObjectWithCollidingProperties.ObjectWithCollidingProperties1Boxed](#objectwithcollidingproperties1boxed)
abstract sealed validated payload class | -| static class | [ObjectWithCollidingProperties.ObjectWithCollidingProperties1BoxedMap](#objectwithcollidingproperties1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ObjectWithCollidingProperties.ObjectWithCollidingProperties1Boxed](#objectwithcollidingproperties1boxed)
sealed interface for validated payloads | +| record | [ObjectWithCollidingProperties.ObjectWithCollidingProperties1BoxedMap](#objectwithcollidingproperties1boxedmap)
boxed class to store validated Map payloads | | static class | [ObjectWithCollidingProperties.ObjectWithCollidingProperties1](#objectwithcollidingproperties1)
schema class | | static class | [ObjectWithCollidingProperties.ObjectWithCollidingPropertiesMapBuilder](#objectwithcollidingpropertiesmapbuilder)
builder for Map payloads | | static class | [ObjectWithCollidingProperties.ObjectWithCollidingPropertiesMap](#objectwithcollidingpropertiesmap)
output class for Map payloads | -| static class | [ObjectWithCollidingProperties.SomepropBoxed](#somepropboxed)
abstract sealed validated payload class | -| static class | [ObjectWithCollidingProperties.SomepropBoxedMap](#somepropboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ObjectWithCollidingProperties.SomepropBoxed](#somepropboxed)
sealed interface for validated payloads | +| record | [ObjectWithCollidingProperties.SomepropBoxedMap](#somepropboxedmap)
boxed class to store validated Map payloads | | static class | [ObjectWithCollidingProperties.Someprop](#someprop)
schema class | -| static class | [ObjectWithCollidingProperties.SomePropBoxed](#somepropboxed)
abstract sealed validated payload class | -| static class | [ObjectWithCollidingProperties.SomePropBoxedMap](#somepropboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ObjectWithCollidingProperties.SomePropBoxed](#somepropboxed)
sealed interface for validated payloads | +| record | [ObjectWithCollidingProperties.SomePropBoxedMap](#somepropboxedmap)
boxed class to store validated Map payloads | | static class | [ObjectWithCollidingProperties.SomeProp](#someprop)
schema class | ## ObjectWithCollidingProperties1Boxed -public static abstract sealed class ObjectWithCollidingProperties1Boxed
+public sealed interface ObjectWithCollidingProperties1Boxed
permits
[ObjectWithCollidingProperties1BoxedMap](#objectwithcollidingproperties1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ObjectWithCollidingProperties1BoxedMap -public static final class ObjectWithCollidingProperties1BoxedMap
-extends [ObjectWithCollidingProperties1Boxed](#objectwithcollidingproperties1boxed) +public record ObjectWithCollidingProperties1BoxedMap
+implements [ObjectWithCollidingProperties1Boxed](#objectwithcollidingproperties1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ObjectWithCollidingProperties1BoxedMap([ObjectWithCollidingPropertiesMap](#objectwithcollidingpropertiesmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [ObjectWithCollidingPropertiesMap](#objectwithcollidingpropertiesmap) | data
validated payload | +| [ObjectWithCollidingPropertiesMap](#objectwithcollidingpropertiesmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ObjectWithCollidingProperties1 public static class ObjectWithCollidingProperties1
@@ -91,7 +92,9 @@ ObjectWithCollidingProperties.ObjectWithCollidingPropertiesMap validatedPayload | ----------------- | ---------------------- | | [ObjectWithCollidingPropertiesMap](#objectwithcollidingpropertiesmap) | validate([Map<?, ?>](#objectwithcollidingpropertiesmapbuilder) arg, SchemaConfiguration configuration) | | [ObjectWithCollidingProperties1BoxedMap](#objectwithcollidingproperties1boxedmap) | validateAndBox([Map<?, ?>](#objectwithcollidingpropertiesmapbuilder) arg, SchemaConfiguration configuration) | +| [ObjectWithCollidingProperties1Boxed](#objectwithcollidingproperties1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ObjectWithCollidingPropertiesMapBuilder public class ObjectWithCollidingPropertiesMapBuilder
builder for `Map` @@ -134,27 +137,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## SomepropBoxed -public static abstract sealed class SomepropBoxed
+public sealed interface SomepropBoxed
permits
[SomepropBoxedMap](#somepropboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## SomepropBoxedMap -public static final class SomepropBoxedMap
-extends [SomepropBoxed](#somepropboxed) +public record SomepropBoxedMap
+implements [SomepropBoxed](#somepropboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | SomepropBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Someprop public static class Someprop
@@ -168,27 +172,28 @@ A schema class that validates payloads | validateAndBox | ## SomePropBoxed -public static abstract sealed class SomePropBoxed
+public sealed interface SomePropBoxed
permits
[SomePropBoxedMap](#somepropboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## SomePropBoxedMap -public static final class SomePropBoxedMap
-extends [SomePropBoxed](#somepropboxed) +public record SomePropBoxedMap
+implements [SomePropBoxed](#somepropboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | SomePropBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## SomeProp public static class SomeProp
diff --git a/samples/client/petstore/java/docs/components/schemas/ObjectWithDecimalProperties.md b/samples/client/petstore/java/docs/components/schemas/ObjectWithDecimalProperties.md index 62b52da3b2d..39bc04983cf 100644 --- a/samples/client/petstore/java/docs/components/schemas/ObjectWithDecimalProperties.md +++ b/samples/client/petstore/java/docs/components/schemas/ObjectWithDecimalProperties.md @@ -4,7 +4,7 @@ public class ObjectWithDecimalProperties
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,37 +12,38 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ObjectWithDecimalProperties.ObjectWithDecimalProperties1Boxed](#objectwithdecimalproperties1boxed)
abstract sealed validated payload class | -| static class | [ObjectWithDecimalProperties.ObjectWithDecimalProperties1BoxedMap](#objectwithdecimalproperties1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ObjectWithDecimalProperties.ObjectWithDecimalProperties1Boxed](#objectwithdecimalproperties1boxed)
sealed interface for validated payloads | +| record | [ObjectWithDecimalProperties.ObjectWithDecimalProperties1BoxedMap](#objectwithdecimalproperties1boxedmap)
boxed class to store validated Map payloads | | static class | [ObjectWithDecimalProperties.ObjectWithDecimalProperties1](#objectwithdecimalproperties1)
schema class | | static class | [ObjectWithDecimalProperties.ObjectWithDecimalPropertiesMapBuilder](#objectwithdecimalpropertiesmapbuilder)
builder for Map payloads | | static class | [ObjectWithDecimalProperties.ObjectWithDecimalPropertiesMap](#objectwithdecimalpropertiesmap)
output class for Map payloads | -| static class | [ObjectWithDecimalProperties.WidthBoxed](#widthboxed)
abstract sealed validated payload class | -| static class | [ObjectWithDecimalProperties.WidthBoxedString](#widthboxedstring)
boxed class to store validated String payloads | +| sealed interface | [ObjectWithDecimalProperties.WidthBoxed](#widthboxed)
sealed interface for validated payloads | +| record | [ObjectWithDecimalProperties.WidthBoxedString](#widthboxedstring)
boxed class to store validated String payloads | | static class | [ObjectWithDecimalProperties.Width](#width)
schema class | ## ObjectWithDecimalProperties1Boxed -public static abstract sealed class ObjectWithDecimalProperties1Boxed
+public sealed interface ObjectWithDecimalProperties1Boxed
permits
[ObjectWithDecimalProperties1BoxedMap](#objectwithdecimalproperties1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ObjectWithDecimalProperties1BoxedMap -public static final class ObjectWithDecimalProperties1BoxedMap
-extends [ObjectWithDecimalProperties1Boxed](#objectwithdecimalproperties1boxed) +public record ObjectWithDecimalProperties1BoxedMap
+implements [ObjectWithDecimalProperties1Boxed](#objectwithdecimalproperties1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ObjectWithDecimalProperties1BoxedMap([ObjectWithDecimalPropertiesMap](#objectwithdecimalpropertiesmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [ObjectWithDecimalPropertiesMap](#objectwithdecimalpropertiesmap) | data
validated payload | +| [ObjectWithDecimalPropertiesMap](#objectwithdecimalpropertiesmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ObjectWithDecimalProperties1 public static class ObjectWithDecimalProperties1
@@ -101,7 +102,9 @@ ObjectWithDecimalProperties.ObjectWithDecimalPropertiesMap validatedPayload = | ----------------- | ---------------------- | | [ObjectWithDecimalPropertiesMap](#objectwithdecimalpropertiesmap) | validate([Map<?, ?>](#objectwithdecimalpropertiesmapbuilder) arg, SchemaConfiguration configuration) | | [ObjectWithDecimalProperties1BoxedMap](#objectwithdecimalproperties1boxedmap) | validateAndBox([Map<?, ?>](#objectwithdecimalpropertiesmapbuilder) arg, SchemaConfiguration configuration) | +| [ObjectWithDecimalProperties1Boxed](#objectwithdecimalproperties1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ObjectWithDecimalPropertiesMapBuilder public class ObjectWithDecimalPropertiesMapBuilder
builder for `Map` @@ -146,27 +149,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## WidthBoxed -public static abstract sealed class WidthBoxed
+public sealed interface WidthBoxed
permits
[WidthBoxedString](#widthboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## WidthBoxedString -public static final class WidthBoxedString
-extends [WidthBoxed](#widthboxed) +public record WidthBoxedString
+implements [WidthBoxed](#widthboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | WidthBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Width public static class Width
diff --git a/samples/client/petstore/java/docs/components/schemas/ObjectWithDifficultlyNamedProps.md b/samples/client/petstore/java/docs/components/schemas/ObjectWithDifficultlyNamedProps.md index 40e5c2643da..7757bcdd6f5 100644 --- a/samples/client/petstore/java/docs/components/schemas/ObjectWithDifficultlyNamedProps.md +++ b/samples/client/petstore/java/docs/components/schemas/ObjectWithDifficultlyNamedProps.md @@ -4,7 +4,7 @@ public class ObjectWithDifficultlyNamedProps
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,43 +12,44 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ObjectWithDifficultlyNamedProps.ObjectWithDifficultlyNamedProps1Boxed](#objectwithdifficultlynamedprops1boxed)
abstract sealed validated payload class | -| static class | [ObjectWithDifficultlyNamedProps.ObjectWithDifficultlyNamedProps1BoxedMap](#objectwithdifficultlynamedprops1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ObjectWithDifficultlyNamedProps.ObjectWithDifficultlyNamedProps1Boxed](#objectwithdifficultlynamedprops1boxed)
sealed interface for validated payloads | +| record | [ObjectWithDifficultlyNamedProps.ObjectWithDifficultlyNamedProps1BoxedMap](#objectwithdifficultlynamedprops1boxedmap)
boxed class to store validated Map payloads | | static class | [ObjectWithDifficultlyNamedProps.ObjectWithDifficultlyNamedProps1](#objectwithdifficultlynamedprops1)
schema class | | static class | [ObjectWithDifficultlyNamedProps.ObjectWithDifficultlyNamedPropsMapBuilder](#objectwithdifficultlynamedpropsmapbuilder)
builder for Map payloads | | static class | [ObjectWithDifficultlyNamedProps.ObjectWithDifficultlyNamedPropsMap](#objectwithdifficultlynamedpropsmap)
output class for Map payloads | -| static class | [ObjectWithDifficultlyNamedProps.Schema123NumberBoxed](#schema123numberboxed)
abstract sealed validated payload class | -| static class | [ObjectWithDifficultlyNamedProps.Schema123NumberBoxedNumber](#schema123numberboxednumber)
boxed class to store validated Number payloads | +| sealed interface | [ObjectWithDifficultlyNamedProps.Schema123NumberBoxed](#schema123numberboxed)
sealed interface for validated payloads | +| record | [ObjectWithDifficultlyNamedProps.Schema123NumberBoxedNumber](#schema123numberboxednumber)
boxed class to store validated Number payloads | | static class | [ObjectWithDifficultlyNamedProps.Schema123Number](#schema123number)
schema class | -| static class | [ObjectWithDifficultlyNamedProps.Schema123listBoxed](#schema123listboxed)
abstract sealed validated payload class | -| static class | [ObjectWithDifficultlyNamedProps.Schema123listBoxedString](#schema123listboxedstring)
boxed class to store validated String payloads | +| sealed interface | [ObjectWithDifficultlyNamedProps.Schema123listBoxed](#schema123listboxed)
sealed interface for validated payloads | +| record | [ObjectWithDifficultlyNamedProps.Schema123listBoxedString](#schema123listboxedstring)
boxed class to store validated String payloads | | static class | [ObjectWithDifficultlyNamedProps.Schema123list](#schema123list)
schema class | -| static class | [ObjectWithDifficultlyNamedProps.SpecialpropertynameBoxed](#specialpropertynameboxed)
abstract sealed validated payload class | -| static class | [ObjectWithDifficultlyNamedProps.SpecialpropertynameBoxedNumber](#specialpropertynameboxednumber)
boxed class to store validated Number payloads | +| sealed interface | [ObjectWithDifficultlyNamedProps.SpecialpropertynameBoxed](#specialpropertynameboxed)
sealed interface for validated payloads | +| record | [ObjectWithDifficultlyNamedProps.SpecialpropertynameBoxedNumber](#specialpropertynameboxednumber)
boxed class to store validated Number payloads | | static class | [ObjectWithDifficultlyNamedProps.Specialpropertyname](#specialpropertyname)
schema class | ## ObjectWithDifficultlyNamedProps1Boxed -public static abstract sealed class ObjectWithDifficultlyNamedProps1Boxed
+public sealed interface ObjectWithDifficultlyNamedProps1Boxed
permits
[ObjectWithDifficultlyNamedProps1BoxedMap](#objectwithdifficultlynamedprops1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ObjectWithDifficultlyNamedProps1BoxedMap -public static final class ObjectWithDifficultlyNamedProps1BoxedMap
-extends [ObjectWithDifficultlyNamedProps1Boxed](#objectwithdifficultlynamedprops1boxed) +public record ObjectWithDifficultlyNamedProps1BoxedMap
+implements [ObjectWithDifficultlyNamedProps1Boxed](#objectwithdifficultlynamedprops1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ObjectWithDifficultlyNamedProps1BoxedMap([ObjectWithDifficultlyNamedPropsMap](#objectwithdifficultlynamedpropsmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [ObjectWithDifficultlyNamedPropsMap](#objectwithdifficultlynamedpropsmap) | data
validated payload | +| [ObjectWithDifficultlyNamedPropsMap](#objectwithdifficultlynamedpropsmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ObjectWithDifficultlyNamedProps1 public static class ObjectWithDifficultlyNamedProps1
@@ -101,7 +102,9 @@ ObjectWithDifficultlyNamedProps.ObjectWithDifficultlyNamedPropsMap validatedPayl | ----------------- | ---------------------- | | [ObjectWithDifficultlyNamedPropsMap](#objectwithdifficultlynamedpropsmap) | validate([Map<?, ?>](#objectwithdifficultlynamedpropsmapbuilder) arg, SchemaConfiguration configuration) | | [ObjectWithDifficultlyNamedProps1BoxedMap](#objectwithdifficultlynamedprops1boxedmap) | validateAndBox([Map<?, ?>](#objectwithdifficultlynamedpropsmapbuilder) arg, SchemaConfiguration configuration) | +| [ObjectWithDifficultlyNamedProps1Boxed](#objectwithdifficultlynamedprops1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ObjectWithDifficultlyNamedPropsMap0Builder public class ObjectWithDifficultlyNamedPropsMap0Builder
builder for `Map` @@ -165,27 +168,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## Schema123NumberBoxed -public static abstract sealed class Schema123NumberBoxed
+public sealed interface Schema123NumberBoxed
permits
[Schema123NumberBoxedNumber](#schema123numberboxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema123NumberBoxedNumber -public static final class Schema123NumberBoxedNumber
-extends [Schema123NumberBoxed](#schema123numberboxed) +public record Schema123NumberBoxedNumber
+implements [Schema123NumberBoxed](#schema123numberboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema123NumberBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema123Number public static class Schema123Number
@@ -199,27 +203,28 @@ A schema class that validates payloads | validateAndBox | ## Schema123listBoxed -public static abstract sealed class Schema123listBoxed
+public sealed interface Schema123listBoxed
permits
[Schema123listBoxedString](#schema123listboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema123listBoxedString -public static final class Schema123listBoxedString
-extends [Schema123listBoxed](#schema123listboxed) +public record Schema123listBoxedString
+implements [Schema123listBoxed](#schema123listboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema123listBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema123list public static class Schema123list
@@ -233,27 +238,28 @@ A schema class that validates payloads | validateAndBox | ## SpecialpropertynameBoxed -public static abstract sealed class SpecialpropertynameBoxed
+public sealed interface SpecialpropertynameBoxed
permits
[SpecialpropertynameBoxedNumber](#specialpropertynameboxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## SpecialpropertynameBoxedNumber -public static final class SpecialpropertynameBoxedNumber
-extends [SpecialpropertynameBoxed](#specialpropertynameboxed) +public record SpecialpropertynameBoxedNumber
+implements [SpecialpropertynameBoxed](#specialpropertynameboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | SpecialpropertynameBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Specialpropertyname public static class Specialpropertyname
diff --git a/samples/client/petstore/java/docs/components/schemas/ObjectWithInlineCompositionProperty.md b/samples/client/petstore/java/docs/components/schemas/ObjectWithInlineCompositionProperty.md index f5343ae68cf..a1f3a503a18 100644 --- a/samples/client/petstore/java/docs/components/schemas/ObjectWithInlineCompositionProperty.md +++ b/samples/client/petstore/java/docs/components/schemas/ObjectWithInlineCompositionProperty.md @@ -4,7 +4,7 @@ public class ObjectWithInlineCompositionProperty
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,45 +12,46 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ObjectWithInlineCompositionProperty.ObjectWithInlineCompositionProperty1Boxed](#objectwithinlinecompositionproperty1boxed)
abstract sealed validated payload class | -| static class | [ObjectWithInlineCompositionProperty.ObjectWithInlineCompositionProperty1BoxedMap](#objectwithinlinecompositionproperty1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ObjectWithInlineCompositionProperty.ObjectWithInlineCompositionProperty1Boxed](#objectwithinlinecompositionproperty1boxed)
sealed interface for validated payloads | +| record | [ObjectWithInlineCompositionProperty.ObjectWithInlineCompositionProperty1BoxedMap](#objectwithinlinecompositionproperty1boxedmap)
boxed class to store validated Map payloads | | static class | [ObjectWithInlineCompositionProperty.ObjectWithInlineCompositionProperty1](#objectwithinlinecompositionproperty1)
schema class | | static class | [ObjectWithInlineCompositionProperty.ObjectWithInlineCompositionPropertyMapBuilder](#objectwithinlinecompositionpropertymapbuilder)
builder for Map payloads | | static class | [ObjectWithInlineCompositionProperty.ObjectWithInlineCompositionPropertyMap](#objectwithinlinecompositionpropertymap)
output class for Map payloads | -| static class | [ObjectWithInlineCompositionProperty.SomePropBoxed](#somepropboxed)
abstract sealed validated payload class | -| static class | [ObjectWithInlineCompositionProperty.SomePropBoxedVoid](#somepropboxedvoid)
boxed class to store validated null payloads | -| static class | [ObjectWithInlineCompositionProperty.SomePropBoxedBoolean](#somepropboxedboolean)
boxed class to store validated boolean payloads | -| static class | [ObjectWithInlineCompositionProperty.SomePropBoxedNumber](#somepropboxednumber)
boxed class to store validated Number payloads | -| static class | [ObjectWithInlineCompositionProperty.SomePropBoxedString](#somepropboxedstring)
boxed class to store validated String payloads | -| static class | [ObjectWithInlineCompositionProperty.SomePropBoxedList](#somepropboxedlist)
boxed class to store validated List payloads | -| static class | [ObjectWithInlineCompositionProperty.SomePropBoxedMap](#somepropboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ObjectWithInlineCompositionProperty.SomePropBoxed](#somepropboxed)
sealed interface for validated payloads | +| record | [ObjectWithInlineCompositionProperty.SomePropBoxedVoid](#somepropboxedvoid)
boxed class to store validated null payloads | +| record | [ObjectWithInlineCompositionProperty.SomePropBoxedBoolean](#somepropboxedboolean)
boxed class to store validated boolean payloads | +| record | [ObjectWithInlineCompositionProperty.SomePropBoxedNumber](#somepropboxednumber)
boxed class to store validated Number payloads | +| record | [ObjectWithInlineCompositionProperty.SomePropBoxedString](#somepropboxedstring)
boxed class to store validated String payloads | +| record | [ObjectWithInlineCompositionProperty.SomePropBoxedList](#somepropboxedlist)
boxed class to store validated List payloads | +| record | [ObjectWithInlineCompositionProperty.SomePropBoxedMap](#somepropboxedmap)
boxed class to store validated Map payloads | | static class | [ObjectWithInlineCompositionProperty.SomeProp](#someprop)
schema class | -| static class | [ObjectWithInlineCompositionProperty.Schema0Boxed](#schema0boxed)
abstract sealed validated payload class | -| static class | [ObjectWithInlineCompositionProperty.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | +| sealed interface | [ObjectWithInlineCompositionProperty.Schema0Boxed](#schema0boxed)
sealed interface for validated payloads | +| record | [ObjectWithInlineCompositionProperty.Schema0BoxedString](#schema0boxedstring)
boxed class to store validated String payloads | | static class | [ObjectWithInlineCompositionProperty.Schema0](#schema0)
schema class | ## ObjectWithInlineCompositionProperty1Boxed -public static abstract sealed class ObjectWithInlineCompositionProperty1Boxed
+public sealed interface ObjectWithInlineCompositionProperty1Boxed
permits
[ObjectWithInlineCompositionProperty1BoxedMap](#objectwithinlinecompositionproperty1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ObjectWithInlineCompositionProperty1BoxedMap -public static final class ObjectWithInlineCompositionProperty1BoxedMap
-extends [ObjectWithInlineCompositionProperty1Boxed](#objectwithinlinecompositionproperty1boxed) +public record ObjectWithInlineCompositionProperty1BoxedMap
+implements [ObjectWithInlineCompositionProperty1Boxed](#objectwithinlinecompositionproperty1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ObjectWithInlineCompositionProperty1BoxedMap([ObjectWithInlineCompositionPropertyMap](#objectwithinlinecompositionpropertymap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [ObjectWithInlineCompositionPropertyMap](#objectwithinlinecompositionpropertymap) | data
validated payload | +| [ObjectWithInlineCompositionPropertyMap](#objectwithinlinecompositionpropertymap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ObjectWithInlineCompositionProperty1 public static class ObjectWithInlineCompositionProperty1
@@ -93,7 +94,9 @@ ObjectWithInlineCompositionProperty.ObjectWithInlineCompositionPropertyMap valid | ----------------- | ---------------------- | | [ObjectWithInlineCompositionPropertyMap](#objectwithinlinecompositionpropertymap) | validate([Map<?, ?>](#objectwithinlinecompositionpropertymapbuilder) arg, SchemaConfiguration configuration) | | [ObjectWithInlineCompositionProperty1BoxedMap](#objectwithinlinecompositionproperty1boxedmap) | validateAndBox([Map<?, ?>](#objectwithinlinecompositionpropertymapbuilder) arg, SchemaConfiguration configuration) | +| [ObjectWithInlineCompositionProperty1Boxed](#objectwithinlinecompositionproperty1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ObjectWithInlineCompositionPropertyMapBuilder public class ObjectWithInlineCompositionPropertyMapBuilder
builder for `Map` @@ -142,7 +145,7 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## SomePropBoxed -public static abstract sealed class SomePropBoxed
+public sealed interface SomePropBoxed
permits
[SomePropBoxedVoid](#somepropboxedvoid), [SomePropBoxedBoolean](#somepropboxedboolean), @@ -151,103 +154,109 @@ permits
[SomePropBoxedList](#somepropboxedlist), [SomePropBoxedMap](#somepropboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## SomePropBoxedVoid -public static final class SomePropBoxedVoid
-extends [SomePropBoxed](#somepropboxed) +public record SomePropBoxedVoid
+implements [SomePropBoxed](#somepropboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | SomePropBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## SomePropBoxedBoolean -public static final class SomePropBoxedBoolean
-extends [SomePropBoxed](#somepropboxed) +public record SomePropBoxedBoolean
+implements [SomePropBoxed](#somepropboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | SomePropBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## SomePropBoxedNumber -public static final class SomePropBoxedNumber
-extends [SomePropBoxed](#somepropboxed) +public record SomePropBoxedNumber
+implements [SomePropBoxed](#somepropboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | SomePropBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## SomePropBoxedString -public static final class SomePropBoxedString
-extends [SomePropBoxed](#somepropboxed) +public record SomePropBoxedString
+implements [SomePropBoxed](#somepropboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | SomePropBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## SomePropBoxedList -public static final class SomePropBoxedList
-extends [SomePropBoxed](#somepropboxed) +public record SomePropBoxedList
+implements [SomePropBoxed](#somepropboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | SomePropBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## SomePropBoxedMap -public static final class SomePropBoxedMap
-extends [SomePropBoxed](#somepropboxed) +public record SomePropBoxedMap
+implements [SomePropBoxed](#somepropboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | SomePropBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## SomeProp public static class SomeProp
@@ -279,29 +288,32 @@ A schema class that validates payloads | [SomePropBoxedBoolean](#somepropboxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [SomePropBoxedMap](#somepropboxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [SomePropBoxedList](#somepropboxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [SomePropBoxed](#somepropboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema0Boxed -public static abstract sealed class Schema0Boxed
+public sealed interface Schema0Boxed
permits
[Schema0BoxedString](#schema0boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema0BoxedString -public static final class Schema0BoxedString
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedString
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0 public static class Schema0
@@ -342,5 +354,7 @@ String validatedPayload = ObjectWithInlineCompositionProperty.Schema0.validate( | ----------------- | ---------------------- | | String | validate(String arg, SchemaConfiguration configuration) | | [Schema0BoxedString](#schema0boxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [Schema0Boxed](#schema0boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/components/schemas/ObjectWithInvalidNamedRefedProperties.md b/samples/client/petstore/java/docs/components/schemas/ObjectWithInvalidNamedRefedProperties.md index d2ddbc18d91..2781f484279 100644 --- a/samples/client/petstore/java/docs/components/schemas/ObjectWithInvalidNamedRefedProperties.md +++ b/samples/client/petstore/java/docs/components/schemas/ObjectWithInvalidNamedRefedProperties.md @@ -4,7 +4,7 @@ public class ObjectWithInvalidNamedRefedProperties
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,34 +12,35 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ObjectWithInvalidNamedRefedProperties.ObjectWithInvalidNamedRefedProperties1Boxed](#objectwithinvalidnamedrefedproperties1boxed)
abstract sealed validated payload class | -| static class | [ObjectWithInvalidNamedRefedProperties.ObjectWithInvalidNamedRefedProperties1BoxedMap](#objectwithinvalidnamedrefedproperties1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ObjectWithInvalidNamedRefedProperties.ObjectWithInvalidNamedRefedProperties1Boxed](#objectwithinvalidnamedrefedproperties1boxed)
sealed interface for validated payloads | +| record | [ObjectWithInvalidNamedRefedProperties.ObjectWithInvalidNamedRefedProperties1BoxedMap](#objectwithinvalidnamedrefedproperties1boxedmap)
boxed class to store validated Map payloads | | static class | [ObjectWithInvalidNamedRefedProperties.ObjectWithInvalidNamedRefedProperties1](#objectwithinvalidnamedrefedproperties1)
schema class | | static class | [ObjectWithInvalidNamedRefedProperties.ObjectWithInvalidNamedRefedPropertiesMapBuilder](#objectwithinvalidnamedrefedpropertiesmapbuilder)
builder for Map payloads | | static class | [ObjectWithInvalidNamedRefedProperties.ObjectWithInvalidNamedRefedPropertiesMap](#objectwithinvalidnamedrefedpropertiesmap)
output class for Map payloads | ## ObjectWithInvalidNamedRefedProperties1Boxed -public static abstract sealed class ObjectWithInvalidNamedRefedProperties1Boxed
+public sealed interface ObjectWithInvalidNamedRefedProperties1Boxed
permits
[ObjectWithInvalidNamedRefedProperties1BoxedMap](#objectwithinvalidnamedrefedproperties1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ObjectWithInvalidNamedRefedProperties1BoxedMap -public static final class ObjectWithInvalidNamedRefedProperties1BoxedMap
-extends [ObjectWithInvalidNamedRefedProperties1Boxed](#objectwithinvalidnamedrefedproperties1boxed) +public record ObjectWithInvalidNamedRefedProperties1BoxedMap
+implements [ObjectWithInvalidNamedRefedProperties1Boxed](#objectwithinvalidnamedrefedproperties1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ObjectWithInvalidNamedRefedProperties1BoxedMap([ObjectWithInvalidNamedRefedPropertiesMap](#objectwithinvalidnamedrefedpropertiesmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [ObjectWithInvalidNamedRefedPropertiesMap](#objectwithinvalidnamedrefedpropertiesmap) | data
validated payload | +| [ObjectWithInvalidNamedRefedPropertiesMap](#objectwithinvalidnamedrefedpropertiesmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ObjectWithInvalidNamedRefedProperties1 public static class ObjectWithInvalidNamedRefedProperties1
@@ -100,7 +101,9 @@ ObjectWithInvalidNamedRefedProperties.ObjectWithInvalidNamedRefedPropertiesMap v | ----------------- | ---------------------- | | [ObjectWithInvalidNamedRefedPropertiesMap](#objectwithinvalidnamedrefedpropertiesmap) | validate([Map<?, ?>](#objectwithinvalidnamedrefedpropertiesmapbuilder) arg, SchemaConfiguration configuration) | | [ObjectWithInvalidNamedRefedProperties1BoxedMap](#objectwithinvalidnamedrefedproperties1boxedmap) | validateAndBox([Map<?, ?>](#objectwithinvalidnamedrefedpropertiesmapbuilder) arg, SchemaConfiguration configuration) | +| [ObjectWithInvalidNamedRefedProperties1Boxed](#objectwithinvalidnamedrefedproperties1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ObjectWithInvalidNamedRefedPropertiesMap00Builder public class ObjectWithInvalidNamedRefedPropertiesMap00Builder
builder for `Map` diff --git a/samples/client/petstore/java/docs/components/schemas/ObjectWithNonIntersectingValues.md b/samples/client/petstore/java/docs/components/schemas/ObjectWithNonIntersectingValues.md index 61ea260b3eb..8a10aef5011 100644 --- a/samples/client/petstore/java/docs/components/schemas/ObjectWithNonIntersectingValues.md +++ b/samples/client/petstore/java/docs/components/schemas/ObjectWithNonIntersectingValues.md @@ -4,7 +4,7 @@ public class ObjectWithNonIntersectingValues
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,40 +12,41 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ObjectWithNonIntersectingValues.ObjectWithNonIntersectingValues1Boxed](#objectwithnonintersectingvalues1boxed)
abstract sealed validated payload class | -| static class | [ObjectWithNonIntersectingValues.ObjectWithNonIntersectingValues1BoxedMap](#objectwithnonintersectingvalues1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ObjectWithNonIntersectingValues.ObjectWithNonIntersectingValues1Boxed](#objectwithnonintersectingvalues1boxed)
sealed interface for validated payloads | +| record | [ObjectWithNonIntersectingValues.ObjectWithNonIntersectingValues1BoxedMap](#objectwithnonintersectingvalues1boxedmap)
boxed class to store validated Map payloads | | static class | [ObjectWithNonIntersectingValues.ObjectWithNonIntersectingValues1](#objectwithnonintersectingvalues1)
schema class | | static class | [ObjectWithNonIntersectingValues.ObjectWithNonIntersectingValuesMapBuilder](#objectwithnonintersectingvaluesmapbuilder)
builder for Map payloads | | static class | [ObjectWithNonIntersectingValues.ObjectWithNonIntersectingValuesMap](#objectwithnonintersectingvaluesmap)
output class for Map payloads | -| static class | [ObjectWithNonIntersectingValues.ABoxed](#aboxed)
abstract sealed validated payload class | -| static class | [ObjectWithNonIntersectingValues.ABoxedNumber](#aboxednumber)
boxed class to store validated Number payloads | +| sealed interface | [ObjectWithNonIntersectingValues.ABoxed](#aboxed)
sealed interface for validated payloads | +| record | [ObjectWithNonIntersectingValues.ABoxedNumber](#aboxednumber)
boxed class to store validated Number payloads | | static class | [ObjectWithNonIntersectingValues.A](#a)
schema class | -| static class | [ObjectWithNonIntersectingValues.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
abstract sealed validated payload class | -| static class | [ObjectWithNonIntersectingValues.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | +| sealed interface | [ObjectWithNonIntersectingValues.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
sealed interface for validated payloads | +| record | [ObjectWithNonIntersectingValues.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | | static class | [ObjectWithNonIntersectingValues.AdditionalProperties](#additionalproperties)
schema class | ## ObjectWithNonIntersectingValues1Boxed -public static abstract sealed class ObjectWithNonIntersectingValues1Boxed
+public sealed interface ObjectWithNonIntersectingValues1Boxed
permits
[ObjectWithNonIntersectingValues1BoxedMap](#objectwithnonintersectingvalues1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ObjectWithNonIntersectingValues1BoxedMap -public static final class ObjectWithNonIntersectingValues1BoxedMap
-extends [ObjectWithNonIntersectingValues1Boxed](#objectwithnonintersectingvalues1boxed) +public record ObjectWithNonIntersectingValues1BoxedMap
+implements [ObjectWithNonIntersectingValues1Boxed](#objectwithnonintersectingvalues1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ObjectWithNonIntersectingValues1BoxedMap([ObjectWithNonIntersectingValuesMap](#objectwithnonintersectingvaluesmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [ObjectWithNonIntersectingValuesMap](#objectwithnonintersectingvaluesmap) | data
validated payload | +| [ObjectWithNonIntersectingValuesMap](#objectwithnonintersectingvaluesmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ObjectWithNonIntersectingValues1 public static class ObjectWithNonIntersectingValues1
@@ -93,7 +94,9 @@ ObjectWithNonIntersectingValues.ObjectWithNonIntersectingValuesMap validatedPayl | ----------------- | ---------------------- | | [ObjectWithNonIntersectingValuesMap](#objectwithnonintersectingvaluesmap) | validate([Map<?, ?>](#objectwithnonintersectingvaluesmapbuilder) arg, SchemaConfiguration configuration) | | [ObjectWithNonIntersectingValues1BoxedMap](#objectwithnonintersectingvalues1boxedmap) | validateAndBox([Map<?, ?>](#objectwithnonintersectingvaluesmapbuilder) arg, SchemaConfiguration configuration) | +| [ObjectWithNonIntersectingValues1Boxed](#objectwithnonintersectingvalues1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ObjectWithNonIntersectingValuesMapBuilder public class ObjectWithNonIntersectingValuesMapBuilder
builder for `Map` @@ -129,27 +132,28 @@ A class to store validated Map payloads | String | getAdditionalProperty(String name)
provides type safety for additional properties | ## ABoxed -public static abstract sealed class ABoxed
+public sealed interface ABoxed
permits
[ABoxedNumber](#aboxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ABoxedNumber -public static final class ABoxedNumber
-extends [ABoxed](#aboxed) +public record ABoxedNumber
+implements [ABoxed](#aboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ABoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## A public static class A
@@ -163,27 +167,28 @@ A schema class that validates payloads | validateAndBox | ## AdditionalPropertiesBoxed -public static abstract sealed class AdditionalPropertiesBoxed
+public sealed interface AdditionalPropertiesBoxed
permits
[AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AdditionalPropertiesBoxedString -public static final class AdditionalPropertiesBoxedString
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedString
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalProperties public static class AdditionalProperties
diff --git a/samples/client/petstore/java/docs/components/schemas/ObjectWithOnlyOptionalProps.md b/samples/client/petstore/java/docs/components/schemas/ObjectWithOnlyOptionalProps.md index 08ad45b67d2..63728fa701c 100644 --- a/samples/client/petstore/java/docs/components/schemas/ObjectWithOnlyOptionalProps.md +++ b/samples/client/petstore/java/docs/components/schemas/ObjectWithOnlyOptionalProps.md @@ -4,7 +4,7 @@ public class ObjectWithOnlyOptionalProps
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,48 +12,49 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ObjectWithOnlyOptionalProps.ObjectWithOnlyOptionalProps1Boxed](#objectwithonlyoptionalprops1boxed)
abstract sealed validated payload class | -| static class | [ObjectWithOnlyOptionalProps.ObjectWithOnlyOptionalProps1BoxedMap](#objectwithonlyoptionalprops1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ObjectWithOnlyOptionalProps.ObjectWithOnlyOptionalProps1Boxed](#objectwithonlyoptionalprops1boxed)
sealed interface for validated payloads | +| record | [ObjectWithOnlyOptionalProps.ObjectWithOnlyOptionalProps1BoxedMap](#objectwithonlyoptionalprops1boxedmap)
boxed class to store validated Map payloads | | static class | [ObjectWithOnlyOptionalProps.ObjectWithOnlyOptionalProps1](#objectwithonlyoptionalprops1)
schema class | | static class | [ObjectWithOnlyOptionalProps.ObjectWithOnlyOptionalPropsMapBuilder](#objectwithonlyoptionalpropsmapbuilder)
builder for Map payloads | | static class | [ObjectWithOnlyOptionalProps.ObjectWithOnlyOptionalPropsMap](#objectwithonlyoptionalpropsmap)
output class for Map payloads | -| static class | [ObjectWithOnlyOptionalProps.BBoxed](#bboxed)
abstract sealed validated payload class | -| static class | [ObjectWithOnlyOptionalProps.BBoxedNumber](#bboxednumber)
boxed class to store validated Number payloads | +| sealed interface | [ObjectWithOnlyOptionalProps.BBoxed](#bboxed)
sealed interface for validated payloads | +| record | [ObjectWithOnlyOptionalProps.BBoxedNumber](#bboxednumber)
boxed class to store validated Number payloads | | static class | [ObjectWithOnlyOptionalProps.B](#b)
schema class | -| static class | [ObjectWithOnlyOptionalProps.ABoxed](#aboxed)
abstract sealed validated payload class | -| static class | [ObjectWithOnlyOptionalProps.ABoxedString](#aboxedstring)
boxed class to store validated String payloads | +| sealed interface | [ObjectWithOnlyOptionalProps.ABoxed](#aboxed)
sealed interface for validated payloads | +| record | [ObjectWithOnlyOptionalProps.ABoxedString](#aboxedstring)
boxed class to store validated String payloads | | static class | [ObjectWithOnlyOptionalProps.A](#a)
schema class | -| static class | [ObjectWithOnlyOptionalProps.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
abstract sealed validated payload class | -| static class | [ObjectWithOnlyOptionalProps.AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid)
boxed class to store validated null payloads | -| static class | [ObjectWithOnlyOptionalProps.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | -| static class | [ObjectWithOnlyOptionalProps.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | -| static class | [ObjectWithOnlyOptionalProps.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | -| static class | [ObjectWithOnlyOptionalProps.AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist)
boxed class to store validated List payloads | -| static class | [ObjectWithOnlyOptionalProps.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ObjectWithOnlyOptionalProps.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
sealed interface for validated payloads | +| record | [ObjectWithOnlyOptionalProps.AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid)
boxed class to store validated null payloads | +| record | [ObjectWithOnlyOptionalProps.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | +| record | [ObjectWithOnlyOptionalProps.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | +| record | [ObjectWithOnlyOptionalProps.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | +| record | [ObjectWithOnlyOptionalProps.AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist)
boxed class to store validated List payloads | +| record | [ObjectWithOnlyOptionalProps.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | | static class | [ObjectWithOnlyOptionalProps.AdditionalProperties](#additionalproperties)
schema class | ## ObjectWithOnlyOptionalProps1Boxed -public static abstract sealed class ObjectWithOnlyOptionalProps1Boxed
+public sealed interface ObjectWithOnlyOptionalProps1Boxed
permits
[ObjectWithOnlyOptionalProps1BoxedMap](#objectwithonlyoptionalprops1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ObjectWithOnlyOptionalProps1BoxedMap -public static final class ObjectWithOnlyOptionalProps1BoxedMap
-extends [ObjectWithOnlyOptionalProps1Boxed](#objectwithonlyoptionalprops1boxed) +public record ObjectWithOnlyOptionalProps1BoxedMap
+implements [ObjectWithOnlyOptionalProps1Boxed](#objectwithonlyoptionalprops1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ObjectWithOnlyOptionalProps1BoxedMap([ObjectWithOnlyOptionalPropsMap](#objectwithonlyoptionalpropsmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [ObjectWithOnlyOptionalPropsMap](#objectwithonlyoptionalpropsmap) | data
validated payload | +| [ObjectWithOnlyOptionalPropsMap](#objectwithonlyoptionalpropsmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ObjectWithOnlyOptionalProps1 public static class ObjectWithOnlyOptionalProps1
@@ -101,7 +102,9 @@ ObjectWithOnlyOptionalProps.ObjectWithOnlyOptionalPropsMap validatedPayload = | ----------------- | ---------------------- | | [ObjectWithOnlyOptionalPropsMap](#objectwithonlyoptionalpropsmap) | validate([Map<?, ?>](#objectwithonlyoptionalpropsmapbuilder) arg, SchemaConfiguration configuration) | | [ObjectWithOnlyOptionalProps1BoxedMap](#objectwithonlyoptionalprops1boxedmap) | validateAndBox([Map<?, ?>](#objectwithonlyoptionalpropsmapbuilder) arg, SchemaConfiguration configuration) | +| [ObjectWithOnlyOptionalProps1Boxed](#objectwithonlyoptionalprops1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ObjectWithOnlyOptionalPropsMapBuilder public class ObjectWithOnlyOptionalPropsMapBuilder
builder for `Map` @@ -137,27 +140,28 @@ A class to store validated Map payloads | Number | b()
[optional] | ## BBoxed -public static abstract sealed class BBoxed
+public sealed interface BBoxed
permits
[BBoxedNumber](#bboxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## BBoxedNumber -public static final class BBoxedNumber
-extends [BBoxed](#bboxed) +public record BBoxedNumber
+implements [BBoxed](#bboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## B public static class B
@@ -171,27 +175,28 @@ A schema class that validates payloads | validateAndBox | ## ABoxed -public static abstract sealed class ABoxed
+public sealed interface ABoxed
permits
[ABoxedString](#aboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ABoxedString -public static final class ABoxedString
-extends [ABoxed](#aboxed) +public record ABoxedString
+implements [ABoxed](#aboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ABoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## A public static class A
@@ -205,7 +210,7 @@ A schema class that validates payloads | validateAndBox | ## AdditionalPropertiesBoxed -public static abstract sealed class AdditionalPropertiesBoxed
+public sealed interface AdditionalPropertiesBoxed
permits
[AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid), [AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean), @@ -214,103 +219,109 @@ permits
[AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist), [AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AdditionalPropertiesBoxedVoid -public static final class AdditionalPropertiesBoxedVoid
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedVoid
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedBoolean -public static final class AdditionalPropertiesBoxedBoolean
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedBoolean
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedNumber -public static final class AdditionalPropertiesBoxedNumber
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedNumber
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedString -public static final class AdditionalPropertiesBoxedString
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedString
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedList -public static final class AdditionalPropertiesBoxedList
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedList
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedMap -public static final class AdditionalPropertiesBoxedMap
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedMap
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalProperties public static class AdditionalProperties
diff --git a/samples/client/petstore/java/docs/components/schemas/ObjectWithOptionalTestProp.md b/samples/client/petstore/java/docs/components/schemas/ObjectWithOptionalTestProp.md index 04b95767694..664620abbd4 100644 --- a/samples/client/petstore/java/docs/components/schemas/ObjectWithOptionalTestProp.md +++ b/samples/client/petstore/java/docs/components/schemas/ObjectWithOptionalTestProp.md @@ -4,7 +4,7 @@ public class ObjectWithOptionalTestProp
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,37 +12,38 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ObjectWithOptionalTestProp.ObjectWithOptionalTestProp1Boxed](#objectwithoptionaltestprop1boxed)
abstract sealed validated payload class | -| static class | [ObjectWithOptionalTestProp.ObjectWithOptionalTestProp1BoxedMap](#objectwithoptionaltestprop1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ObjectWithOptionalTestProp.ObjectWithOptionalTestProp1Boxed](#objectwithoptionaltestprop1boxed)
sealed interface for validated payloads | +| record | [ObjectWithOptionalTestProp.ObjectWithOptionalTestProp1BoxedMap](#objectwithoptionaltestprop1boxedmap)
boxed class to store validated Map payloads | | static class | [ObjectWithOptionalTestProp.ObjectWithOptionalTestProp1](#objectwithoptionaltestprop1)
schema class | | static class | [ObjectWithOptionalTestProp.ObjectWithOptionalTestPropMapBuilder](#objectwithoptionaltestpropmapbuilder)
builder for Map payloads | | static class | [ObjectWithOptionalTestProp.ObjectWithOptionalTestPropMap](#objectwithoptionaltestpropmap)
output class for Map payloads | -| static class | [ObjectWithOptionalTestProp.TestBoxed](#testboxed)
abstract sealed validated payload class | -| static class | [ObjectWithOptionalTestProp.TestBoxedString](#testboxedstring)
boxed class to store validated String payloads | +| sealed interface | [ObjectWithOptionalTestProp.TestBoxed](#testboxed)
sealed interface for validated payloads | +| record | [ObjectWithOptionalTestProp.TestBoxedString](#testboxedstring)
boxed class to store validated String payloads | | static class | [ObjectWithOptionalTestProp.Test](#test)
schema class | ## ObjectWithOptionalTestProp1Boxed -public static abstract sealed class ObjectWithOptionalTestProp1Boxed
+public sealed interface ObjectWithOptionalTestProp1Boxed
permits
[ObjectWithOptionalTestProp1BoxedMap](#objectwithoptionaltestprop1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ObjectWithOptionalTestProp1BoxedMap -public static final class ObjectWithOptionalTestProp1BoxedMap
-extends [ObjectWithOptionalTestProp1Boxed](#objectwithoptionaltestprop1boxed) +public record ObjectWithOptionalTestProp1BoxedMap
+implements [ObjectWithOptionalTestProp1Boxed](#objectwithoptionaltestprop1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ObjectWithOptionalTestProp1BoxedMap([ObjectWithOptionalTestPropMap](#objectwithoptionaltestpropmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [ObjectWithOptionalTestPropMap](#objectwithoptionaltestpropmap) | data
validated payload | +| [ObjectWithOptionalTestPropMap](#objectwithoptionaltestpropmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ObjectWithOptionalTestProp1 public static class ObjectWithOptionalTestProp1
@@ -87,7 +88,9 @@ ObjectWithOptionalTestProp.ObjectWithOptionalTestPropMap validatedPayload = | ----------------- | ---------------------- | | [ObjectWithOptionalTestPropMap](#objectwithoptionaltestpropmap) | validate([Map<?, ?>](#objectwithoptionaltestpropmapbuilder) arg, SchemaConfiguration configuration) | | [ObjectWithOptionalTestProp1BoxedMap](#objectwithoptionaltestprop1boxedmap) | validateAndBox([Map<?, ?>](#objectwithoptionaltestpropmapbuilder) arg, SchemaConfiguration configuration) | +| [ObjectWithOptionalTestProp1Boxed](#objectwithoptionaltestprop1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ObjectWithOptionalTestPropMapBuilder public class ObjectWithOptionalTestPropMapBuilder
builder for `Map` @@ -128,27 +131,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## TestBoxed -public static abstract sealed class TestBoxed
+public sealed interface TestBoxed
permits
[TestBoxedString](#testboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## TestBoxedString -public static final class TestBoxedString
-extends [TestBoxed](#testboxed) +public record TestBoxedString
+implements [TestBoxed](#testboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | TestBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Test public static class Test
diff --git a/samples/client/petstore/java/docs/components/schemas/ObjectWithValidations.md b/samples/client/petstore/java/docs/components/schemas/ObjectWithValidations.md index 188f62b7504..755fa9edbb3 100644 --- a/samples/client/petstore/java/docs/components/schemas/ObjectWithValidations.md +++ b/samples/client/petstore/java/docs/components/schemas/ObjectWithValidations.md @@ -4,38 +4,39 @@ public class ObjectWithValidations
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ObjectWithValidations.ObjectWithValidations1Boxed](#objectwithvalidations1boxed)
abstract sealed validated payload class | -| static class | [ObjectWithValidations.ObjectWithValidations1BoxedMap](#objectwithvalidations1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ObjectWithValidations.ObjectWithValidations1Boxed](#objectwithvalidations1boxed)
sealed interface for validated payloads | +| record | [ObjectWithValidations.ObjectWithValidations1BoxedMap](#objectwithvalidations1boxedmap)
boxed class to store validated Map payloads | | static class | [ObjectWithValidations.ObjectWithValidations1](#objectwithvalidations1)
schema class | ## ObjectWithValidations1Boxed -public static abstract sealed class ObjectWithValidations1Boxed
+public sealed interface ObjectWithValidations1Boxed
permits
[ObjectWithValidations1BoxedMap](#objectwithvalidations1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ObjectWithValidations1BoxedMap -public static final class ObjectWithValidations1BoxedMap
-extends [ObjectWithValidations1Boxed](#objectwithvalidations1boxed) +public record ObjectWithValidations1BoxedMap
+implements [ObjectWithValidations1Boxed](#objectwithvalidations1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ObjectWithValidations1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ObjectWithValidations1 public static class ObjectWithValidations1
@@ -54,5 +55,7 @@ A schema class that validates payloads | ----------------- | ---------------------- | | FrozenMap | validate(Map<?, ?> arg, SchemaConfiguration configuration) | | [ObjectWithValidations1BoxedMap](#objectwithvalidations1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | +| [ObjectWithValidations1Boxed](#objectwithvalidations1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/components/schemas/Order.md b/samples/client/petstore/java/docs/components/schemas/Order.md index acaf75e07cc..ba179bd12f8 100644 --- a/samples/client/petstore/java/docs/components/schemas/Order.md +++ b/samples/client/petstore/java/docs/components/schemas/Order.md @@ -4,7 +4,7 @@ public class Order
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -13,53 +13,54 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Order.Order1Boxed](#order1boxed)
abstract sealed validated payload class | -| static class | [Order.Order1BoxedMap](#order1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [Order.Order1Boxed](#order1boxed)
sealed interface for validated payloads | +| record | [Order.Order1BoxedMap](#order1boxedmap)
boxed class to store validated Map payloads | | static class | [Order.Order1](#order1)
schema class | | static class | [Order.OrderMapBuilder](#ordermapbuilder)
builder for Map payloads | | static class | [Order.OrderMap](#ordermap)
output class for Map payloads | -| static class | [Order.CompleteBoxed](#completeboxed)
abstract sealed validated payload class | -| static class | [Order.CompleteBoxedBoolean](#completeboxedboolean)
boxed class to store validated boolean payloads | +| sealed interface | [Order.CompleteBoxed](#completeboxed)
sealed interface for validated payloads | +| record | [Order.CompleteBoxedBoolean](#completeboxedboolean)
boxed class to store validated boolean payloads | | static class | [Order.Complete](#complete)
schema class | -| static class | [Order.StatusBoxed](#statusboxed)
abstract sealed validated payload class | -| static class | [Order.StatusBoxedString](#statusboxedstring)
boxed class to store validated String payloads | +| sealed interface | [Order.StatusBoxed](#statusboxed)
sealed interface for validated payloads | +| record | [Order.StatusBoxedString](#statusboxedstring)
boxed class to store validated String payloads | | static class | [Order.Status](#status)
schema class | | enum | [Order.StringStatusEnums](#stringstatusenums)
String enum | -| static class | [Order.ShipDateBoxed](#shipdateboxed)
abstract sealed validated payload class | -| static class | [Order.ShipDateBoxedString](#shipdateboxedstring)
boxed class to store validated String payloads | +| sealed interface | [Order.ShipDateBoxed](#shipdateboxed)
sealed interface for validated payloads | +| record | [Order.ShipDateBoxedString](#shipdateboxedstring)
boxed class to store validated String payloads | | static class | [Order.ShipDate](#shipdate)
schema class | -| static class | [Order.QuantityBoxed](#quantityboxed)
abstract sealed validated payload class | -| static class | [Order.QuantityBoxedNumber](#quantityboxednumber)
boxed class to store validated Number payloads | +| sealed interface | [Order.QuantityBoxed](#quantityboxed)
sealed interface for validated payloads | +| record | [Order.QuantityBoxedNumber](#quantityboxednumber)
boxed class to store validated Number payloads | | static class | [Order.Quantity](#quantity)
schema class | -| static class | [Order.PetIdBoxed](#petidboxed)
abstract sealed validated payload class | -| static class | [Order.PetIdBoxedNumber](#petidboxednumber)
boxed class to store validated Number payloads | +| sealed interface | [Order.PetIdBoxed](#petidboxed)
sealed interface for validated payloads | +| record | [Order.PetIdBoxedNumber](#petidboxednumber)
boxed class to store validated Number payloads | | static class | [Order.PetId](#petid)
schema class | -| static class | [Order.IdBoxed](#idboxed)
abstract sealed validated payload class | -| static class | [Order.IdBoxedNumber](#idboxednumber)
boxed class to store validated Number payloads | +| sealed interface | [Order.IdBoxed](#idboxed)
sealed interface for validated payloads | +| record | [Order.IdBoxedNumber](#idboxednumber)
boxed class to store validated Number payloads | | static class | [Order.Id](#id)
schema class | ## Order1Boxed -public static abstract sealed class Order1Boxed
+public sealed interface Order1Boxed
permits
[Order1BoxedMap](#order1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Order1BoxedMap -public static final class Order1BoxedMap
-extends [Order1Boxed](#order1boxed) +public record Order1BoxedMap
+implements [Order1Boxed](#order1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Order1BoxedMap([OrderMap](#ordermap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [OrderMap](#ordermap) | data
validated payload | +| [OrderMap](#ordermap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Order1 public static class Order1
@@ -114,7 +115,9 @@ Order.OrderMap validatedPayload = | ----------------- | ---------------------- | | [OrderMap](#ordermap) | validate([Map<?, ?>](#ordermapbuilder) arg, SchemaConfiguration configuration) | | [Order1BoxedMap](#order1boxedmap) | validateAndBox([Map<?, ?>](#ordermapbuilder) arg, SchemaConfiguration configuration) | +| [Order1Boxed](#order1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## OrderMapBuilder public class OrderMapBuilder
builder for `Map` @@ -173,27 +176,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## CompleteBoxed -public static abstract sealed class CompleteBoxed
+public sealed interface CompleteBoxed
permits
[CompleteBoxedBoolean](#completeboxedboolean) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## CompleteBoxedBoolean -public static final class CompleteBoxedBoolean
-extends [CompleteBoxed](#completeboxed) +public record CompleteBoxedBoolean
+implements [CompleteBoxed](#completeboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | CompleteBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Complete public static class Complete
@@ -207,27 +211,28 @@ A schema class that validates payloads | validateAndBox | ## StatusBoxed -public static abstract sealed class StatusBoxed
+public sealed interface StatusBoxed
permits
[StatusBoxedString](#statusboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## StatusBoxedString -public static final class StatusBoxedString
-extends [StatusBoxed](#statusboxed) +public record StatusBoxedString
+implements [StatusBoxed](#statusboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | StatusBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Status public static class Status
@@ -272,7 +277,9 @@ String validatedPayload = Order.Status.validate( | String | validate(String arg, SchemaConfiguration configuration) | | String | validate([StringStatusEnums](#stringstatusenums) arg, SchemaConfiguration configuration) | | [StatusBoxedString](#statusboxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [StatusBoxed](#statusboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## StringStatusEnums public enum StringStatusEnums
extends `Enum` @@ -287,27 +294,28 @@ A class that stores String enum values | DELIVERED | value = "delivered" | ## ShipDateBoxed -public static abstract sealed class ShipDateBoxed
+public sealed interface ShipDateBoxed
permits
[ShipDateBoxedString](#shipdateboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ShipDateBoxedString -public static final class ShipDateBoxedString
-extends [ShipDateBoxed](#shipdateboxed) +public record ShipDateBoxedString
+implements [ShipDateBoxed](#shipdateboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ShipDateBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ShipDate public static class ShipDate
@@ -321,27 +329,28 @@ A schema class that validates payloads | validateAndBox | ## QuantityBoxed -public static abstract sealed class QuantityBoxed
+public sealed interface QuantityBoxed
permits
[QuantityBoxedNumber](#quantityboxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## QuantityBoxedNumber -public static final class QuantityBoxedNumber
-extends [QuantityBoxed](#quantityboxed) +public record QuantityBoxedNumber
+implements [QuantityBoxed](#quantityboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | QuantityBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Quantity public static class Quantity
@@ -355,27 +364,28 @@ A schema class that validates payloads | validateAndBox | ## PetIdBoxed -public static abstract sealed class PetIdBoxed
+public sealed interface PetIdBoxed
permits
[PetIdBoxedNumber](#petidboxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## PetIdBoxedNumber -public static final class PetIdBoxedNumber
-extends [PetIdBoxed](#petidboxed) +public record PetIdBoxedNumber
+implements [PetIdBoxed](#petidboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PetIdBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PetId public static class PetId
@@ -389,27 +399,28 @@ A schema class that validates payloads | validateAndBox | ## IdBoxed -public static abstract sealed class IdBoxed
+public sealed interface IdBoxed
permits
[IdBoxedNumber](#idboxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## IdBoxedNumber -public static final class IdBoxedNumber
-extends [IdBoxed](#idboxed) +public record IdBoxedNumber
+implements [IdBoxed](#idboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IdBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Id public static class Id
diff --git a/samples/client/petstore/java/docs/components/schemas/PaginatedResultMyObjectDto.md b/samples/client/petstore/java/docs/components/schemas/PaginatedResultMyObjectDto.md index 6fd855e88c1..05e38e2d26b 100644 --- a/samples/client/petstore/java/docs/components/schemas/PaginatedResultMyObjectDto.md +++ b/samples/client/petstore/java/docs/components/schemas/PaginatedResultMyObjectDto.md @@ -4,7 +4,7 @@ public class PaginatedResultMyObjectDto
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated list payloads, extends FrozenList - classes to build inputs for list payloads @@ -14,50 +14,51 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [PaginatedResultMyObjectDto.PaginatedResultMyObjectDto1Boxed](#paginatedresultmyobjectdto1boxed)
abstract sealed validated payload class | -| static class | [PaginatedResultMyObjectDto.PaginatedResultMyObjectDto1BoxedMap](#paginatedresultmyobjectdto1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [PaginatedResultMyObjectDto.PaginatedResultMyObjectDto1Boxed](#paginatedresultmyobjectdto1boxed)
sealed interface for validated payloads | +| record | [PaginatedResultMyObjectDto.PaginatedResultMyObjectDto1BoxedMap](#paginatedresultmyobjectdto1boxedmap)
boxed class to store validated Map payloads | | static class | [PaginatedResultMyObjectDto.PaginatedResultMyObjectDto1](#paginatedresultmyobjectdto1)
schema class | | static class | [PaginatedResultMyObjectDto.PaginatedResultMyObjectDtoMapBuilder](#paginatedresultmyobjectdtomapbuilder)
builder for Map payloads | | static class | [PaginatedResultMyObjectDto.PaginatedResultMyObjectDtoMap](#paginatedresultmyobjectdtomap)
output class for Map payloads | -| static class | [PaginatedResultMyObjectDto.ResultsBoxed](#resultsboxed)
abstract sealed validated payload class | -| static class | [PaginatedResultMyObjectDto.ResultsBoxedList](#resultsboxedlist)
boxed class to store validated List payloads | +| sealed interface | [PaginatedResultMyObjectDto.ResultsBoxed](#resultsboxed)
sealed interface for validated payloads | +| record | [PaginatedResultMyObjectDto.ResultsBoxedList](#resultsboxedlist)
boxed class to store validated List payloads | | static class | [PaginatedResultMyObjectDto.Results](#results)
schema class | | static class | [PaginatedResultMyObjectDto.ResultsListBuilder](#resultslistbuilder)
builder for List payloads | | static class | [PaginatedResultMyObjectDto.ResultsList](#resultslist)
output class for List payloads | -| static class | [PaginatedResultMyObjectDto.CountBoxed](#countboxed)
abstract sealed validated payload class | -| static class | [PaginatedResultMyObjectDto.CountBoxedNumber](#countboxednumber)
boxed class to store validated Number payloads | +| sealed interface | [PaginatedResultMyObjectDto.CountBoxed](#countboxed)
sealed interface for validated payloads | +| record | [PaginatedResultMyObjectDto.CountBoxedNumber](#countboxednumber)
boxed class to store validated Number payloads | | static class | [PaginatedResultMyObjectDto.Count](#count)
schema class | -| static class | [PaginatedResultMyObjectDto.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
abstract sealed validated payload class | -| static class | [PaginatedResultMyObjectDto.AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid)
boxed class to store validated null payloads | -| static class | [PaginatedResultMyObjectDto.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | -| static class | [PaginatedResultMyObjectDto.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | -| static class | [PaginatedResultMyObjectDto.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | -| static class | [PaginatedResultMyObjectDto.AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist)
boxed class to store validated List payloads | -| static class | [PaginatedResultMyObjectDto.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [PaginatedResultMyObjectDto.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
sealed interface for validated payloads | +| record | [PaginatedResultMyObjectDto.AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid)
boxed class to store validated null payloads | +| record | [PaginatedResultMyObjectDto.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | +| record | [PaginatedResultMyObjectDto.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | +| record | [PaginatedResultMyObjectDto.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | +| record | [PaginatedResultMyObjectDto.AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist)
boxed class to store validated List payloads | +| record | [PaginatedResultMyObjectDto.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | | static class | [PaginatedResultMyObjectDto.AdditionalProperties](#additionalproperties)
schema class | ## PaginatedResultMyObjectDto1Boxed -public static abstract sealed class PaginatedResultMyObjectDto1Boxed
+public sealed interface PaginatedResultMyObjectDto1Boxed
permits
[PaginatedResultMyObjectDto1BoxedMap](#paginatedresultmyobjectdto1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## PaginatedResultMyObjectDto1BoxedMap -public static final class PaginatedResultMyObjectDto1BoxedMap
-extends [PaginatedResultMyObjectDto1Boxed](#paginatedresultmyobjectdto1boxed) +public record PaginatedResultMyObjectDto1BoxedMap
+implements [PaginatedResultMyObjectDto1Boxed](#paginatedresultmyobjectdto1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PaginatedResultMyObjectDto1BoxedMap([PaginatedResultMyObjectDtoMap](#paginatedresultmyobjectdtomap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [PaginatedResultMyObjectDtoMap](#paginatedresultmyobjectdtomap) | data
validated payload | +| [PaginatedResultMyObjectDtoMap](#paginatedresultmyobjectdtomap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PaginatedResultMyObjectDto1 public static class PaginatedResultMyObjectDto1
@@ -108,7 +109,9 @@ PaginatedResultMyObjectDto.PaginatedResultMyObjectDtoMap validatedPayload = | ----------------- | ---------------------- | | [PaginatedResultMyObjectDtoMap](#paginatedresultmyobjectdtomap) | validate([Map<?, ?>](#paginatedresultmyobjectdtomapbuilder) arg, SchemaConfiguration configuration) | | [PaginatedResultMyObjectDto1BoxedMap](#paginatedresultmyobjectdto1boxedmap) | validateAndBox([Map<?, ?>](#paginatedresultmyobjectdtomapbuilder) arg, SchemaConfiguration configuration) | +| [PaginatedResultMyObjectDto1Boxed](#paginatedresultmyobjectdto1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## PaginatedResultMyObjectDtoMap00Builder public class PaginatedResultMyObjectDtoMap00Builder
builder for `Map` @@ -194,27 +197,28 @@ A class to store validated Map payloads | [ResultsList](#resultslist) | results()
| ## ResultsBoxed -public static abstract sealed class ResultsBoxed
+public sealed interface ResultsBoxed
permits
[ResultsBoxedList](#resultsboxedlist) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ResultsBoxedList -public static final class ResultsBoxedList
-extends [ResultsBoxed](#resultsboxed) +public record ResultsBoxedList
+implements [ResultsBoxed](#resultsboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ResultsBoxedList([ResultsList](#resultslist) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [ResultsList](#resultslist) | data
validated payload | +| [ResultsList](#resultslist) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Results public static class Results
@@ -257,7 +261,9 @@ PaginatedResultMyObjectDto.ResultsList validatedPayload = | ----------------- | ---------------------- | | [ResultsList](#resultslist) | validate([List](#resultslistbuilder) arg, SchemaConfiguration configuration) | | [ResultsBoxedList](#resultsboxedlist) | validateAndBox([List](#resultslistbuilder) arg, SchemaConfiguration configuration) | +| [ResultsBoxed](#resultsboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ResultsListBuilder public class ResultsListBuilder
builder for `List>` @@ -288,27 +294,28 @@ A class to store validated List payloads | static [ResultsList](#resultslist) | of([List>](#resultslistbuilder) arg, SchemaConfiguration configuration) | ## CountBoxed -public static abstract sealed class CountBoxed
+public sealed interface CountBoxed
permits
[CountBoxedNumber](#countboxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## CountBoxedNumber -public static final class CountBoxedNumber
-extends [CountBoxed](#countboxed) +public record CountBoxedNumber
+implements [CountBoxed](#countboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | CountBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Count public static class Count
@@ -322,7 +329,7 @@ A schema class that validates payloads | validateAndBox | ## AdditionalPropertiesBoxed -public static abstract sealed class AdditionalPropertiesBoxed
+public sealed interface AdditionalPropertiesBoxed
permits
[AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid), [AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean), @@ -331,103 +338,109 @@ permits
[AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist), [AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AdditionalPropertiesBoxedVoid -public static final class AdditionalPropertiesBoxedVoid
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedVoid
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedBoolean -public static final class AdditionalPropertiesBoxedBoolean
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedBoolean
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedNumber -public static final class AdditionalPropertiesBoxedNumber
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedNumber
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedString -public static final class AdditionalPropertiesBoxedString
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedString
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedList -public static final class AdditionalPropertiesBoxedList
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedList
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedMap -public static final class AdditionalPropertiesBoxedMap
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedMap
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalProperties public static class AdditionalProperties
diff --git a/samples/client/petstore/java/docs/components/schemas/ParentPet.md b/samples/client/petstore/java/docs/components/schemas/ParentPet.md index 94a03301eba..d377636a119 100644 --- a/samples/client/petstore/java/docs/components/schemas/ParentPet.md +++ b/samples/client/petstore/java/docs/components/schemas/ParentPet.md @@ -4,38 +4,39 @@ public class ParentPet
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ParentPet.ParentPet1Boxed](#parentpet1boxed)
abstract sealed validated payload class | -| static class | [ParentPet.ParentPet1BoxedMap](#parentpet1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ParentPet.ParentPet1Boxed](#parentpet1boxed)
sealed interface for validated payloads | +| record | [ParentPet.ParentPet1BoxedMap](#parentpet1boxedmap)
boxed class to store validated Map payloads | | static class | [ParentPet.ParentPet1](#parentpet1)
schema class | ## ParentPet1Boxed -public static abstract sealed class ParentPet1Boxed
+public sealed interface ParentPet1Boxed
permits
[ParentPet1BoxedMap](#parentpet1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ParentPet1BoxedMap -public static final class ParentPet1BoxedMap
-extends [ParentPet1Boxed](#parentpet1boxed) +public record ParentPet1BoxedMap
+implements [ParentPet1Boxed](#parentpet1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ParentPet1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ParentPet1 public static class ParentPet1
@@ -54,5 +55,7 @@ A schema class that validates payloads | ----------------- | ---------------------- | | FrozenMap | validate(Map<?, ?> arg, SchemaConfiguration configuration) | | [ParentPet1BoxedMap](#parentpet1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | +| [ParentPet1Boxed](#parentpet1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/components/schemas/Pet.md b/samples/client/petstore/java/docs/components/schemas/Pet.md index 6b786cae553..b037c683712 100644 --- a/samples/client/petstore/java/docs/components/schemas/Pet.md +++ b/samples/client/petstore/java/docs/components/schemas/Pet.md @@ -4,7 +4,7 @@ public class Pet
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated list payloads, extends FrozenList - classes to build inputs for list payloads @@ -15,57 +15,58 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Pet.Pet1Boxed](#pet1boxed)
abstract sealed validated payload class | -| static class | [Pet.Pet1BoxedMap](#pet1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [Pet.Pet1Boxed](#pet1boxed)
sealed interface for validated payloads | +| record | [Pet.Pet1BoxedMap](#pet1boxedmap)
boxed class to store validated Map payloads | | static class | [Pet.Pet1](#pet1)
schema class | | static class | [Pet.PetMapBuilder](#petmapbuilder)
builder for Map payloads | | static class | [Pet.PetMap](#petmap)
output class for Map payloads | -| static class | [Pet.TagsBoxed](#tagsboxed)
abstract sealed validated payload class | -| static class | [Pet.TagsBoxedList](#tagsboxedlist)
boxed class to store validated List payloads | +| sealed interface | [Pet.TagsBoxed](#tagsboxed)
sealed interface for validated payloads | +| record | [Pet.TagsBoxedList](#tagsboxedlist)
boxed class to store validated List payloads | | static class | [Pet.Tags](#tags)
schema class | | static class | [Pet.TagsListBuilder](#tagslistbuilder)
builder for List payloads | | static class | [Pet.TagsList](#tagslist)
output class for List payloads | -| static class | [Pet.StatusBoxed](#statusboxed)
abstract sealed validated payload class | -| static class | [Pet.StatusBoxedString](#statusboxedstring)
boxed class to store validated String payloads | +| sealed interface | [Pet.StatusBoxed](#statusboxed)
sealed interface for validated payloads | +| record | [Pet.StatusBoxedString](#statusboxedstring)
boxed class to store validated String payloads | | static class | [Pet.Status](#status)
schema class | | enum | [Pet.StringStatusEnums](#stringstatusenums)
String enum | -| static class | [Pet.PhotoUrlsBoxed](#photourlsboxed)
abstract sealed validated payload class | -| static class | [Pet.PhotoUrlsBoxedList](#photourlsboxedlist)
boxed class to store validated List payloads | +| sealed interface | [Pet.PhotoUrlsBoxed](#photourlsboxed)
sealed interface for validated payloads | +| record | [Pet.PhotoUrlsBoxedList](#photourlsboxedlist)
boxed class to store validated List payloads | | static class | [Pet.PhotoUrls](#photourls)
schema class | | static class | [Pet.PhotoUrlsListBuilder](#photourlslistbuilder)
builder for List payloads | | static class | [Pet.PhotoUrlsList](#photourlslist)
output class for List payloads | -| static class | [Pet.ItemsBoxed](#itemsboxed)
abstract sealed validated payload class | -| static class | [Pet.ItemsBoxedString](#itemsboxedstring)
boxed class to store validated String payloads | +| sealed interface | [Pet.ItemsBoxed](#itemsboxed)
sealed interface for validated payloads | +| record | [Pet.ItemsBoxedString](#itemsboxedstring)
boxed class to store validated String payloads | | static class | [Pet.Items](#items)
schema class | -| static class | [Pet.NameBoxed](#nameboxed)
abstract sealed validated payload class | -| static class | [Pet.NameBoxedString](#nameboxedstring)
boxed class to store validated String payloads | +| sealed interface | [Pet.NameBoxed](#nameboxed)
sealed interface for validated payloads | +| record | [Pet.NameBoxedString](#nameboxedstring)
boxed class to store validated String payloads | | static class | [Pet.Name](#name)
schema class | -| static class | [Pet.IdBoxed](#idboxed)
abstract sealed validated payload class | -| static class | [Pet.IdBoxedNumber](#idboxednumber)
boxed class to store validated Number payloads | +| sealed interface | [Pet.IdBoxed](#idboxed)
sealed interface for validated payloads | +| record | [Pet.IdBoxedNumber](#idboxednumber)
boxed class to store validated Number payloads | | static class | [Pet.Id](#id)
schema class | ## Pet1Boxed -public static abstract sealed class Pet1Boxed
+public sealed interface Pet1Boxed
permits
[Pet1BoxedMap](#pet1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Pet1BoxedMap -public static final class Pet1BoxedMap
-extends [Pet1Boxed](#pet1boxed) +public record Pet1BoxedMap
+implements [Pet1Boxed](#pet1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Pet1BoxedMap([PetMap](#petmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [PetMap](#petmap) | data
validated payload | +| [PetMap](#petmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Pet1 public static class Pet1
@@ -145,7 +146,9 @@ Pet.PetMap validatedPayload = | ----------------- | ---------------------- | | [PetMap](#petmap) | validate([Map<?, ?>](#petmapbuilder) arg, SchemaConfiguration configuration) | | [Pet1BoxedMap](#pet1boxedmap) | validateAndBox([Map<?, ?>](#petmapbuilder) arg, SchemaConfiguration configuration) | +| [Pet1Boxed](#pet1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## PetMap00Builder public class PetMap00Builder
builder for `Map` @@ -247,27 +250,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## TagsBoxed -public static abstract sealed class TagsBoxed
+public sealed interface TagsBoxed
permits
[TagsBoxedList](#tagsboxedlist) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## TagsBoxedList -public static final class TagsBoxedList
-extends [TagsBoxed](#tagsboxed) +public record TagsBoxedList
+implements [TagsBoxed](#tagsboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | TagsBoxedList([TagsList](#tagslist) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [TagsList](#tagslist) | data
validated payload | +| [TagsList](#tagslist) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Tags public static class Tags
@@ -322,7 +326,9 @@ Pet.TagsList validatedPayload = | ----------------- | ---------------------- | | [TagsList](#tagslist) | validate([List](#tagslistbuilder) arg, SchemaConfiguration configuration) | | [TagsBoxedList](#tagsboxedlist) | validateAndBox([List](#tagslistbuilder) arg, SchemaConfiguration configuration) | +| [TagsBoxed](#tagsboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## TagsListBuilder public class TagsListBuilder
builder for `List>` @@ -353,27 +359,28 @@ A class to store validated List payloads | static [TagsList](#tagslist) | of([List>](#tagslistbuilder) arg, SchemaConfiguration configuration) | ## StatusBoxed -public static abstract sealed class StatusBoxed
+public sealed interface StatusBoxed
permits
[StatusBoxedString](#statusboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## StatusBoxedString -public static final class StatusBoxedString
-extends [StatusBoxed](#statusboxed) +public record StatusBoxedString
+implements [StatusBoxed](#statusboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | StatusBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Status public static class Status
@@ -418,7 +425,9 @@ String validatedPayload = Pet.Status.validate( | String | validate(String arg, SchemaConfiguration configuration) | | String | validate([StringStatusEnums](#stringstatusenums) arg, SchemaConfiguration configuration) | | [StatusBoxedString](#statusboxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [StatusBoxed](#statusboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## StringStatusEnums public enum StringStatusEnums
extends `Enum` @@ -433,27 +442,28 @@ A class that stores String enum values | SOLD | value = "sold" | ## PhotoUrlsBoxed -public static abstract sealed class PhotoUrlsBoxed
+public sealed interface PhotoUrlsBoxed
permits
[PhotoUrlsBoxedList](#photourlsboxedlist) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## PhotoUrlsBoxedList -public static final class PhotoUrlsBoxedList
-extends [PhotoUrlsBoxed](#photourlsboxed) +public record PhotoUrlsBoxedList
+implements [PhotoUrlsBoxed](#photourlsboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PhotoUrlsBoxedList([PhotoUrlsList](#photourlslist) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [PhotoUrlsList](#photourlslist) | data
validated payload | +| [PhotoUrlsList](#photourlslist) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PhotoUrls public static class PhotoUrls
@@ -498,7 +508,9 @@ Pet.PhotoUrlsList validatedPayload = | ----------------- | ---------------------- | | [PhotoUrlsList](#photourlslist) | validate([List](#photourlslistbuilder) arg, SchemaConfiguration configuration) | | [PhotoUrlsBoxedList](#photourlsboxedlist) | validateAndBox([List](#photourlslistbuilder) arg, SchemaConfiguration configuration) | +| [PhotoUrlsBoxed](#photourlsboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## PhotoUrlsListBuilder public class PhotoUrlsListBuilder
builder for `List` @@ -529,27 +541,28 @@ A class to store validated List payloads | static [PhotoUrlsList](#photourlslist) | of([List](#photourlslistbuilder) arg, SchemaConfiguration configuration) | ## ItemsBoxed -public static abstract sealed class ItemsBoxed
+public sealed interface ItemsBoxed
permits
[ItemsBoxedString](#itemsboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ItemsBoxedString -public static final class ItemsBoxedString
-extends [ItemsBoxed](#itemsboxed) +public record ItemsBoxedString
+implements [ItemsBoxed](#itemsboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ItemsBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Items public static class Items
@@ -563,27 +576,28 @@ A schema class that validates payloads | validateAndBox | ## NameBoxed -public static abstract sealed class NameBoxed
+public sealed interface NameBoxed
permits
[NameBoxedString](#nameboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## NameBoxedString -public static final class NameBoxedString
-extends [NameBoxed](#nameboxed) +public record NameBoxedString
+implements [NameBoxed](#nameboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NameBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Name public static class Name
@@ -597,27 +611,28 @@ A schema class that validates payloads | validateAndBox | ## IdBoxed -public static abstract sealed class IdBoxed
+public sealed interface IdBoxed
permits
[IdBoxedNumber](#idboxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## IdBoxedNumber -public static final class IdBoxedNumber
-extends [IdBoxed](#idboxed) +public record IdBoxedNumber
+implements [IdBoxed](#idboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IdBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Id public static class Id
diff --git a/samples/client/petstore/java/docs/components/schemas/Pig.md b/samples/client/petstore/java/docs/components/schemas/Pig.md index cb2dfce8695..bafb15b4d36 100644 --- a/samples/client/petstore/java/docs/components/schemas/Pig.md +++ b/samples/client/petstore/java/docs/components/schemas/Pig.md @@ -4,23 +4,23 @@ public class Pig
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Pig.Pig1Boxed](#pig1boxed)
abstract sealed validated payload class | -| static class | [Pig.Pig1BoxedVoid](#pig1boxedvoid)
boxed class to store validated null payloads | -| static class | [Pig.Pig1BoxedBoolean](#pig1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [Pig.Pig1BoxedNumber](#pig1boxednumber)
boxed class to store validated Number payloads | -| static class | [Pig.Pig1BoxedString](#pig1boxedstring)
boxed class to store validated String payloads | -| static class | [Pig.Pig1BoxedList](#pig1boxedlist)
boxed class to store validated List payloads | -| static class | [Pig.Pig1BoxedMap](#pig1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [Pig.Pig1Boxed](#pig1boxed)
sealed interface for validated payloads | +| record | [Pig.Pig1BoxedVoid](#pig1boxedvoid)
boxed class to store validated null payloads | +| record | [Pig.Pig1BoxedBoolean](#pig1boxedboolean)
boxed class to store validated boolean payloads | +| record | [Pig.Pig1BoxedNumber](#pig1boxednumber)
boxed class to store validated Number payloads | +| record | [Pig.Pig1BoxedString](#pig1boxedstring)
boxed class to store validated String payloads | +| record | [Pig.Pig1BoxedList](#pig1boxedlist)
boxed class to store validated List payloads | +| record | [Pig.Pig1BoxedMap](#pig1boxedmap)
boxed class to store validated Map payloads | | static class | [Pig.Pig1](#pig1)
schema class | ## Pig1Boxed -public static abstract sealed class Pig1Boxed
+public sealed interface Pig1Boxed
permits
[Pig1BoxedVoid](#pig1boxedvoid), [Pig1BoxedBoolean](#pig1boxedboolean), @@ -29,103 +29,109 @@ permits
[Pig1BoxedList](#pig1boxedlist), [Pig1BoxedMap](#pig1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Pig1BoxedVoid -public static final class Pig1BoxedVoid
-extends [Pig1Boxed](#pig1boxed) +public record Pig1BoxedVoid
+implements [Pig1Boxed](#pig1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Pig1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Pig1BoxedBoolean -public static final class Pig1BoxedBoolean
-extends [Pig1Boxed](#pig1boxed) +public record Pig1BoxedBoolean
+implements [Pig1Boxed](#pig1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Pig1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Pig1BoxedNumber -public static final class Pig1BoxedNumber
-extends [Pig1Boxed](#pig1boxed) +public record Pig1BoxedNumber
+implements [Pig1Boxed](#pig1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Pig1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Pig1BoxedString -public static final class Pig1BoxedString
-extends [Pig1Boxed](#pig1boxed) +public record Pig1BoxedString
+implements [Pig1Boxed](#pig1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Pig1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Pig1BoxedList -public static final class Pig1BoxedList
-extends [Pig1Boxed](#pig1boxed) +public record Pig1BoxedList
+implements [Pig1Boxed](#pig1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Pig1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Pig1BoxedMap -public static final class Pig1BoxedMap
-extends [Pig1Boxed](#pig1boxed) +public record Pig1BoxedMap
+implements [Pig1Boxed](#pig1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Pig1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Pig1 public static class Pig1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [Pig1BoxedBoolean](#pig1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Pig1BoxedMap](#pig1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [Pig1BoxedList](#pig1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Pig1Boxed](#pig1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/components/schemas/Player.md b/samples/client/petstore/java/docs/components/schemas/Player.md index 561cce40b42..b1cc1896410 100644 --- a/samples/client/petstore/java/docs/components/schemas/Player.md +++ b/samples/client/petstore/java/docs/components/schemas/Player.md @@ -4,7 +4,7 @@ public class Player
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,37 +12,38 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Player.Player1Boxed](#player1boxed)
abstract sealed validated payload class | -| static class | [Player.Player1BoxedMap](#player1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [Player.Player1Boxed](#player1boxed)
sealed interface for validated payloads | +| record | [Player.Player1BoxedMap](#player1boxedmap)
boxed class to store validated Map payloads | | static class | [Player.Player1](#player1)
schema class | | static class | [Player.PlayerMapBuilder](#playermapbuilder)
builder for Map payloads | | static class | [Player.PlayerMap](#playermap)
output class for Map payloads | -| static class | [Player.NameBoxed](#nameboxed)
abstract sealed validated payload class | -| static class | [Player.NameBoxedString](#nameboxedstring)
boxed class to store validated String payloads | +| sealed interface | [Player.NameBoxed](#nameboxed)
sealed interface for validated payloads | +| record | [Player.NameBoxedString](#nameboxedstring)
boxed class to store validated String payloads | | static class | [Player.Name](#name)
schema class | ## Player1Boxed -public static abstract sealed class Player1Boxed
+public sealed interface Player1Boxed
permits
[Player1BoxedMap](#player1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Player1BoxedMap -public static final class Player1BoxedMap
-extends [Player1Boxed](#player1boxed) +public record Player1BoxedMap
+implements [Player1Boxed](#player1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Player1BoxedMap([PlayerMap](#playermap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [PlayerMap](#playermap) | data
validated payload | +| [PlayerMap](#playermap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Player1 public static class Player1
@@ -90,7 +91,9 @@ Player.PlayerMap validatedPayload = | ----------------- | ---------------------- | | [PlayerMap](#playermap) | validate([Map<?, ?>](#playermapbuilder) arg, SchemaConfiguration configuration) | | [Player1BoxedMap](#player1boxedmap) | validateAndBox([Map<?, ?>](#playermapbuilder) arg, SchemaConfiguration configuration) | +| [Player1Boxed](#player1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## PlayerMapBuilder public class PlayerMapBuilder
builder for `Map` @@ -133,27 +136,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## NameBoxed -public static abstract sealed class NameBoxed
+public sealed interface NameBoxed
permits
[NameBoxedString](#nameboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## NameBoxedString -public static final class NameBoxedString
-extends [NameBoxed](#nameboxed) +public record NameBoxedString
+implements [NameBoxed](#nameboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NameBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Name public static class Name
diff --git a/samples/client/petstore/java/docs/components/schemas/PublicKey.md b/samples/client/petstore/java/docs/components/schemas/PublicKey.md index f236e44bfc7..d264945f70f 100644 --- a/samples/client/petstore/java/docs/components/schemas/PublicKey.md +++ b/samples/client/petstore/java/docs/components/schemas/PublicKey.md @@ -4,7 +4,7 @@ public class PublicKey
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,37 +12,38 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [PublicKey.PublicKey1Boxed](#publickey1boxed)
abstract sealed validated payload class | -| static class | [PublicKey.PublicKey1BoxedMap](#publickey1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [PublicKey.PublicKey1Boxed](#publickey1boxed)
sealed interface for validated payloads | +| record | [PublicKey.PublicKey1BoxedMap](#publickey1boxedmap)
boxed class to store validated Map payloads | | static class | [PublicKey.PublicKey1](#publickey1)
schema class | | static class | [PublicKey.PublicKeyMapBuilder](#publickeymapbuilder)
builder for Map payloads | | static class | [PublicKey.PublicKeyMap](#publickeymap)
output class for Map payloads | -| static class | [PublicKey.KeyBoxed](#keyboxed)
abstract sealed validated payload class | -| static class | [PublicKey.KeyBoxedString](#keyboxedstring)
boxed class to store validated String payloads | +| sealed interface | [PublicKey.KeyBoxed](#keyboxed)
sealed interface for validated payloads | +| record | [PublicKey.KeyBoxedString](#keyboxedstring)
boxed class to store validated String payloads | | static class | [PublicKey.Key](#key)
schema class | ## PublicKey1Boxed -public static abstract sealed class PublicKey1Boxed
+public sealed interface PublicKey1Boxed
permits
[PublicKey1BoxedMap](#publickey1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## PublicKey1BoxedMap -public static final class PublicKey1BoxedMap
-extends [PublicKey1Boxed](#publickey1boxed) +public record PublicKey1BoxedMap
+implements [PublicKey1Boxed](#publickey1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PublicKey1BoxedMap([PublicKeyMap](#publickeymap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [PublicKeyMap](#publickeymap) | data
validated payload | +| [PublicKeyMap](#publickeymap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PublicKey1 public static class PublicKey1
@@ -90,7 +91,9 @@ PublicKey.PublicKeyMap validatedPayload = | ----------------- | ---------------------- | | [PublicKeyMap](#publickeymap) | validate([Map<?, ?>](#publickeymapbuilder) arg, SchemaConfiguration configuration) | | [PublicKey1BoxedMap](#publickey1boxedmap) | validateAndBox([Map<?, ?>](#publickeymapbuilder) arg, SchemaConfiguration configuration) | +| [PublicKey1Boxed](#publickey1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## PublicKeyMapBuilder public class PublicKeyMapBuilder
builder for `Map` @@ -131,27 +134,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## KeyBoxed -public static abstract sealed class KeyBoxed
+public sealed interface KeyBoxed
permits
[KeyBoxedString](#keyboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## KeyBoxedString -public static final class KeyBoxedString
-extends [KeyBoxed](#keyboxed) +public record KeyBoxedString
+implements [KeyBoxed](#keyboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | KeyBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Key public static class Key
diff --git a/samples/client/petstore/java/docs/components/schemas/Quadrilateral.md b/samples/client/petstore/java/docs/components/schemas/Quadrilateral.md index b6a535854b7..d00c2343be1 100644 --- a/samples/client/petstore/java/docs/components/schemas/Quadrilateral.md +++ b/samples/client/petstore/java/docs/components/schemas/Quadrilateral.md @@ -4,23 +4,23 @@ public class Quadrilateral
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Quadrilateral.Quadrilateral1Boxed](#quadrilateral1boxed)
abstract sealed validated payload class | -| static class | [Quadrilateral.Quadrilateral1BoxedVoid](#quadrilateral1boxedvoid)
boxed class to store validated null payloads | -| static class | [Quadrilateral.Quadrilateral1BoxedBoolean](#quadrilateral1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [Quadrilateral.Quadrilateral1BoxedNumber](#quadrilateral1boxednumber)
boxed class to store validated Number payloads | -| static class | [Quadrilateral.Quadrilateral1BoxedString](#quadrilateral1boxedstring)
boxed class to store validated String payloads | -| static class | [Quadrilateral.Quadrilateral1BoxedList](#quadrilateral1boxedlist)
boxed class to store validated List payloads | -| static class | [Quadrilateral.Quadrilateral1BoxedMap](#quadrilateral1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [Quadrilateral.Quadrilateral1Boxed](#quadrilateral1boxed)
sealed interface for validated payloads | +| record | [Quadrilateral.Quadrilateral1BoxedVoid](#quadrilateral1boxedvoid)
boxed class to store validated null payloads | +| record | [Quadrilateral.Quadrilateral1BoxedBoolean](#quadrilateral1boxedboolean)
boxed class to store validated boolean payloads | +| record | [Quadrilateral.Quadrilateral1BoxedNumber](#quadrilateral1boxednumber)
boxed class to store validated Number payloads | +| record | [Quadrilateral.Quadrilateral1BoxedString](#quadrilateral1boxedstring)
boxed class to store validated String payloads | +| record | [Quadrilateral.Quadrilateral1BoxedList](#quadrilateral1boxedlist)
boxed class to store validated List payloads | +| record | [Quadrilateral.Quadrilateral1BoxedMap](#quadrilateral1boxedmap)
boxed class to store validated Map payloads | | static class | [Quadrilateral.Quadrilateral1](#quadrilateral1)
schema class | ## Quadrilateral1Boxed -public static abstract sealed class Quadrilateral1Boxed
+public sealed interface Quadrilateral1Boxed
permits
[Quadrilateral1BoxedVoid](#quadrilateral1boxedvoid), [Quadrilateral1BoxedBoolean](#quadrilateral1boxedboolean), @@ -29,103 +29,109 @@ permits
[Quadrilateral1BoxedList](#quadrilateral1boxedlist), [Quadrilateral1BoxedMap](#quadrilateral1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Quadrilateral1BoxedVoid -public static final class Quadrilateral1BoxedVoid
-extends [Quadrilateral1Boxed](#quadrilateral1boxed) +public record Quadrilateral1BoxedVoid
+implements [Quadrilateral1Boxed](#quadrilateral1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Quadrilateral1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Quadrilateral1BoxedBoolean -public static final class Quadrilateral1BoxedBoolean
-extends [Quadrilateral1Boxed](#quadrilateral1boxed) +public record Quadrilateral1BoxedBoolean
+implements [Quadrilateral1Boxed](#quadrilateral1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Quadrilateral1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Quadrilateral1BoxedNumber -public static final class Quadrilateral1BoxedNumber
-extends [Quadrilateral1Boxed](#quadrilateral1boxed) +public record Quadrilateral1BoxedNumber
+implements [Quadrilateral1Boxed](#quadrilateral1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Quadrilateral1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Quadrilateral1BoxedString -public static final class Quadrilateral1BoxedString
-extends [Quadrilateral1Boxed](#quadrilateral1boxed) +public record Quadrilateral1BoxedString
+implements [Quadrilateral1Boxed](#quadrilateral1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Quadrilateral1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Quadrilateral1BoxedList -public static final class Quadrilateral1BoxedList
-extends [Quadrilateral1Boxed](#quadrilateral1boxed) +public record Quadrilateral1BoxedList
+implements [Quadrilateral1Boxed](#quadrilateral1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Quadrilateral1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Quadrilateral1BoxedMap -public static final class Quadrilateral1BoxedMap
-extends [Quadrilateral1Boxed](#quadrilateral1boxed) +public record Quadrilateral1BoxedMap
+implements [Quadrilateral1Boxed](#quadrilateral1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Quadrilateral1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Quadrilateral1 public static class Quadrilateral1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [Quadrilateral1BoxedBoolean](#quadrilateral1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Quadrilateral1BoxedMap](#quadrilateral1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [Quadrilateral1BoxedList](#quadrilateral1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Quadrilateral1Boxed](#quadrilateral1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/components/schemas/QuadrilateralInterface.md b/samples/client/petstore/java/docs/components/schemas/QuadrilateralInterface.md index a4e277a9c49..d7312853756 100644 --- a/samples/client/petstore/java/docs/components/schemas/QuadrilateralInterface.md +++ b/samples/client/petstore/java/docs/components/schemas/QuadrilateralInterface.md @@ -4,7 +4,7 @@ public class QuadrilateralInterface
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -13,26 +13,26 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [QuadrilateralInterface.QuadrilateralInterface1Boxed](#quadrilateralinterface1boxed)
abstract sealed validated payload class | -| static class | [QuadrilateralInterface.QuadrilateralInterface1BoxedVoid](#quadrilateralinterface1boxedvoid)
boxed class to store validated null payloads | -| static class | [QuadrilateralInterface.QuadrilateralInterface1BoxedBoolean](#quadrilateralinterface1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [QuadrilateralInterface.QuadrilateralInterface1BoxedNumber](#quadrilateralinterface1boxednumber)
boxed class to store validated Number payloads | -| static class | [QuadrilateralInterface.QuadrilateralInterface1BoxedString](#quadrilateralinterface1boxedstring)
boxed class to store validated String payloads | -| static class | [QuadrilateralInterface.QuadrilateralInterface1BoxedList](#quadrilateralinterface1boxedlist)
boxed class to store validated List payloads | -| static class | [QuadrilateralInterface.QuadrilateralInterface1BoxedMap](#quadrilateralinterface1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [QuadrilateralInterface.QuadrilateralInterface1Boxed](#quadrilateralinterface1boxed)
sealed interface for validated payloads | +| record | [QuadrilateralInterface.QuadrilateralInterface1BoxedVoid](#quadrilateralinterface1boxedvoid)
boxed class to store validated null payloads | +| record | [QuadrilateralInterface.QuadrilateralInterface1BoxedBoolean](#quadrilateralinterface1boxedboolean)
boxed class to store validated boolean payloads | +| record | [QuadrilateralInterface.QuadrilateralInterface1BoxedNumber](#quadrilateralinterface1boxednumber)
boxed class to store validated Number payloads | +| record | [QuadrilateralInterface.QuadrilateralInterface1BoxedString](#quadrilateralinterface1boxedstring)
boxed class to store validated String payloads | +| record | [QuadrilateralInterface.QuadrilateralInterface1BoxedList](#quadrilateralinterface1boxedlist)
boxed class to store validated List payloads | +| record | [QuadrilateralInterface.QuadrilateralInterface1BoxedMap](#quadrilateralinterface1boxedmap)
boxed class to store validated Map payloads | | static class | [QuadrilateralInterface.QuadrilateralInterface1](#quadrilateralinterface1)
schema class | | static class | [QuadrilateralInterface.QuadrilateralInterfaceMapBuilder](#quadrilateralinterfacemapbuilder)
builder for Map payloads | | static class | [QuadrilateralInterface.QuadrilateralInterfaceMap](#quadrilateralinterfacemap)
output class for Map payloads | -| static class | [QuadrilateralInterface.QuadrilateralTypeBoxed](#quadrilateraltypeboxed)
abstract sealed validated payload class | -| static class | [QuadrilateralInterface.QuadrilateralTypeBoxedString](#quadrilateraltypeboxedstring)
boxed class to store validated String payloads | +| sealed interface | [QuadrilateralInterface.QuadrilateralTypeBoxed](#quadrilateraltypeboxed)
sealed interface for validated payloads | +| record | [QuadrilateralInterface.QuadrilateralTypeBoxedString](#quadrilateraltypeboxedstring)
boxed class to store validated String payloads | | static class | [QuadrilateralInterface.QuadrilateralType](#quadrilateraltype)
schema class | -| static class | [QuadrilateralInterface.ShapeTypeBoxed](#shapetypeboxed)
abstract sealed validated payload class | -| static class | [QuadrilateralInterface.ShapeTypeBoxedString](#shapetypeboxedstring)
boxed class to store validated String payloads | +| sealed interface | [QuadrilateralInterface.ShapeTypeBoxed](#shapetypeboxed)
sealed interface for validated payloads | +| record | [QuadrilateralInterface.ShapeTypeBoxedString](#shapetypeboxedstring)
boxed class to store validated String payloads | | static class | [QuadrilateralInterface.ShapeType](#shapetype)
schema class | | enum | [QuadrilateralInterface.StringShapeTypeEnums](#stringshapetypeenums)
String enum | ## QuadrilateralInterface1Boxed -public static abstract sealed class QuadrilateralInterface1Boxed
+public sealed interface QuadrilateralInterface1Boxed
permits
[QuadrilateralInterface1BoxedVoid](#quadrilateralinterface1boxedvoid), [QuadrilateralInterface1BoxedBoolean](#quadrilateralinterface1boxedboolean), @@ -41,103 +41,109 @@ permits
[QuadrilateralInterface1BoxedList](#quadrilateralinterface1boxedlist), [QuadrilateralInterface1BoxedMap](#quadrilateralinterface1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## QuadrilateralInterface1BoxedVoid -public static final class QuadrilateralInterface1BoxedVoid
-extends [QuadrilateralInterface1Boxed](#quadrilateralinterface1boxed) +public record QuadrilateralInterface1BoxedVoid
+implements [QuadrilateralInterface1Boxed](#quadrilateralinterface1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | QuadrilateralInterface1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## QuadrilateralInterface1BoxedBoolean -public static final class QuadrilateralInterface1BoxedBoolean
-extends [QuadrilateralInterface1Boxed](#quadrilateralinterface1boxed) +public record QuadrilateralInterface1BoxedBoolean
+implements [QuadrilateralInterface1Boxed](#quadrilateralinterface1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | QuadrilateralInterface1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## QuadrilateralInterface1BoxedNumber -public static final class QuadrilateralInterface1BoxedNumber
-extends [QuadrilateralInterface1Boxed](#quadrilateralinterface1boxed) +public record QuadrilateralInterface1BoxedNumber
+implements [QuadrilateralInterface1Boxed](#quadrilateralinterface1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | QuadrilateralInterface1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## QuadrilateralInterface1BoxedString -public static final class QuadrilateralInterface1BoxedString
-extends [QuadrilateralInterface1Boxed](#quadrilateralinterface1boxed) +public record QuadrilateralInterface1BoxedString
+implements [QuadrilateralInterface1Boxed](#quadrilateralinterface1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | QuadrilateralInterface1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## QuadrilateralInterface1BoxedList -public static final class QuadrilateralInterface1BoxedList
-extends [QuadrilateralInterface1Boxed](#quadrilateralinterface1boxed) +public record QuadrilateralInterface1BoxedList
+implements [QuadrilateralInterface1Boxed](#quadrilateralinterface1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | QuadrilateralInterface1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## QuadrilateralInterface1BoxedMap -public static final class QuadrilateralInterface1BoxedMap
-extends [QuadrilateralInterface1Boxed](#quadrilateralinterface1boxed) +public record QuadrilateralInterface1BoxedMap
+implements [QuadrilateralInterface1Boxed](#quadrilateralinterface1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | QuadrilateralInterface1BoxedMap([QuadrilateralInterfaceMap](#quadrilateralinterfacemap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [QuadrilateralInterfaceMap](#quadrilateralinterfacemap) | data
validated payload | +| [QuadrilateralInterfaceMap](#quadrilateralinterfacemap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## QuadrilateralInterface1 public static class QuadrilateralInterface1
@@ -170,7 +176,9 @@ A schema class that validates payloads | [QuadrilateralInterface1BoxedBoolean](#quadrilateralinterface1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [QuadrilateralInterface1BoxedMap](#quadrilateralinterface1boxedmap) | validateAndBox([Map<?, ?>](#quadrilateralinterfacemapbuilder) arg, SchemaConfiguration configuration) | | [QuadrilateralInterface1BoxedList](#quadrilateralinterface1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [QuadrilateralInterface1Boxed](#quadrilateralinterface1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## QuadrilateralInterfaceMap00Builder public class QuadrilateralInterfaceMap00Builder
builder for `Map` @@ -262,27 +270,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## QuadrilateralTypeBoxed -public static abstract sealed class QuadrilateralTypeBoxed
+public sealed interface QuadrilateralTypeBoxed
permits
[QuadrilateralTypeBoxedString](#quadrilateraltypeboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## QuadrilateralTypeBoxedString -public static final class QuadrilateralTypeBoxedString
-extends [QuadrilateralTypeBoxed](#quadrilateraltypeboxed) +public record QuadrilateralTypeBoxedString
+implements [QuadrilateralTypeBoxed](#quadrilateraltypeboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | QuadrilateralTypeBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## QuadrilateralType public static class QuadrilateralType
@@ -296,27 +305,28 @@ A schema class that validates payloads | validateAndBox | ## ShapeTypeBoxed -public static abstract sealed class ShapeTypeBoxed
+public sealed interface ShapeTypeBoxed
permits
[ShapeTypeBoxedString](#shapetypeboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ShapeTypeBoxedString -public static final class ShapeTypeBoxedString
-extends [ShapeTypeBoxed](#shapetypeboxed) +public record ShapeTypeBoxedString
+implements [ShapeTypeBoxed](#shapetypeboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ShapeTypeBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ShapeType public static class ShapeType
@@ -358,7 +368,9 @@ String validatedPayload = QuadrilateralInterface.ShapeType.validate( | String | validate(String arg, SchemaConfiguration configuration) | | String | validate([StringShapeTypeEnums](#stringshapetypeenums) arg, SchemaConfiguration configuration) | | [ShapeTypeBoxedString](#shapetypeboxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [ShapeTypeBoxed](#shapetypeboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## StringShapeTypeEnums public enum StringShapeTypeEnums
extends `Enum` diff --git a/samples/client/petstore/java/docs/components/schemas/ReadOnlyFirst.md b/samples/client/petstore/java/docs/components/schemas/ReadOnlyFirst.md index 4bbe0bd88cf..cd2c5b7afe9 100644 --- a/samples/client/petstore/java/docs/components/schemas/ReadOnlyFirst.md +++ b/samples/client/petstore/java/docs/components/schemas/ReadOnlyFirst.md @@ -4,7 +4,7 @@ public class ReadOnlyFirst
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,40 +12,41 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ReadOnlyFirst.ReadOnlyFirst1Boxed](#readonlyfirst1boxed)
abstract sealed validated payload class | -| static class | [ReadOnlyFirst.ReadOnlyFirst1BoxedMap](#readonlyfirst1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ReadOnlyFirst.ReadOnlyFirst1Boxed](#readonlyfirst1boxed)
sealed interface for validated payloads | +| record | [ReadOnlyFirst.ReadOnlyFirst1BoxedMap](#readonlyfirst1boxedmap)
boxed class to store validated Map payloads | | static class | [ReadOnlyFirst.ReadOnlyFirst1](#readonlyfirst1)
schema class | | static class | [ReadOnlyFirst.ReadOnlyFirstMapBuilder](#readonlyfirstmapbuilder)
builder for Map payloads | | static class | [ReadOnlyFirst.ReadOnlyFirstMap](#readonlyfirstmap)
output class for Map payloads | -| static class | [ReadOnlyFirst.BazBoxed](#bazboxed)
abstract sealed validated payload class | -| static class | [ReadOnlyFirst.BazBoxedString](#bazboxedstring)
boxed class to store validated String payloads | +| sealed interface | [ReadOnlyFirst.BazBoxed](#bazboxed)
sealed interface for validated payloads | +| record | [ReadOnlyFirst.BazBoxedString](#bazboxedstring)
boxed class to store validated String payloads | | static class | [ReadOnlyFirst.Baz](#baz)
schema class | -| static class | [ReadOnlyFirst.BarBoxed](#barboxed)
abstract sealed validated payload class | -| static class | [ReadOnlyFirst.BarBoxedString](#barboxedstring)
boxed class to store validated String payloads | +| sealed interface | [ReadOnlyFirst.BarBoxed](#barboxed)
sealed interface for validated payloads | +| record | [ReadOnlyFirst.BarBoxedString](#barboxedstring)
boxed class to store validated String payloads | | static class | [ReadOnlyFirst.Bar](#bar)
schema class | ## ReadOnlyFirst1Boxed -public static abstract sealed class ReadOnlyFirst1Boxed
+public sealed interface ReadOnlyFirst1Boxed
permits
[ReadOnlyFirst1BoxedMap](#readonlyfirst1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ReadOnlyFirst1BoxedMap -public static final class ReadOnlyFirst1BoxedMap
-extends [ReadOnlyFirst1Boxed](#readonlyfirst1boxed) +public record ReadOnlyFirst1BoxedMap
+implements [ReadOnlyFirst1Boxed](#readonlyfirst1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ReadOnlyFirst1BoxedMap([ReadOnlyFirstMap](#readonlyfirstmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [ReadOnlyFirstMap](#readonlyfirstmap) | data
validated payload | +| [ReadOnlyFirstMap](#readonlyfirstmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ReadOnlyFirst1 public static class ReadOnlyFirst1
@@ -92,7 +93,9 @@ ReadOnlyFirst.ReadOnlyFirstMap validatedPayload = | ----------------- | ---------------------- | | [ReadOnlyFirstMap](#readonlyfirstmap) | validate([Map<?, ?>](#readonlyfirstmapbuilder) arg, SchemaConfiguration configuration) | | [ReadOnlyFirst1BoxedMap](#readonlyfirst1boxedmap) | validateAndBox([Map<?, ?>](#readonlyfirstmapbuilder) arg, SchemaConfiguration configuration) | +| [ReadOnlyFirst1Boxed](#readonlyfirst1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ReadOnlyFirstMapBuilder public class ReadOnlyFirstMapBuilder
builder for `Map` @@ -135,27 +138,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## BazBoxed -public static abstract sealed class BazBoxed
+public sealed interface BazBoxed
permits
[BazBoxedString](#bazboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## BazBoxedString -public static final class BazBoxedString
-extends [BazBoxed](#bazboxed) +public record BazBoxedString
+implements [BazBoxed](#bazboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BazBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Baz public static class Baz
@@ -169,27 +173,28 @@ A schema class that validates payloads | validateAndBox | ## BarBoxed -public static abstract sealed class BarBoxed
+public sealed interface BarBoxed
permits
[BarBoxedString](#barboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## BarBoxedString -public static final class BarBoxedString
-extends [BarBoxed](#barboxed) +public record BarBoxedString
+implements [BarBoxed](#barboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | BarBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Bar public static class Bar
diff --git a/samples/client/petstore/java/docs/components/schemas/RefPet.md b/samples/client/petstore/java/docs/components/schemas/RefPet.md index c27a5bea0a7..73e54bfa49a 100644 --- a/samples/client/petstore/java/docs/components/schemas/RefPet.md +++ b/samples/client/petstore/java/docs/components/schemas/RefPet.md @@ -5,7 +5,7 @@ extends [Pet1](../../components/schemas/Pet.md#pet) A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary diff --git a/samples/client/petstore/java/docs/components/schemas/ReqPropsFromExplicitAddProps.md b/samples/client/petstore/java/docs/components/schemas/ReqPropsFromExplicitAddProps.md index 54600fa559a..fbbfe96abb9 100644 --- a/samples/client/petstore/java/docs/components/schemas/ReqPropsFromExplicitAddProps.md +++ b/samples/client/petstore/java/docs/components/schemas/ReqPropsFromExplicitAddProps.md @@ -4,7 +4,7 @@ public class ReqPropsFromExplicitAddProps
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,37 +12,38 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ReqPropsFromExplicitAddProps.ReqPropsFromExplicitAddProps1Boxed](#reqpropsfromexplicitaddprops1boxed)
abstract sealed validated payload class | -| static class | [ReqPropsFromExplicitAddProps.ReqPropsFromExplicitAddProps1BoxedMap](#reqpropsfromexplicitaddprops1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ReqPropsFromExplicitAddProps.ReqPropsFromExplicitAddProps1Boxed](#reqpropsfromexplicitaddprops1boxed)
sealed interface for validated payloads | +| record | [ReqPropsFromExplicitAddProps.ReqPropsFromExplicitAddProps1BoxedMap](#reqpropsfromexplicitaddprops1boxedmap)
boxed class to store validated Map payloads | | static class | [ReqPropsFromExplicitAddProps.ReqPropsFromExplicitAddProps1](#reqpropsfromexplicitaddprops1)
schema class | | static class | [ReqPropsFromExplicitAddProps.ReqPropsFromExplicitAddPropsMapBuilder](#reqpropsfromexplicitaddpropsmapbuilder)
builder for Map payloads | | static class | [ReqPropsFromExplicitAddProps.ReqPropsFromExplicitAddPropsMap](#reqpropsfromexplicitaddpropsmap)
output class for Map payloads | -| static class | [ReqPropsFromExplicitAddProps.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
abstract sealed validated payload class | -| static class | [ReqPropsFromExplicitAddProps.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | +| sealed interface | [ReqPropsFromExplicitAddProps.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
sealed interface for validated payloads | +| record | [ReqPropsFromExplicitAddProps.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | | static class | [ReqPropsFromExplicitAddProps.AdditionalProperties](#additionalproperties)
schema class | ## ReqPropsFromExplicitAddProps1Boxed -public static abstract sealed class ReqPropsFromExplicitAddProps1Boxed
+public sealed interface ReqPropsFromExplicitAddProps1Boxed
permits
[ReqPropsFromExplicitAddProps1BoxedMap](#reqpropsfromexplicitaddprops1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ReqPropsFromExplicitAddProps1BoxedMap -public static final class ReqPropsFromExplicitAddProps1BoxedMap
-extends [ReqPropsFromExplicitAddProps1Boxed](#reqpropsfromexplicitaddprops1boxed) +public record ReqPropsFromExplicitAddProps1BoxedMap
+implements [ReqPropsFromExplicitAddProps1Boxed](#reqpropsfromexplicitaddprops1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ReqPropsFromExplicitAddProps1BoxedMap([ReqPropsFromExplicitAddPropsMap](#reqpropsfromexplicitaddpropsmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [ReqPropsFromExplicitAddPropsMap](#reqpropsfromexplicitaddpropsmap) | data
validated payload | +| [ReqPropsFromExplicitAddPropsMap](#reqpropsfromexplicitaddpropsmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ReqPropsFromExplicitAddProps1 public static class ReqPropsFromExplicitAddProps1
@@ -88,7 +89,9 @@ ReqPropsFromExplicitAddProps.ReqPropsFromExplicitAddPropsMap validatedPayload = | ----------------- | ---------------------- | | [ReqPropsFromExplicitAddPropsMap](#reqpropsfromexplicitaddpropsmap) | validate([Map<?, ?>](#reqpropsfromexplicitaddpropsmapbuilder) arg, SchemaConfiguration configuration) | | [ReqPropsFromExplicitAddProps1BoxedMap](#reqpropsfromexplicitaddprops1boxedmap) | validateAndBox([Map<?, ?>](#reqpropsfromexplicitaddpropsmapbuilder) arg, SchemaConfiguration configuration) | +| [ReqPropsFromExplicitAddProps1Boxed](#reqpropsfromexplicitaddprops1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ReqPropsFromExplicitAddPropsMap00Builder public class ReqPropsFromExplicitAddPropsMap00Builder
builder for `Map` @@ -170,27 +173,28 @@ A class to store validated Map payloads | String | getAdditionalProperty(String name)
provides type safety for additional properties | ## AdditionalPropertiesBoxed -public static abstract sealed class AdditionalPropertiesBoxed
+public sealed interface AdditionalPropertiesBoxed
permits
[AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AdditionalPropertiesBoxedString -public static final class AdditionalPropertiesBoxedString
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedString
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalProperties public static class AdditionalProperties
diff --git a/samples/client/petstore/java/docs/components/schemas/ReqPropsFromTrueAddProps.md b/samples/client/petstore/java/docs/components/schemas/ReqPropsFromTrueAddProps.md index 1ae8a7e0233..83d828faf0a 100644 --- a/samples/client/petstore/java/docs/components/schemas/ReqPropsFromTrueAddProps.md +++ b/samples/client/petstore/java/docs/components/schemas/ReqPropsFromTrueAddProps.md @@ -4,7 +4,7 @@ public class ReqPropsFromTrueAddProps
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,42 +12,43 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ReqPropsFromTrueAddProps.ReqPropsFromTrueAddProps1Boxed](#reqpropsfromtrueaddprops1boxed)
abstract sealed validated payload class | -| static class | [ReqPropsFromTrueAddProps.ReqPropsFromTrueAddProps1BoxedMap](#reqpropsfromtrueaddprops1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ReqPropsFromTrueAddProps.ReqPropsFromTrueAddProps1Boxed](#reqpropsfromtrueaddprops1boxed)
sealed interface for validated payloads | +| record | [ReqPropsFromTrueAddProps.ReqPropsFromTrueAddProps1BoxedMap](#reqpropsfromtrueaddprops1boxedmap)
boxed class to store validated Map payloads | | static class | [ReqPropsFromTrueAddProps.ReqPropsFromTrueAddProps1](#reqpropsfromtrueaddprops1)
schema class | | static class | [ReqPropsFromTrueAddProps.ReqPropsFromTrueAddPropsMapBuilder](#reqpropsfromtrueaddpropsmapbuilder)
builder for Map payloads | | static class | [ReqPropsFromTrueAddProps.ReqPropsFromTrueAddPropsMap](#reqpropsfromtrueaddpropsmap)
output class for Map payloads | -| static class | [ReqPropsFromTrueAddProps.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
abstract sealed validated payload class | -| static class | [ReqPropsFromTrueAddProps.AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid)
boxed class to store validated null payloads | -| static class | [ReqPropsFromTrueAddProps.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | -| static class | [ReqPropsFromTrueAddProps.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | -| static class | [ReqPropsFromTrueAddProps.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | -| static class | [ReqPropsFromTrueAddProps.AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist)
boxed class to store validated List payloads | -| static class | [ReqPropsFromTrueAddProps.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ReqPropsFromTrueAddProps.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
sealed interface for validated payloads | +| record | [ReqPropsFromTrueAddProps.AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid)
boxed class to store validated null payloads | +| record | [ReqPropsFromTrueAddProps.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | +| record | [ReqPropsFromTrueAddProps.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | +| record | [ReqPropsFromTrueAddProps.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | +| record | [ReqPropsFromTrueAddProps.AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist)
boxed class to store validated List payloads | +| record | [ReqPropsFromTrueAddProps.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | | static class | [ReqPropsFromTrueAddProps.AdditionalProperties](#additionalproperties)
schema class | ## ReqPropsFromTrueAddProps1Boxed -public static abstract sealed class ReqPropsFromTrueAddProps1Boxed
+public sealed interface ReqPropsFromTrueAddProps1Boxed
permits
[ReqPropsFromTrueAddProps1BoxedMap](#reqpropsfromtrueaddprops1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ReqPropsFromTrueAddProps1BoxedMap -public static final class ReqPropsFromTrueAddProps1BoxedMap
-extends [ReqPropsFromTrueAddProps1Boxed](#reqpropsfromtrueaddprops1boxed) +public record ReqPropsFromTrueAddProps1BoxedMap
+implements [ReqPropsFromTrueAddProps1Boxed](#reqpropsfromtrueaddprops1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ReqPropsFromTrueAddProps1BoxedMap([ReqPropsFromTrueAddPropsMap](#reqpropsfromtrueaddpropsmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [ReqPropsFromTrueAddPropsMap](#reqpropsfromtrueaddpropsmap) | data
validated payload | +| [ReqPropsFromTrueAddPropsMap](#reqpropsfromtrueaddpropsmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ReqPropsFromTrueAddProps1 public static class ReqPropsFromTrueAddProps1
@@ -91,7 +92,9 @@ ReqPropsFromTrueAddProps.ReqPropsFromTrueAddPropsMap validatedPayload = | ----------------- | ---------------------- | | [ReqPropsFromTrueAddPropsMap](#reqpropsfromtrueaddpropsmap) | validate([Map<?, ?>](#reqpropsfromtrueaddpropsmapbuilder) arg, SchemaConfiguration configuration) | | [ReqPropsFromTrueAddProps1BoxedMap](#reqpropsfromtrueaddprops1boxedmap) | validateAndBox([Map<?, ?>](#reqpropsfromtrueaddpropsmapbuilder) arg, SchemaConfiguration configuration) | +| [ReqPropsFromTrueAddProps1Boxed](#reqpropsfromtrueaddprops1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ReqPropsFromTrueAddPropsMap00Builder public class ReqPropsFromTrueAddPropsMap00Builder
builder for `Map` @@ -213,7 +216,7 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## AdditionalPropertiesBoxed -public static abstract sealed class AdditionalPropertiesBoxed
+public sealed interface AdditionalPropertiesBoxed
permits
[AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid), [AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean), @@ -222,103 +225,109 @@ permits
[AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist), [AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AdditionalPropertiesBoxedVoid -public static final class AdditionalPropertiesBoxedVoid
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedVoid
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedBoolean -public static final class AdditionalPropertiesBoxedBoolean
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedBoolean
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedNumber -public static final class AdditionalPropertiesBoxedNumber
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedNumber
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedString -public static final class AdditionalPropertiesBoxedString
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedString
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedList -public static final class AdditionalPropertiesBoxedList
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedList
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedMap -public static final class AdditionalPropertiesBoxedMap
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedMap
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalProperties public static class AdditionalProperties
diff --git a/samples/client/petstore/java/docs/components/schemas/ReqPropsFromUnsetAddProps.md b/samples/client/petstore/java/docs/components/schemas/ReqPropsFromUnsetAddProps.md index 1dcb152055b..cd32f212176 100644 --- a/samples/client/petstore/java/docs/components/schemas/ReqPropsFromUnsetAddProps.md +++ b/samples/client/petstore/java/docs/components/schemas/ReqPropsFromUnsetAddProps.md @@ -4,7 +4,7 @@ public class ReqPropsFromUnsetAddProps
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,34 +12,35 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ReqPropsFromUnsetAddProps.ReqPropsFromUnsetAddProps1Boxed](#reqpropsfromunsetaddprops1boxed)
abstract sealed validated payload class | -| static class | [ReqPropsFromUnsetAddProps.ReqPropsFromUnsetAddProps1BoxedMap](#reqpropsfromunsetaddprops1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ReqPropsFromUnsetAddProps.ReqPropsFromUnsetAddProps1Boxed](#reqpropsfromunsetaddprops1boxed)
sealed interface for validated payloads | +| record | [ReqPropsFromUnsetAddProps.ReqPropsFromUnsetAddProps1BoxedMap](#reqpropsfromunsetaddprops1boxedmap)
boxed class to store validated Map payloads | | static class | [ReqPropsFromUnsetAddProps.ReqPropsFromUnsetAddProps1](#reqpropsfromunsetaddprops1)
schema class | | static class | [ReqPropsFromUnsetAddProps.ReqPropsFromUnsetAddPropsMapBuilder](#reqpropsfromunsetaddpropsmapbuilder)
builder for Map payloads | | static class | [ReqPropsFromUnsetAddProps.ReqPropsFromUnsetAddPropsMap](#reqpropsfromunsetaddpropsmap)
output class for Map payloads | ## ReqPropsFromUnsetAddProps1Boxed -public static abstract sealed class ReqPropsFromUnsetAddProps1Boxed
+public sealed interface ReqPropsFromUnsetAddProps1Boxed
permits
[ReqPropsFromUnsetAddProps1BoxedMap](#reqpropsfromunsetaddprops1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ReqPropsFromUnsetAddProps1BoxedMap -public static final class ReqPropsFromUnsetAddProps1BoxedMap
-extends [ReqPropsFromUnsetAddProps1Boxed](#reqpropsfromunsetaddprops1boxed) +public record ReqPropsFromUnsetAddProps1BoxedMap
+implements [ReqPropsFromUnsetAddProps1Boxed](#reqpropsfromunsetaddprops1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ReqPropsFromUnsetAddProps1BoxedMap([ReqPropsFromUnsetAddPropsMap](#reqpropsfromunsetaddpropsmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [ReqPropsFromUnsetAddPropsMap](#reqpropsfromunsetaddpropsmap) | data
validated payload | +| [ReqPropsFromUnsetAddPropsMap](#reqpropsfromunsetaddpropsmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ReqPropsFromUnsetAddProps1 public static class ReqPropsFromUnsetAddProps1
@@ -82,7 +83,9 @@ ReqPropsFromUnsetAddProps.ReqPropsFromUnsetAddPropsMap validatedPayload = | ----------------- | ---------------------- | | [ReqPropsFromUnsetAddPropsMap](#reqpropsfromunsetaddpropsmap) | validate([Map<?, ?>](#reqpropsfromunsetaddpropsmapbuilder) arg, SchemaConfiguration configuration) | | [ReqPropsFromUnsetAddProps1BoxedMap](#reqpropsfromunsetaddprops1boxedmap) | validateAndBox([Map<?, ?>](#reqpropsfromunsetaddpropsmapbuilder) arg, SchemaConfiguration configuration) | +| [ReqPropsFromUnsetAddProps1Boxed](#reqpropsfromunsetaddprops1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ReqPropsFromUnsetAddPropsMap00Builder public class ReqPropsFromUnsetAddPropsMap00Builder
builder for `Map` diff --git a/samples/client/petstore/java/docs/components/schemas/ReturnSchema.md b/samples/client/petstore/java/docs/components/schemas/ReturnSchema.md index 4420c708a9c..a59d8d4dd9a 100644 --- a/samples/client/petstore/java/docs/components/schemas/ReturnSchema.md +++ b/samples/client/petstore/java/docs/components/schemas/ReturnSchema.md @@ -4,7 +4,7 @@ public class ReturnSchema
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,22 +12,22 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ReturnSchema.ReturnSchema1Boxed](#returnschema1boxed)
abstract sealed validated payload class | -| static class | [ReturnSchema.ReturnSchema1BoxedVoid](#returnschema1boxedvoid)
boxed class to store validated null payloads | -| static class | [ReturnSchema.ReturnSchema1BoxedBoolean](#returnschema1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [ReturnSchema.ReturnSchema1BoxedNumber](#returnschema1boxednumber)
boxed class to store validated Number payloads | -| static class | [ReturnSchema.ReturnSchema1BoxedString](#returnschema1boxedstring)
boxed class to store validated String payloads | -| static class | [ReturnSchema.ReturnSchema1BoxedList](#returnschema1boxedlist)
boxed class to store validated List payloads | -| static class | [ReturnSchema.ReturnSchema1BoxedMap](#returnschema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ReturnSchema.ReturnSchema1Boxed](#returnschema1boxed)
sealed interface for validated payloads | +| record | [ReturnSchema.ReturnSchema1BoxedVoid](#returnschema1boxedvoid)
boxed class to store validated null payloads | +| record | [ReturnSchema.ReturnSchema1BoxedBoolean](#returnschema1boxedboolean)
boxed class to store validated boolean payloads | +| record | [ReturnSchema.ReturnSchema1BoxedNumber](#returnschema1boxednumber)
boxed class to store validated Number payloads | +| record | [ReturnSchema.ReturnSchema1BoxedString](#returnschema1boxedstring)
boxed class to store validated String payloads | +| record | [ReturnSchema.ReturnSchema1BoxedList](#returnschema1boxedlist)
boxed class to store validated List payloads | +| record | [ReturnSchema.ReturnSchema1BoxedMap](#returnschema1boxedmap)
boxed class to store validated Map payloads | | static class | [ReturnSchema.ReturnSchema1](#returnschema1)
schema class | | static class | [ReturnSchema.ReturnMapBuilder1](#returnmapbuilder1)
builder for Map payloads | | static class | [ReturnSchema.ReturnMap](#returnmap)
output class for Map payloads | -| static class | [ReturnSchema.ReturnSchema2Boxed](#returnschema2boxed)
abstract sealed validated payload class | -| static class | [ReturnSchema.ReturnSchema2BoxedNumber](#returnschema2boxednumber)
boxed class to store validated Number payloads | +| sealed interface | [ReturnSchema.ReturnSchema2Boxed](#returnschema2boxed)
sealed interface for validated payloads | +| record | [ReturnSchema.ReturnSchema2BoxedNumber](#returnschema2boxednumber)
boxed class to store validated Number payloads | | static class | [ReturnSchema.ReturnSchema2](#returnschema2)
schema class | ## ReturnSchema1Boxed -public static abstract sealed class ReturnSchema1Boxed
+public sealed interface ReturnSchema1Boxed
permits
[ReturnSchema1BoxedVoid](#returnschema1boxedvoid), [ReturnSchema1BoxedBoolean](#returnschema1boxedboolean), @@ -36,103 +36,109 @@ permits
[ReturnSchema1BoxedList](#returnschema1boxedlist), [ReturnSchema1BoxedMap](#returnschema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ReturnSchema1BoxedVoid -public static final class ReturnSchema1BoxedVoid
-extends [ReturnSchema1Boxed](#returnschema1boxed) +public record ReturnSchema1BoxedVoid
+implements [ReturnSchema1Boxed](#returnschema1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ReturnSchema1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ReturnSchema1BoxedBoolean -public static final class ReturnSchema1BoxedBoolean
-extends [ReturnSchema1Boxed](#returnschema1boxed) +public record ReturnSchema1BoxedBoolean
+implements [ReturnSchema1Boxed](#returnschema1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ReturnSchema1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ReturnSchema1BoxedNumber -public static final class ReturnSchema1BoxedNumber
-extends [ReturnSchema1Boxed](#returnschema1boxed) +public record ReturnSchema1BoxedNumber
+implements [ReturnSchema1Boxed](#returnschema1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ReturnSchema1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ReturnSchema1BoxedString -public static final class ReturnSchema1BoxedString
-extends [ReturnSchema1Boxed](#returnschema1boxed) +public record ReturnSchema1BoxedString
+implements [ReturnSchema1Boxed](#returnschema1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ReturnSchema1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ReturnSchema1BoxedList -public static final class ReturnSchema1BoxedList
-extends [ReturnSchema1Boxed](#returnschema1boxed) +public record ReturnSchema1BoxedList
+implements [ReturnSchema1Boxed](#returnschema1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ReturnSchema1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ReturnSchema1BoxedMap -public static final class ReturnSchema1BoxedMap
-extends [ReturnSchema1Boxed](#returnschema1boxed) +public record ReturnSchema1BoxedMap
+implements [ReturnSchema1Boxed](#returnschema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ReturnSchema1BoxedMap([ReturnMap](#returnmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [ReturnMap](#returnmap) | data
validated payload | +| [ReturnMap](#returnmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ReturnSchema1 public static class ReturnSchema1
@@ -167,7 +173,9 @@ Model for testing reserved words | [ReturnSchema1BoxedBoolean](#returnschema1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [ReturnSchema1BoxedMap](#returnschema1boxedmap) | validateAndBox([Map<?, ?>](#returnmapbuilder1) arg, SchemaConfiguration configuration) | | [ReturnSchema1BoxedList](#returnschema1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [ReturnSchema1Boxed](#returnschema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ReturnMapBuilder1 public class ReturnMapBuilder1
builder for `Map` @@ -209,27 +217,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## ReturnSchema2Boxed -public static abstract sealed class ReturnSchema2Boxed
+public sealed interface ReturnSchema2Boxed
permits
[ReturnSchema2BoxedNumber](#returnschema2boxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ReturnSchema2BoxedNumber -public static final class ReturnSchema2BoxedNumber
-extends [ReturnSchema2Boxed](#returnschema2boxed) +public record ReturnSchema2BoxedNumber
+implements [ReturnSchema2Boxed](#returnschema2boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ReturnSchema2BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ReturnSchema2 public static class ReturnSchema2
diff --git a/samples/client/petstore/java/docs/components/schemas/ScaleneTriangle.md b/samples/client/petstore/java/docs/components/schemas/ScaleneTriangle.md index 714ffbcad82..63941694f59 100644 --- a/samples/client/petstore/java/docs/components/schemas/ScaleneTriangle.md +++ b/samples/client/petstore/java/docs/components/schemas/ScaleneTriangle.md @@ -4,7 +4,7 @@ public class ScaleneTriangle
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -13,26 +13,26 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ScaleneTriangle.ScaleneTriangle1Boxed](#scalenetriangle1boxed)
abstract sealed validated payload class | -| static class | [ScaleneTriangle.ScaleneTriangle1BoxedVoid](#scalenetriangle1boxedvoid)
boxed class to store validated null payloads | -| static class | [ScaleneTriangle.ScaleneTriangle1BoxedBoolean](#scalenetriangle1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [ScaleneTriangle.ScaleneTriangle1BoxedNumber](#scalenetriangle1boxednumber)
boxed class to store validated Number payloads | -| static class | [ScaleneTriangle.ScaleneTriangle1BoxedString](#scalenetriangle1boxedstring)
boxed class to store validated String payloads | -| static class | [ScaleneTriangle.ScaleneTriangle1BoxedList](#scalenetriangle1boxedlist)
boxed class to store validated List payloads | -| static class | [ScaleneTriangle.ScaleneTriangle1BoxedMap](#scalenetriangle1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ScaleneTriangle.ScaleneTriangle1Boxed](#scalenetriangle1boxed)
sealed interface for validated payloads | +| record | [ScaleneTriangle.ScaleneTriangle1BoxedVoid](#scalenetriangle1boxedvoid)
boxed class to store validated null payloads | +| record | [ScaleneTriangle.ScaleneTriangle1BoxedBoolean](#scalenetriangle1boxedboolean)
boxed class to store validated boolean payloads | +| record | [ScaleneTriangle.ScaleneTriangle1BoxedNumber](#scalenetriangle1boxednumber)
boxed class to store validated Number payloads | +| record | [ScaleneTriangle.ScaleneTriangle1BoxedString](#scalenetriangle1boxedstring)
boxed class to store validated String payloads | +| record | [ScaleneTriangle.ScaleneTriangle1BoxedList](#scalenetriangle1boxedlist)
boxed class to store validated List payloads | +| record | [ScaleneTriangle.ScaleneTriangle1BoxedMap](#scalenetriangle1boxedmap)
boxed class to store validated Map payloads | | static class | [ScaleneTriangle.ScaleneTriangle1](#scalenetriangle1)
schema class | -| static class | [ScaleneTriangle.Schema1Boxed](#schema1boxed)
abstract sealed validated payload class | -| static class | [ScaleneTriangle.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ScaleneTriangle.Schema1Boxed](#schema1boxed)
sealed interface for validated payloads | +| record | [ScaleneTriangle.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | | static class | [ScaleneTriangle.Schema1](#schema1)
schema class | | static class | [ScaleneTriangle.Schema1MapBuilder](#schema1mapbuilder)
builder for Map payloads | | static class | [ScaleneTriangle.Schema1Map](#schema1map)
output class for Map payloads | -| static class | [ScaleneTriangle.TriangleTypeBoxed](#triangletypeboxed)
abstract sealed validated payload class | -| static class | [ScaleneTriangle.TriangleTypeBoxedString](#triangletypeboxedstring)
boxed class to store validated String payloads | +| sealed interface | [ScaleneTriangle.TriangleTypeBoxed](#triangletypeboxed)
sealed interface for validated payloads | +| record | [ScaleneTriangle.TriangleTypeBoxedString](#triangletypeboxedstring)
boxed class to store validated String payloads | | static class | [ScaleneTriangle.TriangleType](#triangletype)
schema class | | enum | [ScaleneTriangle.StringTriangleTypeEnums](#stringtriangletypeenums)
String enum | ## ScaleneTriangle1Boxed -public static abstract sealed class ScaleneTriangle1Boxed
+public sealed interface ScaleneTriangle1Boxed
permits
[ScaleneTriangle1BoxedVoid](#scalenetriangle1boxedvoid), [ScaleneTriangle1BoxedBoolean](#scalenetriangle1boxedboolean), @@ -41,103 +41,109 @@ permits
[ScaleneTriangle1BoxedList](#scalenetriangle1boxedlist), [ScaleneTriangle1BoxedMap](#scalenetriangle1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ScaleneTriangle1BoxedVoid -public static final class ScaleneTriangle1BoxedVoid
-extends [ScaleneTriangle1Boxed](#scalenetriangle1boxed) +public record ScaleneTriangle1BoxedVoid
+implements [ScaleneTriangle1Boxed](#scalenetriangle1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ScaleneTriangle1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ScaleneTriangle1BoxedBoolean -public static final class ScaleneTriangle1BoxedBoolean
-extends [ScaleneTriangle1Boxed](#scalenetriangle1boxed) +public record ScaleneTriangle1BoxedBoolean
+implements [ScaleneTriangle1Boxed](#scalenetriangle1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ScaleneTriangle1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ScaleneTriangle1BoxedNumber -public static final class ScaleneTriangle1BoxedNumber
-extends [ScaleneTriangle1Boxed](#scalenetriangle1boxed) +public record ScaleneTriangle1BoxedNumber
+implements [ScaleneTriangle1Boxed](#scalenetriangle1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ScaleneTriangle1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ScaleneTriangle1BoxedString -public static final class ScaleneTriangle1BoxedString
-extends [ScaleneTriangle1Boxed](#scalenetriangle1boxed) +public record ScaleneTriangle1BoxedString
+implements [ScaleneTriangle1Boxed](#scalenetriangle1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ScaleneTriangle1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ScaleneTriangle1BoxedList -public static final class ScaleneTriangle1BoxedList
-extends [ScaleneTriangle1Boxed](#scalenetriangle1boxed) +public record ScaleneTriangle1BoxedList
+implements [ScaleneTriangle1Boxed](#scalenetriangle1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ScaleneTriangle1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ScaleneTriangle1BoxedMap -public static final class ScaleneTriangle1BoxedMap
-extends [ScaleneTriangle1Boxed](#scalenetriangle1boxed) +public record ScaleneTriangle1BoxedMap
+implements [ScaleneTriangle1Boxed](#scalenetriangle1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ScaleneTriangle1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ScaleneTriangle1 public static class ScaleneTriangle1
@@ -169,29 +175,32 @@ A schema class that validates payloads | [ScaleneTriangle1BoxedBoolean](#scalenetriangle1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [ScaleneTriangle1BoxedMap](#scalenetriangle1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [ScaleneTriangle1BoxedList](#scalenetriangle1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [ScaleneTriangle1Boxed](#scalenetriangle1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema1Boxed -public static abstract sealed class Schema1Boxed
+public sealed interface Schema1Boxed
permits
[Schema1BoxedMap](#schema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema1BoxedMap -public static final class Schema1BoxedMap
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedMap
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedMap([Schema1Map](#schema1map) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [Schema1Map](#schema1map) | data
validated payload | +| [Schema1Map](#schema1map) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1 public static class Schema1
@@ -236,7 +245,9 @@ ScaleneTriangle.Schema1Map validatedPayload = | ----------------- | ---------------------- | | [Schema1Map](#schema1map) | validate([Map<?, ?>](#schema1mapbuilder) arg, SchemaConfiguration configuration) | | [Schema1BoxedMap](#schema1boxedmap) | validateAndBox([Map<?, ?>](#schema1mapbuilder) arg, SchemaConfiguration configuration) | +| [Schema1Boxed](#schema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema1MapBuilder public class Schema1MapBuilder
builder for `Map` @@ -278,27 +289,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## TriangleTypeBoxed -public static abstract sealed class TriangleTypeBoxed
+public sealed interface TriangleTypeBoxed
permits
[TriangleTypeBoxedString](#triangletypeboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## TriangleTypeBoxedString -public static final class TriangleTypeBoxedString
-extends [TriangleTypeBoxed](#triangletypeboxed) +public record TriangleTypeBoxedString
+implements [TriangleTypeBoxed](#triangletypeboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | TriangleTypeBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## TriangleType public static class TriangleType
@@ -340,7 +352,9 @@ String validatedPayload = ScaleneTriangle.TriangleType.validate( | String | validate(String arg, SchemaConfiguration configuration) | | String | validate([StringTriangleTypeEnums](#stringtriangletypeenums) arg, SchemaConfiguration configuration) | | [TriangleTypeBoxedString](#triangletypeboxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [TriangleTypeBoxed](#triangletypeboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## StringTriangleTypeEnums public enum StringTriangleTypeEnums
extends `Enum` diff --git a/samples/client/petstore/java/docs/components/schemas/Schema200Response.md b/samples/client/petstore/java/docs/components/schemas/Schema200Response.md index 0435046ef80..e5f2df3e162 100644 --- a/samples/client/petstore/java/docs/components/schemas/Schema200Response.md +++ b/samples/client/petstore/java/docs/components/schemas/Schema200Response.md @@ -4,7 +4,7 @@ public class Schema200Response
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,25 +12,25 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Schema200Response.Schema200Response1Boxed](#schema200response1boxed)
abstract sealed validated payload class | -| static class | [Schema200Response.Schema200Response1BoxedVoid](#schema200response1boxedvoid)
boxed class to store validated null payloads | -| static class | [Schema200Response.Schema200Response1BoxedBoolean](#schema200response1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [Schema200Response.Schema200Response1BoxedNumber](#schema200response1boxednumber)
boxed class to store validated Number payloads | -| static class | [Schema200Response.Schema200Response1BoxedString](#schema200response1boxedstring)
boxed class to store validated String payloads | -| static class | [Schema200Response.Schema200Response1BoxedList](#schema200response1boxedlist)
boxed class to store validated List payloads | -| static class | [Schema200Response.Schema200Response1BoxedMap](#schema200response1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [Schema200Response.Schema200Response1Boxed](#schema200response1boxed)
sealed interface for validated payloads | +| record | [Schema200Response.Schema200Response1BoxedVoid](#schema200response1boxedvoid)
boxed class to store validated null payloads | +| record | [Schema200Response.Schema200Response1BoxedBoolean](#schema200response1boxedboolean)
boxed class to store validated boolean payloads | +| record | [Schema200Response.Schema200Response1BoxedNumber](#schema200response1boxednumber)
boxed class to store validated Number payloads | +| record | [Schema200Response.Schema200Response1BoxedString](#schema200response1boxedstring)
boxed class to store validated String payloads | +| record | [Schema200Response.Schema200Response1BoxedList](#schema200response1boxedlist)
boxed class to store validated List payloads | +| record | [Schema200Response.Schema200Response1BoxedMap](#schema200response1boxedmap)
boxed class to store validated Map payloads | | static class | [Schema200Response.Schema200Response1](#schema200response1)
schema class | | static class | [Schema200Response.Schema200ResponseMapBuilder](#schema200responsemapbuilder)
builder for Map payloads | | static class | [Schema200Response.Schema200ResponseMap](#schema200responsemap)
output class for Map payloads | -| static class | [Schema200Response.ClassSchemaBoxed](#classschemaboxed)
abstract sealed validated payload class | -| static class | [Schema200Response.ClassSchemaBoxedString](#classschemaboxedstring)
boxed class to store validated String payloads | +| sealed interface | [Schema200Response.ClassSchemaBoxed](#classschemaboxed)
sealed interface for validated payloads | +| record | [Schema200Response.ClassSchemaBoxedString](#classschemaboxedstring)
boxed class to store validated String payloads | | static class | [Schema200Response.ClassSchema](#classschema)
schema class | -| static class | [Schema200Response.NameBoxed](#nameboxed)
abstract sealed validated payload class | -| static class | [Schema200Response.NameBoxedNumber](#nameboxednumber)
boxed class to store validated Number payloads | +| sealed interface | [Schema200Response.NameBoxed](#nameboxed)
sealed interface for validated payloads | +| record | [Schema200Response.NameBoxedNumber](#nameboxednumber)
boxed class to store validated Number payloads | | static class | [Schema200Response.Name](#name)
schema class | ## Schema200Response1Boxed -public static abstract sealed class Schema200Response1Boxed
+public sealed interface Schema200Response1Boxed
permits
[Schema200Response1BoxedVoid](#schema200response1boxedvoid), [Schema200Response1BoxedBoolean](#schema200response1boxedboolean), @@ -39,103 +39,109 @@ permits
[Schema200Response1BoxedList](#schema200response1boxedlist), [Schema200Response1BoxedMap](#schema200response1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema200Response1BoxedVoid -public static final class Schema200Response1BoxedVoid
-extends [Schema200Response1Boxed](#schema200response1boxed) +public record Schema200Response1BoxedVoid
+implements [Schema200Response1Boxed](#schema200response1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema200Response1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema200Response1BoxedBoolean -public static final class Schema200Response1BoxedBoolean
-extends [Schema200Response1Boxed](#schema200response1boxed) +public record Schema200Response1BoxedBoolean
+implements [Schema200Response1Boxed](#schema200response1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema200Response1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema200Response1BoxedNumber -public static final class Schema200Response1BoxedNumber
-extends [Schema200Response1Boxed](#schema200response1boxed) +public record Schema200Response1BoxedNumber
+implements [Schema200Response1Boxed](#schema200response1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema200Response1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema200Response1BoxedString -public static final class Schema200Response1BoxedString
-extends [Schema200Response1Boxed](#schema200response1boxed) +public record Schema200Response1BoxedString
+implements [Schema200Response1Boxed](#schema200response1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema200Response1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema200Response1BoxedList -public static final class Schema200Response1BoxedList
-extends [Schema200Response1Boxed](#schema200response1boxed) +public record Schema200Response1BoxedList
+implements [Schema200Response1Boxed](#schema200response1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema200Response1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema200Response1BoxedMap -public static final class Schema200Response1BoxedMap
-extends [Schema200Response1Boxed](#schema200response1boxed) +public record Schema200Response1BoxedMap
+implements [Schema200Response1Boxed](#schema200response1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema200Response1BoxedMap([Schema200ResponseMap](#schema200responsemap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [Schema200ResponseMap](#schema200responsemap) | data
validated payload | +| [Schema200ResponseMap](#schema200responsemap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema200Response1 public static class Schema200Response1
@@ -170,7 +176,9 @@ model with an invalid class name for python, starts with a number | [Schema200Response1BoxedBoolean](#schema200response1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Schema200Response1BoxedMap](#schema200response1boxedmap) | validateAndBox([Map<?, ?>](#schema200responsemapbuilder) arg, SchemaConfiguration configuration) | | [Schema200Response1BoxedList](#schema200response1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Schema200Response1Boxed](#schema200response1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema200ResponseMapBuilder public class Schema200ResponseMapBuilder
builder for `Map` @@ -214,27 +222,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## ClassSchemaBoxed -public static abstract sealed class ClassSchemaBoxed
+public sealed interface ClassSchemaBoxed
permits
[ClassSchemaBoxedString](#classschemaboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ClassSchemaBoxedString -public static final class ClassSchemaBoxedString
-extends [ClassSchemaBoxed](#classschemaboxed) +public record ClassSchemaBoxedString
+implements [ClassSchemaBoxed](#classschemaboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ClassSchemaBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ClassSchema public static class ClassSchema
@@ -251,27 +260,28 @@ this is a reserved python keyword | validateAndBox | ## NameBoxed -public static abstract sealed class NameBoxed
+public sealed interface NameBoxed
permits
[NameBoxedNumber](#nameboxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## NameBoxedNumber -public static final class NameBoxedNumber
-extends [NameBoxed](#nameboxed) +public record NameBoxedNumber
+implements [NameBoxed](#nameboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NameBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Name public static class Name
diff --git a/samples/client/petstore/java/docs/components/schemas/SelfReferencingArrayModel.md b/samples/client/petstore/java/docs/components/schemas/SelfReferencingArrayModel.md index 8e08753da72..d8ede7ede57 100644 --- a/samples/client/petstore/java/docs/components/schemas/SelfReferencingArrayModel.md +++ b/samples/client/petstore/java/docs/components/schemas/SelfReferencingArrayModel.md @@ -4,7 +4,7 @@ public class SelfReferencingArrayModel
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated list payloads, extends FrozenList - classes to build inputs for list payloads @@ -12,34 +12,35 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [SelfReferencingArrayModel.SelfReferencingArrayModel1Boxed](#selfreferencingarraymodel1boxed)
abstract sealed validated payload class | -| static class | [SelfReferencingArrayModel.SelfReferencingArrayModel1BoxedList](#selfreferencingarraymodel1boxedlist)
boxed class to store validated List payloads | +| sealed interface | [SelfReferencingArrayModel.SelfReferencingArrayModel1Boxed](#selfreferencingarraymodel1boxed)
sealed interface for validated payloads | +| record | [SelfReferencingArrayModel.SelfReferencingArrayModel1BoxedList](#selfreferencingarraymodel1boxedlist)
boxed class to store validated List payloads | | static class | [SelfReferencingArrayModel.SelfReferencingArrayModel1](#selfreferencingarraymodel1)
schema class | | static class | [SelfReferencingArrayModel.SelfReferencingArrayModelListBuilder](#selfreferencingarraymodellistbuilder)
builder for List payloads | | static class | [SelfReferencingArrayModel.SelfReferencingArrayModelList](#selfreferencingarraymodellist)
output class for List payloads | ## SelfReferencingArrayModel1Boxed -public static abstract sealed class SelfReferencingArrayModel1Boxed
+public sealed interface SelfReferencingArrayModel1Boxed
permits
[SelfReferencingArrayModel1BoxedList](#selfreferencingarraymodel1boxedlist) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## SelfReferencingArrayModel1BoxedList -public static final class SelfReferencingArrayModel1BoxedList
-extends [SelfReferencingArrayModel1Boxed](#selfreferencingarraymodel1boxed) +public record SelfReferencingArrayModel1BoxedList
+implements [SelfReferencingArrayModel1Boxed](#selfreferencingarraymodel1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | SelfReferencingArrayModel1BoxedList([SelfReferencingArrayModelList](#selfreferencingarraymodellist) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [SelfReferencingArrayModelList](#selfreferencingarraymodellist) | data
validated payload | +| [SelfReferencingArrayModelList](#selfreferencingarraymodellist) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## SelfReferencingArrayModel1 public static class SelfReferencingArrayModel1
@@ -82,7 +83,9 @@ SelfReferencingArrayModel.SelfReferencingArrayModelList validatedPayload = | ----------------- | ---------------------- | | [SelfReferencingArrayModelList](#selfreferencingarraymodellist) | validate([List](#selfreferencingarraymodellistbuilder) arg, SchemaConfiguration configuration) | | [SelfReferencingArrayModel1BoxedList](#selfreferencingarraymodel1boxedlist) | validateAndBox([List](#selfreferencingarraymodellistbuilder) arg, SchemaConfiguration configuration) | +| [SelfReferencingArrayModel1Boxed](#selfreferencingarraymodel1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## SelfReferencingArrayModelListBuilder public class SelfReferencingArrayModelListBuilder
builder for `List>` diff --git a/samples/client/petstore/java/docs/components/schemas/SelfReferencingObjectModel.md b/samples/client/petstore/java/docs/components/schemas/SelfReferencingObjectModel.md index 1b4d9c8fd47..5bce083d9bb 100644 --- a/samples/client/petstore/java/docs/components/schemas/SelfReferencingObjectModel.md +++ b/samples/client/petstore/java/docs/components/schemas/SelfReferencingObjectModel.md @@ -4,7 +4,7 @@ public class SelfReferencingObjectModel
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,34 +12,35 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [SelfReferencingObjectModel.SelfReferencingObjectModel1Boxed](#selfreferencingobjectmodel1boxed)
abstract sealed validated payload class | -| static class | [SelfReferencingObjectModel.SelfReferencingObjectModel1BoxedMap](#selfreferencingobjectmodel1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [SelfReferencingObjectModel.SelfReferencingObjectModel1Boxed](#selfreferencingobjectmodel1boxed)
sealed interface for validated payloads | +| record | [SelfReferencingObjectModel.SelfReferencingObjectModel1BoxedMap](#selfreferencingobjectmodel1boxedmap)
boxed class to store validated Map payloads | | static class | [SelfReferencingObjectModel.SelfReferencingObjectModel1](#selfreferencingobjectmodel1)
schema class | | static class | [SelfReferencingObjectModel.SelfReferencingObjectModelMapBuilder](#selfreferencingobjectmodelmapbuilder)
builder for Map payloads | | static class | [SelfReferencingObjectModel.SelfReferencingObjectModelMap](#selfreferencingobjectmodelmap)
output class for Map payloads | ## SelfReferencingObjectModel1Boxed -public static abstract sealed class SelfReferencingObjectModel1Boxed
+public sealed interface SelfReferencingObjectModel1Boxed
permits
[SelfReferencingObjectModel1BoxedMap](#selfreferencingobjectmodel1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## SelfReferencingObjectModel1BoxedMap -public static final class SelfReferencingObjectModel1BoxedMap
-extends [SelfReferencingObjectModel1Boxed](#selfreferencingobjectmodel1boxed) +public record SelfReferencingObjectModel1BoxedMap
+implements [SelfReferencingObjectModel1Boxed](#selfreferencingobjectmodel1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | SelfReferencingObjectModel1BoxedMap([SelfReferencingObjectModelMap](#selfreferencingobjectmodelmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [SelfReferencingObjectModelMap](#selfreferencingobjectmodelmap) | data
validated payload | +| [SelfReferencingObjectModelMap](#selfreferencingobjectmodelmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## SelfReferencingObjectModel1 public static class SelfReferencingObjectModel1
@@ -83,7 +84,9 @@ SelfReferencingObjectModel.SelfReferencingObjectModelMap validatedPayload = | ----------------- | ---------------------- | | [SelfReferencingObjectModelMap](#selfreferencingobjectmodelmap) | validate([Map<?, ?>](#selfreferencingobjectmodelmapbuilder) arg, SchemaConfiguration configuration) | | [SelfReferencingObjectModel1BoxedMap](#selfreferencingobjectmodel1boxedmap) | validateAndBox([Map<?, ?>](#selfreferencingobjectmodelmapbuilder) arg, SchemaConfiguration configuration) | +| [SelfReferencingObjectModel1Boxed](#selfreferencingobjectmodel1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## SelfReferencingObjectModelMapBuilder public class SelfReferencingObjectModelMapBuilder
builder for `Map` diff --git a/samples/client/petstore/java/docs/components/schemas/Shape.md b/samples/client/petstore/java/docs/components/schemas/Shape.md index 4ebe882efae..6c0f79aec8d 100644 --- a/samples/client/petstore/java/docs/components/schemas/Shape.md +++ b/samples/client/petstore/java/docs/components/schemas/Shape.md @@ -4,23 +4,23 @@ public class Shape
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Shape.Shape1Boxed](#shape1boxed)
abstract sealed validated payload class | -| static class | [Shape.Shape1BoxedVoid](#shape1boxedvoid)
boxed class to store validated null payloads | -| static class | [Shape.Shape1BoxedBoolean](#shape1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [Shape.Shape1BoxedNumber](#shape1boxednumber)
boxed class to store validated Number payloads | -| static class | [Shape.Shape1BoxedString](#shape1boxedstring)
boxed class to store validated String payloads | -| static class | [Shape.Shape1BoxedList](#shape1boxedlist)
boxed class to store validated List payloads | -| static class | [Shape.Shape1BoxedMap](#shape1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [Shape.Shape1Boxed](#shape1boxed)
sealed interface for validated payloads | +| record | [Shape.Shape1BoxedVoid](#shape1boxedvoid)
boxed class to store validated null payloads | +| record | [Shape.Shape1BoxedBoolean](#shape1boxedboolean)
boxed class to store validated boolean payloads | +| record | [Shape.Shape1BoxedNumber](#shape1boxednumber)
boxed class to store validated Number payloads | +| record | [Shape.Shape1BoxedString](#shape1boxedstring)
boxed class to store validated String payloads | +| record | [Shape.Shape1BoxedList](#shape1boxedlist)
boxed class to store validated List payloads | +| record | [Shape.Shape1BoxedMap](#shape1boxedmap)
boxed class to store validated Map payloads | | static class | [Shape.Shape1](#shape1)
schema class | ## Shape1Boxed -public static abstract sealed class Shape1Boxed
+public sealed interface Shape1Boxed
permits
[Shape1BoxedVoid](#shape1boxedvoid), [Shape1BoxedBoolean](#shape1boxedboolean), @@ -29,103 +29,109 @@ permits
[Shape1BoxedList](#shape1boxedlist), [Shape1BoxedMap](#shape1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Shape1BoxedVoid -public static final class Shape1BoxedVoid
-extends [Shape1Boxed](#shape1boxed) +public record Shape1BoxedVoid
+implements [Shape1Boxed](#shape1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Shape1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Shape1BoxedBoolean -public static final class Shape1BoxedBoolean
-extends [Shape1Boxed](#shape1boxed) +public record Shape1BoxedBoolean
+implements [Shape1Boxed](#shape1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Shape1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Shape1BoxedNumber -public static final class Shape1BoxedNumber
-extends [Shape1Boxed](#shape1boxed) +public record Shape1BoxedNumber
+implements [Shape1Boxed](#shape1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Shape1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Shape1BoxedString -public static final class Shape1BoxedString
-extends [Shape1Boxed](#shape1boxed) +public record Shape1BoxedString
+implements [Shape1Boxed](#shape1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Shape1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Shape1BoxedList -public static final class Shape1BoxedList
-extends [Shape1Boxed](#shape1boxed) +public record Shape1BoxedList
+implements [Shape1Boxed](#shape1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Shape1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Shape1BoxedMap -public static final class Shape1BoxedMap
-extends [Shape1Boxed](#shape1boxed) +public record Shape1BoxedMap
+implements [Shape1Boxed](#shape1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Shape1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Shape1 public static class Shape1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [Shape1BoxedBoolean](#shape1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Shape1BoxedMap](#shape1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [Shape1BoxedList](#shape1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Shape1Boxed](#shape1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/components/schemas/ShapeOrNull.md b/samples/client/petstore/java/docs/components/schemas/ShapeOrNull.md index bec6a14b97e..ae25fb658b4 100644 --- a/samples/client/petstore/java/docs/components/schemas/ShapeOrNull.md +++ b/samples/client/petstore/java/docs/components/schemas/ShapeOrNull.md @@ -4,26 +4,26 @@ public class ShapeOrNull
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ShapeOrNull.ShapeOrNull1Boxed](#shapeornull1boxed)
abstract sealed validated payload class | -| static class | [ShapeOrNull.ShapeOrNull1BoxedVoid](#shapeornull1boxedvoid)
boxed class to store validated null payloads | -| static class | [ShapeOrNull.ShapeOrNull1BoxedBoolean](#shapeornull1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [ShapeOrNull.ShapeOrNull1BoxedNumber](#shapeornull1boxednumber)
boxed class to store validated Number payloads | -| static class | [ShapeOrNull.ShapeOrNull1BoxedString](#shapeornull1boxedstring)
boxed class to store validated String payloads | -| static class | [ShapeOrNull.ShapeOrNull1BoxedList](#shapeornull1boxedlist)
boxed class to store validated List payloads | -| static class | [ShapeOrNull.ShapeOrNull1BoxedMap](#shapeornull1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ShapeOrNull.ShapeOrNull1Boxed](#shapeornull1boxed)
sealed interface for validated payloads | +| record | [ShapeOrNull.ShapeOrNull1BoxedVoid](#shapeornull1boxedvoid)
boxed class to store validated null payloads | +| record | [ShapeOrNull.ShapeOrNull1BoxedBoolean](#shapeornull1boxedboolean)
boxed class to store validated boolean payloads | +| record | [ShapeOrNull.ShapeOrNull1BoxedNumber](#shapeornull1boxednumber)
boxed class to store validated Number payloads | +| record | [ShapeOrNull.ShapeOrNull1BoxedString](#shapeornull1boxedstring)
boxed class to store validated String payloads | +| record | [ShapeOrNull.ShapeOrNull1BoxedList](#shapeornull1boxedlist)
boxed class to store validated List payloads | +| record | [ShapeOrNull.ShapeOrNull1BoxedMap](#shapeornull1boxedmap)
boxed class to store validated Map payloads | | static class | [ShapeOrNull.ShapeOrNull1](#shapeornull1)
schema class | -| static class | [ShapeOrNull.Schema0Boxed](#schema0boxed)
abstract sealed validated payload class | -| static class | [ShapeOrNull.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | +| sealed interface | [ShapeOrNull.Schema0Boxed](#schema0boxed)
sealed interface for validated payloads | +| record | [ShapeOrNull.Schema0BoxedVoid](#schema0boxedvoid)
boxed class to store validated null payloads | | static class | [ShapeOrNull.Schema0](#schema0)
schema class | ## ShapeOrNull1Boxed -public static abstract sealed class ShapeOrNull1Boxed
+public sealed interface ShapeOrNull1Boxed
permits
[ShapeOrNull1BoxedVoid](#shapeornull1boxedvoid), [ShapeOrNull1BoxedBoolean](#shapeornull1boxedboolean), @@ -32,103 +32,109 @@ permits
[ShapeOrNull1BoxedList](#shapeornull1boxedlist), [ShapeOrNull1BoxedMap](#shapeornull1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ShapeOrNull1BoxedVoid -public static final class ShapeOrNull1BoxedVoid
-extends [ShapeOrNull1Boxed](#shapeornull1boxed) +public record ShapeOrNull1BoxedVoid
+implements [ShapeOrNull1Boxed](#shapeornull1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ShapeOrNull1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ShapeOrNull1BoxedBoolean -public static final class ShapeOrNull1BoxedBoolean
-extends [ShapeOrNull1Boxed](#shapeornull1boxed) +public record ShapeOrNull1BoxedBoolean
+implements [ShapeOrNull1Boxed](#shapeornull1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ShapeOrNull1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ShapeOrNull1BoxedNumber -public static final class ShapeOrNull1BoxedNumber
-extends [ShapeOrNull1Boxed](#shapeornull1boxed) +public record ShapeOrNull1BoxedNumber
+implements [ShapeOrNull1Boxed](#shapeornull1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ShapeOrNull1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ShapeOrNull1BoxedString -public static final class ShapeOrNull1BoxedString
-extends [ShapeOrNull1Boxed](#shapeornull1boxed) +public record ShapeOrNull1BoxedString
+implements [ShapeOrNull1Boxed](#shapeornull1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ShapeOrNull1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ShapeOrNull1BoxedList -public static final class ShapeOrNull1BoxedList
-extends [ShapeOrNull1Boxed](#shapeornull1boxed) +public record ShapeOrNull1BoxedList
+implements [ShapeOrNull1Boxed](#shapeornull1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ShapeOrNull1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ShapeOrNull1BoxedMap -public static final class ShapeOrNull1BoxedMap
-extends [ShapeOrNull1Boxed](#shapeornull1boxed) +public record ShapeOrNull1BoxedMap
+implements [ShapeOrNull1Boxed](#shapeornull1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ShapeOrNull1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ShapeOrNull1 public static class ShapeOrNull1
@@ -163,29 +169,32 @@ The value may be a shape or the 'null' value. This is introduced in OA | [ShapeOrNull1BoxedBoolean](#shapeornull1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [ShapeOrNull1BoxedMap](#shapeornull1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [ShapeOrNull1BoxedList](#shapeornull1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [ShapeOrNull1Boxed](#shapeornull1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema0Boxed -public static abstract sealed class Schema0Boxed
+public sealed interface Schema0Boxed
permits
[Schema0BoxedVoid](#schema0boxedvoid) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema0BoxedVoid -public static final class Schema0BoxedVoid
-extends [Schema0Boxed](#schema0boxed) +public record Schema0BoxedVoid
+implements [Schema0Boxed](#schema0boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema0BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema0 public static class Schema0
diff --git a/samples/client/petstore/java/docs/components/schemas/SimpleQuadrilateral.md b/samples/client/petstore/java/docs/components/schemas/SimpleQuadrilateral.md index 153bf41d5d4..698beffa2f0 100644 --- a/samples/client/petstore/java/docs/components/schemas/SimpleQuadrilateral.md +++ b/samples/client/petstore/java/docs/components/schemas/SimpleQuadrilateral.md @@ -4,7 +4,7 @@ public class SimpleQuadrilateral
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -13,26 +13,26 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [SimpleQuadrilateral.SimpleQuadrilateral1Boxed](#simplequadrilateral1boxed)
abstract sealed validated payload class | -| static class | [SimpleQuadrilateral.SimpleQuadrilateral1BoxedVoid](#simplequadrilateral1boxedvoid)
boxed class to store validated null payloads | -| static class | [SimpleQuadrilateral.SimpleQuadrilateral1BoxedBoolean](#simplequadrilateral1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [SimpleQuadrilateral.SimpleQuadrilateral1BoxedNumber](#simplequadrilateral1boxednumber)
boxed class to store validated Number payloads | -| static class | [SimpleQuadrilateral.SimpleQuadrilateral1BoxedString](#simplequadrilateral1boxedstring)
boxed class to store validated String payloads | -| static class | [SimpleQuadrilateral.SimpleQuadrilateral1BoxedList](#simplequadrilateral1boxedlist)
boxed class to store validated List payloads | -| static class | [SimpleQuadrilateral.SimpleQuadrilateral1BoxedMap](#simplequadrilateral1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [SimpleQuadrilateral.SimpleQuadrilateral1Boxed](#simplequadrilateral1boxed)
sealed interface for validated payloads | +| record | [SimpleQuadrilateral.SimpleQuadrilateral1BoxedVoid](#simplequadrilateral1boxedvoid)
boxed class to store validated null payloads | +| record | [SimpleQuadrilateral.SimpleQuadrilateral1BoxedBoolean](#simplequadrilateral1boxedboolean)
boxed class to store validated boolean payloads | +| record | [SimpleQuadrilateral.SimpleQuadrilateral1BoxedNumber](#simplequadrilateral1boxednumber)
boxed class to store validated Number payloads | +| record | [SimpleQuadrilateral.SimpleQuadrilateral1BoxedString](#simplequadrilateral1boxedstring)
boxed class to store validated String payloads | +| record | [SimpleQuadrilateral.SimpleQuadrilateral1BoxedList](#simplequadrilateral1boxedlist)
boxed class to store validated List payloads | +| record | [SimpleQuadrilateral.SimpleQuadrilateral1BoxedMap](#simplequadrilateral1boxedmap)
boxed class to store validated Map payloads | | static class | [SimpleQuadrilateral.SimpleQuadrilateral1](#simplequadrilateral1)
schema class | -| static class | [SimpleQuadrilateral.Schema1Boxed](#schema1boxed)
abstract sealed validated payload class | -| static class | [SimpleQuadrilateral.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [SimpleQuadrilateral.Schema1Boxed](#schema1boxed)
sealed interface for validated payloads | +| record | [SimpleQuadrilateral.Schema1BoxedMap](#schema1boxedmap)
boxed class to store validated Map payloads | | static class | [SimpleQuadrilateral.Schema1](#schema1)
schema class | | static class | [SimpleQuadrilateral.Schema1MapBuilder](#schema1mapbuilder)
builder for Map payloads | | static class | [SimpleQuadrilateral.Schema1Map](#schema1map)
output class for Map payloads | -| static class | [SimpleQuadrilateral.QuadrilateralTypeBoxed](#quadrilateraltypeboxed)
abstract sealed validated payload class | -| static class | [SimpleQuadrilateral.QuadrilateralTypeBoxedString](#quadrilateraltypeboxedstring)
boxed class to store validated String payloads | +| sealed interface | [SimpleQuadrilateral.QuadrilateralTypeBoxed](#quadrilateraltypeboxed)
sealed interface for validated payloads | +| record | [SimpleQuadrilateral.QuadrilateralTypeBoxedString](#quadrilateraltypeboxedstring)
boxed class to store validated String payloads | | static class | [SimpleQuadrilateral.QuadrilateralType](#quadrilateraltype)
schema class | | enum | [SimpleQuadrilateral.StringQuadrilateralTypeEnums](#stringquadrilateraltypeenums)
String enum | ## SimpleQuadrilateral1Boxed -public static abstract sealed class SimpleQuadrilateral1Boxed
+public sealed interface SimpleQuadrilateral1Boxed
permits
[SimpleQuadrilateral1BoxedVoid](#simplequadrilateral1boxedvoid), [SimpleQuadrilateral1BoxedBoolean](#simplequadrilateral1boxedboolean), @@ -41,103 +41,109 @@ permits
[SimpleQuadrilateral1BoxedList](#simplequadrilateral1boxedlist), [SimpleQuadrilateral1BoxedMap](#simplequadrilateral1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## SimpleQuadrilateral1BoxedVoid -public static final class SimpleQuadrilateral1BoxedVoid
-extends [SimpleQuadrilateral1Boxed](#simplequadrilateral1boxed) +public record SimpleQuadrilateral1BoxedVoid
+implements [SimpleQuadrilateral1Boxed](#simplequadrilateral1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | SimpleQuadrilateral1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## SimpleQuadrilateral1BoxedBoolean -public static final class SimpleQuadrilateral1BoxedBoolean
-extends [SimpleQuadrilateral1Boxed](#simplequadrilateral1boxed) +public record SimpleQuadrilateral1BoxedBoolean
+implements [SimpleQuadrilateral1Boxed](#simplequadrilateral1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | SimpleQuadrilateral1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## SimpleQuadrilateral1BoxedNumber -public static final class SimpleQuadrilateral1BoxedNumber
-extends [SimpleQuadrilateral1Boxed](#simplequadrilateral1boxed) +public record SimpleQuadrilateral1BoxedNumber
+implements [SimpleQuadrilateral1Boxed](#simplequadrilateral1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | SimpleQuadrilateral1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## SimpleQuadrilateral1BoxedString -public static final class SimpleQuadrilateral1BoxedString
-extends [SimpleQuadrilateral1Boxed](#simplequadrilateral1boxed) +public record SimpleQuadrilateral1BoxedString
+implements [SimpleQuadrilateral1Boxed](#simplequadrilateral1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | SimpleQuadrilateral1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## SimpleQuadrilateral1BoxedList -public static final class SimpleQuadrilateral1BoxedList
-extends [SimpleQuadrilateral1Boxed](#simplequadrilateral1boxed) +public record SimpleQuadrilateral1BoxedList
+implements [SimpleQuadrilateral1Boxed](#simplequadrilateral1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | SimpleQuadrilateral1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## SimpleQuadrilateral1BoxedMap -public static final class SimpleQuadrilateral1BoxedMap
-extends [SimpleQuadrilateral1Boxed](#simplequadrilateral1boxed) +public record SimpleQuadrilateral1BoxedMap
+implements [SimpleQuadrilateral1Boxed](#simplequadrilateral1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | SimpleQuadrilateral1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## SimpleQuadrilateral1 public static class SimpleQuadrilateral1
@@ -169,29 +175,32 @@ A schema class that validates payloads | [SimpleQuadrilateral1BoxedBoolean](#simplequadrilateral1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [SimpleQuadrilateral1BoxedMap](#simplequadrilateral1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [SimpleQuadrilateral1BoxedList](#simplequadrilateral1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [SimpleQuadrilateral1Boxed](#simplequadrilateral1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema1Boxed -public static abstract sealed class Schema1Boxed
+public sealed interface Schema1Boxed
permits
[Schema1BoxedMap](#schema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema1BoxedMap -public static final class Schema1BoxedMap
-extends [Schema1Boxed](#schema1boxed) +public record Schema1BoxedMap
+implements [Schema1Boxed](#schema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema1BoxedMap([Schema1Map](#schema1map) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [Schema1Map](#schema1map) | data
validated payload | +| [Schema1Map](#schema1map) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema1 public static class Schema1
@@ -236,7 +245,9 @@ SimpleQuadrilateral.Schema1Map validatedPayload = | ----------------- | ---------------------- | | [Schema1Map](#schema1map) | validate([Map<?, ?>](#schema1mapbuilder) arg, SchemaConfiguration configuration) | | [Schema1BoxedMap](#schema1boxedmap) | validateAndBox([Map<?, ?>](#schema1mapbuilder) arg, SchemaConfiguration configuration) | +| [Schema1Boxed](#schema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema1MapBuilder public class Schema1MapBuilder
builder for `Map` @@ -278,27 +289,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## QuadrilateralTypeBoxed -public static abstract sealed class QuadrilateralTypeBoxed
+public sealed interface QuadrilateralTypeBoxed
permits
[QuadrilateralTypeBoxedString](#quadrilateraltypeboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## QuadrilateralTypeBoxedString -public static final class QuadrilateralTypeBoxedString
-extends [QuadrilateralTypeBoxed](#quadrilateraltypeboxed) +public record QuadrilateralTypeBoxedString
+implements [QuadrilateralTypeBoxed](#quadrilateraltypeboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | QuadrilateralTypeBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## QuadrilateralType public static class QuadrilateralType
@@ -340,7 +352,9 @@ String validatedPayload = SimpleQuadrilateral.QuadrilateralType.validate( | String | validate(String arg, SchemaConfiguration configuration) | | String | validate([StringQuadrilateralTypeEnums](#stringquadrilateraltypeenums) arg, SchemaConfiguration configuration) | | [QuadrilateralTypeBoxedString](#quadrilateraltypeboxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [QuadrilateralTypeBoxed](#quadrilateraltypeboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## StringQuadrilateralTypeEnums public enum StringQuadrilateralTypeEnums
extends `Enum` diff --git a/samples/client/petstore/java/docs/components/schemas/SomeObject.md b/samples/client/petstore/java/docs/components/schemas/SomeObject.md index 2c782576465..89784b7e81d 100644 --- a/samples/client/petstore/java/docs/components/schemas/SomeObject.md +++ b/samples/client/petstore/java/docs/components/schemas/SomeObject.md @@ -4,23 +4,23 @@ public class SomeObject
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [SomeObject.SomeObject1Boxed](#someobject1boxed)
abstract sealed validated payload class | -| static class | [SomeObject.SomeObject1BoxedVoid](#someobject1boxedvoid)
boxed class to store validated null payloads | -| static class | [SomeObject.SomeObject1BoxedBoolean](#someobject1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [SomeObject.SomeObject1BoxedNumber](#someobject1boxednumber)
boxed class to store validated Number payloads | -| static class | [SomeObject.SomeObject1BoxedString](#someobject1boxedstring)
boxed class to store validated String payloads | -| static class | [SomeObject.SomeObject1BoxedList](#someobject1boxedlist)
boxed class to store validated List payloads | -| static class | [SomeObject.SomeObject1BoxedMap](#someobject1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [SomeObject.SomeObject1Boxed](#someobject1boxed)
sealed interface for validated payloads | +| record | [SomeObject.SomeObject1BoxedVoid](#someobject1boxedvoid)
boxed class to store validated null payloads | +| record | [SomeObject.SomeObject1BoxedBoolean](#someobject1boxedboolean)
boxed class to store validated boolean payloads | +| record | [SomeObject.SomeObject1BoxedNumber](#someobject1boxednumber)
boxed class to store validated Number payloads | +| record | [SomeObject.SomeObject1BoxedString](#someobject1boxedstring)
boxed class to store validated String payloads | +| record | [SomeObject.SomeObject1BoxedList](#someobject1boxedlist)
boxed class to store validated List payloads | +| record | [SomeObject.SomeObject1BoxedMap](#someobject1boxedmap)
boxed class to store validated Map payloads | | static class | [SomeObject.SomeObject1](#someobject1)
schema class | ## SomeObject1Boxed -public static abstract sealed class SomeObject1Boxed
+public sealed interface SomeObject1Boxed
permits
[SomeObject1BoxedVoid](#someobject1boxedvoid), [SomeObject1BoxedBoolean](#someobject1boxedboolean), @@ -29,103 +29,109 @@ permits
[SomeObject1BoxedList](#someobject1boxedlist), [SomeObject1BoxedMap](#someobject1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## SomeObject1BoxedVoid -public static final class SomeObject1BoxedVoid
-extends [SomeObject1Boxed](#someobject1boxed) +public record SomeObject1BoxedVoid
+implements [SomeObject1Boxed](#someobject1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | SomeObject1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## SomeObject1BoxedBoolean -public static final class SomeObject1BoxedBoolean
-extends [SomeObject1Boxed](#someobject1boxed) +public record SomeObject1BoxedBoolean
+implements [SomeObject1Boxed](#someobject1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | SomeObject1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## SomeObject1BoxedNumber -public static final class SomeObject1BoxedNumber
-extends [SomeObject1Boxed](#someobject1boxed) +public record SomeObject1BoxedNumber
+implements [SomeObject1Boxed](#someobject1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | SomeObject1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## SomeObject1BoxedString -public static final class SomeObject1BoxedString
-extends [SomeObject1Boxed](#someobject1boxed) +public record SomeObject1BoxedString
+implements [SomeObject1Boxed](#someobject1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | SomeObject1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## SomeObject1BoxedList -public static final class SomeObject1BoxedList
-extends [SomeObject1Boxed](#someobject1boxed) +public record SomeObject1BoxedList
+implements [SomeObject1Boxed](#someobject1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | SomeObject1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## SomeObject1BoxedMap -public static final class SomeObject1BoxedMap
-extends [SomeObject1Boxed](#someobject1boxed) +public record SomeObject1BoxedMap
+implements [SomeObject1Boxed](#someobject1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | SomeObject1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## SomeObject1 public static class SomeObject1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [SomeObject1BoxedBoolean](#someobject1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [SomeObject1BoxedMap](#someobject1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [SomeObject1BoxedList](#someobject1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [SomeObject1Boxed](#someobject1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/components/schemas/SpecialModelname.md b/samples/client/petstore/java/docs/components/schemas/SpecialModelname.md index ee8442dd9c3..26d0a340d10 100644 --- a/samples/client/petstore/java/docs/components/schemas/SpecialModelname.md +++ b/samples/client/petstore/java/docs/components/schemas/SpecialModelname.md @@ -4,7 +4,7 @@ public class SpecialModelname
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,37 +12,38 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [SpecialModelname.SpecialModelname1Boxed](#specialmodelname1boxed)
abstract sealed validated payload class | -| static class | [SpecialModelname.SpecialModelname1BoxedMap](#specialmodelname1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [SpecialModelname.SpecialModelname1Boxed](#specialmodelname1boxed)
sealed interface for validated payloads | +| record | [SpecialModelname.SpecialModelname1BoxedMap](#specialmodelname1boxedmap)
boxed class to store validated Map payloads | | static class | [SpecialModelname.SpecialModelname1](#specialmodelname1)
schema class | | static class | [SpecialModelname.SpecialModelnameMapBuilder](#specialmodelnamemapbuilder)
builder for Map payloads | | static class | [SpecialModelname.SpecialModelnameMap](#specialmodelnamemap)
output class for Map payloads | -| static class | [SpecialModelname.ABoxed](#aboxed)
abstract sealed validated payload class | -| static class | [SpecialModelname.ABoxedString](#aboxedstring)
boxed class to store validated String payloads | +| sealed interface | [SpecialModelname.ABoxed](#aboxed)
sealed interface for validated payloads | +| record | [SpecialModelname.ABoxedString](#aboxedstring)
boxed class to store validated String payloads | | static class | [SpecialModelname.A](#a)
schema class | ## SpecialModelname1Boxed -public static abstract sealed class SpecialModelname1Boxed
+public sealed interface SpecialModelname1Boxed
permits
[SpecialModelname1BoxedMap](#specialmodelname1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## SpecialModelname1BoxedMap -public static final class SpecialModelname1BoxedMap
-extends [SpecialModelname1Boxed](#specialmodelname1boxed) +public record SpecialModelname1BoxedMap
+implements [SpecialModelname1Boxed](#specialmodelname1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | SpecialModelname1BoxedMap([SpecialModelnameMap](#specialmodelnamemap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [SpecialModelnameMap](#specialmodelnamemap) | data
validated payload | +| [SpecialModelnameMap](#specialmodelnamemap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## SpecialModelname1 public static class SpecialModelname1
@@ -90,7 +91,9 @@ SpecialModelname.SpecialModelnameMap validatedPayload = | ----------------- | ---------------------- | | [SpecialModelnameMap](#specialmodelnamemap) | validate([Map<?, ?>](#specialmodelnamemapbuilder) arg, SchemaConfiguration configuration) | | [SpecialModelname1BoxedMap](#specialmodelname1boxedmap) | validateAndBox([Map<?, ?>](#specialmodelnamemapbuilder) arg, SchemaConfiguration configuration) | +| [SpecialModelname1Boxed](#specialmodelname1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## SpecialModelnameMapBuilder public class SpecialModelnameMapBuilder
builder for `Map` @@ -131,27 +134,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## ABoxed -public static abstract sealed class ABoxed
+public sealed interface ABoxed
permits
[ABoxedString](#aboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ABoxedString -public static final class ABoxedString
-extends [ABoxed](#aboxed) +public record ABoxedString
+implements [ABoxed](#aboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ABoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## A public static class A
diff --git a/samples/client/petstore/java/docs/components/schemas/StringBooleanMap.md b/samples/client/petstore/java/docs/components/schemas/StringBooleanMap.md index a70aa3689e1..f4951685a14 100644 --- a/samples/client/petstore/java/docs/components/schemas/StringBooleanMap.md +++ b/samples/client/petstore/java/docs/components/schemas/StringBooleanMap.md @@ -4,7 +4,7 @@ public class StringBooleanMap
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,37 +12,38 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [StringBooleanMap.StringBooleanMap1Boxed](#stringbooleanmap1boxed)
abstract sealed validated payload class | -| static class | [StringBooleanMap.StringBooleanMap1BoxedMap](#stringbooleanmap1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [StringBooleanMap.StringBooleanMap1Boxed](#stringbooleanmap1boxed)
sealed interface for validated payloads | +| record | [StringBooleanMap.StringBooleanMap1BoxedMap](#stringbooleanmap1boxedmap)
boxed class to store validated Map payloads | | static class | [StringBooleanMap.StringBooleanMap1](#stringbooleanmap1)
schema class | | static class | [StringBooleanMap.StringBooleanMapMapBuilder](#stringbooleanmapmapbuilder)
builder for Map payloads | | static class | [StringBooleanMap.StringBooleanMapMap](#stringbooleanmapmap)
output class for Map payloads | -| static class | [StringBooleanMap.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
abstract sealed validated payload class | -| static class | [StringBooleanMap.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | +| sealed interface | [StringBooleanMap.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
sealed interface for validated payloads | +| record | [StringBooleanMap.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | | static class | [StringBooleanMap.AdditionalProperties](#additionalproperties)
schema class | ## StringBooleanMap1Boxed -public static abstract sealed class StringBooleanMap1Boxed
+public sealed interface StringBooleanMap1Boxed
permits
[StringBooleanMap1BoxedMap](#stringbooleanmap1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## StringBooleanMap1BoxedMap -public static final class StringBooleanMap1BoxedMap
-extends [StringBooleanMap1Boxed](#stringbooleanmap1boxed) +public record StringBooleanMap1BoxedMap
+implements [StringBooleanMap1Boxed](#stringbooleanmap1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | StringBooleanMap1BoxedMap([StringBooleanMapMap](#stringbooleanmapmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [StringBooleanMapMap](#stringbooleanmapmap) | data
validated payload | +| [StringBooleanMapMap](#stringbooleanmapmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## StringBooleanMap1 public static class StringBooleanMap1
@@ -87,7 +88,9 @@ StringBooleanMap.StringBooleanMapMap validatedPayload = | ----------------- | ---------------------- | | [StringBooleanMapMap](#stringbooleanmapmap) | validate([Map<?, ?>](#stringbooleanmapmapbuilder) arg, SchemaConfiguration configuration) | | [StringBooleanMap1BoxedMap](#stringbooleanmap1boxedmap) | validateAndBox([Map<?, ?>](#stringbooleanmapmapbuilder) arg, SchemaConfiguration configuration) | +| [StringBooleanMap1Boxed](#stringbooleanmap1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## StringBooleanMapMapBuilder public class StringBooleanMapMapBuilder
builder for `Map` @@ -118,27 +121,28 @@ A class to store validated Map payloads | boolean | getAdditionalProperty(String name)
provides type safety for additional properties | ## AdditionalPropertiesBoxed -public static abstract sealed class AdditionalPropertiesBoxed
+public sealed interface AdditionalPropertiesBoxed
permits
[AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AdditionalPropertiesBoxedBoolean -public static final class AdditionalPropertiesBoxedBoolean
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedBoolean
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalProperties public static class AdditionalProperties
diff --git a/samples/client/petstore/java/docs/components/schemas/StringEnum.md b/samples/client/petstore/java/docs/components/schemas/StringEnum.md index 9ec50388b4b..394bd6564d5 100644 --- a/samples/client/petstore/java/docs/components/schemas/StringEnum.md +++ b/samples/client/petstore/java/docs/components/schemas/StringEnum.md @@ -4,59 +4,61 @@ public class StringEnum
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - enum classes ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [StringEnum.StringEnum1Boxed](#stringenum1boxed)
abstract sealed validated payload class | -| static class | [StringEnum.StringEnum1BoxedVoid](#stringenum1boxedvoid)
boxed class to store validated null payloads | -| static class | [StringEnum.StringEnum1BoxedString](#stringenum1boxedstring)
boxed class to store validated String payloads | +| sealed interface | [StringEnum.StringEnum1Boxed](#stringenum1boxed)
sealed interface for validated payloads | +| record | [StringEnum.StringEnum1BoxedVoid](#stringenum1boxedvoid)
boxed class to store validated null payloads | +| record | [StringEnum.StringEnum1BoxedString](#stringenum1boxedstring)
boxed class to store validated String payloads | | static class | [StringEnum.StringEnum1](#stringenum1)
schema class | | enum | [StringEnum.StringStringEnumEnums](#stringstringenumenums)
String enum | | enum | [StringEnum.NullStringEnumEnums](#nullstringenumenums)
null enum | ## StringEnum1Boxed -public static abstract sealed class StringEnum1Boxed
+public sealed interface StringEnum1Boxed
permits
[StringEnum1BoxedVoid](#stringenum1boxedvoid), [StringEnum1BoxedString](#stringenum1boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## StringEnum1BoxedVoid -public static final class StringEnum1BoxedVoid
-extends [StringEnum1Boxed](#stringenum1boxed) +public record StringEnum1BoxedVoid
+implements [StringEnum1Boxed](#stringenum1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | StringEnum1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## StringEnum1BoxedString -public static final class StringEnum1BoxedString
-extends [StringEnum1Boxed](#stringenum1boxed) +public record StringEnum1BoxedString
+implements [StringEnum1Boxed](#stringenum1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | StringEnum1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## StringEnum1 public static class StringEnum1
@@ -107,7 +109,9 @@ String validatedPayload = StringEnum.StringEnum1.validate( | String | validate(String arg, SchemaConfiguration configuration) | | String | validate([StringStringEnumEnums](#stringstringenumenums) arg, SchemaConfiguration configuration) | | [StringEnum1BoxedString](#stringenum1boxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [StringEnum1Boxed](#stringenum1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## StringStringEnumEnums public enum StringStringEnumEnums
extends `Enum` diff --git a/samples/client/petstore/java/docs/components/schemas/StringEnumWithDefaultValue.md b/samples/client/petstore/java/docs/components/schemas/StringEnumWithDefaultValue.md index eccd7e05700..1cbb6f57f58 100644 --- a/samples/client/petstore/java/docs/components/schemas/StringEnumWithDefaultValue.md +++ b/samples/client/petstore/java/docs/components/schemas/StringEnumWithDefaultValue.md @@ -4,40 +4,41 @@ public class StringEnumWithDefaultValue
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - enum classes ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [StringEnumWithDefaultValue.StringEnumWithDefaultValue1Boxed](#stringenumwithdefaultvalue1boxed)
abstract sealed validated payload class | -| static class | [StringEnumWithDefaultValue.StringEnumWithDefaultValue1BoxedString](#stringenumwithdefaultvalue1boxedstring)
boxed class to store validated String payloads | +| sealed interface | [StringEnumWithDefaultValue.StringEnumWithDefaultValue1Boxed](#stringenumwithdefaultvalue1boxed)
sealed interface for validated payloads | +| record | [StringEnumWithDefaultValue.StringEnumWithDefaultValue1BoxedString](#stringenumwithdefaultvalue1boxedstring)
boxed class to store validated String payloads | | static class | [StringEnumWithDefaultValue.StringEnumWithDefaultValue1](#stringenumwithdefaultvalue1)
schema class | | enum | [StringEnumWithDefaultValue.StringStringEnumWithDefaultValueEnums](#stringstringenumwithdefaultvalueenums)
String enum | ## StringEnumWithDefaultValue1Boxed -public static abstract sealed class StringEnumWithDefaultValue1Boxed
+public sealed interface StringEnumWithDefaultValue1Boxed
permits
[StringEnumWithDefaultValue1BoxedString](#stringenumwithdefaultvalue1boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## StringEnumWithDefaultValue1BoxedString -public static final class StringEnumWithDefaultValue1BoxedString
-extends [StringEnumWithDefaultValue1Boxed](#stringenumwithdefaultvalue1boxed) +public record StringEnumWithDefaultValue1BoxedString
+implements [StringEnumWithDefaultValue1Boxed](#stringenumwithdefaultvalue1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | StringEnumWithDefaultValue1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## StringEnumWithDefaultValue1 public static class StringEnumWithDefaultValue1
@@ -80,7 +81,9 @@ String validatedPayload = StringEnumWithDefaultValue.StringEnumWithDefaultValue1 | String | validate(String arg, SchemaConfiguration configuration) | | String | validate([StringStringEnumWithDefaultValueEnums](#stringstringenumwithdefaultvalueenums) arg, SchemaConfiguration configuration) | | [StringEnumWithDefaultValue1BoxedString](#stringenumwithdefaultvalue1boxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [StringEnumWithDefaultValue1Boxed](#stringenumwithdefaultvalue1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## StringStringEnumWithDefaultValueEnums public enum StringStringEnumWithDefaultValueEnums
extends `Enum` diff --git a/samples/client/petstore/java/docs/components/schemas/StringSchema.md b/samples/client/petstore/java/docs/components/schemas/StringSchema.md index 7c44878cff6..396ff63d7b9 100644 --- a/samples/client/petstore/java/docs/components/schemas/StringSchema.md +++ b/samples/client/petstore/java/docs/components/schemas/StringSchema.md @@ -4,38 +4,39 @@ public class StringSchema
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [StringSchema.StringSchema1Boxed](#stringschema1boxed)
abstract sealed validated payload class | -| static class | [StringSchema.StringSchema1BoxedString](#stringschema1boxedstring)
boxed class to store validated String payloads | +| sealed interface | [StringSchema.StringSchema1Boxed](#stringschema1boxed)
sealed interface for validated payloads | +| record | [StringSchema.StringSchema1BoxedString](#stringschema1boxedstring)
boxed class to store validated String payloads | | static class | [StringSchema.StringSchema1](#stringschema1)
schema class | ## StringSchema1Boxed -public static abstract sealed class StringSchema1Boxed
+public sealed interface StringSchema1Boxed
permits
[StringSchema1BoxedString](#stringschema1boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## StringSchema1BoxedString -public static final class StringSchema1BoxedString
-extends [StringSchema1Boxed](#stringschema1boxed) +public record StringSchema1BoxedString
+implements [StringSchema1Boxed](#stringschema1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | StringSchema1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## StringSchema1 public static class StringSchema1
diff --git a/samples/client/petstore/java/docs/components/schemas/StringWithValidation.md b/samples/client/petstore/java/docs/components/schemas/StringWithValidation.md index 93ed1fdb6b2..5e5529dbdb9 100644 --- a/samples/client/petstore/java/docs/components/schemas/StringWithValidation.md +++ b/samples/client/petstore/java/docs/components/schemas/StringWithValidation.md @@ -4,38 +4,39 @@ public class StringWithValidation
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [StringWithValidation.StringWithValidation1Boxed](#stringwithvalidation1boxed)
abstract sealed validated payload class | -| static class | [StringWithValidation.StringWithValidation1BoxedString](#stringwithvalidation1boxedstring)
boxed class to store validated String payloads | +| sealed interface | [StringWithValidation.StringWithValidation1Boxed](#stringwithvalidation1boxed)
sealed interface for validated payloads | +| record | [StringWithValidation.StringWithValidation1BoxedString](#stringwithvalidation1boxedstring)
boxed class to store validated String payloads | | static class | [StringWithValidation.StringWithValidation1](#stringwithvalidation1)
schema class | ## StringWithValidation1Boxed -public static abstract sealed class StringWithValidation1Boxed
+public sealed interface StringWithValidation1Boxed
permits
[StringWithValidation1BoxedString](#stringwithvalidation1boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## StringWithValidation1BoxedString -public static final class StringWithValidation1BoxedString
-extends [StringWithValidation1Boxed](#stringwithvalidation1boxed) +public record StringWithValidation1BoxedString
+implements [StringWithValidation1Boxed](#stringwithvalidation1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | StringWithValidation1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## StringWithValidation1 public static class StringWithValidation1
@@ -76,5 +77,7 @@ String validatedPayload = StringWithValidation.StringWithValidation1.validate( | ----------------- | ---------------------- | | String | validate(String arg, SchemaConfiguration configuration) | | [StringWithValidation1BoxedString](#stringwithvalidation1boxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [StringWithValidation1Boxed](#stringwithvalidation1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/components/schemas/Tag.md b/samples/client/petstore/java/docs/components/schemas/Tag.md index 0ee62d9fb64..26836b31006 100644 --- a/samples/client/petstore/java/docs/components/schemas/Tag.md +++ b/samples/client/petstore/java/docs/components/schemas/Tag.md @@ -4,7 +4,7 @@ public class Tag
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,40 +12,41 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Tag.Tag1Boxed](#tag1boxed)
abstract sealed validated payload class | -| static class | [Tag.Tag1BoxedMap](#tag1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [Tag.Tag1Boxed](#tag1boxed)
sealed interface for validated payloads | +| record | [Tag.Tag1BoxedMap](#tag1boxedmap)
boxed class to store validated Map payloads | | static class | [Tag.Tag1](#tag1)
schema class | | static class | [Tag.TagMapBuilder](#tagmapbuilder)
builder for Map payloads | | static class | [Tag.TagMap](#tagmap)
output class for Map payloads | -| static class | [Tag.NameBoxed](#nameboxed)
abstract sealed validated payload class | -| static class | [Tag.NameBoxedString](#nameboxedstring)
boxed class to store validated String payloads | +| sealed interface | [Tag.NameBoxed](#nameboxed)
sealed interface for validated payloads | +| record | [Tag.NameBoxedString](#nameboxedstring)
boxed class to store validated String payloads | | static class | [Tag.Name](#name)
schema class | -| static class | [Tag.IdBoxed](#idboxed)
abstract sealed validated payload class | -| static class | [Tag.IdBoxedNumber](#idboxednumber)
boxed class to store validated Number payloads | +| sealed interface | [Tag.IdBoxed](#idboxed)
sealed interface for validated payloads | +| record | [Tag.IdBoxedNumber](#idboxednumber)
boxed class to store validated Number payloads | | static class | [Tag.Id](#id)
schema class | ## Tag1Boxed -public static abstract sealed class Tag1Boxed
+public sealed interface Tag1Boxed
permits
[Tag1BoxedMap](#tag1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Tag1BoxedMap -public static final class Tag1BoxedMap
-extends [Tag1Boxed](#tag1boxed) +public record Tag1BoxedMap
+implements [Tag1Boxed](#tag1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Tag1BoxedMap([TagMap](#tagmap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [TagMap](#tagmap) | data
validated payload | +| [TagMap](#tagmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Tag1 public static class Tag1
@@ -92,7 +93,9 @@ Tag.TagMap validatedPayload = | ----------------- | ---------------------- | | [TagMap](#tagmap) | validate([Map<?, ?>](#tagmapbuilder) arg, SchemaConfiguration configuration) | | [Tag1BoxedMap](#tag1boxedmap) | validateAndBox([Map<?, ?>](#tagmapbuilder) arg, SchemaConfiguration configuration) | +| [Tag1Boxed](#tag1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## TagMapBuilder public class TagMapBuilder
builder for `Map` @@ -138,27 +141,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## NameBoxed -public static abstract sealed class NameBoxed
+public sealed interface NameBoxed
permits
[NameBoxedString](#nameboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## NameBoxedString -public static final class NameBoxedString
-extends [NameBoxed](#nameboxed) +public record NameBoxedString
+implements [NameBoxed](#nameboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NameBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Name public static class Name
@@ -172,27 +176,28 @@ A schema class that validates payloads | validateAndBox | ## IdBoxed -public static abstract sealed class IdBoxed
+public sealed interface IdBoxed
permits
[IdBoxedNumber](#idboxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## IdBoxedNumber -public static final class IdBoxedNumber
-extends [IdBoxed](#idboxed) +public record IdBoxedNumber
+implements [IdBoxed](#idboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IdBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Id public static class Id
diff --git a/samples/client/petstore/java/docs/components/schemas/Triangle.md b/samples/client/petstore/java/docs/components/schemas/Triangle.md index f1000180daa..4eb768df520 100644 --- a/samples/client/petstore/java/docs/components/schemas/Triangle.md +++ b/samples/client/petstore/java/docs/components/schemas/Triangle.md @@ -4,23 +4,23 @@ public class Triangle
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Triangle.Triangle1Boxed](#triangle1boxed)
abstract sealed validated payload class | -| static class | [Triangle.Triangle1BoxedVoid](#triangle1boxedvoid)
boxed class to store validated null payloads | -| static class | [Triangle.Triangle1BoxedBoolean](#triangle1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [Triangle.Triangle1BoxedNumber](#triangle1boxednumber)
boxed class to store validated Number payloads | -| static class | [Triangle.Triangle1BoxedString](#triangle1boxedstring)
boxed class to store validated String payloads | -| static class | [Triangle.Triangle1BoxedList](#triangle1boxedlist)
boxed class to store validated List payloads | -| static class | [Triangle.Triangle1BoxedMap](#triangle1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [Triangle.Triangle1Boxed](#triangle1boxed)
sealed interface for validated payloads | +| record | [Triangle.Triangle1BoxedVoid](#triangle1boxedvoid)
boxed class to store validated null payloads | +| record | [Triangle.Triangle1BoxedBoolean](#triangle1boxedboolean)
boxed class to store validated boolean payloads | +| record | [Triangle.Triangle1BoxedNumber](#triangle1boxednumber)
boxed class to store validated Number payloads | +| record | [Triangle.Triangle1BoxedString](#triangle1boxedstring)
boxed class to store validated String payloads | +| record | [Triangle.Triangle1BoxedList](#triangle1boxedlist)
boxed class to store validated List payloads | +| record | [Triangle.Triangle1BoxedMap](#triangle1boxedmap)
boxed class to store validated Map payloads | | static class | [Triangle.Triangle1](#triangle1)
schema class | ## Triangle1Boxed -public static abstract sealed class Triangle1Boxed
+public sealed interface Triangle1Boxed
permits
[Triangle1BoxedVoid](#triangle1boxedvoid), [Triangle1BoxedBoolean](#triangle1boxedboolean), @@ -29,103 +29,109 @@ permits
[Triangle1BoxedList](#triangle1boxedlist), [Triangle1BoxedMap](#triangle1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Triangle1BoxedVoid -public static final class Triangle1BoxedVoid
-extends [Triangle1Boxed](#triangle1boxed) +public record Triangle1BoxedVoid
+implements [Triangle1Boxed](#triangle1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Triangle1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Triangle1BoxedBoolean -public static final class Triangle1BoxedBoolean
-extends [Triangle1Boxed](#triangle1boxed) +public record Triangle1BoxedBoolean
+implements [Triangle1Boxed](#triangle1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Triangle1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Triangle1BoxedNumber -public static final class Triangle1BoxedNumber
-extends [Triangle1Boxed](#triangle1boxed) +public record Triangle1BoxedNumber
+implements [Triangle1Boxed](#triangle1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Triangle1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Triangle1BoxedString -public static final class Triangle1BoxedString
-extends [Triangle1Boxed](#triangle1boxed) +public record Triangle1BoxedString
+implements [Triangle1Boxed](#triangle1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Triangle1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Triangle1BoxedList -public static final class Triangle1BoxedList
-extends [Triangle1Boxed](#triangle1boxed) +public record Triangle1BoxedList
+implements [Triangle1Boxed](#triangle1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Triangle1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Triangle1BoxedMap -public static final class Triangle1BoxedMap
-extends [Triangle1Boxed](#triangle1boxed) +public record Triangle1BoxedMap
+implements [Triangle1Boxed](#triangle1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Triangle1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Triangle1 public static class Triangle1
@@ -157,5 +163,7 @@ A schema class that validates payloads | [Triangle1BoxedBoolean](#triangle1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Triangle1BoxedMap](#triangle1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [Triangle1BoxedList](#triangle1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Triangle1Boxed](#triangle1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/components/schemas/TriangleInterface.md b/samples/client/petstore/java/docs/components/schemas/TriangleInterface.md index e3641da4208..32abec86ebf 100644 --- a/samples/client/petstore/java/docs/components/schemas/TriangleInterface.md +++ b/samples/client/petstore/java/docs/components/schemas/TriangleInterface.md @@ -4,7 +4,7 @@ public class TriangleInterface
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -13,26 +13,26 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [TriangleInterface.TriangleInterface1Boxed](#triangleinterface1boxed)
abstract sealed validated payload class | -| static class | [TriangleInterface.TriangleInterface1BoxedVoid](#triangleinterface1boxedvoid)
boxed class to store validated null payloads | -| static class | [TriangleInterface.TriangleInterface1BoxedBoolean](#triangleinterface1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [TriangleInterface.TriangleInterface1BoxedNumber](#triangleinterface1boxednumber)
boxed class to store validated Number payloads | -| static class | [TriangleInterface.TriangleInterface1BoxedString](#triangleinterface1boxedstring)
boxed class to store validated String payloads | -| static class | [TriangleInterface.TriangleInterface1BoxedList](#triangleinterface1boxedlist)
boxed class to store validated List payloads | -| static class | [TriangleInterface.TriangleInterface1BoxedMap](#triangleinterface1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [TriangleInterface.TriangleInterface1Boxed](#triangleinterface1boxed)
sealed interface for validated payloads | +| record | [TriangleInterface.TriangleInterface1BoxedVoid](#triangleinterface1boxedvoid)
boxed class to store validated null payloads | +| record | [TriangleInterface.TriangleInterface1BoxedBoolean](#triangleinterface1boxedboolean)
boxed class to store validated boolean payloads | +| record | [TriangleInterface.TriangleInterface1BoxedNumber](#triangleinterface1boxednumber)
boxed class to store validated Number payloads | +| record | [TriangleInterface.TriangleInterface1BoxedString](#triangleinterface1boxedstring)
boxed class to store validated String payloads | +| record | [TriangleInterface.TriangleInterface1BoxedList](#triangleinterface1boxedlist)
boxed class to store validated List payloads | +| record | [TriangleInterface.TriangleInterface1BoxedMap](#triangleinterface1boxedmap)
boxed class to store validated Map payloads | | static class | [TriangleInterface.TriangleInterface1](#triangleinterface1)
schema class | | static class | [TriangleInterface.TriangleInterfaceMapBuilder](#triangleinterfacemapbuilder)
builder for Map payloads | | static class | [TriangleInterface.TriangleInterfaceMap](#triangleinterfacemap)
output class for Map payloads | -| static class | [TriangleInterface.TriangleTypeBoxed](#triangletypeboxed)
abstract sealed validated payload class | -| static class | [TriangleInterface.TriangleTypeBoxedString](#triangletypeboxedstring)
boxed class to store validated String payloads | +| sealed interface | [TriangleInterface.TriangleTypeBoxed](#triangletypeboxed)
sealed interface for validated payloads | +| record | [TriangleInterface.TriangleTypeBoxedString](#triangletypeboxedstring)
boxed class to store validated String payloads | | static class | [TriangleInterface.TriangleType](#triangletype)
schema class | -| static class | [TriangleInterface.ShapeTypeBoxed](#shapetypeboxed)
abstract sealed validated payload class | -| static class | [TriangleInterface.ShapeTypeBoxedString](#shapetypeboxedstring)
boxed class to store validated String payloads | +| sealed interface | [TriangleInterface.ShapeTypeBoxed](#shapetypeboxed)
sealed interface for validated payloads | +| record | [TriangleInterface.ShapeTypeBoxedString](#shapetypeboxedstring)
boxed class to store validated String payloads | | static class | [TriangleInterface.ShapeType](#shapetype)
schema class | | enum | [TriangleInterface.StringShapeTypeEnums](#stringshapetypeenums)
String enum | ## TriangleInterface1Boxed -public static abstract sealed class TriangleInterface1Boxed
+public sealed interface TriangleInterface1Boxed
permits
[TriangleInterface1BoxedVoid](#triangleinterface1boxedvoid), [TriangleInterface1BoxedBoolean](#triangleinterface1boxedboolean), @@ -41,103 +41,109 @@ permits
[TriangleInterface1BoxedList](#triangleinterface1boxedlist), [TriangleInterface1BoxedMap](#triangleinterface1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## TriangleInterface1BoxedVoid -public static final class TriangleInterface1BoxedVoid
-extends [TriangleInterface1Boxed](#triangleinterface1boxed) +public record TriangleInterface1BoxedVoid
+implements [TriangleInterface1Boxed](#triangleinterface1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | TriangleInterface1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## TriangleInterface1BoxedBoolean -public static final class TriangleInterface1BoxedBoolean
-extends [TriangleInterface1Boxed](#triangleinterface1boxed) +public record TriangleInterface1BoxedBoolean
+implements [TriangleInterface1Boxed](#triangleinterface1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | TriangleInterface1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## TriangleInterface1BoxedNumber -public static final class TriangleInterface1BoxedNumber
-extends [TriangleInterface1Boxed](#triangleinterface1boxed) +public record TriangleInterface1BoxedNumber
+implements [TriangleInterface1Boxed](#triangleinterface1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | TriangleInterface1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## TriangleInterface1BoxedString -public static final class TriangleInterface1BoxedString
-extends [TriangleInterface1Boxed](#triangleinterface1boxed) +public record TriangleInterface1BoxedString
+implements [TriangleInterface1Boxed](#triangleinterface1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | TriangleInterface1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## TriangleInterface1BoxedList -public static final class TriangleInterface1BoxedList
-extends [TriangleInterface1Boxed](#triangleinterface1boxed) +public record TriangleInterface1BoxedList
+implements [TriangleInterface1Boxed](#triangleinterface1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | TriangleInterface1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## TriangleInterface1BoxedMap -public static final class TriangleInterface1BoxedMap
-extends [TriangleInterface1Boxed](#triangleinterface1boxed) +public record TriangleInterface1BoxedMap
+implements [TriangleInterface1Boxed](#triangleinterface1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | TriangleInterface1BoxedMap([TriangleInterfaceMap](#triangleinterfacemap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [TriangleInterfaceMap](#triangleinterfacemap) | data
validated payload | +| [TriangleInterfaceMap](#triangleinterfacemap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## TriangleInterface1 public static class TriangleInterface1
@@ -170,7 +176,9 @@ A schema class that validates payloads | [TriangleInterface1BoxedBoolean](#triangleinterface1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [TriangleInterface1BoxedMap](#triangleinterface1boxedmap) | validateAndBox([Map<?, ?>](#triangleinterfacemapbuilder) arg, SchemaConfiguration configuration) | | [TriangleInterface1BoxedList](#triangleinterface1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [TriangleInterface1Boxed](#triangleinterface1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## TriangleInterfaceMap00Builder public class TriangleInterfaceMap00Builder
builder for `Map` @@ -262,27 +270,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## TriangleTypeBoxed -public static abstract sealed class TriangleTypeBoxed
+public sealed interface TriangleTypeBoxed
permits
[TriangleTypeBoxedString](#triangletypeboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## TriangleTypeBoxedString -public static final class TriangleTypeBoxedString
-extends [TriangleTypeBoxed](#triangletypeboxed) +public record TriangleTypeBoxedString
+implements [TriangleTypeBoxed](#triangletypeboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | TriangleTypeBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## TriangleType public static class TriangleType
@@ -296,27 +305,28 @@ A schema class that validates payloads | validateAndBox | ## ShapeTypeBoxed -public static abstract sealed class ShapeTypeBoxed
+public sealed interface ShapeTypeBoxed
permits
[ShapeTypeBoxedString](#shapetypeboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ShapeTypeBoxedString -public static final class ShapeTypeBoxedString
-extends [ShapeTypeBoxed](#shapetypeboxed) +public record ShapeTypeBoxedString
+implements [ShapeTypeBoxed](#shapetypeboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ShapeTypeBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ShapeType public static class ShapeType
@@ -358,7 +368,9 @@ String validatedPayload = TriangleInterface.ShapeType.validate( | String | validate(String arg, SchemaConfiguration configuration) | | String | validate([StringShapeTypeEnums](#stringshapetypeenums) arg, SchemaConfiguration configuration) | | [ShapeTypeBoxedString](#shapetypeboxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [ShapeTypeBoxed](#shapetypeboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## StringShapeTypeEnums public enum StringShapeTypeEnums
extends `Enum` diff --git a/samples/client/petstore/java/docs/components/schemas/UUIDString.md b/samples/client/petstore/java/docs/components/schemas/UUIDString.md index f4be6e99509..d4e45e241be 100644 --- a/samples/client/petstore/java/docs/components/schemas/UUIDString.md +++ b/samples/client/petstore/java/docs/components/schemas/UUIDString.md @@ -4,38 +4,39 @@ public class UUIDString
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [UUIDString.UUIDString1Boxed](#uuidstring1boxed)
abstract sealed validated payload class | -| static class | [UUIDString.UUIDString1BoxedString](#uuidstring1boxedstring)
boxed class to store validated String payloads | +| sealed interface | [UUIDString.UUIDString1Boxed](#uuidstring1boxed)
sealed interface for validated payloads | +| record | [UUIDString.UUIDString1BoxedString](#uuidstring1boxedstring)
boxed class to store validated String payloads | | static class | [UUIDString.UUIDString1](#uuidstring1)
schema class | ## UUIDString1Boxed -public static abstract sealed class UUIDString1Boxed
+public sealed interface UUIDString1Boxed
permits
[UUIDString1BoxedString](#uuidstring1boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## UUIDString1BoxedString -public static final class UUIDString1BoxedString
-extends [UUIDString1Boxed](#uuidstring1boxed) +public record UUIDString1BoxedString
+implements [UUIDString1Boxed](#uuidstring1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UUIDString1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UUIDString1 public static class UUIDString1
@@ -77,5 +78,7 @@ String validatedPayload = UUIDString.UUIDString1.validate( | ----------------- | ---------------------- | | String | validate(String arg, SchemaConfiguration configuration) | | [UUIDString1BoxedString](#uuidstring1boxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [UUIDString1Boxed](#uuidstring1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/components/schemas/User.md b/samples/client/petstore/java/docs/components/schemas/User.md index a7014dbcdd3..df4d65ace9b 100644 --- a/samples/client/petstore/java/docs/components/schemas/User.md +++ b/samples/client/petstore/java/docs/components/schemas/User.md @@ -4,7 +4,7 @@ public class User
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -12,92 +12,93 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [User.User1Boxed](#user1boxed)
abstract sealed validated payload class | -| static class | [User.User1BoxedMap](#user1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [User.User1Boxed](#user1boxed)
sealed interface for validated payloads | +| record | [User.User1BoxedMap](#user1boxedmap)
boxed class to store validated Map payloads | | static class | [User.User1](#user1)
schema class | | static class | [User.UserMapBuilder](#usermapbuilder)
builder for Map payloads | | static class | [User.UserMap](#usermap)
output class for Map payloads | -| static class | [User.AnyTypePropNullableBoxed](#anytypepropnullableboxed)
abstract sealed validated payload class | -| static class | [User.AnyTypePropNullableBoxedVoid](#anytypepropnullableboxedvoid)
boxed class to store validated null payloads | -| static class | [User.AnyTypePropNullableBoxedBoolean](#anytypepropnullableboxedboolean)
boxed class to store validated boolean payloads | -| static class | [User.AnyTypePropNullableBoxedNumber](#anytypepropnullableboxednumber)
boxed class to store validated Number payloads | -| static class | [User.AnyTypePropNullableBoxedString](#anytypepropnullableboxedstring)
boxed class to store validated String payloads | -| static class | [User.AnyTypePropNullableBoxedList](#anytypepropnullableboxedlist)
boxed class to store validated List payloads | -| static class | [User.AnyTypePropNullableBoxedMap](#anytypepropnullableboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [User.AnyTypePropNullableBoxed](#anytypepropnullableboxed)
sealed interface for validated payloads | +| record | [User.AnyTypePropNullableBoxedVoid](#anytypepropnullableboxedvoid)
boxed class to store validated null payloads | +| record | [User.AnyTypePropNullableBoxedBoolean](#anytypepropnullableboxedboolean)
boxed class to store validated boolean payloads | +| record | [User.AnyTypePropNullableBoxedNumber](#anytypepropnullableboxednumber)
boxed class to store validated Number payloads | +| record | [User.AnyTypePropNullableBoxedString](#anytypepropnullableboxedstring)
boxed class to store validated String payloads | +| record | [User.AnyTypePropNullableBoxedList](#anytypepropnullableboxedlist)
boxed class to store validated List payloads | +| record | [User.AnyTypePropNullableBoxedMap](#anytypepropnullableboxedmap)
boxed class to store validated Map payloads | | static class | [User.AnyTypePropNullable](#anytypepropnullable)
schema class | -| static class | [User.AnyTypeExceptNullPropBoxed](#anytypeexceptnullpropboxed)
abstract sealed validated payload class | -| static class | [User.AnyTypeExceptNullPropBoxedVoid](#anytypeexceptnullpropboxedvoid)
boxed class to store validated null payloads | -| static class | [User.AnyTypeExceptNullPropBoxedBoolean](#anytypeexceptnullpropboxedboolean)
boxed class to store validated boolean payloads | -| static class | [User.AnyTypeExceptNullPropBoxedNumber](#anytypeexceptnullpropboxednumber)
boxed class to store validated Number payloads | -| static class | [User.AnyTypeExceptNullPropBoxedString](#anytypeexceptnullpropboxedstring)
boxed class to store validated String payloads | -| static class | [User.AnyTypeExceptNullPropBoxedList](#anytypeexceptnullpropboxedlist)
boxed class to store validated List payloads | -| static class | [User.AnyTypeExceptNullPropBoxedMap](#anytypeexceptnullpropboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [User.AnyTypeExceptNullPropBoxed](#anytypeexceptnullpropboxed)
sealed interface for validated payloads | +| record | [User.AnyTypeExceptNullPropBoxedVoid](#anytypeexceptnullpropboxedvoid)
boxed class to store validated null payloads | +| record | [User.AnyTypeExceptNullPropBoxedBoolean](#anytypeexceptnullpropboxedboolean)
boxed class to store validated boolean payloads | +| record | [User.AnyTypeExceptNullPropBoxedNumber](#anytypeexceptnullpropboxednumber)
boxed class to store validated Number payloads | +| record | [User.AnyTypeExceptNullPropBoxedString](#anytypeexceptnullpropboxedstring)
boxed class to store validated String payloads | +| record | [User.AnyTypeExceptNullPropBoxedList](#anytypeexceptnullpropboxedlist)
boxed class to store validated List payloads | +| record | [User.AnyTypeExceptNullPropBoxedMap](#anytypeexceptnullpropboxedmap)
boxed class to store validated Map payloads | | static class | [User.AnyTypeExceptNullProp](#anytypeexceptnullprop)
schema class | -| static class | [User.NotBoxed](#notboxed)
abstract sealed validated payload class | -| static class | [User.NotBoxedVoid](#notboxedvoid)
boxed class to store validated null payloads | +| sealed interface | [User.NotBoxed](#notboxed)
sealed interface for validated payloads | +| record | [User.NotBoxedVoid](#notboxedvoid)
boxed class to store validated null payloads | | static class | [User.Not](#not)
schema class | -| static class | [User.AnyTypePropBoxed](#anytypepropboxed)
abstract sealed validated payload class | -| static class | [User.AnyTypePropBoxedVoid](#anytypepropboxedvoid)
boxed class to store validated null payloads | -| static class | [User.AnyTypePropBoxedBoolean](#anytypepropboxedboolean)
boxed class to store validated boolean payloads | -| static class | [User.AnyTypePropBoxedNumber](#anytypepropboxednumber)
boxed class to store validated Number payloads | -| static class | [User.AnyTypePropBoxedString](#anytypepropboxedstring)
boxed class to store validated String payloads | -| static class | [User.AnyTypePropBoxedList](#anytypepropboxedlist)
boxed class to store validated List payloads | -| static class | [User.AnyTypePropBoxedMap](#anytypepropboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [User.AnyTypePropBoxed](#anytypepropboxed)
sealed interface for validated payloads | +| record | [User.AnyTypePropBoxedVoid](#anytypepropboxedvoid)
boxed class to store validated null payloads | +| record | [User.AnyTypePropBoxedBoolean](#anytypepropboxedboolean)
boxed class to store validated boolean payloads | +| record | [User.AnyTypePropBoxedNumber](#anytypepropboxednumber)
boxed class to store validated Number payloads | +| record | [User.AnyTypePropBoxedString](#anytypepropboxedstring)
boxed class to store validated String payloads | +| record | [User.AnyTypePropBoxedList](#anytypepropboxedlist)
boxed class to store validated List payloads | +| record | [User.AnyTypePropBoxedMap](#anytypepropboxedmap)
boxed class to store validated Map payloads | | static class | [User.AnyTypeProp](#anytypeprop)
schema class | -| static class | [User.ObjectWithNoDeclaredPropsNullableBoxed](#objectwithnodeclaredpropsnullableboxed)
abstract sealed validated payload class | -| static class | [User.ObjectWithNoDeclaredPropsNullableBoxedVoid](#objectwithnodeclaredpropsnullableboxedvoid)
boxed class to store validated null payloads | -| static class | [User.ObjectWithNoDeclaredPropsNullableBoxedMap](#objectwithnodeclaredpropsnullableboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [User.ObjectWithNoDeclaredPropsNullableBoxed](#objectwithnodeclaredpropsnullableboxed)
sealed interface for validated payloads | +| record | [User.ObjectWithNoDeclaredPropsNullableBoxedVoid](#objectwithnodeclaredpropsnullableboxedvoid)
boxed class to store validated null payloads | +| record | [User.ObjectWithNoDeclaredPropsNullableBoxedMap](#objectwithnodeclaredpropsnullableboxedmap)
boxed class to store validated Map payloads | | static class | [User.ObjectWithNoDeclaredPropsNullable](#objectwithnodeclaredpropsnullable)
schema class | -| static class | [User.ObjectWithNoDeclaredPropsBoxed](#objectwithnodeclaredpropsboxed)
abstract sealed validated payload class | -| static class | [User.ObjectWithNoDeclaredPropsBoxedMap](#objectwithnodeclaredpropsboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [User.ObjectWithNoDeclaredPropsBoxed](#objectwithnodeclaredpropsboxed)
sealed interface for validated payloads | +| record | [User.ObjectWithNoDeclaredPropsBoxedMap](#objectwithnodeclaredpropsboxedmap)
boxed class to store validated Map payloads | | static class | [User.ObjectWithNoDeclaredProps](#objectwithnodeclaredprops)
schema class | -| static class | [User.UserStatusBoxed](#userstatusboxed)
abstract sealed validated payload class | -| static class | [User.UserStatusBoxedNumber](#userstatusboxednumber)
boxed class to store validated Number payloads | +| sealed interface | [User.UserStatusBoxed](#userstatusboxed)
sealed interface for validated payloads | +| record | [User.UserStatusBoxedNumber](#userstatusboxednumber)
boxed class to store validated Number payloads | | static class | [User.UserStatus](#userstatus)
schema class | -| static class | [User.PhoneBoxed](#phoneboxed)
abstract sealed validated payload class | -| static class | [User.PhoneBoxedString](#phoneboxedstring)
boxed class to store validated String payloads | +| sealed interface | [User.PhoneBoxed](#phoneboxed)
sealed interface for validated payloads | +| record | [User.PhoneBoxedString](#phoneboxedstring)
boxed class to store validated String payloads | | static class | [User.Phone](#phone)
schema class | -| static class | [User.PasswordBoxed](#passwordboxed)
abstract sealed validated payload class | -| static class | [User.PasswordBoxedString](#passwordboxedstring)
boxed class to store validated String payloads | +| sealed interface | [User.PasswordBoxed](#passwordboxed)
sealed interface for validated payloads | +| record | [User.PasswordBoxedString](#passwordboxedstring)
boxed class to store validated String payloads | | static class | [User.Password](#password)
schema class | -| static class | [User.EmailBoxed](#emailboxed)
abstract sealed validated payload class | -| static class | [User.EmailBoxedString](#emailboxedstring)
boxed class to store validated String payloads | +| sealed interface | [User.EmailBoxed](#emailboxed)
sealed interface for validated payloads | +| record | [User.EmailBoxedString](#emailboxedstring)
boxed class to store validated String payloads | | static class | [User.Email](#email)
schema class | -| static class | [User.LastNameBoxed](#lastnameboxed)
abstract sealed validated payload class | -| static class | [User.LastNameBoxedString](#lastnameboxedstring)
boxed class to store validated String payloads | +| sealed interface | [User.LastNameBoxed](#lastnameboxed)
sealed interface for validated payloads | +| record | [User.LastNameBoxedString](#lastnameboxedstring)
boxed class to store validated String payloads | | static class | [User.LastName](#lastname)
schema class | -| static class | [User.FirstNameBoxed](#firstnameboxed)
abstract sealed validated payload class | -| static class | [User.FirstNameBoxedString](#firstnameboxedstring)
boxed class to store validated String payloads | +| sealed interface | [User.FirstNameBoxed](#firstnameboxed)
sealed interface for validated payloads | +| record | [User.FirstNameBoxedString](#firstnameboxedstring)
boxed class to store validated String payloads | | static class | [User.FirstName](#firstname)
schema class | -| static class | [User.UsernameBoxed](#usernameboxed)
abstract sealed validated payload class | -| static class | [User.UsernameBoxedString](#usernameboxedstring)
boxed class to store validated String payloads | +| sealed interface | [User.UsernameBoxed](#usernameboxed)
sealed interface for validated payloads | +| record | [User.UsernameBoxedString](#usernameboxedstring)
boxed class to store validated String payloads | | static class | [User.Username](#username)
schema class | -| static class | [User.IdBoxed](#idboxed)
abstract sealed validated payload class | -| static class | [User.IdBoxedNumber](#idboxednumber)
boxed class to store validated Number payloads | +| sealed interface | [User.IdBoxed](#idboxed)
sealed interface for validated payloads | +| record | [User.IdBoxedNumber](#idboxednumber)
boxed class to store validated Number payloads | | static class | [User.Id](#id)
schema class | ## User1Boxed -public static abstract sealed class User1Boxed
+public sealed interface User1Boxed
permits
[User1BoxedMap](#user1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## User1BoxedMap -public static final class User1BoxedMap
-extends [User1Boxed](#user1boxed) +public record User1BoxedMap
+implements [User1Boxed](#user1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | User1BoxedMap([UserMap](#usermap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [UserMap](#usermap) | data
validated payload | +| [UserMap](#usermap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## User1 public static class User1
@@ -158,7 +159,9 @@ User.UserMap validatedPayload = | ----------------- | ---------------------- | | [UserMap](#usermap) | validate([Map<?, ?>](#usermapbuilder) arg, SchemaConfiguration configuration) | | [User1BoxedMap](#user1boxedmap) | validateAndBox([Map<?, ?>](#usermapbuilder) arg, SchemaConfiguration configuration) | +| [User1Boxed](#user1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## UserMapBuilder public class UserMapBuilder
builder for `Map` @@ -252,7 +255,7 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## AnyTypePropNullableBoxed -public static abstract sealed class AnyTypePropNullableBoxed
+public sealed interface AnyTypePropNullableBoxed
permits
[AnyTypePropNullableBoxedVoid](#anytypepropnullableboxedvoid), [AnyTypePropNullableBoxedBoolean](#anytypepropnullableboxedboolean), @@ -261,103 +264,109 @@ permits
[AnyTypePropNullableBoxedList](#anytypepropnullableboxedlist), [AnyTypePropNullableBoxedMap](#anytypepropnullableboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AnyTypePropNullableBoxedVoid -public static final class AnyTypePropNullableBoxedVoid
-extends [AnyTypePropNullableBoxed](#anytypepropnullableboxed) +public record AnyTypePropNullableBoxedVoid
+implements [AnyTypePropNullableBoxed](#anytypepropnullableboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AnyTypePropNullableBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AnyTypePropNullableBoxedBoolean -public static final class AnyTypePropNullableBoxedBoolean
-extends [AnyTypePropNullableBoxed](#anytypepropnullableboxed) +public record AnyTypePropNullableBoxedBoolean
+implements [AnyTypePropNullableBoxed](#anytypepropnullableboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AnyTypePropNullableBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AnyTypePropNullableBoxedNumber -public static final class AnyTypePropNullableBoxedNumber
-extends [AnyTypePropNullableBoxed](#anytypepropnullableboxed) +public record AnyTypePropNullableBoxedNumber
+implements [AnyTypePropNullableBoxed](#anytypepropnullableboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AnyTypePropNullableBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AnyTypePropNullableBoxedString -public static final class AnyTypePropNullableBoxedString
-extends [AnyTypePropNullableBoxed](#anytypepropnullableboxed) +public record AnyTypePropNullableBoxedString
+implements [AnyTypePropNullableBoxed](#anytypepropnullableboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AnyTypePropNullableBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AnyTypePropNullableBoxedList -public static final class AnyTypePropNullableBoxedList
-extends [AnyTypePropNullableBoxed](#anytypepropnullableboxed) +public record AnyTypePropNullableBoxedList
+implements [AnyTypePropNullableBoxed](#anytypepropnullableboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AnyTypePropNullableBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AnyTypePropNullableBoxedMap -public static final class AnyTypePropNullableBoxedMap
-extends [AnyTypePropNullableBoxed](#anytypepropnullableboxed) +public record AnyTypePropNullableBoxedMap
+implements [AnyTypePropNullableBoxed](#anytypepropnullableboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AnyTypePropNullableBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AnyTypePropNullable public static class AnyTypePropNullable
@@ -374,7 +383,7 @@ test code generation for any type Here the 'type' attribute is not spe | validateAndBox | ## AnyTypeExceptNullPropBoxed -public static abstract sealed class AnyTypeExceptNullPropBoxed
+public sealed interface AnyTypeExceptNullPropBoxed
permits
[AnyTypeExceptNullPropBoxedVoid](#anytypeexceptnullpropboxedvoid), [AnyTypeExceptNullPropBoxedBoolean](#anytypeexceptnullpropboxedboolean), @@ -383,103 +392,109 @@ permits
[AnyTypeExceptNullPropBoxedList](#anytypeexceptnullpropboxedlist), [AnyTypeExceptNullPropBoxedMap](#anytypeexceptnullpropboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AnyTypeExceptNullPropBoxedVoid -public static final class AnyTypeExceptNullPropBoxedVoid
-extends [AnyTypeExceptNullPropBoxed](#anytypeexceptnullpropboxed) +public record AnyTypeExceptNullPropBoxedVoid
+implements [AnyTypeExceptNullPropBoxed](#anytypeexceptnullpropboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AnyTypeExceptNullPropBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AnyTypeExceptNullPropBoxedBoolean -public static final class AnyTypeExceptNullPropBoxedBoolean
-extends [AnyTypeExceptNullPropBoxed](#anytypeexceptnullpropboxed) +public record AnyTypeExceptNullPropBoxedBoolean
+implements [AnyTypeExceptNullPropBoxed](#anytypeexceptnullpropboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AnyTypeExceptNullPropBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AnyTypeExceptNullPropBoxedNumber -public static final class AnyTypeExceptNullPropBoxedNumber
-extends [AnyTypeExceptNullPropBoxed](#anytypeexceptnullpropboxed) +public record AnyTypeExceptNullPropBoxedNumber
+implements [AnyTypeExceptNullPropBoxed](#anytypeexceptnullpropboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AnyTypeExceptNullPropBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AnyTypeExceptNullPropBoxedString -public static final class AnyTypeExceptNullPropBoxedString
-extends [AnyTypeExceptNullPropBoxed](#anytypeexceptnullpropboxed) +public record AnyTypeExceptNullPropBoxedString
+implements [AnyTypeExceptNullPropBoxed](#anytypeexceptnullpropboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AnyTypeExceptNullPropBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AnyTypeExceptNullPropBoxedList -public static final class AnyTypeExceptNullPropBoxedList
-extends [AnyTypeExceptNullPropBoxed](#anytypeexceptnullpropboxed) +public record AnyTypeExceptNullPropBoxedList
+implements [AnyTypeExceptNullPropBoxed](#anytypeexceptnullpropboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AnyTypeExceptNullPropBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AnyTypeExceptNullPropBoxedMap -public static final class AnyTypeExceptNullPropBoxedMap
-extends [AnyTypeExceptNullPropBoxed](#anytypeexceptnullpropboxed) +public record AnyTypeExceptNullPropBoxedMap
+implements [AnyTypeExceptNullPropBoxed](#anytypeexceptnullpropboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AnyTypeExceptNullPropBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AnyTypeExceptNullProp public static class AnyTypeExceptNullProp
@@ -514,29 +529,32 @@ any type except 'null' Here the 'type' attribute is not spec | [AnyTypeExceptNullPropBoxedBoolean](#anytypeexceptnullpropboxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [AnyTypeExceptNullPropBoxedMap](#anytypeexceptnullpropboxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [AnyTypeExceptNullPropBoxedList](#anytypeexceptnullpropboxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [AnyTypeExceptNullPropBoxed](#anytypeexceptnullpropboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## NotBoxed -public static abstract sealed class NotBoxed
+public sealed interface NotBoxed
permits
[NotBoxedVoid](#notboxedvoid) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## NotBoxedVoid -public static final class NotBoxedVoid
-extends [NotBoxed](#notboxed) +public record NotBoxedVoid
+implements [NotBoxed](#notboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | NotBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Not public static class Not
@@ -550,7 +568,7 @@ A schema class that validates payloads | validateAndBox | ## AnyTypePropBoxed -public static abstract sealed class AnyTypePropBoxed
+public sealed interface AnyTypePropBoxed
permits
[AnyTypePropBoxedVoid](#anytypepropboxedvoid), [AnyTypePropBoxedBoolean](#anytypepropboxedboolean), @@ -559,103 +577,109 @@ permits
[AnyTypePropBoxedList](#anytypepropboxedlist), [AnyTypePropBoxedMap](#anytypepropboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AnyTypePropBoxedVoid -public static final class AnyTypePropBoxedVoid
-extends [AnyTypePropBoxed](#anytypepropboxed) +public record AnyTypePropBoxedVoid
+implements [AnyTypePropBoxed](#anytypepropboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AnyTypePropBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AnyTypePropBoxedBoolean -public static final class AnyTypePropBoxedBoolean
-extends [AnyTypePropBoxed](#anytypepropboxed) +public record AnyTypePropBoxedBoolean
+implements [AnyTypePropBoxed](#anytypepropboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AnyTypePropBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AnyTypePropBoxedNumber -public static final class AnyTypePropBoxedNumber
-extends [AnyTypePropBoxed](#anytypepropboxed) +public record AnyTypePropBoxedNumber
+implements [AnyTypePropBoxed](#anytypepropboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AnyTypePropBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AnyTypePropBoxedString -public static final class AnyTypePropBoxedString
-extends [AnyTypePropBoxed](#anytypepropboxed) +public record AnyTypePropBoxedString
+implements [AnyTypePropBoxed](#anytypepropboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AnyTypePropBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AnyTypePropBoxedList -public static final class AnyTypePropBoxedList
-extends [AnyTypePropBoxed](#anytypepropboxed) +public record AnyTypePropBoxedList
+implements [AnyTypePropBoxed](#anytypepropboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AnyTypePropBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AnyTypePropBoxedMap -public static final class AnyTypePropBoxedMap
-extends [AnyTypePropBoxed](#anytypepropboxed) +public record AnyTypePropBoxedMap
+implements [AnyTypePropBoxed](#anytypepropboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AnyTypePropBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AnyTypeProp public static class AnyTypeProp
@@ -672,44 +696,46 @@ test code generation for any type Here the 'type' attribute is not spe | validateAndBox | ## ObjectWithNoDeclaredPropsNullableBoxed -public static abstract sealed class ObjectWithNoDeclaredPropsNullableBoxed
+public sealed interface ObjectWithNoDeclaredPropsNullableBoxed
permits
[ObjectWithNoDeclaredPropsNullableBoxedVoid](#objectwithnodeclaredpropsnullableboxedvoid), [ObjectWithNoDeclaredPropsNullableBoxedMap](#objectwithnodeclaredpropsnullableboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ObjectWithNoDeclaredPropsNullableBoxedVoid -public static final class ObjectWithNoDeclaredPropsNullableBoxedVoid
-extends [ObjectWithNoDeclaredPropsNullableBoxed](#objectwithnodeclaredpropsnullableboxed) +public record ObjectWithNoDeclaredPropsNullableBoxedVoid
+implements [ObjectWithNoDeclaredPropsNullableBoxed](#objectwithnodeclaredpropsnullableboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ObjectWithNoDeclaredPropsNullableBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ObjectWithNoDeclaredPropsNullableBoxedMap -public static final class ObjectWithNoDeclaredPropsNullableBoxedMap
-extends [ObjectWithNoDeclaredPropsNullableBoxed](#objectwithnodeclaredpropsnullableboxed) +public record ObjectWithNoDeclaredPropsNullableBoxedMap
+implements [ObjectWithNoDeclaredPropsNullableBoxed](#objectwithnodeclaredpropsnullableboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ObjectWithNoDeclaredPropsNullableBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ObjectWithNoDeclaredPropsNullable public static class ObjectWithNoDeclaredPropsNullable
@@ -754,29 +780,32 @@ Void validatedPayload = User.ObjectWithNoDeclaredPropsNullable.validate( | [ObjectWithNoDeclaredPropsNullableBoxedVoid](#objectwithnodeclaredpropsnullableboxedvoid) | validateAndBox(Void arg, SchemaConfiguration configuration) | | FrozenMap | validate(Map<?, ?> arg, SchemaConfiguration configuration) | | [ObjectWithNoDeclaredPropsNullableBoxedMap](#objectwithnodeclaredpropsnullableboxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | +| [ObjectWithNoDeclaredPropsNullableBoxed](#objectwithnodeclaredpropsnullableboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ObjectWithNoDeclaredPropsBoxed -public static abstract sealed class ObjectWithNoDeclaredPropsBoxed
+public sealed interface ObjectWithNoDeclaredPropsBoxed
permits
[ObjectWithNoDeclaredPropsBoxedMap](#objectwithnodeclaredpropsboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ObjectWithNoDeclaredPropsBoxedMap -public static final class ObjectWithNoDeclaredPropsBoxedMap
-extends [ObjectWithNoDeclaredPropsBoxed](#objectwithnodeclaredpropsboxed) +public record ObjectWithNoDeclaredPropsBoxedMap
+implements [ObjectWithNoDeclaredPropsBoxed](#objectwithnodeclaredpropsboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ObjectWithNoDeclaredPropsBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ObjectWithNoDeclaredProps public static class ObjectWithNoDeclaredProps
@@ -793,27 +822,28 @@ test code generation for objects Value must be a map of strings to values. It ca | validateAndBox | ## UserStatusBoxed -public static abstract sealed class UserStatusBoxed
+public sealed interface UserStatusBoxed
permits
[UserStatusBoxedNumber](#userstatusboxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## UserStatusBoxedNumber -public static final class UserStatusBoxedNumber
-extends [UserStatusBoxed](#userstatusboxed) +public record UserStatusBoxedNumber
+implements [UserStatusBoxed](#userstatusboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UserStatusBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## UserStatus public static class UserStatus
@@ -830,27 +860,28 @@ User Status | validateAndBox | ## PhoneBoxed -public static abstract sealed class PhoneBoxed
+public sealed interface PhoneBoxed
permits
[PhoneBoxedString](#phoneboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## PhoneBoxedString -public static final class PhoneBoxedString
-extends [PhoneBoxed](#phoneboxed) +public record PhoneBoxedString
+implements [PhoneBoxed](#phoneboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PhoneBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Phone public static class Phone
@@ -864,27 +895,28 @@ A schema class that validates payloads | validateAndBox | ## PasswordBoxed -public static abstract sealed class PasswordBoxed
+public sealed interface PasswordBoxed
permits
[PasswordBoxedString](#passwordboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## PasswordBoxedString -public static final class PasswordBoxedString
-extends [PasswordBoxed](#passwordboxed) +public record PasswordBoxedString
+implements [PasswordBoxed](#passwordboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PasswordBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Password public static class Password
@@ -898,27 +930,28 @@ A schema class that validates payloads | validateAndBox | ## EmailBoxed -public static abstract sealed class EmailBoxed
+public sealed interface EmailBoxed
permits
[EmailBoxedString](#emailboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## EmailBoxedString -public static final class EmailBoxedString
-extends [EmailBoxed](#emailboxed) +public record EmailBoxedString
+implements [EmailBoxed](#emailboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | EmailBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Email public static class Email
@@ -932,27 +965,28 @@ A schema class that validates payloads | validateAndBox | ## LastNameBoxed -public static abstract sealed class LastNameBoxed
+public sealed interface LastNameBoxed
permits
[LastNameBoxedString](#lastnameboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## LastNameBoxedString -public static final class LastNameBoxedString
-extends [LastNameBoxed](#lastnameboxed) +public record LastNameBoxedString
+implements [LastNameBoxed](#lastnameboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | LastNameBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## LastName public static class LastName
@@ -966,27 +1000,28 @@ A schema class that validates payloads | validateAndBox | ## FirstNameBoxed -public static abstract sealed class FirstNameBoxed
+public sealed interface FirstNameBoxed
permits
[FirstNameBoxedString](#firstnameboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## FirstNameBoxedString -public static final class FirstNameBoxedString
-extends [FirstNameBoxed](#firstnameboxed) +public record FirstNameBoxedString
+implements [FirstNameBoxed](#firstnameboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | FirstNameBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## FirstName public static class FirstName
@@ -1000,27 +1035,28 @@ A schema class that validates payloads | validateAndBox | ## UsernameBoxed -public static abstract sealed class UsernameBoxed
+public sealed interface UsernameBoxed
permits
[UsernameBoxedString](#usernameboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## UsernameBoxedString -public static final class UsernameBoxedString
-extends [UsernameBoxed](#usernameboxed) +public record UsernameBoxedString
+implements [UsernameBoxed](#usernameboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | UsernameBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Username public static class Username
@@ -1034,27 +1070,28 @@ A schema class that validates payloads | validateAndBox | ## IdBoxed -public static abstract sealed class IdBoxed
+public sealed interface IdBoxed
permits
[IdBoxedNumber](#idboxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## IdBoxedNumber -public static final class IdBoxedNumber
-extends [IdBoxed](#idboxed) +public record IdBoxedNumber
+implements [IdBoxed](#idboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | IdBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Id public static class Id
diff --git a/samples/client/petstore/java/docs/components/schemas/Whale.md b/samples/client/petstore/java/docs/components/schemas/Whale.md index 32b690d4b48..287514ff2c3 100644 --- a/samples/client/petstore/java/docs/components/schemas/Whale.md +++ b/samples/client/petstore/java/docs/components/schemas/Whale.md @@ -4,7 +4,7 @@ public class Whale
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -13,44 +13,45 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Whale.Whale1Boxed](#whale1boxed)
abstract sealed validated payload class | -| static class | [Whale.Whale1BoxedMap](#whale1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [Whale.Whale1Boxed](#whale1boxed)
sealed interface for validated payloads | +| record | [Whale.Whale1BoxedMap](#whale1boxedmap)
boxed class to store validated Map payloads | | static class | [Whale.Whale1](#whale1)
schema class | | static class | [Whale.WhaleMapBuilder](#whalemapbuilder)
builder for Map payloads | | static class | [Whale.WhaleMap](#whalemap)
output class for Map payloads | -| static class | [Whale.ClassNameBoxed](#classnameboxed)
abstract sealed validated payload class | -| static class | [Whale.ClassNameBoxedString](#classnameboxedstring)
boxed class to store validated String payloads | +| sealed interface | [Whale.ClassNameBoxed](#classnameboxed)
sealed interface for validated payloads | +| record | [Whale.ClassNameBoxedString](#classnameboxedstring)
boxed class to store validated String payloads | | static class | [Whale.ClassName](#classname)
schema class | | enum | [Whale.StringClassNameEnums](#stringclassnameenums)
String enum | -| static class | [Whale.HasTeethBoxed](#hasteethboxed)
abstract sealed validated payload class | -| static class | [Whale.HasTeethBoxedBoolean](#hasteethboxedboolean)
boxed class to store validated boolean payloads | +| sealed interface | [Whale.HasTeethBoxed](#hasteethboxed)
sealed interface for validated payloads | +| record | [Whale.HasTeethBoxedBoolean](#hasteethboxedboolean)
boxed class to store validated boolean payloads | | static class | [Whale.HasTeeth](#hasteeth)
schema class | -| static class | [Whale.HasBaleenBoxed](#hasbaleenboxed)
abstract sealed validated payload class | -| static class | [Whale.HasBaleenBoxedBoolean](#hasbaleenboxedboolean)
boxed class to store validated boolean payloads | +| sealed interface | [Whale.HasBaleenBoxed](#hasbaleenboxed)
sealed interface for validated payloads | +| record | [Whale.HasBaleenBoxedBoolean](#hasbaleenboxedboolean)
boxed class to store validated boolean payloads | | static class | [Whale.HasBaleen](#hasbaleen)
schema class | ## Whale1Boxed -public static abstract sealed class Whale1Boxed
+public sealed interface Whale1Boxed
permits
[Whale1BoxedMap](#whale1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Whale1BoxedMap -public static final class Whale1BoxedMap
-extends [Whale1Boxed](#whale1boxed) +public record Whale1BoxedMap
+implements [Whale1Boxed](#whale1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Whale1BoxedMap([WhaleMap](#whalemap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [WhaleMap](#whalemap) | data
validated payload | +| [WhaleMap](#whalemap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Whale1 public static class Whale1
@@ -100,7 +101,9 @@ Whale.WhaleMap validatedPayload = | ----------------- | ---------------------- | | [WhaleMap](#whalemap) | validate([Map<?, ?>](#whalemapbuilder) arg, SchemaConfiguration configuration) | | [Whale1BoxedMap](#whale1boxedmap) | validateAndBox([Map<?, ?>](#whalemapbuilder) arg, SchemaConfiguration configuration) | +| [Whale1Boxed](#whale1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## WhaleMap0Builder public class WhaleMap0Builder
builder for `Map` @@ -161,27 +164,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## ClassNameBoxed -public static abstract sealed class ClassNameBoxed
+public sealed interface ClassNameBoxed
permits
[ClassNameBoxedString](#classnameboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ClassNameBoxedString -public static final class ClassNameBoxedString
-extends [ClassNameBoxed](#classnameboxed) +public record ClassNameBoxedString
+implements [ClassNameBoxed](#classnameboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ClassNameBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ClassName public static class ClassName
@@ -223,7 +227,9 @@ String validatedPayload = Whale.ClassName.validate( | String | validate(String arg, SchemaConfiguration configuration) | | String | validate([StringClassNameEnums](#stringclassnameenums) arg, SchemaConfiguration configuration) | | [ClassNameBoxedString](#classnameboxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [ClassNameBoxed](#classnameboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## StringClassNameEnums public enum StringClassNameEnums
extends `Enum` @@ -236,27 +242,28 @@ A class that stores String enum values | WHALE | value = "whale" | ## HasTeethBoxed -public static abstract sealed class HasTeethBoxed
+public sealed interface HasTeethBoxed
permits
[HasTeethBoxedBoolean](#hasteethboxedboolean) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## HasTeethBoxedBoolean -public static final class HasTeethBoxedBoolean
-extends [HasTeethBoxed](#hasteethboxed) +public record HasTeethBoxedBoolean
+implements [HasTeethBoxed](#hasteethboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | HasTeethBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## HasTeeth public static class HasTeeth
@@ -270,27 +277,28 @@ A schema class that validates payloads | validateAndBox | ## HasBaleenBoxed -public static abstract sealed class HasBaleenBoxed
+public sealed interface HasBaleenBoxed
permits
[HasBaleenBoxedBoolean](#hasbaleenboxedboolean) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## HasBaleenBoxedBoolean -public static final class HasBaleenBoxedBoolean
-extends [HasBaleenBoxed](#hasbaleenboxed) +public record HasBaleenBoxedBoolean
+implements [HasBaleenBoxed](#hasbaleenboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | HasBaleenBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## HasBaleen public static class HasBaleen
diff --git a/samples/client/petstore/java/docs/components/schemas/Zebra.md b/samples/client/petstore/java/docs/components/schemas/Zebra.md index 3f24bb68dc5..e3750eec3b8 100644 --- a/samples/client/petstore/java/docs/components/schemas/Zebra.md +++ b/samples/client/petstore/java/docs/components/schemas/Zebra.md @@ -4,7 +4,7 @@ public class Zebra
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -13,50 +13,51 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Zebra.Zebra1Boxed](#zebra1boxed)
abstract sealed validated payload class | -| static class | [Zebra.Zebra1BoxedMap](#zebra1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [Zebra.Zebra1Boxed](#zebra1boxed)
sealed interface for validated payloads | +| record | [Zebra.Zebra1BoxedMap](#zebra1boxedmap)
boxed class to store validated Map payloads | | static class | [Zebra.Zebra1](#zebra1)
schema class | | static class | [Zebra.ZebraMapBuilder](#zebramapbuilder)
builder for Map payloads | | static class | [Zebra.ZebraMap](#zebramap)
output class for Map payloads | -| static class | [Zebra.ClassNameBoxed](#classnameboxed)
abstract sealed validated payload class | -| static class | [Zebra.ClassNameBoxedString](#classnameboxedstring)
boxed class to store validated String payloads | +| sealed interface | [Zebra.ClassNameBoxed](#classnameboxed)
sealed interface for validated payloads | +| record | [Zebra.ClassNameBoxedString](#classnameboxedstring)
boxed class to store validated String payloads | | static class | [Zebra.ClassName](#classname)
schema class | | enum | [Zebra.StringClassNameEnums](#stringclassnameenums)
String enum | -| static class | [Zebra.TypeBoxed](#typeboxed)
abstract sealed validated payload class | -| static class | [Zebra.TypeBoxedString](#typeboxedstring)
boxed class to store validated String payloads | +| sealed interface | [Zebra.TypeBoxed](#typeboxed)
sealed interface for validated payloads | +| record | [Zebra.TypeBoxedString](#typeboxedstring)
boxed class to store validated String payloads | | static class | [Zebra.Type](#type)
schema class | | enum | [Zebra.StringTypeEnums](#stringtypeenums)
String enum | -| static class | [Zebra.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
abstract sealed validated payload class | -| static class | [Zebra.AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid)
boxed class to store validated null payloads | -| static class | [Zebra.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | -| static class | [Zebra.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | -| static class | [Zebra.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | -| static class | [Zebra.AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist)
boxed class to store validated List payloads | -| static class | [Zebra.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [Zebra.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
sealed interface for validated payloads | +| record | [Zebra.AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid)
boxed class to store validated null payloads | +| record | [Zebra.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | +| record | [Zebra.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | +| record | [Zebra.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | +| record | [Zebra.AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist)
boxed class to store validated List payloads | +| record | [Zebra.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | | static class | [Zebra.AdditionalProperties](#additionalproperties)
schema class | ## Zebra1Boxed -public static abstract sealed class Zebra1Boxed
+public sealed interface Zebra1Boxed
permits
[Zebra1BoxedMap](#zebra1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Zebra1BoxedMap -public static final class Zebra1BoxedMap
-extends [Zebra1Boxed](#zebra1boxed) +public record Zebra1BoxedMap
+implements [Zebra1Boxed](#zebra1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Zebra1BoxedMap([ZebraMap](#zebramap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [ZebraMap](#zebramap) | data
validated payload | +| [ZebraMap](#zebramap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Zebra1 public static class Zebra1
@@ -105,7 +106,9 @@ Zebra.ZebraMap validatedPayload = | ----------------- | ---------------------- | | [ZebraMap](#zebramap) | validate([Map<?, ?>](#zebramapbuilder) arg, SchemaConfiguration configuration) | | [Zebra1BoxedMap](#zebra1boxedmap) | validateAndBox([Map<?, ?>](#zebramapbuilder) arg, SchemaConfiguration configuration) | +| [Zebra1Boxed](#zebra1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ZebraMap0Builder public class ZebraMap0Builder
builder for `Map` @@ -165,27 +168,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## ClassNameBoxed -public static abstract sealed class ClassNameBoxed
+public sealed interface ClassNameBoxed
permits
[ClassNameBoxedString](#classnameboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ClassNameBoxedString -public static final class ClassNameBoxedString
-extends [ClassNameBoxed](#classnameboxed) +public record ClassNameBoxedString
+implements [ClassNameBoxed](#classnameboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ClassNameBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ClassName public static class ClassName
@@ -227,7 +231,9 @@ String validatedPayload = Zebra.ClassName.validate( | String | validate(String arg, SchemaConfiguration configuration) | | String | validate([StringClassNameEnums](#stringclassnameenums) arg, SchemaConfiguration configuration) | | [ClassNameBoxedString](#classnameboxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [ClassNameBoxed](#classnameboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## StringClassNameEnums public enum StringClassNameEnums
extends `Enum` @@ -240,27 +246,28 @@ A class that stores String enum values | ZEBRA | value = "zebra" | ## TypeBoxed -public static abstract sealed class TypeBoxed
+public sealed interface TypeBoxed
permits
[TypeBoxedString](#typeboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## TypeBoxedString -public static final class TypeBoxedString
-extends [TypeBoxed](#typeboxed) +public record TypeBoxedString
+implements [TypeBoxed](#typeboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | TypeBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Type public static class Type
@@ -302,7 +309,9 @@ String validatedPayload = Zebra.Type.validate( | String | validate(String arg, SchemaConfiguration configuration) | | String | validate([StringTypeEnums](#stringtypeenums) arg, SchemaConfiguration configuration) | | [TypeBoxedString](#typeboxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [TypeBoxed](#typeboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## StringTypeEnums public enum StringTypeEnums
extends `Enum` @@ -317,7 +326,7 @@ A class that stores String enum values | GREVYS | value = "grevys" | ## AdditionalPropertiesBoxed -public static abstract sealed class AdditionalPropertiesBoxed
+public sealed interface AdditionalPropertiesBoxed
permits
[AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid), [AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean), @@ -326,103 +335,109 @@ permits
[AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist), [AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## AdditionalPropertiesBoxedVoid -public static final class AdditionalPropertiesBoxedVoid
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedVoid
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedBoolean -public static final class AdditionalPropertiesBoxedBoolean
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedBoolean
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedNumber -public static final class AdditionalPropertiesBoxedNumber
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedNumber
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedString -public static final class AdditionalPropertiesBoxedString
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedString
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedList -public static final class AdditionalPropertiesBoxedList
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedList
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalPropertiesBoxedMap -public static final class AdditionalPropertiesBoxedMap
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedMap
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## AdditionalProperties public static class AdditionalProperties
diff --git a/samples/client/petstore/java/docs/paths/anotherfakedummy/patch/responses/response200/content/applicationjson/ApplicationjsonSchema.md b/samples/client/petstore/java/docs/paths/anotherfakedummy/patch/responses/code200response/content/applicationjson/ApplicationjsonSchema.md similarity index 89% rename from samples/client/petstore/java/docs/paths/anotherfakedummy/patch/responses/response200/content/applicationjson/ApplicationjsonSchema.md rename to samples/client/petstore/java/docs/paths/anotherfakedummy/patch/responses/code200response/content/applicationjson/ApplicationjsonSchema.md index 104d3d325b5..0a219ca9fad 100644 --- a/samples/client/petstore/java/docs/paths/anotherfakedummy/patch/responses/response200/content/applicationjson/ApplicationjsonSchema.md +++ b/samples/client/petstore/java/docs/paths/anotherfakedummy/patch/responses/code200response/content/applicationjson/ApplicationjsonSchema.md @@ -4,7 +4,7 @@ extends [Client1](../../../../../../../../../components/schemas/Client.md#client A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary diff --git a/samples/client/petstore/java/docs/paths/commonparamsubdir/delete/parameters/parameter0/Schema0.md b/samples/client/petstore/java/docs/paths/commonparamsubdir/delete/parameters/parameter0/Schema0.md index 34951cbef92..9ff90e0bc35 100644 --- a/samples/client/petstore/java/docs/paths/commonparamsubdir/delete/parameters/parameter0/Schema0.md +++ b/samples/client/petstore/java/docs/paths/commonparamsubdir/delete/parameters/parameter0/Schema0.md @@ -3,38 +3,39 @@ public class Schema0
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Schema0.Schema01Boxed](#schema01boxed)
abstract sealed validated payload class | -| static class | [Schema0.Schema01BoxedString](#schema01boxedstring)
boxed class to store validated String payloads | +| sealed interface | [Schema0.Schema01Boxed](#schema01boxed)
sealed interface for validated payloads | +| record | [Schema0.Schema01BoxedString](#schema01boxedstring)
boxed class to store validated String payloads | | static class | [Schema0.Schema01](#schema01)
schema class | ## Schema01Boxed -public static abstract sealed class Schema01Boxed
+public sealed interface Schema01Boxed
permits
[Schema01BoxedString](#schema01boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema01BoxedString -public static final class Schema01BoxedString
-extends [Schema01Boxed](#schema01boxed) +public record Schema01BoxedString
+implements [Schema01Boxed](#schema01boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema01BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema01 public static class Schema01
diff --git a/samples/client/petstore/java/docs/paths/commonparamsubdir/delete/parameters/parameter1/Schema1.md b/samples/client/petstore/java/docs/paths/commonparamsubdir/delete/parameters/parameter1/Schema1.md index 8547e796a3b..05f2b572d37 100644 --- a/samples/client/petstore/java/docs/paths/commonparamsubdir/delete/parameters/parameter1/Schema1.md +++ b/samples/client/petstore/java/docs/paths/commonparamsubdir/delete/parameters/parameter1/Schema1.md @@ -3,40 +3,41 @@ public class Schema1
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - enum classes ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Schema1.Schema11Boxed](#schema11boxed)
abstract sealed validated payload class | -| static class | [Schema1.Schema11BoxedString](#schema11boxedstring)
boxed class to store validated String payloads | +| sealed interface | [Schema1.Schema11Boxed](#schema11boxed)
sealed interface for validated payloads | +| record | [Schema1.Schema11BoxedString](#schema11boxedstring)
boxed class to store validated String payloads | | static class | [Schema1.Schema11](#schema11)
schema class | | enum | [Schema1.StringSchemaEnums1](#stringschemaenums1)
String enum | ## Schema11Boxed -public static abstract sealed class Schema11Boxed
+public sealed interface Schema11Boxed
permits
[Schema11BoxedString](#schema11boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema11BoxedString -public static final class Schema11BoxedString
-extends [Schema11Boxed](#schema11boxed) +public record Schema11BoxedString
+implements [Schema11Boxed](#schema11boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema11BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema11 public static class Schema11
@@ -78,7 +79,9 @@ String validatedPayload = Schema1.Schema11.validate( | String | validate(String arg, SchemaConfiguration configuration) | | String | validate([StringSchemaEnums1](#stringschemaenums1) arg, SchemaConfiguration configuration) | | [Schema11BoxedString](#schema11boxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [Schema11Boxed](#schema11boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## StringSchemaEnums1 public enum StringSchemaEnums1
extends `Enum` diff --git a/samples/client/petstore/java/docs/paths/commonparamsubdir/get/parameters/parameter0/Schema0.md b/samples/client/petstore/java/docs/paths/commonparamsubdir/get/parameters/parameter0/Schema0.md index 34951cbef92..9ff90e0bc35 100644 --- a/samples/client/petstore/java/docs/paths/commonparamsubdir/get/parameters/parameter0/Schema0.md +++ b/samples/client/petstore/java/docs/paths/commonparamsubdir/get/parameters/parameter0/Schema0.md @@ -3,38 +3,39 @@ public class Schema0
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Schema0.Schema01Boxed](#schema01boxed)
abstract sealed validated payload class | -| static class | [Schema0.Schema01BoxedString](#schema01boxedstring)
boxed class to store validated String payloads | +| sealed interface | [Schema0.Schema01Boxed](#schema01boxed)
sealed interface for validated payloads | +| record | [Schema0.Schema01BoxedString](#schema01boxedstring)
boxed class to store validated String payloads | | static class | [Schema0.Schema01](#schema01)
schema class | ## Schema01Boxed -public static abstract sealed class Schema01Boxed
+public sealed interface Schema01Boxed
permits
[Schema01BoxedString](#schema01boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema01BoxedString -public static final class Schema01BoxedString
-extends [Schema01Boxed](#schema01boxed) +public record Schema01BoxedString
+implements [Schema01Boxed](#schema01boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema01BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema01 public static class Schema01
diff --git a/samples/client/petstore/java/docs/paths/commonparamsubdir/parameters/parameter0/PathParamSchema0.md b/samples/client/petstore/java/docs/paths/commonparamsubdir/parameters/parameter0/PathParamSchema0.md index ff61f37ac2d..e7aa6c85451 100644 --- a/samples/client/petstore/java/docs/paths/commonparamsubdir/parameters/parameter0/PathParamSchema0.md +++ b/samples/client/petstore/java/docs/paths/commonparamsubdir/parameters/parameter0/PathParamSchema0.md @@ -3,40 +3,41 @@ public class PathParamSchema0
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - enum classes ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [PathParamSchema0.PathParamSchema01Boxed](#pathparamschema01boxed)
abstract sealed validated payload class | -| static class | [PathParamSchema0.PathParamSchema01BoxedString](#pathparamschema01boxedstring)
boxed class to store validated String payloads | +| sealed interface | [PathParamSchema0.PathParamSchema01Boxed](#pathparamschema01boxed)
sealed interface for validated payloads | +| record | [PathParamSchema0.PathParamSchema01BoxedString](#pathparamschema01boxedstring)
boxed class to store validated String payloads | | static class | [PathParamSchema0.PathParamSchema01](#pathparamschema01)
schema class | | enum | [PathParamSchema0.StringPathParamSchemaEnums0](#stringpathparamschemaenums0)
String enum | ## PathParamSchema01Boxed -public static abstract sealed class PathParamSchema01Boxed
+public sealed interface PathParamSchema01Boxed
permits
[PathParamSchema01BoxedString](#pathparamschema01boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## PathParamSchema01BoxedString -public static final class PathParamSchema01BoxedString
-extends [PathParamSchema01Boxed](#pathparamschema01boxed) +public record PathParamSchema01BoxedString
+implements [PathParamSchema01Boxed](#pathparamschema01boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | PathParamSchema01BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## PathParamSchema01 public static class PathParamSchema01
@@ -78,7 +79,9 @@ String validatedPayload = PathParamSchema0.PathParamSchema01.validate( | String | validate(String arg, SchemaConfiguration configuration) | | String | validate([StringPathParamSchemaEnums0](#stringpathparamschemaenums0) arg, SchemaConfiguration configuration) | | [PathParamSchema01BoxedString](#pathparamschema01boxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [PathParamSchema01Boxed](#pathparamschema01boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## StringPathParamSchemaEnums0 public enum StringPathParamSchemaEnums0
extends `Enum` diff --git a/samples/client/petstore/java/docs/paths/commonparamsubdir/post/parameters/parameter0/Schema0.md b/samples/client/petstore/java/docs/paths/commonparamsubdir/post/parameters/parameter0/Schema0.md index 34951cbef92..9ff90e0bc35 100644 --- a/samples/client/petstore/java/docs/paths/commonparamsubdir/post/parameters/parameter0/Schema0.md +++ b/samples/client/petstore/java/docs/paths/commonparamsubdir/post/parameters/parameter0/Schema0.md @@ -3,38 +3,39 @@ public class Schema0
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Schema0.Schema01Boxed](#schema01boxed)
abstract sealed validated payload class | -| static class | [Schema0.Schema01BoxedString](#schema01boxedstring)
boxed class to store validated String payloads | +| sealed interface | [Schema0.Schema01Boxed](#schema01boxed)
sealed interface for validated payloads | +| record | [Schema0.Schema01BoxedString](#schema01boxedstring)
boxed class to store validated String payloads | | static class | [Schema0.Schema01](#schema01)
schema class | ## Schema01Boxed -public static abstract sealed class Schema01Boxed
+public sealed interface Schema01Boxed
permits
[Schema01BoxedString](#schema01boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema01BoxedString -public static final class Schema01BoxedString
-extends [Schema01Boxed](#schema01boxed) +public record Schema01BoxedString
+implements [Schema01Boxed](#schema01boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema01BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema01 public static class Schema01
diff --git a/samples/client/petstore/java/docs/paths/fake/delete/parameters/parameter0/Schema0.md b/samples/client/petstore/java/docs/paths/fake/delete/parameters/parameter0/Schema0.md index 34951cbef92..9ff90e0bc35 100644 --- a/samples/client/petstore/java/docs/paths/fake/delete/parameters/parameter0/Schema0.md +++ b/samples/client/petstore/java/docs/paths/fake/delete/parameters/parameter0/Schema0.md @@ -3,38 +3,39 @@ public class Schema0
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Schema0.Schema01Boxed](#schema01boxed)
abstract sealed validated payload class | -| static class | [Schema0.Schema01BoxedString](#schema01boxedstring)
boxed class to store validated String payloads | +| sealed interface | [Schema0.Schema01Boxed](#schema01boxed)
sealed interface for validated payloads | +| record | [Schema0.Schema01BoxedString](#schema01boxedstring)
boxed class to store validated String payloads | | static class | [Schema0.Schema01](#schema01)
schema class | ## Schema01Boxed -public static abstract sealed class Schema01Boxed
+public sealed interface Schema01Boxed
permits
[Schema01BoxedString](#schema01boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema01BoxedString -public static final class Schema01BoxedString
-extends [Schema01Boxed](#schema01boxed) +public record Schema01BoxedString
+implements [Schema01Boxed](#schema01boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema01BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema01 public static class Schema01
diff --git a/samples/client/petstore/java/docs/paths/fake/delete/parameters/parameter1/Schema1.md b/samples/client/petstore/java/docs/paths/fake/delete/parameters/parameter1/Schema1.md index 87afe9fb90e..7a88894daa9 100644 --- a/samples/client/petstore/java/docs/paths/fake/delete/parameters/parameter1/Schema1.md +++ b/samples/client/petstore/java/docs/paths/fake/delete/parameters/parameter1/Schema1.md @@ -3,40 +3,41 @@ public class Schema1
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - enum classes ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Schema1.Schema11Boxed](#schema11boxed)
abstract sealed validated payload class | -| static class | [Schema1.Schema11BoxedString](#schema11boxedstring)
boxed class to store validated String payloads | +| sealed interface | [Schema1.Schema11Boxed](#schema11boxed)
sealed interface for validated payloads | +| record | [Schema1.Schema11BoxedString](#schema11boxedstring)
boxed class to store validated String payloads | | static class | [Schema1.Schema11](#schema11)
schema class | | enum | [Schema1.StringSchemaEnums1](#stringschemaenums1)
String enum | ## Schema11Boxed -public static abstract sealed class Schema11Boxed
+public sealed interface Schema11Boxed
permits
[Schema11BoxedString](#schema11boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema11BoxedString -public static final class Schema11BoxedString
-extends [Schema11Boxed](#schema11boxed) +public record Schema11BoxedString
+implements [Schema11Boxed](#schema11boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema11BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema11 public static class Schema11
@@ -78,7 +79,9 @@ String validatedPayload = Schema1.Schema11.validate( | String | validate(String arg, SchemaConfiguration configuration) | | String | validate([StringSchemaEnums1](#stringschemaenums1) arg, SchemaConfiguration configuration) | | [Schema11BoxedString](#schema11boxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [Schema11Boxed](#schema11boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## StringSchemaEnums1 public enum StringSchemaEnums1
extends `Enum` diff --git a/samples/client/petstore/java/docs/paths/fake/delete/parameters/parameter2/Schema2.md b/samples/client/petstore/java/docs/paths/fake/delete/parameters/parameter2/Schema2.md index b3f8c15a378..440bb8ca283 100644 --- a/samples/client/petstore/java/docs/paths/fake/delete/parameters/parameter2/Schema2.md +++ b/samples/client/petstore/java/docs/paths/fake/delete/parameters/parameter2/Schema2.md @@ -3,38 +3,39 @@ public class Schema2
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Schema2.Schema21Boxed](#schema21boxed)
abstract sealed validated payload class | -| static class | [Schema2.Schema21BoxedNumber](#schema21boxednumber)
boxed class to store validated Number payloads | +| sealed interface | [Schema2.Schema21Boxed](#schema21boxed)
sealed interface for validated payloads | +| record | [Schema2.Schema21BoxedNumber](#schema21boxednumber)
boxed class to store validated Number payloads | | static class | [Schema2.Schema21](#schema21)
schema class | ## Schema21Boxed -public static abstract sealed class Schema21Boxed
+public sealed interface Schema21Boxed
permits
[Schema21BoxedNumber](#schema21boxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema21BoxedNumber -public static final class Schema21BoxedNumber
-extends [Schema21Boxed](#schema21boxed) +public record Schema21BoxedNumber
+implements [Schema21Boxed](#schema21boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema21BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema21 public static class Schema21
diff --git a/samples/client/petstore/java/docs/paths/fake/delete/parameters/parameter3/Schema3.md b/samples/client/petstore/java/docs/paths/fake/delete/parameters/parameter3/Schema3.md index b09a6ef7f98..41d54a1d930 100644 --- a/samples/client/petstore/java/docs/paths/fake/delete/parameters/parameter3/Schema3.md +++ b/samples/client/petstore/java/docs/paths/fake/delete/parameters/parameter3/Schema3.md @@ -3,38 +3,39 @@ public class Schema3
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Schema3.Schema31Boxed](#schema31boxed)
abstract sealed validated payload class | -| static class | [Schema3.Schema31BoxedString](#schema31boxedstring)
boxed class to store validated String payloads | +| sealed interface | [Schema3.Schema31Boxed](#schema31boxed)
sealed interface for validated payloads | +| record | [Schema3.Schema31BoxedString](#schema31boxedstring)
boxed class to store validated String payloads | | static class | [Schema3.Schema31](#schema31)
schema class | ## Schema31Boxed -public static abstract sealed class Schema31Boxed
+public sealed interface Schema31Boxed
permits
[Schema31BoxedString](#schema31boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema31BoxedString -public static final class Schema31BoxedString
-extends [Schema31Boxed](#schema31boxed) +public record Schema31BoxedString
+implements [Schema31Boxed](#schema31boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema31BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema31 public static class Schema31
diff --git a/samples/client/petstore/java/docs/paths/fake/delete/parameters/parameter4/Schema4.md b/samples/client/petstore/java/docs/paths/fake/delete/parameters/parameter4/Schema4.md index b5f52f6271e..a0a2551d43f 100644 --- a/samples/client/petstore/java/docs/paths/fake/delete/parameters/parameter4/Schema4.md +++ b/samples/client/petstore/java/docs/paths/fake/delete/parameters/parameter4/Schema4.md @@ -3,40 +3,41 @@ public class Schema4
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - enum classes ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Schema4.Schema41Boxed](#schema41boxed)
abstract sealed validated payload class | -| static class | [Schema4.Schema41BoxedString](#schema41boxedstring)
boxed class to store validated String payloads | +| sealed interface | [Schema4.Schema41Boxed](#schema41boxed)
sealed interface for validated payloads | +| record | [Schema4.Schema41BoxedString](#schema41boxedstring)
boxed class to store validated String payloads | | static class | [Schema4.Schema41](#schema41)
schema class | | enum | [Schema4.StringSchemaEnums4](#stringschemaenums4)
String enum | ## Schema41Boxed -public static abstract sealed class Schema41Boxed
+public sealed interface Schema41Boxed
permits
[Schema41BoxedString](#schema41boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema41BoxedString -public static final class Schema41BoxedString
-extends [Schema41Boxed](#schema41boxed) +public record Schema41BoxedString
+implements [Schema41Boxed](#schema41boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema41BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema41 public static class Schema41
@@ -78,7 +79,9 @@ String validatedPayload = Schema4.Schema41.validate( | String | validate(String arg, SchemaConfiguration configuration) | | String | validate([StringSchemaEnums4](#stringschemaenums4) arg, SchemaConfiguration configuration) | | [Schema41BoxedString](#schema41boxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [Schema41Boxed](#schema41boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## StringSchemaEnums4 public enum StringSchemaEnums4
extends `Enum` diff --git a/samples/client/petstore/java/docs/paths/fake/delete/parameters/parameter5/Schema5.md b/samples/client/petstore/java/docs/paths/fake/delete/parameters/parameter5/Schema5.md index a72c1d81468..9611a34edb2 100644 --- a/samples/client/petstore/java/docs/paths/fake/delete/parameters/parameter5/Schema5.md +++ b/samples/client/petstore/java/docs/paths/fake/delete/parameters/parameter5/Schema5.md @@ -3,38 +3,39 @@ public class Schema5
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Schema5.Schema51Boxed](#schema51boxed)
abstract sealed validated payload class | -| static class | [Schema5.Schema51BoxedNumber](#schema51boxednumber)
boxed class to store validated Number payloads | +| sealed interface | [Schema5.Schema51Boxed](#schema51boxed)
sealed interface for validated payloads | +| record | [Schema5.Schema51BoxedNumber](#schema51boxednumber)
boxed class to store validated Number payloads | | static class | [Schema5.Schema51](#schema51)
schema class | ## Schema51Boxed -public static abstract sealed class Schema51Boxed
+public sealed interface Schema51Boxed
permits
[Schema51BoxedNumber](#schema51boxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema51BoxedNumber -public static final class Schema51BoxedNumber
-extends [Schema51Boxed](#schema51boxed) +public record Schema51BoxedNumber
+implements [Schema51Boxed](#schema51boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema51BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema51 public static class Schema51
diff --git a/samples/client/petstore/java/docs/paths/fake/get/parameters/parameter0/Schema0.md b/samples/client/petstore/java/docs/paths/fake/get/parameters/parameter0/Schema0.md index f4abcae80b2..1368daf90c2 100644 --- a/samples/client/petstore/java/docs/paths/fake/get/parameters/parameter0/Schema0.md +++ b/samples/client/petstore/java/docs/paths/fake/get/parameters/parameter0/Schema0.md @@ -3,7 +3,7 @@ public class Schema0
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated list payloads, extends FrozenList - classes to build inputs for list payloads @@ -12,38 +12,39 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Schema0.Schema01Boxed](#schema01boxed)
abstract sealed validated payload class | -| static class | [Schema0.Schema01BoxedList](#schema01boxedlist)
boxed class to store validated List payloads | +| sealed interface | [Schema0.Schema01Boxed](#schema01boxed)
sealed interface for validated payloads | +| record | [Schema0.Schema01BoxedList](#schema01boxedlist)
boxed class to store validated List payloads | | static class | [Schema0.Schema01](#schema01)
schema class | | static class | [Schema0.SchemaListBuilder0](#schemalistbuilder0)
builder for List payloads | | static class | [Schema0.SchemaList0](#schemalist0)
output class for List payloads | -| static class | [Schema0.Items0Boxed](#items0boxed)
abstract sealed validated payload class | -| static class | [Schema0.Items0BoxedString](#items0boxedstring)
boxed class to store validated String payloads | +| sealed interface | [Schema0.Items0Boxed](#items0boxed)
sealed interface for validated payloads | +| record | [Schema0.Items0BoxedString](#items0boxedstring)
boxed class to store validated String payloads | | static class | [Schema0.Items0](#items0)
schema class | | enum | [Schema0.StringItemsEnums0](#stringitemsenums0)
String enum | ## Schema01Boxed -public static abstract sealed class Schema01Boxed
+public sealed interface Schema01Boxed
permits
[Schema01BoxedList](#schema01boxedlist) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema01BoxedList -public static final class Schema01BoxedList
-extends [Schema01Boxed](#schema01boxed) +public record Schema01BoxedList
+implements [Schema01Boxed](#schema01boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema01BoxedList([SchemaList0](#schemalist0) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [SchemaList0](#schemalist0) | data
validated payload | +| [SchemaList0](#schemalist0) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema01 public static class Schema01
@@ -88,7 +89,9 @@ Schema0.SchemaList0 validatedPayload = | ----------------- | ---------------------- | | [SchemaList0](#schemalist0) | validate([List](#schemalistbuilder0) arg, SchemaConfiguration configuration) | | [Schema01BoxedList](#schema01boxedlist) | validateAndBox([List](#schemalistbuilder0) arg, SchemaConfiguration configuration) | +| [Schema01Boxed](#schema01boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## SchemaListBuilder0 public class SchemaListBuilder0
builder for `List` @@ -120,27 +123,28 @@ A class to store validated List payloads | static [SchemaList0](#schemalist0) | of([List](#schemalistbuilder0) arg, SchemaConfiguration configuration) | ## Items0Boxed -public static abstract sealed class Items0Boxed
+public sealed interface Items0Boxed
permits
[Items0BoxedString](#items0boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Items0BoxedString -public static final class Items0BoxedString
-extends [Items0Boxed](#items0boxed) +public record Items0BoxedString
+implements [Items0Boxed](#items0boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Items0BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Items0 public static class Items0
@@ -183,7 +187,9 @@ String validatedPayload = Schema0.Items0.validate( | String | validate(String arg, SchemaConfiguration configuration) | | String | validate([StringItemsEnums0](#stringitemsenums0) arg, SchemaConfiguration configuration) | | [Items0BoxedString](#items0boxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [Items0Boxed](#items0boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## StringItemsEnums0 public enum StringItemsEnums0
extends `Enum` diff --git a/samples/client/petstore/java/docs/paths/fake/get/parameters/parameter1/Schema1.md b/samples/client/petstore/java/docs/paths/fake/get/parameters/parameter1/Schema1.md index 495894feeeb..1ac3fd696b3 100644 --- a/samples/client/petstore/java/docs/paths/fake/get/parameters/parameter1/Schema1.md +++ b/samples/client/petstore/java/docs/paths/fake/get/parameters/parameter1/Schema1.md @@ -3,40 +3,41 @@ public class Schema1
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - enum classes ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Schema1.Schema11Boxed](#schema11boxed)
abstract sealed validated payload class | -| static class | [Schema1.Schema11BoxedString](#schema11boxedstring)
boxed class to store validated String payloads | +| sealed interface | [Schema1.Schema11Boxed](#schema11boxed)
sealed interface for validated payloads | +| record | [Schema1.Schema11BoxedString](#schema11boxedstring)
boxed class to store validated String payloads | | static class | [Schema1.Schema11](#schema11)
schema class | | enum | [Schema1.StringSchemaEnums1](#stringschemaenums1)
String enum | ## Schema11Boxed -public static abstract sealed class Schema11Boxed
+public sealed interface Schema11Boxed
permits
[Schema11BoxedString](#schema11boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema11BoxedString -public static final class Schema11BoxedString
-extends [Schema11Boxed](#schema11boxed) +public record Schema11BoxedString
+implements [Schema11Boxed](#schema11boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema11BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema11 public static class Schema11
@@ -79,7 +80,9 @@ String validatedPayload = Schema1.Schema11.validate( | String | validate(String arg, SchemaConfiguration configuration) | | String | validate([StringSchemaEnums1](#stringschemaenums1) arg, SchemaConfiguration configuration) | | [Schema11BoxedString](#schema11boxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [Schema11Boxed](#schema11boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## StringSchemaEnums1 public enum StringSchemaEnums1
extends `Enum` diff --git a/samples/client/petstore/java/docs/paths/fake/get/parameters/parameter2/Schema2.md b/samples/client/petstore/java/docs/paths/fake/get/parameters/parameter2/Schema2.md index ef73a16d5a1..b2b467e3a74 100644 --- a/samples/client/petstore/java/docs/paths/fake/get/parameters/parameter2/Schema2.md +++ b/samples/client/petstore/java/docs/paths/fake/get/parameters/parameter2/Schema2.md @@ -3,7 +3,7 @@ public class Schema2
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated list payloads, extends FrozenList - classes to build inputs for list payloads @@ -12,38 +12,39 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Schema2.Schema21Boxed](#schema21boxed)
abstract sealed validated payload class | -| static class | [Schema2.Schema21BoxedList](#schema21boxedlist)
boxed class to store validated List payloads | +| sealed interface | [Schema2.Schema21Boxed](#schema21boxed)
sealed interface for validated payloads | +| record | [Schema2.Schema21BoxedList](#schema21boxedlist)
boxed class to store validated List payloads | | static class | [Schema2.Schema21](#schema21)
schema class | | static class | [Schema2.SchemaListBuilder2](#schemalistbuilder2)
builder for List payloads | | static class | [Schema2.SchemaList2](#schemalist2)
output class for List payloads | -| static class | [Schema2.Items2Boxed](#items2boxed)
abstract sealed validated payload class | -| static class | [Schema2.Items2BoxedString](#items2boxedstring)
boxed class to store validated String payloads | +| sealed interface | [Schema2.Items2Boxed](#items2boxed)
sealed interface for validated payloads | +| record | [Schema2.Items2BoxedString](#items2boxedstring)
boxed class to store validated String payloads | | static class | [Schema2.Items2](#items2)
schema class | | enum | [Schema2.StringItemsEnums2](#stringitemsenums2)
String enum | ## Schema21Boxed -public static abstract sealed class Schema21Boxed
+public sealed interface Schema21Boxed
permits
[Schema21BoxedList](#schema21boxedlist) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema21BoxedList -public static final class Schema21BoxedList
-extends [Schema21Boxed](#schema21boxed) +public record Schema21BoxedList
+implements [Schema21Boxed](#schema21boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema21BoxedList([SchemaList2](#schemalist2) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [SchemaList2](#schemalist2) | data
validated payload | +| [SchemaList2](#schemalist2) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema21 public static class Schema21
@@ -88,7 +89,9 @@ Schema2.SchemaList2 validatedPayload = | ----------------- | ---------------------- | | [SchemaList2](#schemalist2) | validate([List](#schemalistbuilder2) arg, SchemaConfiguration configuration) | | [Schema21BoxedList](#schema21boxedlist) | validateAndBox([List](#schemalistbuilder2) arg, SchemaConfiguration configuration) | +| [Schema21Boxed](#schema21boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## SchemaListBuilder2 public class SchemaListBuilder2
builder for `List` @@ -120,27 +123,28 @@ A class to store validated List payloads | static [SchemaList2](#schemalist2) | of([List](#schemalistbuilder2) arg, SchemaConfiguration configuration) | ## Items2Boxed -public static abstract sealed class Items2Boxed
+public sealed interface Items2Boxed
permits
[Items2BoxedString](#items2boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Items2BoxedString -public static final class Items2BoxedString
-extends [Items2Boxed](#items2boxed) +public record Items2BoxedString
+implements [Items2Boxed](#items2boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Items2BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Items2 public static class Items2
@@ -183,7 +187,9 @@ String validatedPayload = Schema2.Items2.validate( | String | validate(String arg, SchemaConfiguration configuration) | | String | validate([StringItemsEnums2](#stringitemsenums2) arg, SchemaConfiguration configuration) | | [Items2BoxedString](#items2boxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [Items2Boxed](#items2boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## StringItemsEnums2 public enum StringItemsEnums2
extends `Enum` diff --git a/samples/client/petstore/java/docs/paths/fake/get/parameters/parameter3/Schema3.md b/samples/client/petstore/java/docs/paths/fake/get/parameters/parameter3/Schema3.md index d538b4ac830..16752518f19 100644 --- a/samples/client/petstore/java/docs/paths/fake/get/parameters/parameter3/Schema3.md +++ b/samples/client/petstore/java/docs/paths/fake/get/parameters/parameter3/Schema3.md @@ -3,40 +3,41 @@ public class Schema3
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - enum classes ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Schema3.Schema31Boxed](#schema31boxed)
abstract sealed validated payload class | -| static class | [Schema3.Schema31BoxedString](#schema31boxedstring)
boxed class to store validated String payloads | +| sealed interface | [Schema3.Schema31Boxed](#schema31boxed)
sealed interface for validated payloads | +| record | [Schema3.Schema31BoxedString](#schema31boxedstring)
boxed class to store validated String payloads | | static class | [Schema3.Schema31](#schema31)
schema class | | enum | [Schema3.StringSchemaEnums3](#stringschemaenums3)
String enum | ## Schema31Boxed -public static abstract sealed class Schema31Boxed
+public sealed interface Schema31Boxed
permits
[Schema31BoxedString](#schema31boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema31BoxedString -public static final class Schema31BoxedString
-extends [Schema31Boxed](#schema31boxed) +public record Schema31BoxedString
+implements [Schema31Boxed](#schema31boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema31BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema31 public static class Schema31
@@ -79,7 +80,9 @@ String validatedPayload = Schema3.Schema31.validate( | String | validate(String arg, SchemaConfiguration configuration) | | String | validate([StringSchemaEnums3](#stringschemaenums3) arg, SchemaConfiguration configuration) | | [Schema31BoxedString](#schema31boxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [Schema31Boxed](#schema31boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## StringSchemaEnums3 public enum StringSchemaEnums3
extends `Enum` diff --git a/samples/client/petstore/java/docs/paths/fake/get/parameters/parameter4/Schema4.md b/samples/client/petstore/java/docs/paths/fake/get/parameters/parameter4/Schema4.md index 789be4b35a0..2abcee63be4 100644 --- a/samples/client/petstore/java/docs/paths/fake/get/parameters/parameter4/Schema4.md +++ b/samples/client/petstore/java/docs/paths/fake/get/parameters/parameter4/Schema4.md @@ -3,15 +3,15 @@ public class Schema4
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - enum classes ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Schema4.Schema41Boxed](#schema41boxed)
abstract sealed validated payload class | -| static class | [Schema4.Schema41BoxedNumber](#schema41boxednumber)
boxed class to store validated Number payloads | +| sealed interface | [Schema4.Schema41Boxed](#schema41boxed)
sealed interface for validated payloads | +| record | [Schema4.Schema41BoxedNumber](#schema41boxednumber)
boxed class to store validated Number payloads | | static class | [Schema4.Schema41](#schema41)
schema class | | enum | [Schema4.IntegerSchemaEnums4](#integerschemaenums4)
Integer enum | | enum | [Schema4.LongSchemaEnums4](#longschemaenums4)
Long enum | @@ -19,27 +19,28 @@ A class that contains necessary nested | enum | [Schema4.DoubleSchemaEnums4](#doubleschemaenums4)
Double enum | ## Schema41Boxed -public static abstract sealed class Schema41Boxed
+public sealed interface Schema41Boxed
permits
[Schema41BoxedNumber](#schema41boxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema41BoxedNumber -public static final class Schema41BoxedNumber
-extends [Schema41Boxed](#schema41boxed) +public record Schema41BoxedNumber
+implements [Schema41Boxed](#schema41boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema41BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema41 public static class Schema41
@@ -81,7 +82,9 @@ int validatedPayload = Schema4.Schema41.validate( | ----------------- | ---------------------- | | int | validate(int arg, SchemaConfiguration configuration) | | [Schema41BoxedNumber](#schema41boxednumber) | validateAndBox(Number arg, SchemaConfiguration configuration) | +| [Schema41Boxed](#schema41boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## IntegerSchemaEnums4 public enum IntegerSchemaEnums4
extends `Enum` diff --git a/samples/client/petstore/java/docs/paths/fake/get/parameters/parameter5/Schema5.md b/samples/client/petstore/java/docs/paths/fake/get/parameters/parameter5/Schema5.md index 0e1d0b93edc..87338d58142 100644 --- a/samples/client/petstore/java/docs/paths/fake/get/parameters/parameter5/Schema5.md +++ b/samples/client/petstore/java/docs/paths/fake/get/parameters/parameter5/Schema5.md @@ -3,41 +3,42 @@ public class Schema5
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - enum classes ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Schema5.Schema51Boxed](#schema51boxed)
abstract sealed validated payload class | -| static class | [Schema5.Schema51BoxedNumber](#schema51boxednumber)
boxed class to store validated Number payloads | +| sealed interface | [Schema5.Schema51Boxed](#schema51boxed)
sealed interface for validated payloads | +| record | [Schema5.Schema51BoxedNumber](#schema51boxednumber)
boxed class to store validated Number payloads | | static class | [Schema5.Schema51](#schema51)
schema class | | enum | [Schema5.DoubleSchemaEnums5](#doubleschemaenums5)
Double enum | | enum | [Schema5.FloatSchemaEnums5](#floatschemaenums5)
Float enum | ## Schema51Boxed -public static abstract sealed class Schema51Boxed
+public sealed interface Schema51Boxed
permits
[Schema51BoxedNumber](#schema51boxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema51BoxedNumber -public static final class Schema51BoxedNumber
-extends [Schema51Boxed](#schema51boxed) +public record Schema51BoxedNumber
+implements [Schema51Boxed](#schema51boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema51BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema51 public static class Schema51
@@ -79,7 +80,9 @@ double validatedPayload = Schema5.Schema51.validate( | ----------------- | ---------------------- | | double | validate(double arg, SchemaConfiguration configuration) | | [Schema51BoxedNumber](#schema51boxednumber) | validateAndBox(Number arg, SchemaConfiguration configuration) | +| [Schema51Boxed](#schema51boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## DoubleSchemaEnums5 public enum DoubleSchemaEnums5
extends `Enum` diff --git a/samples/client/petstore/java/docs/paths/fake/get/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.md b/samples/client/petstore/java/docs/paths/fake/get/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.md index 94832c88ae9..fa9ddb49360 100644 --- a/samples/client/petstore/java/docs/paths/fake/get/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.md +++ b/samples/client/petstore/java/docs/paths/fake/get/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.md @@ -3,7 +3,7 @@ public class ApplicationxwwwformurlencodedSchema
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated list payloads, extends FrozenList - classes to build inputs for list payloads @@ -14,47 +14,48 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1Boxed](#applicationxwwwformurlencodedschema1boxed)
abstract sealed validated payload class | -| static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1BoxedMap](#applicationxwwwformurlencodedschema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1Boxed](#applicationxwwwformurlencodedschema1boxed)
sealed interface for validated payloads | +| record | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1BoxedMap](#applicationxwwwformurlencodedschema1boxedmap)
boxed class to store validated Map payloads | | static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1](#applicationxwwwformurlencodedschema1)
schema class | | static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchemaMapBuilder](#applicationxwwwformurlencodedschemamapbuilder)
builder for Map payloads | | static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchemaMap](#applicationxwwwformurlencodedschemamap)
output class for Map payloads | -| static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedEnumFormStringBoxed](#applicationxwwwformurlencodedenumformstringboxed)
abstract sealed validated payload class | -| static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedEnumFormStringBoxedString](#applicationxwwwformurlencodedenumformstringboxedstring)
boxed class to store validated String payloads | +| sealed interface | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedEnumFormStringBoxed](#applicationxwwwformurlencodedenumformstringboxed)
sealed interface for validated payloads | +| record | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedEnumFormStringBoxedString](#applicationxwwwformurlencodedenumformstringboxedstring)
boxed class to store validated String payloads | | static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedEnumFormString](#applicationxwwwformurlencodedenumformstring)
schema class | | enum | [ApplicationxwwwformurlencodedSchema.StringApplicationxwwwformurlencodedEnumFormStringEnums](#stringapplicationxwwwformurlencodedenumformstringenums)
String enum | -| static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedEnumFormStringArrayBoxed](#applicationxwwwformurlencodedenumformstringarrayboxed)
abstract sealed validated payload class | -| static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedEnumFormStringArrayBoxedList](#applicationxwwwformurlencodedenumformstringarrayboxedlist)
boxed class to store validated List payloads | +| sealed interface | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedEnumFormStringArrayBoxed](#applicationxwwwformurlencodedenumformstringarrayboxed)
sealed interface for validated payloads | +| record | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedEnumFormStringArrayBoxedList](#applicationxwwwformurlencodedenumformstringarrayboxedlist)
boxed class to store validated List payloads | | static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedEnumFormStringArray](#applicationxwwwformurlencodedenumformstringarray)
schema class | | static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedEnumFormStringArrayListBuilder](#applicationxwwwformurlencodedenumformstringarraylistbuilder)
builder for List payloads | | static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedEnumFormStringArrayList](#applicationxwwwformurlencodedenumformstringarraylist)
output class for List payloads | -| static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedItemsBoxed](#applicationxwwwformurlencodeditemsboxed)
abstract sealed validated payload class | -| static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedItemsBoxedString](#applicationxwwwformurlencodeditemsboxedstring)
boxed class to store validated String payloads | +| sealed interface | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedItemsBoxed](#applicationxwwwformurlencodeditemsboxed)
sealed interface for validated payloads | +| record | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedItemsBoxedString](#applicationxwwwformurlencodeditemsboxedstring)
boxed class to store validated String payloads | | static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedItems](#applicationxwwwformurlencodeditems)
schema class | | enum | [ApplicationxwwwformurlencodedSchema.StringApplicationxwwwformurlencodedItemsEnums](#stringapplicationxwwwformurlencodeditemsenums)
String enum | ## ApplicationxwwwformurlencodedSchema1Boxed -public static abstract sealed class ApplicationxwwwformurlencodedSchema1Boxed
+public sealed interface ApplicationxwwwformurlencodedSchema1Boxed
permits
[ApplicationxwwwformurlencodedSchema1BoxedMap](#applicationxwwwformurlencodedschema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ApplicationxwwwformurlencodedSchema1BoxedMap -public static final class ApplicationxwwwformurlencodedSchema1BoxedMap
-extends [ApplicationxwwwformurlencodedSchema1Boxed](#applicationxwwwformurlencodedschema1boxed) +public record ApplicationxwwwformurlencodedSchema1BoxedMap
+implements [ApplicationxwwwformurlencodedSchema1Boxed](#applicationxwwwformurlencodedschema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ApplicationxwwwformurlencodedSchema1BoxedMap([ApplicationxwwwformurlencodedSchemaMap](#applicationxwwwformurlencodedschemamap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [ApplicationxwwwformurlencodedSchemaMap](#applicationxwwwformurlencodedschemamap) | data
validated payload | +| [ApplicationxwwwformurlencodedSchemaMap](#applicationxwwwformurlencodedschemamap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ApplicationxwwwformurlencodedSchema1 public static class ApplicationxwwwformurlencodedSchema1
@@ -104,7 +105,9 @@ ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchemaMap valid | ----------------- | ---------------------- | | [ApplicationxwwwformurlencodedSchemaMap](#applicationxwwwformurlencodedschemamap) | validate([Map<?, ?>](#applicationxwwwformurlencodedschemamapbuilder) arg, SchemaConfiguration configuration) | | [ApplicationxwwwformurlencodedSchema1BoxedMap](#applicationxwwwformurlencodedschema1boxedmap) | validateAndBox([Map<?, ?>](#applicationxwwwformurlencodedschemamapbuilder) arg, SchemaConfiguration configuration) | +| [ApplicationxwwwformurlencodedSchema1Boxed](#applicationxwwwformurlencodedschema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ApplicationxwwwformurlencodedSchemaMapBuilder public class ApplicationxwwwformurlencodedSchemaMapBuilder
builder for `Map` @@ -148,27 +151,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## ApplicationxwwwformurlencodedEnumFormStringBoxed -public static abstract sealed class ApplicationxwwwformurlencodedEnumFormStringBoxed
+public sealed interface ApplicationxwwwformurlencodedEnumFormStringBoxed
permits
[ApplicationxwwwformurlencodedEnumFormStringBoxedString](#applicationxwwwformurlencodedenumformstringboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ApplicationxwwwformurlencodedEnumFormStringBoxedString -public static final class ApplicationxwwwformurlencodedEnumFormStringBoxedString
-extends [ApplicationxwwwformurlencodedEnumFormStringBoxed](#applicationxwwwformurlencodedenumformstringboxed) +public record ApplicationxwwwformurlencodedEnumFormStringBoxedString
+implements [ApplicationxwwwformurlencodedEnumFormStringBoxed](#applicationxwwwformurlencodedenumformstringboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ApplicationxwwwformurlencodedEnumFormStringBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ApplicationxwwwformurlencodedEnumFormString public static class ApplicationxwwwformurlencodedEnumFormString
@@ -214,7 +218,9 @@ String validatedPayload = ApplicationxwwwformurlencodedSchema.Applicationxwwwfor | String | validate(String arg, SchemaConfiguration configuration) | | String | validate([StringApplicationxwwwformurlencodedEnumFormStringEnums](#stringapplicationxwwwformurlencodedenumformstringenums) arg, SchemaConfiguration configuration) | | [ApplicationxwwwformurlencodedEnumFormStringBoxedString](#applicationxwwwformurlencodedenumformstringboxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [ApplicationxwwwformurlencodedEnumFormStringBoxed](#applicationxwwwformurlencodedenumformstringboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## StringApplicationxwwwformurlencodedEnumFormStringEnums public enum StringApplicationxwwwformurlencodedEnumFormStringEnums
extends `Enum` @@ -229,27 +235,28 @@ A class that stores String enum values | LEFT_PARENTHESIS_XYZ_RIGHT_PARENTHESIS | value = "(xyz)" | ## ApplicationxwwwformurlencodedEnumFormStringArrayBoxed -public static abstract sealed class ApplicationxwwwformurlencodedEnumFormStringArrayBoxed
+public sealed interface ApplicationxwwwformurlencodedEnumFormStringArrayBoxed
permits
[ApplicationxwwwformurlencodedEnumFormStringArrayBoxedList](#applicationxwwwformurlencodedenumformstringarrayboxedlist) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ApplicationxwwwformurlencodedEnumFormStringArrayBoxedList -public static final class ApplicationxwwwformurlencodedEnumFormStringArrayBoxedList
-extends [ApplicationxwwwformurlencodedEnumFormStringArrayBoxed](#applicationxwwwformurlencodedenumformstringarrayboxed) +public record ApplicationxwwwformurlencodedEnumFormStringArrayBoxedList
+implements [ApplicationxwwwformurlencodedEnumFormStringArrayBoxed](#applicationxwwwformurlencodedenumformstringarrayboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ApplicationxwwwformurlencodedEnumFormStringArrayBoxedList([ApplicationxwwwformurlencodedEnumFormStringArrayList](#applicationxwwwformurlencodedenumformstringarraylist) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [ApplicationxwwwformurlencodedEnumFormStringArrayList](#applicationxwwwformurlencodedenumformstringarraylist) | data
validated payload | +| [ApplicationxwwwformurlencodedEnumFormStringArrayList](#applicationxwwwformurlencodedenumformstringarraylist) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ApplicationxwwwformurlencodedEnumFormStringArray public static class ApplicationxwwwformurlencodedEnumFormStringArray
@@ -297,7 +304,9 @@ ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedEnumFormStringA | ----------------- | ---------------------- | | [ApplicationxwwwformurlencodedEnumFormStringArrayList](#applicationxwwwformurlencodedenumformstringarraylist) | validate([List](#applicationxwwwformurlencodedenumformstringarraylistbuilder) arg, SchemaConfiguration configuration) | | [ApplicationxwwwformurlencodedEnumFormStringArrayBoxedList](#applicationxwwwformurlencodedenumformstringarrayboxedlist) | validateAndBox([List](#applicationxwwwformurlencodedenumformstringarraylistbuilder) arg, SchemaConfiguration configuration) | +| [ApplicationxwwwformurlencodedEnumFormStringArrayBoxed](#applicationxwwwformurlencodedenumformstringarrayboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ApplicationxwwwformurlencodedEnumFormStringArrayListBuilder public class ApplicationxwwwformurlencodedEnumFormStringArrayListBuilder
builder for `List` @@ -329,27 +338,28 @@ A class to store validated List payloads | static [ApplicationxwwwformurlencodedEnumFormStringArrayList](#applicationxwwwformurlencodedenumformstringarraylist) | of([List](#applicationxwwwformurlencodedenumformstringarraylistbuilder) arg, SchemaConfiguration configuration) | ## ApplicationxwwwformurlencodedItemsBoxed -public static abstract sealed class ApplicationxwwwformurlencodedItemsBoxed
+public sealed interface ApplicationxwwwformurlencodedItemsBoxed
permits
[ApplicationxwwwformurlencodedItemsBoxedString](#applicationxwwwformurlencodeditemsboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ApplicationxwwwformurlencodedItemsBoxedString -public static final class ApplicationxwwwformurlencodedItemsBoxedString
-extends [ApplicationxwwwformurlencodedItemsBoxed](#applicationxwwwformurlencodeditemsboxed) +public record ApplicationxwwwformurlencodedItemsBoxedString
+implements [ApplicationxwwwformurlencodedItemsBoxed](#applicationxwwwformurlencodeditemsboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ApplicationxwwwformurlencodedItemsBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ApplicationxwwwformurlencodedItems public static class ApplicationxwwwformurlencodedItems
@@ -392,7 +402,9 @@ String validatedPayload = ApplicationxwwwformurlencodedSchema.Applicationxwwwfor | String | validate(String arg, SchemaConfiguration configuration) | | String | validate([StringApplicationxwwwformurlencodedItemsEnums](#stringapplicationxwwwformurlencodeditemsenums) arg, SchemaConfiguration configuration) | | [ApplicationxwwwformurlencodedItemsBoxedString](#applicationxwwwformurlencodeditemsboxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [ApplicationxwwwformurlencodedItemsBoxed](#applicationxwwwformurlencodeditemsboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## StringApplicationxwwwformurlencodedItemsEnums public enum StringApplicationxwwwformurlencodedItemsEnums
extends `Enum` diff --git a/samples/client/petstore/java/docs/paths/fake/get/responses/response404/content/applicationjson/ApplicationjsonSchema.md b/samples/client/petstore/java/docs/paths/fake/get/responses/code404response/content/applicationjson/ApplicationjsonSchema.md similarity index 60% rename from samples/client/petstore/java/docs/paths/fake/get/responses/response404/content/applicationjson/ApplicationjsonSchema.md rename to samples/client/petstore/java/docs/paths/fake/get/responses/code404response/content/applicationjson/ApplicationjsonSchema.md index f943791db0e..3ce84c1630e 100644 --- a/samples/client/petstore/java/docs/paths/fake/get/responses/response404/content/applicationjson/ApplicationjsonSchema.md +++ b/samples/client/petstore/java/docs/paths/fake/get/responses/code404response/content/applicationjson/ApplicationjsonSchema.md @@ -3,38 +3,39 @@ public class ApplicationjsonSchema
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed)
abstract sealed validated payload class | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ApplicationjsonSchema.ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed)
sealed interface for validated payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap)
boxed class to store validated Map payloads | | static class | [ApplicationjsonSchema.ApplicationjsonSchema1](#applicationjsonschema1)
schema class | ## ApplicationjsonSchema1Boxed -public static abstract sealed class ApplicationjsonSchema1Boxed
+public sealed interface ApplicationjsonSchema1Boxed
permits
[ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ApplicationjsonSchema1BoxedMap -public static final class ApplicationjsonSchema1BoxedMap
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) +public record ApplicationjsonSchema1BoxedMap
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ApplicationjsonSchema1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ApplicationjsonSchema1 public static class ApplicationjsonSchema1
diff --git a/samples/client/petstore/java/docs/paths/fakeclassnametest/patch/responses/response200/content/applicationjson/ApplicationjsonSchema.md b/samples/client/petstore/java/docs/paths/fake/patch/responses/code200response/content/applicationjson/ApplicationjsonSchema.md similarity index 89% rename from samples/client/petstore/java/docs/paths/fakeclassnametest/patch/responses/response200/content/applicationjson/ApplicationjsonSchema.md rename to samples/client/petstore/java/docs/paths/fake/patch/responses/code200response/content/applicationjson/ApplicationjsonSchema.md index 104d3d325b5..0a219ca9fad 100644 --- a/samples/client/petstore/java/docs/paths/fakeclassnametest/patch/responses/response200/content/applicationjson/ApplicationjsonSchema.md +++ b/samples/client/petstore/java/docs/paths/fake/patch/responses/code200response/content/applicationjson/ApplicationjsonSchema.md @@ -4,7 +4,7 @@ extends [Client1](../../../../../../../../../components/schemas/Client.md#client A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary diff --git a/samples/client/petstore/java/docs/paths/fake/post/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.md b/samples/client/petstore/java/docs/paths/fake/post/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.md index 9c5c11c446a..210e7231695 100644 --- a/samples/client/petstore/java/docs/paths/fake/post/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.md +++ b/samples/client/petstore/java/docs/paths/fake/post/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.md @@ -3,7 +3,7 @@ public class ApplicationxwwwformurlencodedSchema
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -11,75 +11,76 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1Boxed](#applicationxwwwformurlencodedschema1boxed)
abstract sealed validated payload class | -| static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1BoxedMap](#applicationxwwwformurlencodedschema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1Boxed](#applicationxwwwformurlencodedschema1boxed)
sealed interface for validated payloads | +| record | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1BoxedMap](#applicationxwwwformurlencodedschema1boxedmap)
boxed class to store validated Map payloads | | static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1](#applicationxwwwformurlencodedschema1)
schema class | | static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchemaMapBuilder](#applicationxwwwformurlencodedschemamapbuilder)
builder for Map payloads | | static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchemaMap](#applicationxwwwformurlencodedschemamap)
output class for Map payloads | -| static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedCallbackBoxed](#applicationxwwwformurlencodedcallbackboxed)
abstract sealed validated payload class | -| static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedCallbackBoxedString](#applicationxwwwformurlencodedcallbackboxedstring)
boxed class to store validated String payloads | +| sealed interface | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedCallbackBoxed](#applicationxwwwformurlencodedcallbackboxed)
sealed interface for validated payloads | +| record | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedCallbackBoxedString](#applicationxwwwformurlencodedcallbackboxedstring)
boxed class to store validated String payloads | | static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedCallback](#applicationxwwwformurlencodedcallback)
schema class | -| static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedPasswordBoxed](#applicationxwwwformurlencodedpasswordboxed)
abstract sealed validated payload class | -| static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedPasswordBoxedString](#applicationxwwwformurlencodedpasswordboxedstring)
boxed class to store validated String payloads | +| sealed interface | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedPasswordBoxed](#applicationxwwwformurlencodedpasswordboxed)
sealed interface for validated payloads | +| record | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedPasswordBoxedString](#applicationxwwwformurlencodedpasswordboxedstring)
boxed class to store validated String payloads | | static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedPassword](#applicationxwwwformurlencodedpassword)
schema class | -| static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedDateTimeBoxed](#applicationxwwwformurlencodeddatetimeboxed)
abstract sealed validated payload class | -| static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedDateTimeBoxedString](#applicationxwwwformurlencodeddatetimeboxedstring)
boxed class to store validated String payloads | +| sealed interface | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedDateTimeBoxed](#applicationxwwwformurlencodeddatetimeboxed)
sealed interface for validated payloads | +| record | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedDateTimeBoxedString](#applicationxwwwformurlencodeddatetimeboxedstring)
boxed class to store validated String payloads | | static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedDateTime](#applicationxwwwformurlencodeddatetime)
schema class | -| static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedDateBoxed](#applicationxwwwformurlencodeddateboxed)
abstract sealed validated payload class | -| static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedDateBoxedString](#applicationxwwwformurlencodeddateboxedstring)
boxed class to store validated String payloads | +| sealed interface | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedDateBoxed](#applicationxwwwformurlencodeddateboxed)
sealed interface for validated payloads | +| record | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedDateBoxedString](#applicationxwwwformurlencodeddateboxedstring)
boxed class to store validated String payloads | | static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedDate](#applicationxwwwformurlencodeddate)
schema class | -| static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedBinaryBoxed](#applicationxwwwformurlencodedbinaryboxed)
abstract sealed validated payload class | +| sealed interface | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedBinaryBoxed](#applicationxwwwformurlencodedbinaryboxed)
sealed interface for validated payloads | | static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedBinary](#applicationxwwwformurlencodedbinary)
schema class | -| static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedByteBoxed](#applicationxwwwformurlencodedbyteboxed)
abstract sealed validated payload class | -| static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedByteBoxedString](#applicationxwwwformurlencodedbyteboxedstring)
boxed class to store validated String payloads | +| sealed interface | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedByteBoxed](#applicationxwwwformurlencodedbyteboxed)
sealed interface for validated payloads | +| record | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedByteBoxedString](#applicationxwwwformurlencodedbyteboxedstring)
boxed class to store validated String payloads | | static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedByte](#applicationxwwwformurlencodedbyte)
schema class | -| static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedPatternWithoutDelimiterBoxed](#applicationxwwwformurlencodedpatternwithoutdelimiterboxed)
abstract sealed validated payload class | -| static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedPatternWithoutDelimiterBoxedString](#applicationxwwwformurlencodedpatternwithoutdelimiterboxedstring)
boxed class to store validated String payloads | +| sealed interface | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedPatternWithoutDelimiterBoxed](#applicationxwwwformurlencodedpatternwithoutdelimiterboxed)
sealed interface for validated payloads | +| record | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedPatternWithoutDelimiterBoxedString](#applicationxwwwformurlencodedpatternwithoutdelimiterboxedstring)
boxed class to store validated String payloads | | static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedPatternWithoutDelimiter](#applicationxwwwformurlencodedpatternwithoutdelimiter)
schema class | -| static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedStringBoxed](#applicationxwwwformurlencodedstringboxed)
abstract sealed validated payload class | -| static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedStringBoxedString](#applicationxwwwformurlencodedstringboxedstring)
boxed class to store validated String payloads | +| sealed interface | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedStringBoxed](#applicationxwwwformurlencodedstringboxed)
sealed interface for validated payloads | +| record | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedStringBoxedString](#applicationxwwwformurlencodedstringboxedstring)
boxed class to store validated String payloads | | static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedString](#applicationxwwwformurlencodedstring)
schema class | -| static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedDoubleBoxed](#applicationxwwwformurlencodeddoubleboxed)
abstract sealed validated payload class | -| static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedDoubleBoxedNumber](#applicationxwwwformurlencodeddoubleboxednumber)
boxed class to store validated Number payloads | +| sealed interface | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedDoubleBoxed](#applicationxwwwformurlencodeddoubleboxed)
sealed interface for validated payloads | +| record | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedDoubleBoxedNumber](#applicationxwwwformurlencodeddoubleboxednumber)
boxed class to store validated Number payloads | | static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedDouble](#applicationxwwwformurlencodeddouble)
schema class | -| static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedFloatBoxed](#applicationxwwwformurlencodedfloatboxed)
abstract sealed validated payload class | -| static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedFloatBoxedNumber](#applicationxwwwformurlencodedfloatboxednumber)
boxed class to store validated Number payloads | +| sealed interface | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedFloatBoxed](#applicationxwwwformurlencodedfloatboxed)
sealed interface for validated payloads | +| record | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedFloatBoxedNumber](#applicationxwwwformurlencodedfloatboxednumber)
boxed class to store validated Number payloads | | static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedFloat](#applicationxwwwformurlencodedfloat)
schema class | -| static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedNumberBoxed](#applicationxwwwformurlencodednumberboxed)
abstract sealed validated payload class | -| static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedNumberBoxedNumber](#applicationxwwwformurlencodednumberboxednumber)
boxed class to store validated Number payloads | +| sealed interface | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedNumberBoxed](#applicationxwwwformurlencodednumberboxed)
sealed interface for validated payloads | +| record | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedNumberBoxedNumber](#applicationxwwwformurlencodednumberboxednumber)
boxed class to store validated Number payloads | | static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedNumber](#applicationxwwwformurlencodednumber)
schema class | -| static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedInt64Boxed](#applicationxwwwformurlencodedint64boxed)
abstract sealed validated payload class | -| static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedInt64BoxedNumber](#applicationxwwwformurlencodedint64boxednumber)
boxed class to store validated Number payloads | +| sealed interface | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedInt64Boxed](#applicationxwwwformurlencodedint64boxed)
sealed interface for validated payloads | +| record | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedInt64BoxedNumber](#applicationxwwwformurlencodedint64boxednumber)
boxed class to store validated Number payloads | | static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedInt64](#applicationxwwwformurlencodedint64)
schema class | -| static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedInt32Boxed](#applicationxwwwformurlencodedint32boxed)
abstract sealed validated payload class | -| static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedInt32BoxedNumber](#applicationxwwwformurlencodedint32boxednumber)
boxed class to store validated Number payloads | +| sealed interface | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedInt32Boxed](#applicationxwwwformurlencodedint32boxed)
sealed interface for validated payloads | +| record | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedInt32BoxedNumber](#applicationxwwwformurlencodedint32boxednumber)
boxed class to store validated Number payloads | | static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedInt32](#applicationxwwwformurlencodedint32)
schema class | -| static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedIntegerBoxed](#applicationxwwwformurlencodedintegerboxed)
abstract sealed validated payload class | -| static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedIntegerBoxedNumber](#applicationxwwwformurlencodedintegerboxednumber)
boxed class to store validated Number payloads | +| sealed interface | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedIntegerBoxed](#applicationxwwwformurlencodedintegerboxed)
sealed interface for validated payloads | +| record | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedIntegerBoxedNumber](#applicationxwwwformurlencodedintegerboxednumber)
boxed class to store validated Number payloads | | static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedInteger](#applicationxwwwformurlencodedinteger)
schema class | ## ApplicationxwwwformurlencodedSchema1Boxed -public static abstract sealed class ApplicationxwwwformurlencodedSchema1Boxed
+public sealed interface ApplicationxwwwformurlencodedSchema1Boxed
permits
[ApplicationxwwwformurlencodedSchema1BoxedMap](#applicationxwwwformurlencodedschema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ApplicationxwwwformurlencodedSchema1BoxedMap -public static final class ApplicationxwwwformurlencodedSchema1BoxedMap
-extends [ApplicationxwwwformurlencodedSchema1Boxed](#applicationxwwwformurlencodedschema1boxed) +public record ApplicationxwwwformurlencodedSchema1BoxedMap
+implements [ApplicationxwwwformurlencodedSchema1Boxed](#applicationxwwwformurlencodedschema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ApplicationxwwwformurlencodedSchema1BoxedMap([ApplicationxwwwformurlencodedSchemaMap](#applicationxwwwformurlencodedschemamap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [ApplicationxwwwformurlencodedSchemaMap](#applicationxwwwformurlencodedschemamap) | data
validated payload | +| [ApplicationxwwwformurlencodedSchemaMap](#applicationxwwwformurlencodedschemamap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ApplicationxwwwformurlencodedSchema1 public static class ApplicationxwwwformurlencodedSchema1
@@ -151,7 +152,9 @@ ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchemaMap valid | ----------------- | ---------------------- | | [ApplicationxwwwformurlencodedSchemaMap](#applicationxwwwformurlencodedschemamap) | validate([Map<?, ?>](#applicationxwwwformurlencodedschemamapbuilder) arg, SchemaConfiguration configuration) | | [ApplicationxwwwformurlencodedSchema1BoxedMap](#applicationxwwwformurlencodedschema1boxedmap) | validateAndBox([Map<?, ?>](#applicationxwwwformurlencodedschemamapbuilder) arg, SchemaConfiguration configuration) | +| [ApplicationxwwwformurlencodedSchema1Boxed](#applicationxwwwformurlencodedschema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ApplicationxwwwformurlencodedSchemaMap0000Builder public class ApplicationxwwwformurlencodedSchemaMap0000Builder
builder for `Map` @@ -524,27 +527,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## ApplicationxwwwformurlencodedCallbackBoxed -public static abstract sealed class ApplicationxwwwformurlencodedCallbackBoxed
+public sealed interface ApplicationxwwwformurlencodedCallbackBoxed
permits
[ApplicationxwwwformurlencodedCallbackBoxedString](#applicationxwwwformurlencodedcallbackboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ApplicationxwwwformurlencodedCallbackBoxedString -public static final class ApplicationxwwwformurlencodedCallbackBoxedString
-extends [ApplicationxwwwformurlencodedCallbackBoxed](#applicationxwwwformurlencodedcallbackboxed) +public record ApplicationxwwwformurlencodedCallbackBoxedString
+implements [ApplicationxwwwformurlencodedCallbackBoxed](#applicationxwwwformurlencodedcallbackboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ApplicationxwwwformurlencodedCallbackBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ApplicationxwwwformurlencodedCallback public static class ApplicationxwwwformurlencodedCallback
@@ -561,27 +565,28 @@ None | validateAndBox | ## ApplicationxwwwformurlencodedPasswordBoxed -public static abstract sealed class ApplicationxwwwformurlencodedPasswordBoxed
+public sealed interface ApplicationxwwwformurlencodedPasswordBoxed
permits
[ApplicationxwwwformurlencodedPasswordBoxedString](#applicationxwwwformurlencodedpasswordboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ApplicationxwwwformurlencodedPasswordBoxedString -public static final class ApplicationxwwwformurlencodedPasswordBoxedString
-extends [ApplicationxwwwformurlencodedPasswordBoxed](#applicationxwwwformurlencodedpasswordboxed) +public record ApplicationxwwwformurlencodedPasswordBoxedString
+implements [ApplicationxwwwformurlencodedPasswordBoxed](#applicationxwwwformurlencodedpasswordboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ApplicationxwwwformurlencodedPasswordBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ApplicationxwwwformurlencodedPassword public static class ApplicationxwwwformurlencodedPassword
@@ -627,29 +632,32 @@ String validatedPayload = ApplicationxwwwformurlencodedSchema.Applicationxwwwfor | ----------------- | ---------------------- | | String | validate(String arg, SchemaConfiguration configuration) | | [ApplicationxwwwformurlencodedPasswordBoxedString](#applicationxwwwformurlencodedpasswordboxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [ApplicationxwwwformurlencodedPasswordBoxed](#applicationxwwwformurlencodedpasswordboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ApplicationxwwwformurlencodedDateTimeBoxed -public static abstract sealed class ApplicationxwwwformurlencodedDateTimeBoxed
+public sealed interface ApplicationxwwwformurlencodedDateTimeBoxed
permits
[ApplicationxwwwformurlencodedDateTimeBoxedString](#applicationxwwwformurlencodeddatetimeboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ApplicationxwwwformurlencodedDateTimeBoxedString -public static final class ApplicationxwwwformurlencodedDateTimeBoxedString
-extends [ApplicationxwwwformurlencodedDateTimeBoxed](#applicationxwwwformurlencodeddatetimeboxed) +public record ApplicationxwwwformurlencodedDateTimeBoxedString
+implements [ApplicationxwwwformurlencodedDateTimeBoxed](#applicationxwwwformurlencodeddatetimeboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ApplicationxwwwformurlencodedDateTimeBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ApplicationxwwwformurlencodedDateTime public static class ApplicationxwwwformurlencodedDateTime
@@ -694,29 +702,32 @@ String validatedPayload = ApplicationxwwwformurlencodedSchema.Applicationxwwwfor | ----------------- | ---------------------- | | String | validate(String arg, SchemaConfiguration configuration) | | [ApplicationxwwwformurlencodedDateTimeBoxedString](#applicationxwwwformurlencodeddatetimeboxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [ApplicationxwwwformurlencodedDateTimeBoxed](#applicationxwwwformurlencodeddatetimeboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ApplicationxwwwformurlencodedDateBoxed -public static abstract sealed class ApplicationxwwwformurlencodedDateBoxed
+public sealed interface ApplicationxwwwformurlencodedDateBoxed
permits
[ApplicationxwwwformurlencodedDateBoxedString](#applicationxwwwformurlencodeddateboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ApplicationxwwwformurlencodedDateBoxedString -public static final class ApplicationxwwwformurlencodedDateBoxedString
-extends [ApplicationxwwwformurlencodedDateBoxed](#applicationxwwwformurlencodeddateboxed) +public record ApplicationxwwwformurlencodedDateBoxedString
+implements [ApplicationxwwwformurlencodedDateBoxed](#applicationxwwwformurlencodeddateboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ApplicationxwwwformurlencodedDateBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ApplicationxwwwformurlencodedDate public static class ApplicationxwwwformurlencodedDate
@@ -733,10 +744,10 @@ None | validateAndBox | ## ApplicationxwwwformurlencodedBinaryBoxed -public static abstract sealed class ApplicationxwwwformurlencodedBinaryBoxed
+public sealed interface ApplicationxwwwformurlencodedBinaryBoxed
permits
-abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ApplicationxwwwformurlencodedBinary public static class ApplicationxwwwformurlencodedBinary
@@ -748,27 +759,28 @@ A schema class that validates payloads None ## ApplicationxwwwformurlencodedByteBoxed -public static abstract sealed class ApplicationxwwwformurlencodedByteBoxed
+public sealed interface ApplicationxwwwformurlencodedByteBoxed
permits
[ApplicationxwwwformurlencodedByteBoxedString](#applicationxwwwformurlencodedbyteboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ApplicationxwwwformurlencodedByteBoxedString -public static final class ApplicationxwwwformurlencodedByteBoxedString
-extends [ApplicationxwwwformurlencodedByteBoxed](#applicationxwwwformurlencodedbyteboxed) +public record ApplicationxwwwformurlencodedByteBoxedString
+implements [ApplicationxwwwformurlencodedByteBoxed](#applicationxwwwformurlencodedbyteboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ApplicationxwwwformurlencodedByteBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ApplicationxwwwformurlencodedByte public static class ApplicationxwwwformurlencodedByte
@@ -780,27 +792,28 @@ A schema class that validates payloads None ## ApplicationxwwwformurlencodedPatternWithoutDelimiterBoxed -public static abstract sealed class ApplicationxwwwformurlencodedPatternWithoutDelimiterBoxed
+public sealed interface ApplicationxwwwformurlencodedPatternWithoutDelimiterBoxed
permits
[ApplicationxwwwformurlencodedPatternWithoutDelimiterBoxedString](#applicationxwwwformurlencodedpatternwithoutdelimiterboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ApplicationxwwwformurlencodedPatternWithoutDelimiterBoxedString -public static final class ApplicationxwwwformurlencodedPatternWithoutDelimiterBoxedString
-extends [ApplicationxwwwformurlencodedPatternWithoutDelimiterBoxed](#applicationxwwwformurlencodedpatternwithoutdelimiterboxed) +public record ApplicationxwwwformurlencodedPatternWithoutDelimiterBoxedString
+implements [ApplicationxwwwformurlencodedPatternWithoutDelimiterBoxed](#applicationxwwwformurlencodedpatternwithoutdelimiterboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ApplicationxwwwformurlencodedPatternWithoutDelimiterBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ApplicationxwwwformurlencodedPatternWithoutDelimiter public static class ApplicationxwwwformurlencodedPatternWithoutDelimiter
@@ -844,29 +857,32 @@ String validatedPayload = ApplicationxwwwformurlencodedSchema.Applicationxwwwfor | ----------------- | ---------------------- | | String | validate(String arg, SchemaConfiguration configuration) | | [ApplicationxwwwformurlencodedPatternWithoutDelimiterBoxedString](#applicationxwwwformurlencodedpatternwithoutdelimiterboxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [ApplicationxwwwformurlencodedPatternWithoutDelimiterBoxed](#applicationxwwwformurlencodedpatternwithoutdelimiterboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ApplicationxwwwformurlencodedStringBoxed -public static abstract sealed class ApplicationxwwwformurlencodedStringBoxed
+public sealed interface ApplicationxwwwformurlencodedStringBoxed
permits
[ApplicationxwwwformurlencodedStringBoxedString](#applicationxwwwformurlencodedstringboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ApplicationxwwwformurlencodedStringBoxedString -public static final class ApplicationxwwwformurlencodedStringBoxedString
-extends [ApplicationxwwwformurlencodedStringBoxed](#applicationxwwwformurlencodedstringboxed) +public record ApplicationxwwwformurlencodedStringBoxedString
+implements [ApplicationxwwwformurlencodedStringBoxed](#applicationxwwwformurlencodedstringboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ApplicationxwwwformurlencodedStringBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ApplicationxwwwformurlencodedString public static class ApplicationxwwwformurlencodedString
@@ -910,29 +926,32 @@ String validatedPayload = ApplicationxwwwformurlencodedSchema.Applicationxwwwfor | ----------------- | ---------------------- | | String | validate(String arg, SchemaConfiguration configuration) | | [ApplicationxwwwformurlencodedStringBoxedString](#applicationxwwwformurlencodedstringboxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [ApplicationxwwwformurlencodedStringBoxed](#applicationxwwwformurlencodedstringboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ApplicationxwwwformurlencodedDoubleBoxed -public static abstract sealed class ApplicationxwwwformurlencodedDoubleBoxed
+public sealed interface ApplicationxwwwformurlencodedDoubleBoxed
permits
[ApplicationxwwwformurlencodedDoubleBoxedNumber](#applicationxwwwformurlencodeddoubleboxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ApplicationxwwwformurlencodedDoubleBoxedNumber -public static final class ApplicationxwwwformurlencodedDoubleBoxedNumber
-extends [ApplicationxwwwformurlencodedDoubleBoxed](#applicationxwwwformurlencodeddoubleboxed) +public record ApplicationxwwwformurlencodedDoubleBoxedNumber
+implements [ApplicationxwwwformurlencodedDoubleBoxed](#applicationxwwwformurlencodeddoubleboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ApplicationxwwwformurlencodedDoubleBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ApplicationxwwwformurlencodedDouble public static class ApplicationxwwwformurlencodedDouble
@@ -978,29 +997,32 @@ double validatedPayload = ApplicationxwwwformurlencodedSchema.Applicationxwwwfor | ----------------- | ---------------------- | | double | validate(double arg, SchemaConfiguration configuration) | | [ApplicationxwwwformurlencodedDoubleBoxedNumber](#applicationxwwwformurlencodeddoubleboxednumber) | validateAndBox(Number arg, SchemaConfiguration configuration) | +| [ApplicationxwwwformurlencodedDoubleBoxed](#applicationxwwwformurlencodeddoubleboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ApplicationxwwwformurlencodedFloatBoxed -public static abstract sealed class ApplicationxwwwformurlencodedFloatBoxed
+public sealed interface ApplicationxwwwformurlencodedFloatBoxed
permits
[ApplicationxwwwformurlencodedFloatBoxedNumber](#applicationxwwwformurlencodedfloatboxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ApplicationxwwwformurlencodedFloatBoxedNumber -public static final class ApplicationxwwwformurlencodedFloatBoxedNumber
-extends [ApplicationxwwwformurlencodedFloatBoxed](#applicationxwwwformurlencodedfloatboxed) +public record ApplicationxwwwformurlencodedFloatBoxedNumber
+implements [ApplicationxwwwformurlencodedFloatBoxed](#applicationxwwwformurlencodedfloatboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ApplicationxwwwformurlencodedFloatBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ApplicationxwwwformurlencodedFloat public static class ApplicationxwwwformurlencodedFloat
@@ -1045,29 +1067,32 @@ float validatedPayload = ApplicationxwwwformurlencodedSchema.Applicationxwwwform | ----------------- | ---------------------- | | float | validate(float arg, SchemaConfiguration configuration) | | [ApplicationxwwwformurlencodedFloatBoxedNumber](#applicationxwwwformurlencodedfloatboxednumber) | validateAndBox(Number arg, SchemaConfiguration configuration) | +| [ApplicationxwwwformurlencodedFloatBoxed](#applicationxwwwformurlencodedfloatboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ApplicationxwwwformurlencodedNumberBoxed -public static abstract sealed class ApplicationxwwwformurlencodedNumberBoxed
+public sealed interface ApplicationxwwwformurlencodedNumberBoxed
permits
[ApplicationxwwwformurlencodedNumberBoxedNumber](#applicationxwwwformurlencodednumberboxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ApplicationxwwwformurlencodedNumberBoxedNumber -public static final class ApplicationxwwwformurlencodedNumberBoxedNumber
-extends [ApplicationxwwwformurlencodedNumberBoxed](#applicationxwwwformurlencodednumberboxed) +public record ApplicationxwwwformurlencodedNumberBoxedNumber
+implements [ApplicationxwwwformurlencodedNumberBoxed](#applicationxwwwformurlencodednumberboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ApplicationxwwwformurlencodedNumberBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ApplicationxwwwformurlencodedNumber public static class ApplicationxwwwformurlencodedNumber
@@ -1112,29 +1137,32 @@ int validatedPayload = ApplicationxwwwformurlencodedSchema.Applicationxwwwformur | ----------------- | ---------------------- | | Number | validate(Number arg, SchemaConfiguration configuration) | | [ApplicationxwwwformurlencodedNumberBoxedNumber](#applicationxwwwformurlencodednumberboxednumber) | validateAndBox(Number arg, SchemaConfiguration configuration) | +| [ApplicationxwwwformurlencodedNumberBoxed](#applicationxwwwformurlencodednumberboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ApplicationxwwwformurlencodedInt64Boxed -public static abstract sealed class ApplicationxwwwformurlencodedInt64Boxed
+public sealed interface ApplicationxwwwformurlencodedInt64Boxed
permits
[ApplicationxwwwformurlencodedInt64BoxedNumber](#applicationxwwwformurlencodedint64boxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ApplicationxwwwformurlencodedInt64BoxedNumber -public static final class ApplicationxwwwformurlencodedInt64BoxedNumber
-extends [ApplicationxwwwformurlencodedInt64Boxed](#applicationxwwwformurlencodedint64boxed) +public record ApplicationxwwwformurlencodedInt64BoxedNumber
+implements [ApplicationxwwwformurlencodedInt64Boxed](#applicationxwwwformurlencodedint64boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ApplicationxwwwformurlencodedInt64BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ApplicationxwwwformurlencodedInt64 public static class ApplicationxwwwformurlencodedInt64
@@ -1151,27 +1179,28 @@ None | validateAndBox | ## ApplicationxwwwformurlencodedInt32Boxed -public static abstract sealed class ApplicationxwwwformurlencodedInt32Boxed
+public sealed interface ApplicationxwwwformurlencodedInt32Boxed
permits
[ApplicationxwwwformurlencodedInt32BoxedNumber](#applicationxwwwformurlencodedint32boxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ApplicationxwwwformurlencodedInt32BoxedNumber -public static final class ApplicationxwwwformurlencodedInt32BoxedNumber
-extends [ApplicationxwwwformurlencodedInt32Boxed](#applicationxwwwformurlencodedint32boxed) +public record ApplicationxwwwformurlencodedInt32BoxedNumber
+implements [ApplicationxwwwformurlencodedInt32Boxed](#applicationxwwwformurlencodedint32boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ApplicationxwwwformurlencodedInt32BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ApplicationxwwwformurlencodedInt32 public static class ApplicationxwwwformurlencodedInt32
@@ -1217,29 +1246,32 @@ int validatedPayload = ApplicationxwwwformurlencodedSchema.Applicationxwwwformur | ----------------- | ---------------------- | | int | validate(int arg, SchemaConfiguration configuration) | | [ApplicationxwwwformurlencodedInt32BoxedNumber](#applicationxwwwformurlencodedint32boxednumber) | validateAndBox(Number arg, SchemaConfiguration configuration) | +| [ApplicationxwwwformurlencodedInt32Boxed](#applicationxwwwformurlencodedint32boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ApplicationxwwwformurlencodedIntegerBoxed -public static abstract sealed class ApplicationxwwwformurlencodedIntegerBoxed
+public sealed interface ApplicationxwwwformurlencodedIntegerBoxed
permits
[ApplicationxwwwformurlencodedIntegerBoxedNumber](#applicationxwwwformurlencodedintegerboxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ApplicationxwwwformurlencodedIntegerBoxedNumber -public static final class ApplicationxwwwformurlencodedIntegerBoxedNumber
-extends [ApplicationxwwwformurlencodedIntegerBoxed](#applicationxwwwformurlencodedintegerboxed) +public record ApplicationxwwwformurlencodedIntegerBoxedNumber
+implements [ApplicationxwwwformurlencodedIntegerBoxed](#applicationxwwwformurlencodedintegerboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ApplicationxwwwformurlencodedIntegerBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ApplicationxwwwformurlencodedInteger public static class ApplicationxwwwformurlencodedInteger
@@ -1285,4 +1317,5 @@ int validatedPayload = ApplicationxwwwformurlencodedSchema.Applicationxwwwformur | ----------------- | ---------------------- | | long | validate(long arg, SchemaConfiguration configuration) | | [ApplicationxwwwformurlencodedIntegerBoxedNumber](#applicationxwwwformurlencodedintegerboxednumber) | validateAndBox(Number arg, SchemaConfiguration configuration) | -| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | \ No newline at end of file +| [ApplicationxwwwformurlencodedIntegerBoxed](#applicationxwwwformurlencodedintegerboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | +| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | diff --git a/samples/client/petstore/java/docs/paths/fakeadditionalpropertieswitharrayofenums/get/requestbody/content/applicationjson/ApplicationjsonSchema.md b/samples/client/petstore/java/docs/paths/fakeadditionalpropertieswitharrayofenums/get/requestbody/content/applicationjson/ApplicationjsonSchema.md index 9219d61e8af..3c5d3360d21 100644 --- a/samples/client/petstore/java/docs/paths/fakeadditionalpropertieswitharrayofenums/get/requestbody/content/applicationjson/ApplicationjsonSchema.md +++ b/samples/client/petstore/java/docs/paths/fakeadditionalpropertieswitharrayofenums/get/requestbody/content/applicationjson/ApplicationjsonSchema.md @@ -4,7 +4,7 @@ extends [AdditionalPropertiesWithArrayOfEnums1](../../../../../../../components/ A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary diff --git a/samples/client/petstore/java/docs/paths/fakeadditionalpropertieswitharrayofenums/get/responses/response200/content/applicationjson/ApplicationjsonSchema.md b/samples/client/petstore/java/docs/paths/fakeadditionalpropertieswitharrayofenums/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md similarity index 91% rename from samples/client/petstore/java/docs/paths/fakeadditionalpropertieswitharrayofenums/get/responses/response200/content/applicationjson/ApplicationjsonSchema.md rename to samples/client/petstore/java/docs/paths/fakeadditionalpropertieswitharrayofenums/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md index a7884c2ba44..f29d75df1fc 100644 --- a/samples/client/petstore/java/docs/paths/fakeadditionalpropertieswitharrayofenums/get/responses/response200/content/applicationjson/ApplicationjsonSchema.md +++ b/samples/client/petstore/java/docs/paths/fakeadditionalpropertieswitharrayofenums/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md @@ -4,7 +4,7 @@ extends [AdditionalPropertiesWithArrayOfEnums1](../../../../../../../../../compo A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary diff --git a/samples/client/petstore/java/docs/paths/fakebodywithfileschema/put/requestbody/content/applicationjson/ApplicationjsonSchema.md b/samples/client/petstore/java/docs/paths/fakebodywithfileschema/put/requestbody/content/applicationjson/ApplicationjsonSchema.md index f95b89518d6..a3c6ea7cd01 100644 --- a/samples/client/petstore/java/docs/paths/fakebodywithfileschema/put/requestbody/content/applicationjson/ApplicationjsonSchema.md +++ b/samples/client/petstore/java/docs/paths/fakebodywithfileschema/put/requestbody/content/applicationjson/ApplicationjsonSchema.md @@ -4,7 +4,7 @@ extends [FileSchemaTestClass1](../../../../../../../components/schemas/FileSchem A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary diff --git a/samples/client/petstore/java/docs/paths/fakebodywithqueryparams/put/parameters/parameter0/Schema0.md b/samples/client/petstore/java/docs/paths/fakebodywithqueryparams/put/parameters/parameter0/Schema0.md index 34951cbef92..9ff90e0bc35 100644 --- a/samples/client/petstore/java/docs/paths/fakebodywithqueryparams/put/parameters/parameter0/Schema0.md +++ b/samples/client/petstore/java/docs/paths/fakebodywithqueryparams/put/parameters/parameter0/Schema0.md @@ -3,38 +3,39 @@ public class Schema0
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Schema0.Schema01Boxed](#schema01boxed)
abstract sealed validated payload class | -| static class | [Schema0.Schema01BoxedString](#schema01boxedstring)
boxed class to store validated String payloads | +| sealed interface | [Schema0.Schema01Boxed](#schema01boxed)
sealed interface for validated payloads | +| record | [Schema0.Schema01BoxedString](#schema01boxedstring)
boxed class to store validated String payloads | | static class | [Schema0.Schema01](#schema01)
schema class | ## Schema01Boxed -public static abstract sealed class Schema01Boxed
+public sealed interface Schema01Boxed
permits
[Schema01BoxedString](#schema01boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema01BoxedString -public static final class Schema01BoxedString
-extends [Schema01Boxed](#schema01boxed) +public record Schema01BoxedString
+implements [Schema01Boxed](#schema01boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema01BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema01 public static class Schema01
diff --git a/samples/client/petstore/java/docs/paths/fakebodywithqueryparams/put/requestbody/content/applicationjson/ApplicationjsonSchema.md b/samples/client/petstore/java/docs/paths/fakebodywithqueryparams/put/requestbody/content/applicationjson/ApplicationjsonSchema.md index f2e3fc91680..3433b43b8a4 100644 --- a/samples/client/petstore/java/docs/paths/fakebodywithqueryparams/put/requestbody/content/applicationjson/ApplicationjsonSchema.md +++ b/samples/client/petstore/java/docs/paths/fakebodywithqueryparams/put/requestbody/content/applicationjson/ApplicationjsonSchema.md @@ -4,7 +4,7 @@ extends [User1](../../../../../../../components/schemas/User.md#user) A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary diff --git a/samples/client/petstore/java/docs/paths/fakecasesensitiveparams/put/parameters/parameter0/Schema0.md b/samples/client/petstore/java/docs/paths/fakecasesensitiveparams/put/parameters/parameter0/Schema0.md index 34951cbef92..9ff90e0bc35 100644 --- a/samples/client/petstore/java/docs/paths/fakecasesensitiveparams/put/parameters/parameter0/Schema0.md +++ b/samples/client/petstore/java/docs/paths/fakecasesensitiveparams/put/parameters/parameter0/Schema0.md @@ -3,38 +3,39 @@ public class Schema0
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Schema0.Schema01Boxed](#schema01boxed)
abstract sealed validated payload class | -| static class | [Schema0.Schema01BoxedString](#schema01boxedstring)
boxed class to store validated String payloads | +| sealed interface | [Schema0.Schema01Boxed](#schema01boxed)
sealed interface for validated payloads | +| record | [Schema0.Schema01BoxedString](#schema01boxedstring)
boxed class to store validated String payloads | | static class | [Schema0.Schema01](#schema01)
schema class | ## Schema01Boxed -public static abstract sealed class Schema01Boxed
+public sealed interface Schema01Boxed
permits
[Schema01BoxedString](#schema01boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema01BoxedString -public static final class Schema01BoxedString
-extends [Schema01Boxed](#schema01boxed) +public record Schema01BoxedString
+implements [Schema01Boxed](#schema01boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema01BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema01 public static class Schema01
diff --git a/samples/client/petstore/java/docs/paths/fakecasesensitiveparams/put/parameters/parameter1/Schema1.md b/samples/client/petstore/java/docs/paths/fakecasesensitiveparams/put/parameters/parameter1/Schema1.md index dc73fa004df..63ec3a884fc 100644 --- a/samples/client/petstore/java/docs/paths/fakecasesensitiveparams/put/parameters/parameter1/Schema1.md +++ b/samples/client/petstore/java/docs/paths/fakecasesensitiveparams/put/parameters/parameter1/Schema1.md @@ -3,38 +3,39 @@ public class Schema1
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Schema1.Schema11Boxed](#schema11boxed)
abstract sealed validated payload class | -| static class | [Schema1.Schema11BoxedString](#schema11boxedstring)
boxed class to store validated String payloads | +| sealed interface | [Schema1.Schema11Boxed](#schema11boxed)
sealed interface for validated payloads | +| record | [Schema1.Schema11BoxedString](#schema11boxedstring)
boxed class to store validated String payloads | | static class | [Schema1.Schema11](#schema11)
schema class | ## Schema11Boxed -public static abstract sealed class Schema11Boxed
+public sealed interface Schema11Boxed
permits
[Schema11BoxedString](#schema11boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema11BoxedString -public static final class Schema11BoxedString
-extends [Schema11Boxed](#schema11boxed) +public record Schema11BoxedString
+implements [Schema11Boxed](#schema11boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema11BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema11 public static class Schema11
diff --git a/samples/client/petstore/java/docs/paths/fakecasesensitiveparams/put/parameters/parameter2/Schema2.md b/samples/client/petstore/java/docs/paths/fakecasesensitiveparams/put/parameters/parameter2/Schema2.md index e44ea1732a1..4a7d57953eb 100644 --- a/samples/client/petstore/java/docs/paths/fakecasesensitiveparams/put/parameters/parameter2/Schema2.md +++ b/samples/client/petstore/java/docs/paths/fakecasesensitiveparams/put/parameters/parameter2/Schema2.md @@ -3,38 +3,39 @@ public class Schema2
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Schema2.Schema21Boxed](#schema21boxed)
abstract sealed validated payload class | -| static class | [Schema2.Schema21BoxedString](#schema21boxedstring)
boxed class to store validated String payloads | +| sealed interface | [Schema2.Schema21Boxed](#schema21boxed)
sealed interface for validated payloads | +| record | [Schema2.Schema21BoxedString](#schema21boxedstring)
boxed class to store validated String payloads | | static class | [Schema2.Schema21](#schema21)
schema class | ## Schema21Boxed -public static abstract sealed class Schema21Boxed
+public sealed interface Schema21Boxed
permits
[Schema21BoxedString](#schema21boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema21BoxedString -public static final class Schema21BoxedString
-extends [Schema21Boxed](#schema21boxed) +public record Schema21BoxedString
+implements [Schema21Boxed](#schema21boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema21BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema21 public static class Schema21
diff --git a/samples/client/petstore/java/docs/paths/fake/patch/responses/response200/content/applicationjson/ApplicationjsonSchema.md b/samples/client/petstore/java/docs/paths/fakeclassnametest/patch/responses/code200response/content/applicationjson/ApplicationjsonSchema.md similarity index 89% rename from samples/client/petstore/java/docs/paths/fake/patch/responses/response200/content/applicationjson/ApplicationjsonSchema.md rename to samples/client/petstore/java/docs/paths/fakeclassnametest/patch/responses/code200response/content/applicationjson/ApplicationjsonSchema.md index 104d3d325b5..0a219ca9fad 100644 --- a/samples/client/petstore/java/docs/paths/fake/patch/responses/response200/content/applicationjson/ApplicationjsonSchema.md +++ b/samples/client/petstore/java/docs/paths/fakeclassnametest/patch/responses/code200response/content/applicationjson/ApplicationjsonSchema.md @@ -4,7 +4,7 @@ extends [Client1](../../../../../../../../../components/schemas/Client.md#client A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary diff --git a/samples/client/petstore/java/docs/paths/fakedeletecoffeeid/delete/parameters/parameter0/Schema0.md b/samples/client/petstore/java/docs/paths/fakedeletecoffeeid/delete/parameters/parameter0/Schema0.md index 34951cbef92..9ff90e0bc35 100644 --- a/samples/client/petstore/java/docs/paths/fakedeletecoffeeid/delete/parameters/parameter0/Schema0.md +++ b/samples/client/petstore/java/docs/paths/fakedeletecoffeeid/delete/parameters/parameter0/Schema0.md @@ -3,38 +3,39 @@ public class Schema0
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Schema0.Schema01Boxed](#schema01boxed)
abstract sealed validated payload class | -| static class | [Schema0.Schema01BoxedString](#schema01boxedstring)
boxed class to store validated String payloads | +| sealed interface | [Schema0.Schema01Boxed](#schema01boxed)
sealed interface for validated payloads | +| record | [Schema0.Schema01BoxedString](#schema01boxedstring)
boxed class to store validated String payloads | | static class | [Schema0.Schema01](#schema01)
schema class | ## Schema01Boxed -public static abstract sealed class Schema01Boxed
+public sealed interface Schema01Boxed
permits
[Schema01BoxedString](#schema01boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema01BoxedString -public static final class Schema01BoxedString
-extends [Schema01Boxed](#schema01boxed) +public record Schema01BoxedString
+implements [Schema01Boxed](#schema01boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema01BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema01 public static class Schema01
diff --git a/samples/client/petstore/java/docs/paths/fakehealth/get/responses/response200/content/applicationjson/ApplicationjsonSchema.md b/samples/client/petstore/java/docs/paths/fakehealth/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md similarity index 90% rename from samples/client/petstore/java/docs/paths/fakehealth/get/responses/response200/content/applicationjson/ApplicationjsonSchema.md rename to samples/client/petstore/java/docs/paths/fakehealth/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md index 4fadc5bc16b..ff3de49a907 100644 --- a/samples/client/petstore/java/docs/paths/fakehealth/get/responses/response200/content/applicationjson/ApplicationjsonSchema.md +++ b/samples/client/petstore/java/docs/paths/fakehealth/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md @@ -4,7 +4,7 @@ extends [HealthCheckResult1](../../../../../../../../../components/schemas/Healt A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary diff --git a/samples/client/petstore/java/docs/paths/fakeinlineadditionalproperties/post/requestbody/content/applicationjson/ApplicationjsonSchema.md b/samples/client/petstore/java/docs/paths/fakeinlineadditionalproperties/post/requestbody/content/applicationjson/ApplicationjsonSchema.md index 7ef6cc35abd..f6063eadb5e 100644 --- a/samples/client/petstore/java/docs/paths/fakeinlineadditionalproperties/post/requestbody/content/applicationjson/ApplicationjsonSchema.md +++ b/samples/client/petstore/java/docs/paths/fakeinlineadditionalproperties/post/requestbody/content/applicationjson/ApplicationjsonSchema.md @@ -3,7 +3,7 @@ public class ApplicationjsonSchema
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -11,37 +11,38 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed)
abstract sealed validated payload class | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ApplicationjsonSchema.ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed)
sealed interface for validated payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap)
boxed class to store validated Map payloads | | static class | [ApplicationjsonSchema.ApplicationjsonSchema1](#applicationjsonschema1)
schema class | | static class | [ApplicationjsonSchema.ApplicationjsonSchemaMapBuilder](#applicationjsonschemamapbuilder)
builder for Map payloads | | static class | [ApplicationjsonSchema.ApplicationjsonSchemaMap](#applicationjsonschemamap)
output class for Map payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonAdditionalPropertiesBoxed](#applicationjsonadditionalpropertiesboxed)
abstract sealed validated payload class | -| static class | [ApplicationjsonSchema.ApplicationjsonAdditionalPropertiesBoxedString](#applicationjsonadditionalpropertiesboxedstring)
boxed class to store validated String payloads | +| sealed interface | [ApplicationjsonSchema.ApplicationjsonAdditionalPropertiesBoxed](#applicationjsonadditionalpropertiesboxed)
sealed interface for validated payloads | +| record | [ApplicationjsonSchema.ApplicationjsonAdditionalPropertiesBoxedString](#applicationjsonadditionalpropertiesboxedstring)
boxed class to store validated String payloads | | static class | [ApplicationjsonSchema.ApplicationjsonAdditionalProperties](#applicationjsonadditionalproperties)
schema class | ## ApplicationjsonSchema1Boxed -public static abstract sealed class ApplicationjsonSchema1Boxed
+public sealed interface ApplicationjsonSchema1Boxed
permits
[ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ApplicationjsonSchema1BoxedMap -public static final class ApplicationjsonSchema1BoxedMap
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) +public record ApplicationjsonSchema1BoxedMap
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ApplicationjsonSchema1BoxedMap([ApplicationjsonSchemaMap](#applicationjsonschemamap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [ApplicationjsonSchemaMap](#applicationjsonschemamap) | data
validated payload | +| [ApplicationjsonSchemaMap](#applicationjsonschemamap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ApplicationjsonSchema1 public static class ApplicationjsonSchema1
@@ -86,7 +87,9 @@ ApplicationjsonSchema.ApplicationjsonSchemaMap validatedPayload = | ----------------- | ---------------------- | | [ApplicationjsonSchemaMap](#applicationjsonschemamap) | validate([Map<?, ?>](#applicationjsonschemamapbuilder) arg, SchemaConfiguration configuration) | | [ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap) | validateAndBox([Map<?, ?>](#applicationjsonschemamapbuilder) arg, SchemaConfiguration configuration) | +| [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ApplicationjsonSchemaMapBuilder public class ApplicationjsonSchemaMapBuilder
builder for `Map` @@ -117,27 +120,28 @@ A class to store validated Map payloads | String | getAdditionalProperty(String name)
provides type safety for additional properties | ## ApplicationjsonAdditionalPropertiesBoxed -public static abstract sealed class ApplicationjsonAdditionalPropertiesBoxed
+public sealed interface ApplicationjsonAdditionalPropertiesBoxed
permits
[ApplicationjsonAdditionalPropertiesBoxedString](#applicationjsonadditionalpropertiesboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ApplicationjsonAdditionalPropertiesBoxedString -public static final class ApplicationjsonAdditionalPropertiesBoxedString
-extends [ApplicationjsonAdditionalPropertiesBoxed](#applicationjsonadditionalpropertiesboxed) +public record ApplicationjsonAdditionalPropertiesBoxedString
+implements [ApplicationjsonAdditionalPropertiesBoxed](#applicationjsonadditionalpropertiesboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ApplicationjsonAdditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ApplicationjsonAdditionalProperties public static class ApplicationjsonAdditionalProperties
diff --git a/samples/client/petstore/java/docs/paths/fakeinlinecomposition/post/parameters/parameter0/Schema0.md b/samples/client/petstore/java/docs/paths/fakeinlinecomposition/post/parameters/parameter0/Schema0.md index e9600069529..f2faa251a6c 100644 --- a/samples/client/petstore/java/docs/paths/fakeinlinecomposition/post/parameters/parameter0/Schema0.md +++ b/samples/client/petstore/java/docs/paths/fakeinlinecomposition/post/parameters/parameter0/Schema0.md @@ -3,26 +3,26 @@ public class Schema0
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Schema0.Schema01Boxed](#schema01boxed)
abstract sealed validated payload class | -| static class | [Schema0.Schema01BoxedVoid](#schema01boxedvoid)
boxed class to store validated null payloads | -| static class | [Schema0.Schema01BoxedBoolean](#schema01boxedboolean)
boxed class to store validated boolean payloads | -| static class | [Schema0.Schema01BoxedNumber](#schema01boxednumber)
boxed class to store validated Number payloads | -| static class | [Schema0.Schema01BoxedString](#schema01boxedstring)
boxed class to store validated String payloads | -| static class | [Schema0.Schema01BoxedList](#schema01boxedlist)
boxed class to store validated List payloads | -| static class | [Schema0.Schema01BoxedMap](#schema01boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [Schema0.Schema01Boxed](#schema01boxed)
sealed interface for validated payloads | +| record | [Schema0.Schema01BoxedVoid](#schema01boxedvoid)
boxed class to store validated null payloads | +| record | [Schema0.Schema01BoxedBoolean](#schema01boxedboolean)
boxed class to store validated boolean payloads | +| record | [Schema0.Schema01BoxedNumber](#schema01boxednumber)
boxed class to store validated Number payloads | +| record | [Schema0.Schema01BoxedString](#schema01boxedstring)
boxed class to store validated String payloads | +| record | [Schema0.Schema01BoxedList](#schema01boxedlist)
boxed class to store validated List payloads | +| record | [Schema0.Schema01BoxedMap](#schema01boxedmap)
boxed class to store validated Map payloads | | static class | [Schema0.Schema01](#schema01)
schema class | -| static class | [Schema0.Schema00Boxed](#schema00boxed)
abstract sealed validated payload class | -| static class | [Schema0.Schema00BoxedString](#schema00boxedstring)
boxed class to store validated String payloads | +| sealed interface | [Schema0.Schema00Boxed](#schema00boxed)
sealed interface for validated payloads | +| record | [Schema0.Schema00BoxedString](#schema00boxedstring)
boxed class to store validated String payloads | | static class | [Schema0.Schema00](#schema00)
schema class | ## Schema01Boxed -public static abstract sealed class Schema01Boxed
+public sealed interface Schema01Boxed
permits
[Schema01BoxedVoid](#schema01boxedvoid), [Schema01BoxedBoolean](#schema01boxedboolean), @@ -31,103 +31,109 @@ permits
[Schema01BoxedList](#schema01boxedlist), [Schema01BoxedMap](#schema01boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema01BoxedVoid -public static final class Schema01BoxedVoid
-extends [Schema01Boxed](#schema01boxed) +public record Schema01BoxedVoid
+implements [Schema01Boxed](#schema01boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema01BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema01BoxedBoolean -public static final class Schema01BoxedBoolean
-extends [Schema01Boxed](#schema01boxed) +public record Schema01BoxedBoolean
+implements [Schema01Boxed](#schema01boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema01BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema01BoxedNumber -public static final class Schema01BoxedNumber
-extends [Schema01Boxed](#schema01boxed) +public record Schema01BoxedNumber
+implements [Schema01Boxed](#schema01boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema01BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema01BoxedString -public static final class Schema01BoxedString
-extends [Schema01Boxed](#schema01boxed) +public record Schema01BoxedString
+implements [Schema01Boxed](#schema01boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema01BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema01BoxedList -public static final class Schema01BoxedList
-extends [Schema01Boxed](#schema01boxed) +public record Schema01BoxedList
+implements [Schema01Boxed](#schema01boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema01BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema01BoxedMap -public static final class Schema01BoxedMap
-extends [Schema01Boxed](#schema01boxed) +public record Schema01BoxedMap
+implements [Schema01Boxed](#schema01boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema01BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema01 public static class Schema01
@@ -159,29 +165,32 @@ A schema class that validates payloads | [Schema01BoxedBoolean](#schema01boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [Schema01BoxedMap](#schema01boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [Schema01BoxedList](#schema01boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [Schema01Boxed](#schema01boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema00Boxed -public static abstract sealed class Schema00Boxed
+public sealed interface Schema00Boxed
permits
[Schema00BoxedString](#schema00boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema00BoxedString -public static final class Schema00BoxedString
-extends [Schema00Boxed](#schema00boxed) +public record Schema00BoxedString
+implements [Schema00Boxed](#schema00boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema00BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema00 public static class Schema00
@@ -222,4 +231,5 @@ String validatedPayload = Schema0.Schema00.validate( | ----------------- | ---------------------- | | String | validate(String arg, SchemaConfiguration configuration) | | [Schema00BoxedString](#schema00boxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | -| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | \ No newline at end of file +| [Schema00Boxed](#schema00boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | +| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | diff --git a/samples/client/petstore/java/docs/paths/fakeinlinecomposition/post/parameters/parameter1/Schema1.md b/samples/client/petstore/java/docs/paths/fakeinlinecomposition/post/parameters/parameter1/Schema1.md index 36ef207ff66..519f6e4249e 100644 --- a/samples/client/petstore/java/docs/paths/fakeinlinecomposition/post/parameters/parameter1/Schema1.md +++ b/samples/client/petstore/java/docs/paths/fakeinlinecomposition/post/parameters/parameter1/Schema1.md @@ -3,7 +3,7 @@ public class Schema1
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -11,45 +11,46 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Schema1.Schema11Boxed](#schema11boxed)
abstract sealed validated payload class | -| static class | [Schema1.Schema11BoxedMap](#schema11boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [Schema1.Schema11Boxed](#schema11boxed)
sealed interface for validated payloads | +| record | [Schema1.Schema11BoxedMap](#schema11boxedmap)
boxed class to store validated Map payloads | | static class | [Schema1.Schema11](#schema11)
schema class | | static class | [Schema1.SchemaMapBuilder1](#schemamapbuilder1)
builder for Map payloads | | static class | [Schema1.SchemaMap1](#schemamap1)
output class for Map payloads | -| static class | [Schema1.SomeProp1Boxed](#someprop1boxed)
abstract sealed validated payload class | -| static class | [Schema1.SomeProp1BoxedVoid](#someprop1boxedvoid)
boxed class to store validated null payloads | -| static class | [Schema1.SomeProp1BoxedBoolean](#someprop1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [Schema1.SomeProp1BoxedNumber](#someprop1boxednumber)
boxed class to store validated Number payloads | -| static class | [Schema1.SomeProp1BoxedString](#someprop1boxedstring)
boxed class to store validated String payloads | -| static class | [Schema1.SomeProp1BoxedList](#someprop1boxedlist)
boxed class to store validated List payloads | -| static class | [Schema1.SomeProp1BoxedMap](#someprop1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [Schema1.SomeProp1Boxed](#someprop1boxed)
sealed interface for validated payloads | +| record | [Schema1.SomeProp1BoxedVoid](#someprop1boxedvoid)
boxed class to store validated null payloads | +| record | [Schema1.SomeProp1BoxedBoolean](#someprop1boxedboolean)
boxed class to store validated boolean payloads | +| record | [Schema1.SomeProp1BoxedNumber](#someprop1boxednumber)
boxed class to store validated Number payloads | +| record | [Schema1.SomeProp1BoxedString](#someprop1boxedstring)
boxed class to store validated String payloads | +| record | [Schema1.SomeProp1BoxedList](#someprop1boxedlist)
boxed class to store validated List payloads | +| record | [Schema1.SomeProp1BoxedMap](#someprop1boxedmap)
boxed class to store validated Map payloads | | static class | [Schema1.SomeProp1](#someprop1)
schema class | -| static class | [Schema1.Schema01Boxed](#schema01boxed)
abstract sealed validated payload class | -| static class | [Schema1.Schema01BoxedString](#schema01boxedstring)
boxed class to store validated String payloads | +| sealed interface | [Schema1.Schema01Boxed](#schema01boxed)
sealed interface for validated payloads | +| record | [Schema1.Schema01BoxedString](#schema01boxedstring)
boxed class to store validated String payloads | | static class | [Schema1.Schema01](#schema01)
schema class | ## Schema11Boxed -public static abstract sealed class Schema11Boxed
+public sealed interface Schema11Boxed
permits
[Schema11BoxedMap](#schema11boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema11BoxedMap -public static final class Schema11BoxedMap
-extends [Schema11Boxed](#schema11boxed) +public record Schema11BoxedMap
+implements [Schema11Boxed](#schema11boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema11BoxedMap([SchemaMap1](#schemamap1) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [SchemaMap1](#schemamap1) | data
validated payload | +| [SchemaMap1](#schemamap1) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema11 public static class Schema11
@@ -92,7 +93,9 @@ Schema1.SchemaMap1 validatedPayload = | ----------------- | ---------------------- | | [SchemaMap1](#schemamap1) | validate([Map<?, ?>](#schemamapbuilder1) arg, SchemaConfiguration configuration) | | [Schema11BoxedMap](#schema11boxedmap) | validateAndBox([Map<?, ?>](#schemamapbuilder1) arg, SchemaConfiguration configuration) | +| [Schema11Boxed](#schema11boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## SchemaMapBuilder1 public class SchemaMapBuilder1
builder for `Map` @@ -141,7 +144,7 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## SomeProp1Boxed -public static abstract sealed class SomeProp1Boxed
+public sealed interface SomeProp1Boxed
permits
[SomeProp1BoxedVoid](#someprop1boxedvoid), [SomeProp1BoxedBoolean](#someprop1boxedboolean), @@ -150,103 +153,109 @@ permits
[SomeProp1BoxedList](#someprop1boxedlist), [SomeProp1BoxedMap](#someprop1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## SomeProp1BoxedVoid -public static final class SomeProp1BoxedVoid
-extends [SomeProp1Boxed](#someprop1boxed) +public record SomeProp1BoxedVoid
+implements [SomeProp1Boxed](#someprop1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | SomeProp1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## SomeProp1BoxedBoolean -public static final class SomeProp1BoxedBoolean
-extends [SomeProp1Boxed](#someprop1boxed) +public record SomeProp1BoxedBoolean
+implements [SomeProp1Boxed](#someprop1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | SomeProp1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## SomeProp1BoxedNumber -public static final class SomeProp1BoxedNumber
-extends [SomeProp1Boxed](#someprop1boxed) +public record SomeProp1BoxedNumber
+implements [SomeProp1Boxed](#someprop1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | SomeProp1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## SomeProp1BoxedString -public static final class SomeProp1BoxedString
-extends [SomeProp1Boxed](#someprop1boxed) +public record SomeProp1BoxedString
+implements [SomeProp1Boxed](#someprop1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | SomeProp1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## SomeProp1BoxedList -public static final class SomeProp1BoxedList
-extends [SomeProp1Boxed](#someprop1boxed) +public record SomeProp1BoxedList
+implements [SomeProp1Boxed](#someprop1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | SomeProp1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## SomeProp1BoxedMap -public static final class SomeProp1BoxedMap
-extends [SomeProp1Boxed](#someprop1boxed) +public record SomeProp1BoxedMap
+implements [SomeProp1Boxed](#someprop1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | SomeProp1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## SomeProp1 public static class SomeProp1
@@ -278,29 +287,32 @@ A schema class that validates payloads | [SomeProp1BoxedBoolean](#someprop1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [SomeProp1BoxedMap](#someprop1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [SomeProp1BoxedList](#someprop1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [SomeProp1Boxed](#someprop1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Schema01Boxed -public static abstract sealed class Schema01Boxed
+public sealed interface Schema01Boxed
permits
[Schema01BoxedString](#schema01boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema01BoxedString -public static final class Schema01BoxedString
-extends [Schema01Boxed](#schema01boxed) +public record Schema01BoxedString
+implements [Schema01Boxed](#schema01boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema01BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema01 public static class Schema01
@@ -341,4 +353,5 @@ String validatedPayload = Schema1.Schema01.validate( | ----------------- | ---------------------- | | String | validate(String arg, SchemaConfiguration configuration) | | [Schema01BoxedString](#schema01boxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | -| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | \ No newline at end of file +| [Schema01Boxed](#schema01boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | +| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | diff --git a/samples/client/petstore/java/docs/paths/fakeinlinecomposition/post/requestbody/content/applicationjson/ApplicationjsonSchema.md b/samples/client/petstore/java/docs/paths/fakeinlinecomposition/post/requestbody/content/applicationjson/ApplicationjsonSchema.md index 5208411e6d2..bc425ecb794 100644 --- a/samples/client/petstore/java/docs/paths/fakeinlinecomposition/post/requestbody/content/applicationjson/ApplicationjsonSchema.md +++ b/samples/client/petstore/java/docs/paths/fakeinlinecomposition/post/requestbody/content/applicationjson/ApplicationjsonSchema.md @@ -3,26 +3,26 @@ public class ApplicationjsonSchema
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed)
abstract sealed validated payload class | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedVoid](#applicationjsonschema1boxedvoid)
boxed class to store validated null payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedBoolean](#applicationjsonschema1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedNumber](#applicationjsonschema1boxednumber)
boxed class to store validated Number payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedString](#applicationjsonschema1boxedstring)
boxed class to store validated String payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedList](#applicationjsonschema1boxedlist)
boxed class to store validated List payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ApplicationjsonSchema.ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed)
sealed interface for validated payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedVoid](#applicationjsonschema1boxedvoid)
boxed class to store validated null payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedBoolean](#applicationjsonschema1boxedboolean)
boxed class to store validated boolean payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedNumber](#applicationjsonschema1boxednumber)
boxed class to store validated Number payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedString](#applicationjsonschema1boxedstring)
boxed class to store validated String payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedList](#applicationjsonschema1boxedlist)
boxed class to store validated List payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap)
boxed class to store validated Map payloads | | static class | [ApplicationjsonSchema.ApplicationjsonSchema1](#applicationjsonschema1)
schema class | -| static class | [ApplicationjsonSchema.Applicationjson0Boxed](#applicationjson0boxed)
abstract sealed validated payload class | -| static class | [ApplicationjsonSchema.Applicationjson0BoxedString](#applicationjson0boxedstring)
boxed class to store validated String payloads | +| sealed interface | [ApplicationjsonSchema.Applicationjson0Boxed](#applicationjson0boxed)
sealed interface for validated payloads | +| record | [ApplicationjsonSchema.Applicationjson0BoxedString](#applicationjson0boxedstring)
boxed class to store validated String payloads | | static class | [ApplicationjsonSchema.Applicationjson0](#applicationjson0)
schema class | ## ApplicationjsonSchema1Boxed -public static abstract sealed class ApplicationjsonSchema1Boxed
+public sealed interface ApplicationjsonSchema1Boxed
permits
[ApplicationjsonSchema1BoxedVoid](#applicationjsonschema1boxedvoid), [ApplicationjsonSchema1BoxedBoolean](#applicationjsonschema1boxedboolean), @@ -31,103 +31,109 @@ permits
[ApplicationjsonSchema1BoxedList](#applicationjsonschema1boxedlist), [ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ApplicationjsonSchema1BoxedVoid -public static final class ApplicationjsonSchema1BoxedVoid
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) +public record ApplicationjsonSchema1BoxedVoid
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ApplicationjsonSchema1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ApplicationjsonSchema1BoxedBoolean -public static final class ApplicationjsonSchema1BoxedBoolean
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) +public record ApplicationjsonSchema1BoxedBoolean
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ApplicationjsonSchema1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ApplicationjsonSchema1BoxedNumber -public static final class ApplicationjsonSchema1BoxedNumber
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) +public record ApplicationjsonSchema1BoxedNumber
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ApplicationjsonSchema1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ApplicationjsonSchema1BoxedString -public static final class ApplicationjsonSchema1BoxedString
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) +public record ApplicationjsonSchema1BoxedString
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ApplicationjsonSchema1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ApplicationjsonSchema1BoxedList -public static final class ApplicationjsonSchema1BoxedList
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) +public record ApplicationjsonSchema1BoxedList
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ApplicationjsonSchema1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ApplicationjsonSchema1BoxedMap -public static final class ApplicationjsonSchema1BoxedMap
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) +public record ApplicationjsonSchema1BoxedMap
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ApplicationjsonSchema1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ApplicationjsonSchema1 public static class ApplicationjsonSchema1
@@ -159,29 +165,32 @@ A schema class that validates payloads | [ApplicationjsonSchema1BoxedBoolean](#applicationjsonschema1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [ApplicationjsonSchema1BoxedList](#applicationjsonschema1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Applicationjson0Boxed -public static abstract sealed class Applicationjson0Boxed
+public sealed interface Applicationjson0Boxed
permits
[Applicationjson0BoxedString](#applicationjson0boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Applicationjson0BoxedString -public static final class Applicationjson0BoxedString
-extends [Applicationjson0Boxed](#applicationjson0boxed) +public record Applicationjson0BoxedString
+implements [Applicationjson0Boxed](#applicationjson0boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Applicationjson0BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Applicationjson0 public static class Applicationjson0
@@ -222,4 +231,5 @@ String validatedPayload = ApplicationjsonSchema.Applicationjson0.validate( | ----------------- | ---------------------- | | String | validate(String arg, SchemaConfiguration configuration) | | [Applicationjson0BoxedString](#applicationjson0boxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | -| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | \ No newline at end of file +| [Applicationjson0Boxed](#applicationjson0boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | +| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | diff --git a/samples/client/petstore/java/docs/paths/fakeinlinecomposition/post/requestbody/content/multipartformdata/MultipartformdataSchema.md b/samples/client/petstore/java/docs/paths/fakeinlinecomposition/post/requestbody/content/multipartformdata/MultipartformdataSchema.md index b1e100db12e..f6ec53a8044 100644 --- a/samples/client/petstore/java/docs/paths/fakeinlinecomposition/post/requestbody/content/multipartformdata/MultipartformdataSchema.md +++ b/samples/client/petstore/java/docs/paths/fakeinlinecomposition/post/requestbody/content/multipartformdata/MultipartformdataSchema.md @@ -3,7 +3,7 @@ public class MultipartformdataSchema
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -11,45 +11,46 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [MultipartformdataSchema.MultipartformdataSchema1Boxed](#multipartformdataschema1boxed)
abstract sealed validated payload class | -| static class | [MultipartformdataSchema.MultipartformdataSchema1BoxedMap](#multipartformdataschema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [MultipartformdataSchema.MultipartformdataSchema1Boxed](#multipartformdataschema1boxed)
sealed interface for validated payloads | +| record | [MultipartformdataSchema.MultipartformdataSchema1BoxedMap](#multipartformdataschema1boxedmap)
boxed class to store validated Map payloads | | static class | [MultipartformdataSchema.MultipartformdataSchema1](#multipartformdataschema1)
schema class | | static class | [MultipartformdataSchema.MultipartformdataSchemaMapBuilder](#multipartformdataschemamapbuilder)
builder for Map payloads | | static class | [MultipartformdataSchema.MultipartformdataSchemaMap](#multipartformdataschemamap)
output class for Map payloads | -| static class | [MultipartformdataSchema.MultipartformdataSomePropBoxed](#multipartformdatasomepropboxed)
abstract sealed validated payload class | -| static class | [MultipartformdataSchema.MultipartformdataSomePropBoxedVoid](#multipartformdatasomepropboxedvoid)
boxed class to store validated null payloads | -| static class | [MultipartformdataSchema.MultipartformdataSomePropBoxedBoolean](#multipartformdatasomepropboxedboolean)
boxed class to store validated boolean payloads | -| static class | [MultipartformdataSchema.MultipartformdataSomePropBoxedNumber](#multipartformdatasomepropboxednumber)
boxed class to store validated Number payloads | -| static class | [MultipartformdataSchema.MultipartformdataSomePropBoxedString](#multipartformdatasomepropboxedstring)
boxed class to store validated String payloads | -| static class | [MultipartformdataSchema.MultipartformdataSomePropBoxedList](#multipartformdatasomepropboxedlist)
boxed class to store validated List payloads | -| static class | [MultipartformdataSchema.MultipartformdataSomePropBoxedMap](#multipartformdatasomepropboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [MultipartformdataSchema.MultipartformdataSomePropBoxed](#multipartformdatasomepropboxed)
sealed interface for validated payloads | +| record | [MultipartformdataSchema.MultipartformdataSomePropBoxedVoid](#multipartformdatasomepropboxedvoid)
boxed class to store validated null payloads | +| record | [MultipartformdataSchema.MultipartformdataSomePropBoxedBoolean](#multipartformdatasomepropboxedboolean)
boxed class to store validated boolean payloads | +| record | [MultipartformdataSchema.MultipartformdataSomePropBoxedNumber](#multipartformdatasomepropboxednumber)
boxed class to store validated Number payloads | +| record | [MultipartformdataSchema.MultipartformdataSomePropBoxedString](#multipartformdatasomepropboxedstring)
boxed class to store validated String payloads | +| record | [MultipartformdataSchema.MultipartformdataSomePropBoxedList](#multipartformdatasomepropboxedlist)
boxed class to store validated List payloads | +| record | [MultipartformdataSchema.MultipartformdataSomePropBoxedMap](#multipartformdatasomepropboxedmap)
boxed class to store validated Map payloads | | static class | [MultipartformdataSchema.MultipartformdataSomeProp](#multipartformdatasomeprop)
schema class | -| static class | [MultipartformdataSchema.Multipartformdata0Boxed](#multipartformdata0boxed)
abstract sealed validated payload class | -| static class | [MultipartformdataSchema.Multipartformdata0BoxedString](#multipartformdata0boxedstring)
boxed class to store validated String payloads | +| sealed interface | [MultipartformdataSchema.Multipartformdata0Boxed](#multipartformdata0boxed)
sealed interface for validated payloads | +| record | [MultipartformdataSchema.Multipartformdata0BoxedString](#multipartformdata0boxedstring)
boxed class to store validated String payloads | | static class | [MultipartformdataSchema.Multipartformdata0](#multipartformdata0)
schema class | ## MultipartformdataSchema1Boxed -public static abstract sealed class MultipartformdataSchema1Boxed
+public sealed interface MultipartformdataSchema1Boxed
permits
[MultipartformdataSchema1BoxedMap](#multipartformdataschema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## MultipartformdataSchema1BoxedMap -public static final class MultipartformdataSchema1BoxedMap
-extends [MultipartformdataSchema1Boxed](#multipartformdataschema1boxed) +public record MultipartformdataSchema1BoxedMap
+implements [MultipartformdataSchema1Boxed](#multipartformdataschema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MultipartformdataSchema1BoxedMap([MultipartformdataSchemaMap](#multipartformdataschemamap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [MultipartformdataSchemaMap](#multipartformdataschemamap) | data
validated payload | +| [MultipartformdataSchemaMap](#multipartformdataschemamap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MultipartformdataSchema1 public static class MultipartformdataSchema1
@@ -92,7 +93,9 @@ MultipartformdataSchema.MultipartformdataSchemaMap validatedPayload = | ----------------- | ---------------------- | | [MultipartformdataSchemaMap](#multipartformdataschemamap) | validate([Map<?, ?>](#multipartformdataschemamapbuilder) arg, SchemaConfiguration configuration) | | [MultipartformdataSchema1BoxedMap](#multipartformdataschema1boxedmap) | validateAndBox([Map<?, ?>](#multipartformdataschemamapbuilder) arg, SchemaConfiguration configuration) | +| [MultipartformdataSchema1Boxed](#multipartformdataschema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## MultipartformdataSchemaMapBuilder public class MultipartformdataSchemaMapBuilder
builder for `Map` @@ -141,7 +144,7 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## MultipartformdataSomePropBoxed -public static abstract sealed class MultipartformdataSomePropBoxed
+public sealed interface MultipartformdataSomePropBoxed
permits
[MultipartformdataSomePropBoxedVoid](#multipartformdatasomepropboxedvoid), [MultipartformdataSomePropBoxedBoolean](#multipartformdatasomepropboxedboolean), @@ -150,103 +153,109 @@ permits
[MultipartformdataSomePropBoxedList](#multipartformdatasomepropboxedlist), [MultipartformdataSomePropBoxedMap](#multipartformdatasomepropboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## MultipartformdataSomePropBoxedVoid -public static final class MultipartformdataSomePropBoxedVoid
-extends [MultipartformdataSomePropBoxed](#multipartformdatasomepropboxed) +public record MultipartformdataSomePropBoxedVoid
+implements [MultipartformdataSomePropBoxed](#multipartformdatasomepropboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MultipartformdataSomePropBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MultipartformdataSomePropBoxedBoolean -public static final class MultipartformdataSomePropBoxedBoolean
-extends [MultipartformdataSomePropBoxed](#multipartformdatasomepropboxed) +public record MultipartformdataSomePropBoxedBoolean
+implements [MultipartformdataSomePropBoxed](#multipartformdatasomepropboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MultipartformdataSomePropBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MultipartformdataSomePropBoxedNumber -public static final class MultipartformdataSomePropBoxedNumber
-extends [MultipartformdataSomePropBoxed](#multipartformdatasomepropboxed) +public record MultipartformdataSomePropBoxedNumber
+implements [MultipartformdataSomePropBoxed](#multipartformdatasomepropboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MultipartformdataSomePropBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MultipartformdataSomePropBoxedString -public static final class MultipartformdataSomePropBoxedString
-extends [MultipartformdataSomePropBoxed](#multipartformdatasomepropboxed) +public record MultipartformdataSomePropBoxedString
+implements [MultipartformdataSomePropBoxed](#multipartformdatasomepropboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MultipartformdataSomePropBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MultipartformdataSomePropBoxedList -public static final class MultipartformdataSomePropBoxedList
-extends [MultipartformdataSomePropBoxed](#multipartformdatasomepropboxed) +public record MultipartformdataSomePropBoxedList
+implements [MultipartformdataSomePropBoxed](#multipartformdatasomepropboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MultipartformdataSomePropBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MultipartformdataSomePropBoxedMap -public static final class MultipartformdataSomePropBoxedMap
-extends [MultipartformdataSomePropBoxed](#multipartformdatasomepropboxed) +public record MultipartformdataSomePropBoxedMap
+implements [MultipartformdataSomePropBoxed](#multipartformdatasomepropboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MultipartformdataSomePropBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MultipartformdataSomeProp public static class MultipartformdataSomeProp
@@ -278,29 +287,32 @@ A schema class that validates payloads | [MultipartformdataSomePropBoxedBoolean](#multipartformdatasomepropboxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [MultipartformdataSomePropBoxedMap](#multipartformdatasomepropboxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [MultipartformdataSomePropBoxedList](#multipartformdatasomepropboxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [MultipartformdataSomePropBoxed](#multipartformdatasomepropboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Multipartformdata0Boxed -public static abstract sealed class Multipartformdata0Boxed
+public sealed interface Multipartformdata0Boxed
permits
[Multipartformdata0BoxedString](#multipartformdata0boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Multipartformdata0BoxedString -public static final class Multipartformdata0BoxedString
-extends [Multipartformdata0Boxed](#multipartformdata0boxed) +public record Multipartformdata0BoxedString
+implements [Multipartformdata0Boxed](#multipartformdata0boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Multipartformdata0BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Multipartformdata0 public static class Multipartformdata0
@@ -341,4 +353,5 @@ String validatedPayload = MultipartformdataSchema.Multipartformdata0.validate( | ----------------- | ---------------------- | | String | validate(String arg, SchemaConfiguration configuration) | | [Multipartformdata0BoxedString](#multipartformdata0boxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | -| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | \ No newline at end of file +| [Multipartformdata0Boxed](#multipartformdata0boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | +| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | diff --git a/samples/client/petstore/java/docs/paths/fakeinlinecomposition/post/responses/response200/content/applicationjson/ApplicationjsonSchema.md b/samples/client/petstore/java/docs/paths/fakeinlinecomposition/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md similarity index 59% rename from samples/client/petstore/java/docs/paths/fakeinlinecomposition/post/responses/response200/content/applicationjson/ApplicationjsonSchema.md rename to samples/client/petstore/java/docs/paths/fakeinlinecomposition/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md index 5208411e6d2..bc425ecb794 100644 --- a/samples/client/petstore/java/docs/paths/fakeinlinecomposition/post/responses/response200/content/applicationjson/ApplicationjsonSchema.md +++ b/samples/client/petstore/java/docs/paths/fakeinlinecomposition/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md @@ -3,26 +3,26 @@ public class ApplicationjsonSchema
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed)
abstract sealed validated payload class | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedVoid](#applicationjsonschema1boxedvoid)
boxed class to store validated null payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedBoolean](#applicationjsonschema1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedNumber](#applicationjsonschema1boxednumber)
boxed class to store validated Number payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedString](#applicationjsonschema1boxedstring)
boxed class to store validated String payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedList](#applicationjsonschema1boxedlist)
boxed class to store validated List payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ApplicationjsonSchema.ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed)
sealed interface for validated payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedVoid](#applicationjsonschema1boxedvoid)
boxed class to store validated null payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedBoolean](#applicationjsonschema1boxedboolean)
boxed class to store validated boolean payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedNumber](#applicationjsonschema1boxednumber)
boxed class to store validated Number payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedString](#applicationjsonschema1boxedstring)
boxed class to store validated String payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedList](#applicationjsonschema1boxedlist)
boxed class to store validated List payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap)
boxed class to store validated Map payloads | | static class | [ApplicationjsonSchema.ApplicationjsonSchema1](#applicationjsonschema1)
schema class | -| static class | [ApplicationjsonSchema.Applicationjson0Boxed](#applicationjson0boxed)
abstract sealed validated payload class | -| static class | [ApplicationjsonSchema.Applicationjson0BoxedString](#applicationjson0boxedstring)
boxed class to store validated String payloads | +| sealed interface | [ApplicationjsonSchema.Applicationjson0Boxed](#applicationjson0boxed)
sealed interface for validated payloads | +| record | [ApplicationjsonSchema.Applicationjson0BoxedString](#applicationjson0boxedstring)
boxed class to store validated String payloads | | static class | [ApplicationjsonSchema.Applicationjson0](#applicationjson0)
schema class | ## ApplicationjsonSchema1Boxed -public static abstract sealed class ApplicationjsonSchema1Boxed
+public sealed interface ApplicationjsonSchema1Boxed
permits
[ApplicationjsonSchema1BoxedVoid](#applicationjsonschema1boxedvoid), [ApplicationjsonSchema1BoxedBoolean](#applicationjsonschema1boxedboolean), @@ -31,103 +31,109 @@ permits
[ApplicationjsonSchema1BoxedList](#applicationjsonschema1boxedlist), [ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ApplicationjsonSchema1BoxedVoid -public static final class ApplicationjsonSchema1BoxedVoid
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) +public record ApplicationjsonSchema1BoxedVoid
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ApplicationjsonSchema1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ApplicationjsonSchema1BoxedBoolean -public static final class ApplicationjsonSchema1BoxedBoolean
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) +public record ApplicationjsonSchema1BoxedBoolean
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ApplicationjsonSchema1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ApplicationjsonSchema1BoxedNumber -public static final class ApplicationjsonSchema1BoxedNumber
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) +public record ApplicationjsonSchema1BoxedNumber
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ApplicationjsonSchema1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ApplicationjsonSchema1BoxedString -public static final class ApplicationjsonSchema1BoxedString
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) +public record ApplicationjsonSchema1BoxedString
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ApplicationjsonSchema1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ApplicationjsonSchema1BoxedList -public static final class ApplicationjsonSchema1BoxedList
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) +public record ApplicationjsonSchema1BoxedList
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ApplicationjsonSchema1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ApplicationjsonSchema1BoxedMap -public static final class ApplicationjsonSchema1BoxedMap
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) +public record ApplicationjsonSchema1BoxedMap
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ApplicationjsonSchema1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ApplicationjsonSchema1 public static class ApplicationjsonSchema1
@@ -159,29 +165,32 @@ A schema class that validates payloads | [ApplicationjsonSchema1BoxedBoolean](#applicationjsonschema1boxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [ApplicationjsonSchema1BoxedList](#applicationjsonschema1boxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Applicationjson0Boxed -public static abstract sealed class Applicationjson0Boxed
+public sealed interface Applicationjson0Boxed
permits
[Applicationjson0BoxedString](#applicationjson0boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Applicationjson0BoxedString -public static final class Applicationjson0BoxedString
-extends [Applicationjson0Boxed](#applicationjson0boxed) +public record Applicationjson0BoxedString
+implements [Applicationjson0Boxed](#applicationjson0boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Applicationjson0BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Applicationjson0 public static class Applicationjson0
@@ -222,4 +231,5 @@ String validatedPayload = ApplicationjsonSchema.Applicationjson0.validate( | ----------------- | ---------------------- | | String | validate(String arg, SchemaConfiguration configuration) | | [Applicationjson0BoxedString](#applicationjson0boxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | -| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | \ No newline at end of file +| [Applicationjson0Boxed](#applicationjson0boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | +| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | diff --git a/samples/client/petstore/java/docs/paths/fakeinlinecomposition/post/responses/response200/content/multipartformdata/MultipartformdataSchema.md b/samples/client/petstore/java/docs/paths/fakeinlinecomposition/post/responses/code200response/content/multipartformdata/MultipartformdataSchema.md similarity index 70% rename from samples/client/petstore/java/docs/paths/fakeinlinecomposition/post/responses/response200/content/multipartformdata/MultipartformdataSchema.md rename to samples/client/petstore/java/docs/paths/fakeinlinecomposition/post/responses/code200response/content/multipartformdata/MultipartformdataSchema.md index b1e100db12e..f6ec53a8044 100644 --- a/samples/client/petstore/java/docs/paths/fakeinlinecomposition/post/responses/response200/content/multipartformdata/MultipartformdataSchema.md +++ b/samples/client/petstore/java/docs/paths/fakeinlinecomposition/post/responses/code200response/content/multipartformdata/MultipartformdataSchema.md @@ -3,7 +3,7 @@ public class MultipartformdataSchema
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -11,45 +11,46 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [MultipartformdataSchema.MultipartformdataSchema1Boxed](#multipartformdataschema1boxed)
abstract sealed validated payload class | -| static class | [MultipartformdataSchema.MultipartformdataSchema1BoxedMap](#multipartformdataschema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [MultipartformdataSchema.MultipartformdataSchema1Boxed](#multipartformdataschema1boxed)
sealed interface for validated payloads | +| record | [MultipartformdataSchema.MultipartformdataSchema1BoxedMap](#multipartformdataschema1boxedmap)
boxed class to store validated Map payloads | | static class | [MultipartformdataSchema.MultipartformdataSchema1](#multipartformdataschema1)
schema class | | static class | [MultipartformdataSchema.MultipartformdataSchemaMapBuilder](#multipartformdataschemamapbuilder)
builder for Map payloads | | static class | [MultipartformdataSchema.MultipartformdataSchemaMap](#multipartformdataschemamap)
output class for Map payloads | -| static class | [MultipartformdataSchema.MultipartformdataSomePropBoxed](#multipartformdatasomepropboxed)
abstract sealed validated payload class | -| static class | [MultipartformdataSchema.MultipartformdataSomePropBoxedVoid](#multipartformdatasomepropboxedvoid)
boxed class to store validated null payloads | -| static class | [MultipartformdataSchema.MultipartformdataSomePropBoxedBoolean](#multipartformdatasomepropboxedboolean)
boxed class to store validated boolean payloads | -| static class | [MultipartformdataSchema.MultipartformdataSomePropBoxedNumber](#multipartformdatasomepropboxednumber)
boxed class to store validated Number payloads | -| static class | [MultipartformdataSchema.MultipartformdataSomePropBoxedString](#multipartformdatasomepropboxedstring)
boxed class to store validated String payloads | -| static class | [MultipartformdataSchema.MultipartformdataSomePropBoxedList](#multipartformdatasomepropboxedlist)
boxed class to store validated List payloads | -| static class | [MultipartformdataSchema.MultipartformdataSomePropBoxedMap](#multipartformdatasomepropboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [MultipartformdataSchema.MultipartformdataSomePropBoxed](#multipartformdatasomepropboxed)
sealed interface for validated payloads | +| record | [MultipartformdataSchema.MultipartformdataSomePropBoxedVoid](#multipartformdatasomepropboxedvoid)
boxed class to store validated null payloads | +| record | [MultipartformdataSchema.MultipartformdataSomePropBoxedBoolean](#multipartformdatasomepropboxedboolean)
boxed class to store validated boolean payloads | +| record | [MultipartformdataSchema.MultipartformdataSomePropBoxedNumber](#multipartformdatasomepropboxednumber)
boxed class to store validated Number payloads | +| record | [MultipartformdataSchema.MultipartformdataSomePropBoxedString](#multipartformdatasomepropboxedstring)
boxed class to store validated String payloads | +| record | [MultipartformdataSchema.MultipartformdataSomePropBoxedList](#multipartformdatasomepropboxedlist)
boxed class to store validated List payloads | +| record | [MultipartformdataSchema.MultipartformdataSomePropBoxedMap](#multipartformdatasomepropboxedmap)
boxed class to store validated Map payloads | | static class | [MultipartformdataSchema.MultipartformdataSomeProp](#multipartformdatasomeprop)
schema class | -| static class | [MultipartformdataSchema.Multipartformdata0Boxed](#multipartformdata0boxed)
abstract sealed validated payload class | -| static class | [MultipartformdataSchema.Multipartformdata0BoxedString](#multipartformdata0boxedstring)
boxed class to store validated String payloads | +| sealed interface | [MultipartformdataSchema.Multipartformdata0Boxed](#multipartformdata0boxed)
sealed interface for validated payloads | +| record | [MultipartformdataSchema.Multipartformdata0BoxedString](#multipartformdata0boxedstring)
boxed class to store validated String payloads | | static class | [MultipartformdataSchema.Multipartformdata0](#multipartformdata0)
schema class | ## MultipartformdataSchema1Boxed -public static abstract sealed class MultipartformdataSchema1Boxed
+public sealed interface MultipartformdataSchema1Boxed
permits
[MultipartformdataSchema1BoxedMap](#multipartformdataschema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## MultipartformdataSchema1BoxedMap -public static final class MultipartformdataSchema1BoxedMap
-extends [MultipartformdataSchema1Boxed](#multipartformdataschema1boxed) +public record MultipartformdataSchema1BoxedMap
+implements [MultipartformdataSchema1Boxed](#multipartformdataschema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MultipartformdataSchema1BoxedMap([MultipartformdataSchemaMap](#multipartformdataschemamap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [MultipartformdataSchemaMap](#multipartformdataschemamap) | data
validated payload | +| [MultipartformdataSchemaMap](#multipartformdataschemamap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MultipartformdataSchema1 public static class MultipartformdataSchema1
@@ -92,7 +93,9 @@ MultipartformdataSchema.MultipartformdataSchemaMap validatedPayload = | ----------------- | ---------------------- | | [MultipartformdataSchemaMap](#multipartformdataschemamap) | validate([Map<?, ?>](#multipartformdataschemamapbuilder) arg, SchemaConfiguration configuration) | | [MultipartformdataSchema1BoxedMap](#multipartformdataschema1boxedmap) | validateAndBox([Map<?, ?>](#multipartformdataschemamapbuilder) arg, SchemaConfiguration configuration) | +| [MultipartformdataSchema1Boxed](#multipartformdataschema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## MultipartformdataSchemaMapBuilder public class MultipartformdataSchemaMapBuilder
builder for `Map` @@ -141,7 +144,7 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## MultipartformdataSomePropBoxed -public static abstract sealed class MultipartformdataSomePropBoxed
+public sealed interface MultipartformdataSomePropBoxed
permits
[MultipartformdataSomePropBoxedVoid](#multipartformdatasomepropboxedvoid), [MultipartformdataSomePropBoxedBoolean](#multipartformdatasomepropboxedboolean), @@ -150,103 +153,109 @@ permits
[MultipartformdataSomePropBoxedList](#multipartformdatasomepropboxedlist), [MultipartformdataSomePropBoxedMap](#multipartformdatasomepropboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## MultipartformdataSomePropBoxedVoid -public static final class MultipartformdataSomePropBoxedVoid
-extends [MultipartformdataSomePropBoxed](#multipartformdatasomepropboxed) +public record MultipartformdataSomePropBoxedVoid
+implements [MultipartformdataSomePropBoxed](#multipartformdatasomepropboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MultipartformdataSomePropBoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MultipartformdataSomePropBoxedBoolean -public static final class MultipartformdataSomePropBoxedBoolean
-extends [MultipartformdataSomePropBoxed](#multipartformdatasomepropboxed) +public record MultipartformdataSomePropBoxedBoolean
+implements [MultipartformdataSomePropBoxed](#multipartformdatasomepropboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MultipartformdataSomePropBoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MultipartformdataSomePropBoxedNumber -public static final class MultipartformdataSomePropBoxedNumber
-extends [MultipartformdataSomePropBoxed](#multipartformdatasomepropboxed) +public record MultipartformdataSomePropBoxedNumber
+implements [MultipartformdataSomePropBoxed](#multipartformdatasomepropboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MultipartformdataSomePropBoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MultipartformdataSomePropBoxedString -public static final class MultipartformdataSomePropBoxedString
-extends [MultipartformdataSomePropBoxed](#multipartformdatasomepropboxed) +public record MultipartformdataSomePropBoxedString
+implements [MultipartformdataSomePropBoxed](#multipartformdatasomepropboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MultipartformdataSomePropBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MultipartformdataSomePropBoxedList -public static final class MultipartformdataSomePropBoxedList
-extends [MultipartformdataSomePropBoxed](#multipartformdatasomepropboxed) +public record MultipartformdataSomePropBoxedList
+implements [MultipartformdataSomePropBoxed](#multipartformdatasomepropboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MultipartformdataSomePropBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MultipartformdataSomePropBoxedMap -public static final class MultipartformdataSomePropBoxedMap
-extends [MultipartformdataSomePropBoxed](#multipartformdatasomepropboxed) +public record MultipartformdataSomePropBoxedMap
+implements [MultipartformdataSomePropBoxed](#multipartformdatasomepropboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MultipartformdataSomePropBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MultipartformdataSomeProp public static class MultipartformdataSomeProp
@@ -278,29 +287,32 @@ A schema class that validates payloads | [MultipartformdataSomePropBoxedBoolean](#multipartformdatasomepropboxedboolean) | validateAndBox(boolean arg, SchemaConfiguration configuration) | | [MultipartformdataSomePropBoxedMap](#multipartformdatasomepropboxedmap) | validateAndBox(Map<?, ?> arg, SchemaConfiguration configuration) | | [MultipartformdataSomePropBoxedList](#multipartformdatasomepropboxedlist) | validateAndBox(List arg, SchemaConfiguration configuration) | +| [MultipartformdataSomePropBoxed](#multipartformdatasomepropboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## Multipartformdata0Boxed -public static abstract sealed class Multipartformdata0Boxed
+public sealed interface Multipartformdata0Boxed
permits
[Multipartformdata0BoxedString](#multipartformdata0boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Multipartformdata0BoxedString -public static final class Multipartformdata0BoxedString
-extends [Multipartformdata0Boxed](#multipartformdata0boxed) +public record Multipartformdata0BoxedString
+implements [Multipartformdata0Boxed](#multipartformdata0boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Multipartformdata0BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Multipartformdata0 public static class Multipartformdata0
@@ -341,4 +353,5 @@ String validatedPayload = MultipartformdataSchema.Multipartformdata0.validate( | ----------------- | ---------------------- | | String | validate(String arg, SchemaConfiguration configuration) | | [Multipartformdata0BoxedString](#multipartformdata0boxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | -| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | \ No newline at end of file +| [Multipartformdata0Boxed](#multipartformdata0boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | +| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | diff --git a/samples/client/petstore/java/docs/paths/fakejsonformdata/get/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.md b/samples/client/petstore/java/docs/paths/fakejsonformdata/get/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.md index 5ba79920aee..daf46a40db5 100644 --- a/samples/client/petstore/java/docs/paths/fakejsonformdata/get/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.md +++ b/samples/client/petstore/java/docs/paths/fakejsonformdata/get/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.md @@ -3,7 +3,7 @@ public class ApplicationxwwwformurlencodedSchema
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -11,40 +11,41 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1Boxed](#applicationxwwwformurlencodedschema1boxed)
abstract sealed validated payload class | -| static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1BoxedMap](#applicationxwwwformurlencodedschema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1Boxed](#applicationxwwwformurlencodedschema1boxed)
sealed interface for validated payloads | +| record | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1BoxedMap](#applicationxwwwformurlencodedschema1boxedmap)
boxed class to store validated Map payloads | | static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1](#applicationxwwwformurlencodedschema1)
schema class | | static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchemaMapBuilder](#applicationxwwwformurlencodedschemamapbuilder)
builder for Map payloads | | static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchemaMap](#applicationxwwwformurlencodedschemamap)
output class for Map payloads | -| static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedParam2Boxed](#applicationxwwwformurlencodedparam2boxed)
abstract sealed validated payload class | -| static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedParam2BoxedString](#applicationxwwwformurlencodedparam2boxedstring)
boxed class to store validated String payloads | +| sealed interface | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedParam2Boxed](#applicationxwwwformurlencodedparam2boxed)
sealed interface for validated payloads | +| record | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedParam2BoxedString](#applicationxwwwformurlencodedparam2boxedstring)
boxed class to store validated String payloads | | static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedParam2](#applicationxwwwformurlencodedparam2)
schema class | -| static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedParamBoxed](#applicationxwwwformurlencodedparamboxed)
abstract sealed validated payload class | -| static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedParamBoxedString](#applicationxwwwformurlencodedparamboxedstring)
boxed class to store validated String payloads | +| sealed interface | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedParamBoxed](#applicationxwwwformurlencodedparamboxed)
sealed interface for validated payloads | +| record | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedParamBoxedString](#applicationxwwwformurlencodedparamboxedstring)
boxed class to store validated String payloads | | static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedParam](#applicationxwwwformurlencodedparam)
schema class | ## ApplicationxwwwformurlencodedSchema1Boxed -public static abstract sealed class ApplicationxwwwformurlencodedSchema1Boxed
+public sealed interface ApplicationxwwwformurlencodedSchema1Boxed
permits
[ApplicationxwwwformurlencodedSchema1BoxedMap](#applicationxwwwformurlencodedschema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ApplicationxwwwformurlencodedSchema1BoxedMap -public static final class ApplicationxwwwformurlencodedSchema1BoxedMap
-extends [ApplicationxwwwformurlencodedSchema1Boxed](#applicationxwwwformurlencodedschema1boxed) +public record ApplicationxwwwformurlencodedSchema1BoxedMap
+implements [ApplicationxwwwformurlencodedSchema1Boxed](#applicationxwwwformurlencodedschema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ApplicationxwwwformurlencodedSchema1BoxedMap([ApplicationxwwwformurlencodedSchemaMap](#applicationxwwwformurlencodedschemamap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [ApplicationxwwwformurlencodedSchemaMap](#applicationxwwwformurlencodedschemamap) | data
validated payload | +| [ApplicationxwwwformurlencodedSchemaMap](#applicationxwwwformurlencodedschemamap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ApplicationxwwwformurlencodedSchema1 public static class ApplicationxwwwformurlencodedSchema1
@@ -92,7 +93,9 @@ ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchemaMap valid | ----------------- | ---------------------- | | [ApplicationxwwwformurlencodedSchemaMap](#applicationxwwwformurlencodedschemamap) | validate([Map<?, ?>](#applicationxwwwformurlencodedschemamapbuilder) arg, SchemaConfiguration configuration) | | [ApplicationxwwwformurlencodedSchema1BoxedMap](#applicationxwwwformurlencodedschema1boxedmap) | validateAndBox([Map<?, ?>](#applicationxwwwformurlencodedschemamapbuilder) arg, SchemaConfiguration configuration) | +| [ApplicationxwwwformurlencodedSchema1Boxed](#applicationxwwwformurlencodedschema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ApplicationxwwwformurlencodedSchemaMap00Builder public class ApplicationxwwwformurlencodedSchemaMap00Builder
builder for `Map` @@ -182,27 +185,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## ApplicationxwwwformurlencodedParam2Boxed -public static abstract sealed class ApplicationxwwwformurlencodedParam2Boxed
+public sealed interface ApplicationxwwwformurlencodedParam2Boxed
permits
[ApplicationxwwwformurlencodedParam2BoxedString](#applicationxwwwformurlencodedparam2boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ApplicationxwwwformurlencodedParam2BoxedString -public static final class ApplicationxwwwformurlencodedParam2BoxedString
-extends [ApplicationxwwwformurlencodedParam2Boxed](#applicationxwwwformurlencodedparam2boxed) +public record ApplicationxwwwformurlencodedParam2BoxedString
+implements [ApplicationxwwwformurlencodedParam2Boxed](#applicationxwwwformurlencodedparam2boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ApplicationxwwwformurlencodedParam2BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ApplicationxwwwformurlencodedParam2 public static class ApplicationxwwwformurlencodedParam2
@@ -219,27 +223,28 @@ field2 | validateAndBox | ## ApplicationxwwwformurlencodedParamBoxed -public static abstract sealed class ApplicationxwwwformurlencodedParamBoxed
+public sealed interface ApplicationxwwwformurlencodedParamBoxed
permits
[ApplicationxwwwformurlencodedParamBoxedString](#applicationxwwwformurlencodedparamboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ApplicationxwwwformurlencodedParamBoxedString -public static final class ApplicationxwwwformurlencodedParamBoxedString
-extends [ApplicationxwwwformurlencodedParamBoxed](#applicationxwwwformurlencodedparamboxed) +public record ApplicationxwwwformurlencodedParamBoxedString
+implements [ApplicationxwwwformurlencodedParamBoxed](#applicationxwwwformurlencodedparamboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ApplicationxwwwformurlencodedParamBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ApplicationxwwwformurlencodedParam public static class ApplicationxwwwformurlencodedParam
diff --git a/samples/client/petstore/java/docs/paths/fakejsonpatch/patch/requestbody/content/applicationjsonpatchjson/ApplicationjsonpatchjsonSchema.md b/samples/client/petstore/java/docs/paths/fakejsonpatch/patch/requestbody/content/applicationjsonpatchjson/ApplicationjsonpatchjsonSchema.md index 72998483ab7..d1984604169 100644 --- a/samples/client/petstore/java/docs/paths/fakejsonpatch/patch/requestbody/content/applicationjsonpatchjson/ApplicationjsonpatchjsonSchema.md +++ b/samples/client/petstore/java/docs/paths/fakejsonpatch/patch/requestbody/content/applicationjsonpatchjson/ApplicationjsonpatchjsonSchema.md @@ -4,7 +4,7 @@ extends [JSONPatchRequest1](../../../../../../../components/schemas/JSONPatchReq A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary diff --git a/samples/client/petstore/java/docs/paths/fakejsonwithcharset/post/requestbody/content/applicationjsoncharsetutf8/Applicationjsoncharsetutf8Schema.md b/samples/client/petstore/java/docs/paths/fakejsonwithcharset/post/requestbody/content/applicationjsoncharsetutf8/Applicationjsoncharsetutf8Schema.md index c73738de19e..1465105b55d 100644 --- a/samples/client/petstore/java/docs/paths/fakejsonwithcharset/post/requestbody/content/applicationjsoncharsetutf8/Applicationjsoncharsetutf8Schema.md +++ b/samples/client/petstore/java/docs/paths/fakejsonwithcharset/post/requestbody/content/applicationjsoncharsetutf8/Applicationjsoncharsetutf8Schema.md @@ -3,23 +3,23 @@ public class Applicationjsoncharsetutf8Schema
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Applicationjsoncharsetutf8Schema.Applicationjsoncharsetutf8Schema1Boxed](#applicationjsoncharsetutf8schema1boxed)
abstract sealed validated payload class | -| static class | [Applicationjsoncharsetutf8Schema.Applicationjsoncharsetutf8Schema1BoxedVoid](#applicationjsoncharsetutf8schema1boxedvoid)
boxed class to store validated null payloads | -| static class | [Applicationjsoncharsetutf8Schema.Applicationjsoncharsetutf8Schema1BoxedBoolean](#applicationjsoncharsetutf8schema1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [Applicationjsoncharsetutf8Schema.Applicationjsoncharsetutf8Schema1BoxedNumber](#applicationjsoncharsetutf8schema1boxednumber)
boxed class to store validated Number payloads | -| static class | [Applicationjsoncharsetutf8Schema.Applicationjsoncharsetutf8Schema1BoxedString](#applicationjsoncharsetutf8schema1boxedstring)
boxed class to store validated String payloads | -| static class | [Applicationjsoncharsetutf8Schema.Applicationjsoncharsetutf8Schema1BoxedList](#applicationjsoncharsetutf8schema1boxedlist)
boxed class to store validated List payloads | -| static class | [Applicationjsoncharsetutf8Schema.Applicationjsoncharsetutf8Schema1BoxedMap](#applicationjsoncharsetutf8schema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [Applicationjsoncharsetutf8Schema.Applicationjsoncharsetutf8Schema1Boxed](#applicationjsoncharsetutf8schema1boxed)
sealed interface for validated payloads | +| record | [Applicationjsoncharsetutf8Schema.Applicationjsoncharsetutf8Schema1BoxedVoid](#applicationjsoncharsetutf8schema1boxedvoid)
boxed class to store validated null payloads | +| record | [Applicationjsoncharsetutf8Schema.Applicationjsoncharsetutf8Schema1BoxedBoolean](#applicationjsoncharsetutf8schema1boxedboolean)
boxed class to store validated boolean payloads | +| record | [Applicationjsoncharsetutf8Schema.Applicationjsoncharsetutf8Schema1BoxedNumber](#applicationjsoncharsetutf8schema1boxednumber)
boxed class to store validated Number payloads | +| record | [Applicationjsoncharsetutf8Schema.Applicationjsoncharsetutf8Schema1BoxedString](#applicationjsoncharsetutf8schema1boxedstring)
boxed class to store validated String payloads | +| record | [Applicationjsoncharsetutf8Schema.Applicationjsoncharsetutf8Schema1BoxedList](#applicationjsoncharsetutf8schema1boxedlist)
boxed class to store validated List payloads | +| record | [Applicationjsoncharsetutf8Schema.Applicationjsoncharsetutf8Schema1BoxedMap](#applicationjsoncharsetutf8schema1boxedmap)
boxed class to store validated Map payloads | | static class | [Applicationjsoncharsetutf8Schema.Applicationjsoncharsetutf8Schema1](#applicationjsoncharsetutf8schema1)
schema class | ## Applicationjsoncharsetutf8Schema1Boxed -public static abstract sealed class Applicationjsoncharsetutf8Schema1Boxed
+public sealed interface Applicationjsoncharsetutf8Schema1Boxed
permits
[Applicationjsoncharsetutf8Schema1BoxedVoid](#applicationjsoncharsetutf8schema1boxedvoid), [Applicationjsoncharsetutf8Schema1BoxedBoolean](#applicationjsoncharsetutf8schema1boxedboolean), @@ -28,103 +28,109 @@ permits
[Applicationjsoncharsetutf8Schema1BoxedList](#applicationjsoncharsetutf8schema1boxedlist), [Applicationjsoncharsetutf8Schema1BoxedMap](#applicationjsoncharsetutf8schema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Applicationjsoncharsetutf8Schema1BoxedVoid -public static final class Applicationjsoncharsetutf8Schema1BoxedVoid
-extends [Applicationjsoncharsetutf8Schema1Boxed](#applicationjsoncharsetutf8schema1boxed) +public record Applicationjsoncharsetutf8Schema1BoxedVoid
+implements [Applicationjsoncharsetutf8Schema1Boxed](#applicationjsoncharsetutf8schema1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Applicationjsoncharsetutf8Schema1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Applicationjsoncharsetutf8Schema1BoxedBoolean -public static final class Applicationjsoncharsetutf8Schema1BoxedBoolean
-extends [Applicationjsoncharsetutf8Schema1Boxed](#applicationjsoncharsetutf8schema1boxed) +public record Applicationjsoncharsetutf8Schema1BoxedBoolean
+implements [Applicationjsoncharsetutf8Schema1Boxed](#applicationjsoncharsetutf8schema1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Applicationjsoncharsetutf8Schema1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Applicationjsoncharsetutf8Schema1BoxedNumber -public static final class Applicationjsoncharsetutf8Schema1BoxedNumber
-extends [Applicationjsoncharsetutf8Schema1Boxed](#applicationjsoncharsetutf8schema1boxed) +public record Applicationjsoncharsetutf8Schema1BoxedNumber
+implements [Applicationjsoncharsetutf8Schema1Boxed](#applicationjsoncharsetutf8schema1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Applicationjsoncharsetutf8Schema1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Applicationjsoncharsetutf8Schema1BoxedString -public static final class Applicationjsoncharsetutf8Schema1BoxedString
-extends [Applicationjsoncharsetutf8Schema1Boxed](#applicationjsoncharsetutf8schema1boxed) +public record Applicationjsoncharsetutf8Schema1BoxedString
+implements [Applicationjsoncharsetutf8Schema1Boxed](#applicationjsoncharsetutf8schema1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Applicationjsoncharsetutf8Schema1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Applicationjsoncharsetutf8Schema1BoxedList -public static final class Applicationjsoncharsetutf8Schema1BoxedList
-extends [Applicationjsoncharsetutf8Schema1Boxed](#applicationjsoncharsetutf8schema1boxed) +public record Applicationjsoncharsetutf8Schema1BoxedList
+implements [Applicationjsoncharsetutf8Schema1Boxed](#applicationjsoncharsetutf8schema1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Applicationjsoncharsetutf8Schema1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Applicationjsoncharsetutf8Schema1BoxedMap -public static final class Applicationjsoncharsetutf8Schema1BoxedMap
-extends [Applicationjsoncharsetutf8Schema1Boxed](#applicationjsoncharsetutf8schema1boxed) +public record Applicationjsoncharsetutf8Schema1BoxedMap
+implements [Applicationjsoncharsetutf8Schema1Boxed](#applicationjsoncharsetutf8schema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Applicationjsoncharsetutf8Schema1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Applicationjsoncharsetutf8Schema1 public static class Applicationjsoncharsetutf8Schema1
diff --git a/samples/client/petstore/java/docs/paths/fakejsonwithcharset/post/responses/code200response/content/applicationjsoncharsetutf8/Applicationjsoncharsetutf8Schema.md b/samples/client/petstore/java/docs/paths/fakejsonwithcharset/post/responses/code200response/content/applicationjsoncharsetutf8/Applicationjsoncharsetutf8Schema.md new file mode 100644 index 00000000000..1465105b55d --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakejsonwithcharset/post/responses/code200response/content/applicationjsoncharsetutf8/Applicationjsoncharsetutf8Schema.md @@ -0,0 +1,144 @@ +# Applicationjsoncharsetutf8Schema +public class Applicationjsoncharsetutf8Schema
+ +A class that contains necessary nested +- schema classes (which validate payloads), extends JsonSchema +- sealed interfaces which store validated payloads, java version of a sum type +- boxed classes which store validated payloads, sealed permits class implementations + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | ---------------------- | +| sealed interface | [Applicationjsoncharsetutf8Schema.Applicationjsoncharsetutf8Schema1Boxed](#applicationjsoncharsetutf8schema1boxed)
sealed interface for validated payloads | +| record | [Applicationjsoncharsetutf8Schema.Applicationjsoncharsetutf8Schema1BoxedVoid](#applicationjsoncharsetutf8schema1boxedvoid)
boxed class to store validated null payloads | +| record | [Applicationjsoncharsetutf8Schema.Applicationjsoncharsetutf8Schema1BoxedBoolean](#applicationjsoncharsetutf8schema1boxedboolean)
boxed class to store validated boolean payloads | +| record | [Applicationjsoncharsetutf8Schema.Applicationjsoncharsetutf8Schema1BoxedNumber](#applicationjsoncharsetutf8schema1boxednumber)
boxed class to store validated Number payloads | +| record | [Applicationjsoncharsetutf8Schema.Applicationjsoncharsetutf8Schema1BoxedString](#applicationjsoncharsetutf8schema1boxedstring)
boxed class to store validated String payloads | +| record | [Applicationjsoncharsetutf8Schema.Applicationjsoncharsetutf8Schema1BoxedList](#applicationjsoncharsetutf8schema1boxedlist)
boxed class to store validated List payloads | +| record | [Applicationjsoncharsetutf8Schema.Applicationjsoncharsetutf8Schema1BoxedMap](#applicationjsoncharsetutf8schema1boxedmap)
boxed class to store validated Map payloads | +| static class | [Applicationjsoncharsetutf8Schema.Applicationjsoncharsetutf8Schema1](#applicationjsoncharsetutf8schema1)
schema class | + +## Applicationjsoncharsetutf8Schema1Boxed +public sealed interface Applicationjsoncharsetutf8Schema1Boxed
+permits
+[Applicationjsoncharsetutf8Schema1BoxedVoid](#applicationjsoncharsetutf8schema1boxedvoid), +[Applicationjsoncharsetutf8Schema1BoxedBoolean](#applicationjsoncharsetutf8schema1boxedboolean), +[Applicationjsoncharsetutf8Schema1BoxedNumber](#applicationjsoncharsetutf8schema1boxednumber), +[Applicationjsoncharsetutf8Schema1BoxedString](#applicationjsoncharsetutf8schema1boxedstring), +[Applicationjsoncharsetutf8Schema1BoxedList](#applicationjsoncharsetutf8schema1boxedlist), +[Applicationjsoncharsetutf8Schema1BoxedMap](#applicationjsoncharsetutf8schema1boxedmap) + +sealed interface that stores validated payloads using boxed classes + +## Applicationjsoncharsetutf8Schema1BoxedVoid +public record Applicationjsoncharsetutf8Schema1BoxedVoid
+implements [Applicationjsoncharsetutf8Schema1Boxed](#applicationjsoncharsetutf8schema1boxed) + +record that stores validated null payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Applicationjsoncharsetutf8Schema1BoxedVoid(Void data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## Applicationjsoncharsetutf8Schema1BoxedBoolean +public record Applicationjsoncharsetutf8Schema1BoxedBoolean
+implements [Applicationjsoncharsetutf8Schema1Boxed](#applicationjsoncharsetutf8schema1boxed) + +record that stores validated boolean payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Applicationjsoncharsetutf8Schema1BoxedBoolean(boolean data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## Applicationjsoncharsetutf8Schema1BoxedNumber +public record Applicationjsoncharsetutf8Schema1BoxedNumber
+implements [Applicationjsoncharsetutf8Schema1Boxed](#applicationjsoncharsetutf8schema1boxed) + +record that stores validated Number payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Applicationjsoncharsetutf8Schema1BoxedNumber(Number data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## Applicationjsoncharsetutf8Schema1BoxedString +public record Applicationjsoncharsetutf8Schema1BoxedString
+implements [Applicationjsoncharsetutf8Schema1Boxed](#applicationjsoncharsetutf8schema1boxed) + +record that stores validated String payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Applicationjsoncharsetutf8Schema1BoxedString(String data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## Applicationjsoncharsetutf8Schema1BoxedList +public record Applicationjsoncharsetutf8Schema1BoxedList
+implements [Applicationjsoncharsetutf8Schema1Boxed](#applicationjsoncharsetutf8schema1boxed) + +record that stores validated List payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Applicationjsoncharsetutf8Schema1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## Applicationjsoncharsetutf8Schema1BoxedMap +public record Applicationjsoncharsetutf8Schema1BoxedMap
+implements [Applicationjsoncharsetutf8Schema1Boxed](#applicationjsoncharsetutf8schema1boxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Applicationjsoncharsetutf8Schema1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## Applicationjsoncharsetutf8Schema1 +public static class Applicationjsoncharsetutf8Schema1
+extends AnyTypeJsonSchema.AnyTypeJsonSchema1 + +A schema class that validates payloads + +| Methods Inherited from class org.openapijsonschematools.client.schemas.AnyTypeJsonSchema.AnyTypeJsonSchema1 | +| ------------------------------------------------------------------ | +| validate | +| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/fakejsonwithcharset/post/responses/response200/content/applicationjsoncharsetutf8/Applicationjsoncharsetutf8Schema.md b/samples/client/petstore/java/docs/paths/fakejsonwithcharset/post/responses/response200/content/applicationjsoncharsetutf8/Applicationjsoncharsetutf8Schema.md deleted file mode 100644 index c73738de19e..00000000000 --- a/samples/client/petstore/java/docs/paths/fakejsonwithcharset/post/responses/response200/content/applicationjsoncharsetutf8/Applicationjsoncharsetutf8Schema.md +++ /dev/null @@ -1,138 +0,0 @@ -# Applicationjsoncharsetutf8Schema -public class Applicationjsoncharsetutf8Schema
- -A class that contains necessary nested -- schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type -- boxed classes which store validated payloads, sealed permits class implementations - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | ---------------------- | -| static class | [Applicationjsoncharsetutf8Schema.Applicationjsoncharsetutf8Schema1Boxed](#applicationjsoncharsetutf8schema1boxed)
abstract sealed validated payload class | -| static class | [Applicationjsoncharsetutf8Schema.Applicationjsoncharsetutf8Schema1BoxedVoid](#applicationjsoncharsetutf8schema1boxedvoid)
boxed class to store validated null payloads | -| static class | [Applicationjsoncharsetutf8Schema.Applicationjsoncharsetutf8Schema1BoxedBoolean](#applicationjsoncharsetutf8schema1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [Applicationjsoncharsetutf8Schema.Applicationjsoncharsetutf8Schema1BoxedNumber](#applicationjsoncharsetutf8schema1boxednumber)
boxed class to store validated Number payloads | -| static class | [Applicationjsoncharsetutf8Schema.Applicationjsoncharsetutf8Schema1BoxedString](#applicationjsoncharsetutf8schema1boxedstring)
boxed class to store validated String payloads | -| static class | [Applicationjsoncharsetutf8Schema.Applicationjsoncharsetutf8Schema1BoxedList](#applicationjsoncharsetutf8schema1boxedlist)
boxed class to store validated List payloads | -| static class | [Applicationjsoncharsetutf8Schema.Applicationjsoncharsetutf8Schema1BoxedMap](#applicationjsoncharsetutf8schema1boxedmap)
boxed class to store validated Map payloads | -| static class | [Applicationjsoncharsetutf8Schema.Applicationjsoncharsetutf8Schema1](#applicationjsoncharsetutf8schema1)
schema class | - -## Applicationjsoncharsetutf8Schema1Boxed -public static abstract sealed class Applicationjsoncharsetutf8Schema1Boxed
-permits
-[Applicationjsoncharsetutf8Schema1BoxedVoid](#applicationjsoncharsetutf8schema1boxedvoid), -[Applicationjsoncharsetutf8Schema1BoxedBoolean](#applicationjsoncharsetutf8schema1boxedboolean), -[Applicationjsoncharsetutf8Schema1BoxedNumber](#applicationjsoncharsetutf8schema1boxednumber), -[Applicationjsoncharsetutf8Schema1BoxedString](#applicationjsoncharsetutf8schema1boxedstring), -[Applicationjsoncharsetutf8Schema1BoxedList](#applicationjsoncharsetutf8schema1boxedlist), -[Applicationjsoncharsetutf8Schema1BoxedMap](#applicationjsoncharsetutf8schema1boxedmap) - -abstract sealed class that stores validated payloads using boxed classes - -## Applicationjsoncharsetutf8Schema1BoxedVoid -public static final class Applicationjsoncharsetutf8Schema1BoxedVoid
-extends [Applicationjsoncharsetutf8Schema1Boxed](#applicationjsoncharsetutf8schema1boxed) - -a boxed class to store validated null payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Applicationjsoncharsetutf8Schema1BoxedVoid(Void data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| Void | data
validated payload | - -## Applicationjsoncharsetutf8Schema1BoxedBoolean -public static final class Applicationjsoncharsetutf8Schema1BoxedBoolean
-extends [Applicationjsoncharsetutf8Schema1Boxed](#applicationjsoncharsetutf8schema1boxed) - -a boxed class to store validated boolean payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Applicationjsoncharsetutf8Schema1BoxedBoolean(boolean data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| boolean | data
validated payload | - -## Applicationjsoncharsetutf8Schema1BoxedNumber -public static final class Applicationjsoncharsetutf8Schema1BoxedNumber
-extends [Applicationjsoncharsetutf8Schema1Boxed](#applicationjsoncharsetutf8schema1boxed) - -a boxed class to store validated Number payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Applicationjsoncharsetutf8Schema1BoxedNumber(Number data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| Number | data
validated payload | - -## Applicationjsoncharsetutf8Schema1BoxedString -public static final class Applicationjsoncharsetutf8Schema1BoxedString
-extends [Applicationjsoncharsetutf8Schema1Boxed](#applicationjsoncharsetutf8schema1boxed) - -a boxed class to store validated String payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Applicationjsoncharsetutf8Schema1BoxedString(String data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| String | data
validated payload | - -## Applicationjsoncharsetutf8Schema1BoxedList -public static final class Applicationjsoncharsetutf8Schema1BoxedList
-extends [Applicationjsoncharsetutf8Schema1Boxed](#applicationjsoncharsetutf8schema1boxed) - -a boxed class to store validated List payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Applicationjsoncharsetutf8Schema1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | - -## Applicationjsoncharsetutf8Schema1BoxedMap -public static final class Applicationjsoncharsetutf8Schema1BoxedMap
-extends [Applicationjsoncharsetutf8Schema1Boxed](#applicationjsoncharsetutf8schema1boxed) - -a boxed class to store validated Map payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Applicationjsoncharsetutf8Schema1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | - -## Applicationjsoncharsetutf8Schema1 -public static class Applicationjsoncharsetutf8Schema1
-extends AnyTypeJsonSchema.AnyTypeJsonSchema1 - -A schema class that validates payloads - -| Methods Inherited from class org.openapijsonschematools.client.schemas.AnyTypeJsonSchema.AnyTypeJsonSchema1 | -| ------------------------------------------------------------------ | -| validate | -| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/fakemultiplerequestbodycontenttypes/post/requestbody/content/applicationjson/ApplicationjsonSchema.md b/samples/client/petstore/java/docs/paths/fakemultiplerequestbodycontenttypes/post/requestbody/content/applicationjson/ApplicationjsonSchema.md index 6025f8e4614..a6b2289a5c2 100644 --- a/samples/client/petstore/java/docs/paths/fakemultiplerequestbodycontenttypes/post/requestbody/content/applicationjson/ApplicationjsonSchema.md +++ b/samples/client/petstore/java/docs/paths/fakemultiplerequestbodycontenttypes/post/requestbody/content/applicationjson/ApplicationjsonSchema.md @@ -3,7 +3,7 @@ public class ApplicationjsonSchema
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -11,37 +11,38 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed)
abstract sealed validated payload class | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ApplicationjsonSchema.ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed)
sealed interface for validated payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap)
boxed class to store validated Map payloads | | static class | [ApplicationjsonSchema.ApplicationjsonSchema1](#applicationjsonschema1)
schema class | | static class | [ApplicationjsonSchema.ApplicationjsonSchemaMapBuilder](#applicationjsonschemamapbuilder)
builder for Map payloads | | static class | [ApplicationjsonSchema.ApplicationjsonSchemaMap](#applicationjsonschemamap)
output class for Map payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonABoxed](#applicationjsonaboxed)
abstract sealed validated payload class | -| static class | [ApplicationjsonSchema.ApplicationjsonABoxedString](#applicationjsonaboxedstring)
boxed class to store validated String payloads | +| sealed interface | [ApplicationjsonSchema.ApplicationjsonABoxed](#applicationjsonaboxed)
sealed interface for validated payloads | +| record | [ApplicationjsonSchema.ApplicationjsonABoxedString](#applicationjsonaboxedstring)
boxed class to store validated String payloads | | static class | [ApplicationjsonSchema.ApplicationjsonA](#applicationjsona)
schema class | ## ApplicationjsonSchema1Boxed -public static abstract sealed class ApplicationjsonSchema1Boxed
+public sealed interface ApplicationjsonSchema1Boxed
permits
[ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ApplicationjsonSchema1BoxedMap -public static final class ApplicationjsonSchema1BoxedMap
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) +public record ApplicationjsonSchema1BoxedMap
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ApplicationjsonSchema1BoxedMap([ApplicationjsonSchemaMap](#applicationjsonschemamap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [ApplicationjsonSchemaMap](#applicationjsonschemamap) | data
validated payload | +| [ApplicationjsonSchemaMap](#applicationjsonschemamap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ApplicationjsonSchema1 public static class ApplicationjsonSchema1
@@ -86,7 +87,9 @@ ApplicationjsonSchema.ApplicationjsonSchemaMap validatedPayload = | ----------------- | ---------------------- | | [ApplicationjsonSchemaMap](#applicationjsonschemamap) | validate([Map<?, ?>](#applicationjsonschemamapbuilder) arg, SchemaConfiguration configuration) | | [ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap) | validateAndBox([Map<?, ?>](#applicationjsonschemamapbuilder) arg, SchemaConfiguration configuration) | +| [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ApplicationjsonSchemaMapBuilder public class ApplicationjsonSchemaMapBuilder
builder for `Map` @@ -127,27 +130,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## ApplicationjsonABoxed -public static abstract sealed class ApplicationjsonABoxed
+public sealed interface ApplicationjsonABoxed
permits
[ApplicationjsonABoxedString](#applicationjsonaboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ApplicationjsonABoxedString -public static final class ApplicationjsonABoxedString
-extends [ApplicationjsonABoxed](#applicationjsonaboxed) +public record ApplicationjsonABoxedString
+implements [ApplicationjsonABoxed](#applicationjsonaboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ApplicationjsonABoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ApplicationjsonA public static class ApplicationjsonA
diff --git a/samples/client/petstore/java/docs/paths/fakemultiplerequestbodycontenttypes/post/requestbody/content/multipartformdata/MultipartformdataSchema.md b/samples/client/petstore/java/docs/paths/fakemultiplerequestbodycontenttypes/post/requestbody/content/multipartformdata/MultipartformdataSchema.md index 4debc7ab000..6e389170b4b 100644 --- a/samples/client/petstore/java/docs/paths/fakemultiplerequestbodycontenttypes/post/requestbody/content/multipartformdata/MultipartformdataSchema.md +++ b/samples/client/petstore/java/docs/paths/fakemultiplerequestbodycontenttypes/post/requestbody/content/multipartformdata/MultipartformdataSchema.md @@ -3,7 +3,7 @@ public class MultipartformdataSchema
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -11,37 +11,38 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [MultipartformdataSchema.MultipartformdataSchema1Boxed](#multipartformdataschema1boxed)
abstract sealed validated payload class | -| static class | [MultipartformdataSchema.MultipartformdataSchema1BoxedMap](#multipartformdataschema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [MultipartformdataSchema.MultipartformdataSchema1Boxed](#multipartformdataschema1boxed)
sealed interface for validated payloads | +| record | [MultipartformdataSchema.MultipartformdataSchema1BoxedMap](#multipartformdataschema1boxedmap)
boxed class to store validated Map payloads | | static class | [MultipartformdataSchema.MultipartformdataSchema1](#multipartformdataschema1)
schema class | | static class | [MultipartformdataSchema.MultipartformdataSchemaMapBuilder](#multipartformdataschemamapbuilder)
builder for Map payloads | | static class | [MultipartformdataSchema.MultipartformdataSchemaMap](#multipartformdataschemamap)
output class for Map payloads | -| static class | [MultipartformdataSchema.MultipartformdataBBoxed](#multipartformdatabboxed)
abstract sealed validated payload class | -| static class | [MultipartformdataSchema.MultipartformdataBBoxedString](#multipartformdatabboxedstring)
boxed class to store validated String payloads | +| sealed interface | [MultipartformdataSchema.MultipartformdataBBoxed](#multipartformdatabboxed)
sealed interface for validated payloads | +| record | [MultipartformdataSchema.MultipartformdataBBoxedString](#multipartformdatabboxedstring)
boxed class to store validated String payloads | | static class | [MultipartformdataSchema.MultipartformdataB](#multipartformdatab)
schema class | ## MultipartformdataSchema1Boxed -public static abstract sealed class MultipartformdataSchema1Boxed
+public sealed interface MultipartformdataSchema1Boxed
permits
[MultipartformdataSchema1BoxedMap](#multipartformdataschema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## MultipartformdataSchema1BoxedMap -public static final class MultipartformdataSchema1BoxedMap
-extends [MultipartformdataSchema1Boxed](#multipartformdataschema1boxed) +public record MultipartformdataSchema1BoxedMap
+implements [MultipartformdataSchema1Boxed](#multipartformdataschema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MultipartformdataSchema1BoxedMap([MultipartformdataSchemaMap](#multipartformdataschemamap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [MultipartformdataSchemaMap](#multipartformdataschemamap) | data
validated payload | +| [MultipartformdataSchemaMap](#multipartformdataschemamap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MultipartformdataSchema1 public static class MultipartformdataSchema1
@@ -86,7 +87,9 @@ MultipartformdataSchema.MultipartformdataSchemaMap validatedPayload = | ----------------- | ---------------------- | | [MultipartformdataSchemaMap](#multipartformdataschemamap) | validate([Map<?, ?>](#multipartformdataschemamapbuilder) arg, SchemaConfiguration configuration) | | [MultipartformdataSchema1BoxedMap](#multipartformdataschema1boxedmap) | validateAndBox([Map<?, ?>](#multipartformdataschemamapbuilder) arg, SchemaConfiguration configuration) | +| [MultipartformdataSchema1Boxed](#multipartformdataschema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## MultipartformdataSchemaMapBuilder public class MultipartformdataSchemaMapBuilder
builder for `Map` @@ -127,27 +130,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## MultipartformdataBBoxed -public static abstract sealed class MultipartformdataBBoxed
+public sealed interface MultipartformdataBBoxed
permits
[MultipartformdataBBoxedString](#multipartformdatabboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## MultipartformdataBBoxedString -public static final class MultipartformdataBBoxedString
-extends [MultipartformdataBBoxed](#multipartformdatabboxed) +public record MultipartformdataBBoxedString
+implements [MultipartformdataBBoxed](#multipartformdatabboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MultipartformdataBBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MultipartformdataB public static class MultipartformdataB
diff --git a/samples/client/petstore/java/docs/paths/fakemultiplerequestbodycontenttypes/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md b/samples/client/petstore/java/docs/paths/fakemultiplerequestbodycontenttypes/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md new file mode 100644 index 00000000000..98eb062fdd7 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakemultiplerequestbodycontenttypes/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md @@ -0,0 +1,144 @@ +# ApplicationjsonSchema +public class ApplicationjsonSchema
+ +A class that contains necessary nested +- schema classes (which validate payloads), extends JsonSchema +- sealed interfaces which store validated payloads, java version of a sum type +- boxed classes which store validated payloads, sealed permits class implementations + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | ---------------------- | +| sealed interface | [ApplicationjsonSchema.ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed)
sealed interface for validated payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedVoid](#applicationjsonschema1boxedvoid)
boxed class to store validated null payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedBoolean](#applicationjsonschema1boxedboolean)
boxed class to store validated boolean payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedNumber](#applicationjsonschema1boxednumber)
boxed class to store validated Number payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedString](#applicationjsonschema1boxedstring)
boxed class to store validated String payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedList](#applicationjsonschema1boxedlist)
boxed class to store validated List payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap)
boxed class to store validated Map payloads | +| static class | [ApplicationjsonSchema.ApplicationjsonSchema1](#applicationjsonschema1)
schema class | + +## ApplicationjsonSchema1Boxed +public sealed interface ApplicationjsonSchema1Boxed
+permits
+[ApplicationjsonSchema1BoxedVoid](#applicationjsonschema1boxedvoid), +[ApplicationjsonSchema1BoxedBoolean](#applicationjsonschema1boxedboolean), +[ApplicationjsonSchema1BoxedNumber](#applicationjsonschema1boxednumber), +[ApplicationjsonSchema1BoxedString](#applicationjsonschema1boxedstring), +[ApplicationjsonSchema1BoxedList](#applicationjsonschema1boxedlist), +[ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap) + +sealed interface that stores validated payloads using boxed classes + +## ApplicationjsonSchema1BoxedVoid +public record ApplicationjsonSchema1BoxedVoid
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) + +record that stores validated null payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonSchema1BoxedVoid(Void data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## ApplicationjsonSchema1BoxedBoolean +public record ApplicationjsonSchema1BoxedBoolean
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) + +record that stores validated boolean payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonSchema1BoxedBoolean(boolean data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## ApplicationjsonSchema1BoxedNumber +public record ApplicationjsonSchema1BoxedNumber
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) + +record that stores validated Number payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonSchema1BoxedNumber(Number data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## ApplicationjsonSchema1BoxedString +public record ApplicationjsonSchema1BoxedString
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) + +record that stores validated String payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonSchema1BoxedString(String data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## ApplicationjsonSchema1BoxedList +public record ApplicationjsonSchema1BoxedList
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) + +record that stores validated List payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonSchema1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## ApplicationjsonSchema1BoxedMap +public record ApplicationjsonSchema1BoxedMap
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonSchema1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## ApplicationjsonSchema1 +public static class ApplicationjsonSchema1
+extends AnyTypeJsonSchema.AnyTypeJsonSchema1 + +A schema class that validates payloads + +| Methods Inherited from class org.openapijsonschematools.client.schemas.AnyTypeJsonSchema.AnyTypeJsonSchema1 | +| ------------------------------------------------------------------ | +| validate | +| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/fakemultiplerequestbodycontenttypes/post/responses/response200/content/applicationjson/ApplicationjsonSchema.md b/samples/client/petstore/java/docs/paths/fakemultiplerequestbodycontenttypes/post/responses/response200/content/applicationjson/ApplicationjsonSchema.md deleted file mode 100644 index 53da126ffca..00000000000 --- a/samples/client/petstore/java/docs/paths/fakemultiplerequestbodycontenttypes/post/responses/response200/content/applicationjson/ApplicationjsonSchema.md +++ /dev/null @@ -1,138 +0,0 @@ -# ApplicationjsonSchema -public class ApplicationjsonSchema
- -A class that contains necessary nested -- schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type -- boxed classes which store validated payloads, sealed permits class implementations - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | ---------------------- | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed)
abstract sealed validated payload class | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedVoid](#applicationjsonschema1boxedvoid)
boxed class to store validated null payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedBoolean](#applicationjsonschema1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedNumber](#applicationjsonschema1boxednumber)
boxed class to store validated Number payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedString](#applicationjsonschema1boxedstring)
boxed class to store validated String payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedList](#applicationjsonschema1boxedlist)
boxed class to store validated List payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap)
boxed class to store validated Map payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1](#applicationjsonschema1)
schema class | - -## ApplicationjsonSchema1Boxed -public static abstract sealed class ApplicationjsonSchema1Boxed
-permits
-[ApplicationjsonSchema1BoxedVoid](#applicationjsonschema1boxedvoid), -[ApplicationjsonSchema1BoxedBoolean](#applicationjsonschema1boxedboolean), -[ApplicationjsonSchema1BoxedNumber](#applicationjsonschema1boxednumber), -[ApplicationjsonSchema1BoxedString](#applicationjsonschema1boxedstring), -[ApplicationjsonSchema1BoxedList](#applicationjsonschema1boxedlist), -[ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap) - -abstract sealed class that stores validated payloads using boxed classes - -## ApplicationjsonSchema1BoxedVoid -public static final class ApplicationjsonSchema1BoxedVoid
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) - -a boxed class to store validated null payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonSchema1BoxedVoid(Void data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| Void | data
validated payload | - -## ApplicationjsonSchema1BoxedBoolean -public static final class ApplicationjsonSchema1BoxedBoolean
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) - -a boxed class to store validated boolean payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonSchema1BoxedBoolean(boolean data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| boolean | data
validated payload | - -## ApplicationjsonSchema1BoxedNumber -public static final class ApplicationjsonSchema1BoxedNumber
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) - -a boxed class to store validated Number payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonSchema1BoxedNumber(Number data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| Number | data
validated payload | - -## ApplicationjsonSchema1BoxedString -public static final class ApplicationjsonSchema1BoxedString
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) - -a boxed class to store validated String payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonSchema1BoxedString(String data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| String | data
validated payload | - -## ApplicationjsonSchema1BoxedList -public static final class ApplicationjsonSchema1BoxedList
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) - -a boxed class to store validated List payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonSchema1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | - -## ApplicationjsonSchema1BoxedMap -public static final class ApplicationjsonSchema1BoxedMap
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) - -a boxed class to store validated Map payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonSchema1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | - -## ApplicationjsonSchema1 -public static class ApplicationjsonSchema1
-extends AnyTypeJsonSchema.AnyTypeJsonSchema1 - -A schema class that validates payloads - -| Methods Inherited from class org.openapijsonschematools.client.schemas.AnyTypeJsonSchema.AnyTypeJsonSchema1 | -| ------------------------------------------------------------------ | -| validate | -| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/fakemultipleresponsebodies/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md b/samples/client/petstore/java/docs/paths/fakemultipleresponsebodies/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md new file mode 100644 index 00000000000..98eb062fdd7 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakemultipleresponsebodies/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md @@ -0,0 +1,144 @@ +# ApplicationjsonSchema +public class ApplicationjsonSchema
+ +A class that contains necessary nested +- schema classes (which validate payloads), extends JsonSchema +- sealed interfaces which store validated payloads, java version of a sum type +- boxed classes which store validated payloads, sealed permits class implementations + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | ---------------------- | +| sealed interface | [ApplicationjsonSchema.ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed)
sealed interface for validated payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedVoid](#applicationjsonschema1boxedvoid)
boxed class to store validated null payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedBoolean](#applicationjsonschema1boxedboolean)
boxed class to store validated boolean payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedNumber](#applicationjsonschema1boxednumber)
boxed class to store validated Number payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedString](#applicationjsonschema1boxedstring)
boxed class to store validated String payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedList](#applicationjsonschema1boxedlist)
boxed class to store validated List payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap)
boxed class to store validated Map payloads | +| static class | [ApplicationjsonSchema.ApplicationjsonSchema1](#applicationjsonschema1)
schema class | + +## ApplicationjsonSchema1Boxed +public sealed interface ApplicationjsonSchema1Boxed
+permits
+[ApplicationjsonSchema1BoxedVoid](#applicationjsonschema1boxedvoid), +[ApplicationjsonSchema1BoxedBoolean](#applicationjsonschema1boxedboolean), +[ApplicationjsonSchema1BoxedNumber](#applicationjsonschema1boxednumber), +[ApplicationjsonSchema1BoxedString](#applicationjsonschema1boxedstring), +[ApplicationjsonSchema1BoxedList](#applicationjsonschema1boxedlist), +[ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap) + +sealed interface that stores validated payloads using boxed classes + +## ApplicationjsonSchema1BoxedVoid +public record ApplicationjsonSchema1BoxedVoid
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) + +record that stores validated null payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonSchema1BoxedVoid(Void data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## ApplicationjsonSchema1BoxedBoolean +public record ApplicationjsonSchema1BoxedBoolean
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) + +record that stores validated boolean payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonSchema1BoxedBoolean(boolean data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## ApplicationjsonSchema1BoxedNumber +public record ApplicationjsonSchema1BoxedNumber
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) + +record that stores validated Number payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonSchema1BoxedNumber(Number data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## ApplicationjsonSchema1BoxedString +public record ApplicationjsonSchema1BoxedString
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) + +record that stores validated String payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonSchema1BoxedString(String data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## ApplicationjsonSchema1BoxedList +public record ApplicationjsonSchema1BoxedList
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) + +record that stores validated List payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonSchema1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## ApplicationjsonSchema1BoxedMap +public record ApplicationjsonSchema1BoxedMap
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonSchema1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## ApplicationjsonSchema1 +public static class ApplicationjsonSchema1
+extends AnyTypeJsonSchema.AnyTypeJsonSchema1 + +A schema class that validates payloads + +| Methods Inherited from class org.openapijsonschematools.client.schemas.AnyTypeJsonSchema.AnyTypeJsonSchema1 | +| ------------------------------------------------------------------ | +| validate | +| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/fakemultipleresponsebodies/get/responses/code202response/content/applicationjson/ApplicationjsonSchema.md b/samples/client/petstore/java/docs/paths/fakemultipleresponsebodies/get/responses/code202response/content/applicationjson/ApplicationjsonSchema.md new file mode 100644 index 00000000000..98eb062fdd7 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakemultipleresponsebodies/get/responses/code202response/content/applicationjson/ApplicationjsonSchema.md @@ -0,0 +1,144 @@ +# ApplicationjsonSchema +public class ApplicationjsonSchema
+ +A class that contains necessary nested +- schema classes (which validate payloads), extends JsonSchema +- sealed interfaces which store validated payloads, java version of a sum type +- boxed classes which store validated payloads, sealed permits class implementations + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | ---------------------- | +| sealed interface | [ApplicationjsonSchema.ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed)
sealed interface for validated payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedVoid](#applicationjsonschema1boxedvoid)
boxed class to store validated null payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedBoolean](#applicationjsonschema1boxedboolean)
boxed class to store validated boolean payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedNumber](#applicationjsonschema1boxednumber)
boxed class to store validated Number payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedString](#applicationjsonschema1boxedstring)
boxed class to store validated String payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedList](#applicationjsonschema1boxedlist)
boxed class to store validated List payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap)
boxed class to store validated Map payloads | +| static class | [ApplicationjsonSchema.ApplicationjsonSchema1](#applicationjsonschema1)
schema class | + +## ApplicationjsonSchema1Boxed +public sealed interface ApplicationjsonSchema1Boxed
+permits
+[ApplicationjsonSchema1BoxedVoid](#applicationjsonschema1boxedvoid), +[ApplicationjsonSchema1BoxedBoolean](#applicationjsonschema1boxedboolean), +[ApplicationjsonSchema1BoxedNumber](#applicationjsonschema1boxednumber), +[ApplicationjsonSchema1BoxedString](#applicationjsonschema1boxedstring), +[ApplicationjsonSchema1BoxedList](#applicationjsonschema1boxedlist), +[ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap) + +sealed interface that stores validated payloads using boxed classes + +## ApplicationjsonSchema1BoxedVoid +public record ApplicationjsonSchema1BoxedVoid
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) + +record that stores validated null payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonSchema1BoxedVoid(Void data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## ApplicationjsonSchema1BoxedBoolean +public record ApplicationjsonSchema1BoxedBoolean
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) + +record that stores validated boolean payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonSchema1BoxedBoolean(boolean data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## ApplicationjsonSchema1BoxedNumber +public record ApplicationjsonSchema1BoxedNumber
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) + +record that stores validated Number payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonSchema1BoxedNumber(Number data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## ApplicationjsonSchema1BoxedString +public record ApplicationjsonSchema1BoxedString
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) + +record that stores validated String payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonSchema1BoxedString(String data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## ApplicationjsonSchema1BoxedList +public record ApplicationjsonSchema1BoxedList
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) + +record that stores validated List payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonSchema1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## ApplicationjsonSchema1BoxedMap +public record ApplicationjsonSchema1BoxedMap
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonSchema1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## ApplicationjsonSchema1 +public static class ApplicationjsonSchema1
+extends AnyTypeJsonSchema.AnyTypeJsonSchema1 + +A schema class that validates payloads + +| Methods Inherited from class org.openapijsonschematools.client.schemas.AnyTypeJsonSchema.AnyTypeJsonSchema1 | +| ------------------------------------------------------------------ | +| validate | +| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/fakemultipleresponsebodies/get/responses/response200/content/applicationjson/ApplicationjsonSchema.md b/samples/client/petstore/java/docs/paths/fakemultipleresponsebodies/get/responses/response200/content/applicationjson/ApplicationjsonSchema.md deleted file mode 100644 index 53da126ffca..00000000000 --- a/samples/client/petstore/java/docs/paths/fakemultipleresponsebodies/get/responses/response200/content/applicationjson/ApplicationjsonSchema.md +++ /dev/null @@ -1,138 +0,0 @@ -# ApplicationjsonSchema -public class ApplicationjsonSchema
- -A class that contains necessary nested -- schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type -- boxed classes which store validated payloads, sealed permits class implementations - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | ---------------------- | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed)
abstract sealed validated payload class | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedVoid](#applicationjsonschema1boxedvoid)
boxed class to store validated null payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedBoolean](#applicationjsonschema1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedNumber](#applicationjsonschema1boxednumber)
boxed class to store validated Number payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedString](#applicationjsonschema1boxedstring)
boxed class to store validated String payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedList](#applicationjsonschema1boxedlist)
boxed class to store validated List payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap)
boxed class to store validated Map payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1](#applicationjsonschema1)
schema class | - -## ApplicationjsonSchema1Boxed -public static abstract sealed class ApplicationjsonSchema1Boxed
-permits
-[ApplicationjsonSchema1BoxedVoid](#applicationjsonschema1boxedvoid), -[ApplicationjsonSchema1BoxedBoolean](#applicationjsonschema1boxedboolean), -[ApplicationjsonSchema1BoxedNumber](#applicationjsonschema1boxednumber), -[ApplicationjsonSchema1BoxedString](#applicationjsonschema1boxedstring), -[ApplicationjsonSchema1BoxedList](#applicationjsonschema1boxedlist), -[ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap) - -abstract sealed class that stores validated payloads using boxed classes - -## ApplicationjsonSchema1BoxedVoid -public static final class ApplicationjsonSchema1BoxedVoid
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) - -a boxed class to store validated null payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonSchema1BoxedVoid(Void data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| Void | data
validated payload | - -## ApplicationjsonSchema1BoxedBoolean -public static final class ApplicationjsonSchema1BoxedBoolean
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) - -a boxed class to store validated boolean payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonSchema1BoxedBoolean(boolean data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| boolean | data
validated payload | - -## ApplicationjsonSchema1BoxedNumber -public static final class ApplicationjsonSchema1BoxedNumber
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) - -a boxed class to store validated Number payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonSchema1BoxedNumber(Number data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| Number | data
validated payload | - -## ApplicationjsonSchema1BoxedString -public static final class ApplicationjsonSchema1BoxedString
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) - -a boxed class to store validated String payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonSchema1BoxedString(String data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| String | data
validated payload | - -## ApplicationjsonSchema1BoxedList -public static final class ApplicationjsonSchema1BoxedList
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) - -a boxed class to store validated List payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonSchema1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | - -## ApplicationjsonSchema1BoxedMap -public static final class ApplicationjsonSchema1BoxedMap
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) - -a boxed class to store validated Map payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonSchema1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | - -## ApplicationjsonSchema1 -public static class ApplicationjsonSchema1
-extends AnyTypeJsonSchema.AnyTypeJsonSchema1 - -A schema class that validates payloads - -| Methods Inherited from class org.openapijsonschematools.client.schemas.AnyTypeJsonSchema.AnyTypeJsonSchema1 | -| ------------------------------------------------------------------ | -| validate | -| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/fakemultipleresponsebodies/get/responses/response202/content/applicationjson/ApplicationjsonSchema.md b/samples/client/petstore/java/docs/paths/fakemultipleresponsebodies/get/responses/response202/content/applicationjson/ApplicationjsonSchema.md deleted file mode 100644 index 53da126ffca..00000000000 --- a/samples/client/petstore/java/docs/paths/fakemultipleresponsebodies/get/responses/response202/content/applicationjson/ApplicationjsonSchema.md +++ /dev/null @@ -1,138 +0,0 @@ -# ApplicationjsonSchema -public class ApplicationjsonSchema
- -A class that contains necessary nested -- schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type -- boxed classes which store validated payloads, sealed permits class implementations - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | ---------------------- | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed)
abstract sealed validated payload class | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedVoid](#applicationjsonschema1boxedvoid)
boxed class to store validated null payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedBoolean](#applicationjsonschema1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedNumber](#applicationjsonschema1boxednumber)
boxed class to store validated Number payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedString](#applicationjsonschema1boxedstring)
boxed class to store validated String payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedList](#applicationjsonschema1boxedlist)
boxed class to store validated List payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap)
boxed class to store validated Map payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1](#applicationjsonschema1)
schema class | - -## ApplicationjsonSchema1Boxed -public static abstract sealed class ApplicationjsonSchema1Boxed
-permits
-[ApplicationjsonSchema1BoxedVoid](#applicationjsonschema1boxedvoid), -[ApplicationjsonSchema1BoxedBoolean](#applicationjsonschema1boxedboolean), -[ApplicationjsonSchema1BoxedNumber](#applicationjsonschema1boxednumber), -[ApplicationjsonSchema1BoxedString](#applicationjsonschema1boxedstring), -[ApplicationjsonSchema1BoxedList](#applicationjsonschema1boxedlist), -[ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap) - -abstract sealed class that stores validated payloads using boxed classes - -## ApplicationjsonSchema1BoxedVoid -public static final class ApplicationjsonSchema1BoxedVoid
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) - -a boxed class to store validated null payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonSchema1BoxedVoid(Void data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| Void | data
validated payload | - -## ApplicationjsonSchema1BoxedBoolean -public static final class ApplicationjsonSchema1BoxedBoolean
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) - -a boxed class to store validated boolean payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonSchema1BoxedBoolean(boolean data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| boolean | data
validated payload | - -## ApplicationjsonSchema1BoxedNumber -public static final class ApplicationjsonSchema1BoxedNumber
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) - -a boxed class to store validated Number payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonSchema1BoxedNumber(Number data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| Number | data
validated payload | - -## ApplicationjsonSchema1BoxedString -public static final class ApplicationjsonSchema1BoxedString
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) - -a boxed class to store validated String payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonSchema1BoxedString(String data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| String | data
validated payload | - -## ApplicationjsonSchema1BoxedList -public static final class ApplicationjsonSchema1BoxedList
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) - -a boxed class to store validated List payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonSchema1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | - -## ApplicationjsonSchema1BoxedMap -public static final class ApplicationjsonSchema1BoxedMap
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) - -a boxed class to store validated Map payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonSchema1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | - -## ApplicationjsonSchema1 -public static class ApplicationjsonSchema1
-extends AnyTypeJsonSchema.AnyTypeJsonSchema1 - -A schema class that validates payloads - -| Methods Inherited from class org.openapijsonschematools.client.schemas.AnyTypeJsonSchema.AnyTypeJsonSchema1 | -| ------------------------------------------------------------------ | -| validate | -| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/fakemultiplesecurities/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md b/samples/client/petstore/java/docs/paths/fakemultiplesecurities/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md new file mode 100644 index 00000000000..98eb062fdd7 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakemultiplesecurities/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md @@ -0,0 +1,144 @@ +# ApplicationjsonSchema +public class ApplicationjsonSchema
+ +A class that contains necessary nested +- schema classes (which validate payloads), extends JsonSchema +- sealed interfaces which store validated payloads, java version of a sum type +- boxed classes which store validated payloads, sealed permits class implementations + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | ---------------------- | +| sealed interface | [ApplicationjsonSchema.ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed)
sealed interface for validated payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedVoid](#applicationjsonschema1boxedvoid)
boxed class to store validated null payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedBoolean](#applicationjsonschema1boxedboolean)
boxed class to store validated boolean payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedNumber](#applicationjsonschema1boxednumber)
boxed class to store validated Number payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedString](#applicationjsonschema1boxedstring)
boxed class to store validated String payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedList](#applicationjsonschema1boxedlist)
boxed class to store validated List payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap)
boxed class to store validated Map payloads | +| static class | [ApplicationjsonSchema.ApplicationjsonSchema1](#applicationjsonschema1)
schema class | + +## ApplicationjsonSchema1Boxed +public sealed interface ApplicationjsonSchema1Boxed
+permits
+[ApplicationjsonSchema1BoxedVoid](#applicationjsonschema1boxedvoid), +[ApplicationjsonSchema1BoxedBoolean](#applicationjsonschema1boxedboolean), +[ApplicationjsonSchema1BoxedNumber](#applicationjsonschema1boxednumber), +[ApplicationjsonSchema1BoxedString](#applicationjsonschema1boxedstring), +[ApplicationjsonSchema1BoxedList](#applicationjsonschema1boxedlist), +[ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap) + +sealed interface that stores validated payloads using boxed classes + +## ApplicationjsonSchema1BoxedVoid +public record ApplicationjsonSchema1BoxedVoid
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) + +record that stores validated null payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonSchema1BoxedVoid(Void data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## ApplicationjsonSchema1BoxedBoolean +public record ApplicationjsonSchema1BoxedBoolean
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) + +record that stores validated boolean payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonSchema1BoxedBoolean(boolean data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## ApplicationjsonSchema1BoxedNumber +public record ApplicationjsonSchema1BoxedNumber
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) + +record that stores validated Number payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonSchema1BoxedNumber(Number data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## ApplicationjsonSchema1BoxedString +public record ApplicationjsonSchema1BoxedString
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) + +record that stores validated String payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonSchema1BoxedString(String data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## ApplicationjsonSchema1BoxedList +public record ApplicationjsonSchema1BoxedList
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) + +record that stores validated List payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonSchema1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## ApplicationjsonSchema1BoxedMap +public record ApplicationjsonSchema1BoxedMap
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonSchema1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## ApplicationjsonSchema1 +public static class ApplicationjsonSchema1
+extends AnyTypeJsonSchema.AnyTypeJsonSchema1 + +A schema class that validates payloads + +| Methods Inherited from class org.openapijsonschematools.client.schemas.AnyTypeJsonSchema.AnyTypeJsonSchema1 | +| ------------------------------------------------------------------ | +| validate | +| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/fakemultiplesecurities/get/responses/response200/content/applicationjson/ApplicationjsonSchema.md b/samples/client/petstore/java/docs/paths/fakemultiplesecurities/get/responses/response200/content/applicationjson/ApplicationjsonSchema.md deleted file mode 100644 index 53da126ffca..00000000000 --- a/samples/client/petstore/java/docs/paths/fakemultiplesecurities/get/responses/response200/content/applicationjson/ApplicationjsonSchema.md +++ /dev/null @@ -1,138 +0,0 @@ -# ApplicationjsonSchema -public class ApplicationjsonSchema
- -A class that contains necessary nested -- schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type -- boxed classes which store validated payloads, sealed permits class implementations - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | ---------------------- | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed)
abstract sealed validated payload class | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedVoid](#applicationjsonschema1boxedvoid)
boxed class to store validated null payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedBoolean](#applicationjsonschema1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedNumber](#applicationjsonschema1boxednumber)
boxed class to store validated Number payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedString](#applicationjsonschema1boxedstring)
boxed class to store validated String payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedList](#applicationjsonschema1boxedlist)
boxed class to store validated List payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap)
boxed class to store validated Map payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1](#applicationjsonschema1)
schema class | - -## ApplicationjsonSchema1Boxed -public static abstract sealed class ApplicationjsonSchema1Boxed
-permits
-[ApplicationjsonSchema1BoxedVoid](#applicationjsonschema1boxedvoid), -[ApplicationjsonSchema1BoxedBoolean](#applicationjsonschema1boxedboolean), -[ApplicationjsonSchema1BoxedNumber](#applicationjsonschema1boxednumber), -[ApplicationjsonSchema1BoxedString](#applicationjsonschema1boxedstring), -[ApplicationjsonSchema1BoxedList](#applicationjsonschema1boxedlist), -[ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap) - -abstract sealed class that stores validated payloads using boxed classes - -## ApplicationjsonSchema1BoxedVoid -public static final class ApplicationjsonSchema1BoxedVoid
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) - -a boxed class to store validated null payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonSchema1BoxedVoid(Void data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| Void | data
validated payload | - -## ApplicationjsonSchema1BoxedBoolean -public static final class ApplicationjsonSchema1BoxedBoolean
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) - -a boxed class to store validated boolean payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonSchema1BoxedBoolean(boolean data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| boolean | data
validated payload | - -## ApplicationjsonSchema1BoxedNumber -public static final class ApplicationjsonSchema1BoxedNumber
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) - -a boxed class to store validated Number payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonSchema1BoxedNumber(Number data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| Number | data
validated payload | - -## ApplicationjsonSchema1BoxedString -public static final class ApplicationjsonSchema1BoxedString
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) - -a boxed class to store validated String payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonSchema1BoxedString(String data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| String | data
validated payload | - -## ApplicationjsonSchema1BoxedList -public static final class ApplicationjsonSchema1BoxedList
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) - -a boxed class to store validated List payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonSchema1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | - -## ApplicationjsonSchema1BoxedMap -public static final class ApplicationjsonSchema1BoxedMap
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) - -a boxed class to store validated Map payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonSchema1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | - -## ApplicationjsonSchema1 -public static class ApplicationjsonSchema1
-extends AnyTypeJsonSchema.AnyTypeJsonSchema1 - -A schema class that validates payloads - -| Methods Inherited from class org.openapijsonschematools.client.schemas.AnyTypeJsonSchema.AnyTypeJsonSchema1 | -| ------------------------------------------------------------------ | -| validate | -| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/fakeobjinquery/get/parameters/parameter0/Schema0.md b/samples/client/petstore/java/docs/paths/fakeobjinquery/get/parameters/parameter0/Schema0.md index 527700646ce..2d363bd32b7 100644 --- a/samples/client/petstore/java/docs/paths/fakeobjinquery/get/parameters/parameter0/Schema0.md +++ b/samples/client/petstore/java/docs/paths/fakeobjinquery/get/parameters/parameter0/Schema0.md @@ -3,7 +3,7 @@ public class Schema0
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -11,37 +11,38 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Schema0.Schema01Boxed](#schema01boxed)
abstract sealed validated payload class | -| static class | [Schema0.Schema01BoxedMap](#schema01boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [Schema0.Schema01Boxed](#schema01boxed)
sealed interface for validated payloads | +| record | [Schema0.Schema01BoxedMap](#schema01boxedmap)
boxed class to store validated Map payloads | | static class | [Schema0.Schema01](#schema01)
schema class | | static class | [Schema0.SchemaMapBuilder0](#schemamapbuilder0)
builder for Map payloads | | static class | [Schema0.SchemaMap0](#schemamap0)
output class for Map payloads | -| static class | [Schema0.Keyword0Boxed](#keyword0boxed)
abstract sealed validated payload class | -| static class | [Schema0.Keyword0BoxedString](#keyword0boxedstring)
boxed class to store validated String payloads | +| sealed interface | [Schema0.Keyword0Boxed](#keyword0boxed)
sealed interface for validated payloads | +| record | [Schema0.Keyword0BoxedString](#keyword0boxedstring)
boxed class to store validated String payloads | | static class | [Schema0.Keyword0](#keyword0)
schema class | ## Schema01Boxed -public static abstract sealed class Schema01Boxed
+public sealed interface Schema01Boxed
permits
[Schema01BoxedMap](#schema01boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema01BoxedMap -public static final class Schema01BoxedMap
-extends [Schema01Boxed](#schema01boxed) +public record Schema01BoxedMap
+implements [Schema01Boxed](#schema01boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema01BoxedMap([SchemaMap0](#schemamap0) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [SchemaMap0](#schemamap0) | data
validated payload | +| [SchemaMap0](#schemamap0) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema01 public static class Schema01
@@ -86,7 +87,9 @@ Schema0.SchemaMap0 validatedPayload = | ----------------- | ---------------------- | | [SchemaMap0](#schemamap0) | validate([Map<?, ?>](#schemamapbuilder0) arg, SchemaConfiguration configuration) | | [Schema01BoxedMap](#schema01boxedmap) | validateAndBox([Map<?, ?>](#schemamapbuilder0) arg, SchemaConfiguration configuration) | +| [Schema01Boxed](#schema01boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## SchemaMapBuilder0 public class SchemaMapBuilder0
builder for `Map` @@ -127,27 +130,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## Keyword0Boxed -public static abstract sealed class Keyword0Boxed
+public sealed interface Keyword0Boxed
permits
[Keyword0BoxedString](#keyword0boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Keyword0BoxedString -public static final class Keyword0BoxedString
-extends [Keyword0Boxed](#keyword0boxed) +public record Keyword0BoxedString
+implements [Keyword0Boxed](#keyword0boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Keyword0BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Keyword0 public static class Keyword0
diff --git a/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter0/Schema0.md b/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter0/Schema0.md index 34951cbef92..9ff90e0bc35 100644 --- a/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter0/Schema0.md +++ b/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter0/Schema0.md @@ -3,38 +3,39 @@ public class Schema0
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Schema0.Schema01Boxed](#schema01boxed)
abstract sealed validated payload class | -| static class | [Schema0.Schema01BoxedString](#schema01boxedstring)
boxed class to store validated String payloads | +| sealed interface | [Schema0.Schema01Boxed](#schema01boxed)
sealed interface for validated payloads | +| record | [Schema0.Schema01BoxedString](#schema01boxedstring)
boxed class to store validated String payloads | | static class | [Schema0.Schema01](#schema01)
schema class | ## Schema01Boxed -public static abstract sealed class Schema01Boxed
+public sealed interface Schema01Boxed
permits
[Schema01BoxedString](#schema01boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema01BoxedString -public static final class Schema01BoxedString
-extends [Schema01Boxed](#schema01boxed) +public record Schema01BoxedString
+implements [Schema01Boxed](#schema01boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema01BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema01 public static class Schema01
diff --git a/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter1/Schema1.md b/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter1/Schema1.md index dc73fa004df..63ec3a884fc 100644 --- a/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter1/Schema1.md +++ b/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter1/Schema1.md @@ -3,38 +3,39 @@ public class Schema1
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Schema1.Schema11Boxed](#schema11boxed)
abstract sealed validated payload class | -| static class | [Schema1.Schema11BoxedString](#schema11boxedstring)
boxed class to store validated String payloads | +| sealed interface | [Schema1.Schema11Boxed](#schema11boxed)
sealed interface for validated payloads | +| record | [Schema1.Schema11BoxedString](#schema11boxedstring)
boxed class to store validated String payloads | | static class | [Schema1.Schema11](#schema11)
schema class | ## Schema11Boxed -public static abstract sealed class Schema11Boxed
+public sealed interface Schema11Boxed
permits
[Schema11BoxedString](#schema11boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema11BoxedString -public static final class Schema11BoxedString
-extends [Schema11Boxed](#schema11boxed) +public record Schema11BoxedString
+implements [Schema11Boxed](#schema11boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema11BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema11 public static class Schema11
diff --git a/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter10/Schema10.md b/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter10/Schema10.md index e2b72589fe5..f2313e921f9 100644 --- a/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter10/Schema10.md +++ b/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter10/Schema10.md @@ -3,38 +3,39 @@ public class Schema10
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Schema10.Schema101Boxed](#schema101boxed)
abstract sealed validated payload class | -| static class | [Schema10.Schema101BoxedString](#schema101boxedstring)
boxed class to store validated String payloads | +| sealed interface | [Schema10.Schema101Boxed](#schema101boxed)
sealed interface for validated payloads | +| record | [Schema10.Schema101BoxedString](#schema101boxedstring)
boxed class to store validated String payloads | | static class | [Schema10.Schema101](#schema101)
schema class | ## Schema101Boxed -public static abstract sealed class Schema101Boxed
+public sealed interface Schema101Boxed
permits
[Schema101BoxedString](#schema101boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema101BoxedString -public static final class Schema101BoxedString
-extends [Schema101Boxed](#schema101boxed) +public record Schema101BoxedString
+implements [Schema101Boxed](#schema101boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema101BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema101 public static class Schema101
diff --git a/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter11/Schema11.md b/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter11/Schema11.md index ddfd46d1495..c309cbd677b 100644 --- a/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter11/Schema11.md +++ b/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter11/Schema11.md @@ -3,38 +3,39 @@ public class Schema11
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Schema11.Schema111Boxed](#schema111boxed)
abstract sealed validated payload class | -| static class | [Schema11.Schema111BoxedString](#schema111boxedstring)
boxed class to store validated String payloads | +| sealed interface | [Schema11.Schema111Boxed](#schema111boxed)
sealed interface for validated payloads | +| record | [Schema11.Schema111BoxedString](#schema111boxedstring)
boxed class to store validated String payloads | | static class | [Schema11.Schema111](#schema111)
schema class | ## Schema111Boxed -public static abstract sealed class Schema111Boxed
+public sealed interface Schema111Boxed
permits
[Schema111BoxedString](#schema111boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema111BoxedString -public static final class Schema111BoxedString
-extends [Schema111Boxed](#schema111boxed) +public record Schema111BoxedString
+implements [Schema111Boxed](#schema111boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema111BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema111 public static class Schema111
diff --git a/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter12/Schema12.md b/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter12/Schema12.md index 11cb68252c8..fa969e69734 100644 --- a/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter12/Schema12.md +++ b/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter12/Schema12.md @@ -3,38 +3,39 @@ public class Schema12
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Schema12.Schema121Boxed](#schema121boxed)
abstract sealed validated payload class | -| static class | [Schema12.Schema121BoxedString](#schema121boxedstring)
boxed class to store validated String payloads | +| sealed interface | [Schema12.Schema121Boxed](#schema121boxed)
sealed interface for validated payloads | +| record | [Schema12.Schema121BoxedString](#schema121boxedstring)
boxed class to store validated String payloads | | static class | [Schema12.Schema121](#schema121)
schema class | ## Schema121Boxed -public static abstract sealed class Schema121Boxed
+public sealed interface Schema121Boxed
permits
[Schema121BoxedString](#schema121boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema121BoxedString -public static final class Schema121BoxedString
-extends [Schema121Boxed](#schema121boxed) +public record Schema121BoxedString
+implements [Schema121Boxed](#schema121boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema121BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema121 public static class Schema121
diff --git a/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter13/Schema13.md b/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter13/Schema13.md index b57089125e4..8b6ce934c35 100644 --- a/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter13/Schema13.md +++ b/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter13/Schema13.md @@ -3,38 +3,39 @@ public class Schema13
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Schema13.Schema131Boxed](#schema131boxed)
abstract sealed validated payload class | -| static class | [Schema13.Schema131BoxedString](#schema131boxedstring)
boxed class to store validated String payloads | +| sealed interface | [Schema13.Schema131Boxed](#schema131boxed)
sealed interface for validated payloads | +| record | [Schema13.Schema131BoxedString](#schema131boxedstring)
boxed class to store validated String payloads | | static class | [Schema13.Schema131](#schema131)
schema class | ## Schema131Boxed -public static abstract sealed class Schema131Boxed
+public sealed interface Schema131Boxed
permits
[Schema131BoxedString](#schema131boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema131BoxedString -public static final class Schema131BoxedString
-extends [Schema131Boxed](#schema131boxed) +public record Schema131BoxedString
+implements [Schema131Boxed](#schema131boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema131BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema131 public static class Schema131
diff --git a/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter14/Schema14.md b/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter14/Schema14.md index 73013ec6253..b6987c8c80f 100644 --- a/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter14/Schema14.md +++ b/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter14/Schema14.md @@ -3,38 +3,39 @@ public class Schema14
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Schema14.Schema141Boxed](#schema141boxed)
abstract sealed validated payload class | -| static class | [Schema14.Schema141BoxedString](#schema141boxedstring)
boxed class to store validated String payloads | +| sealed interface | [Schema14.Schema141Boxed](#schema141boxed)
sealed interface for validated payloads | +| record | [Schema14.Schema141BoxedString](#schema141boxedstring)
boxed class to store validated String payloads | | static class | [Schema14.Schema141](#schema141)
schema class | ## Schema141Boxed -public static abstract sealed class Schema141Boxed
+public sealed interface Schema141Boxed
permits
[Schema141BoxedString](#schema141boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema141BoxedString -public static final class Schema141BoxedString
-extends [Schema141Boxed](#schema141boxed) +public record Schema141BoxedString
+implements [Schema141Boxed](#schema141boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema141BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema141 public static class Schema141
diff --git a/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter15/Schema15.md b/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter15/Schema15.md index 61523eb9775..272a98b600d 100644 --- a/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter15/Schema15.md +++ b/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter15/Schema15.md @@ -3,38 +3,39 @@ public class Schema15
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Schema15.Schema151Boxed](#schema151boxed)
abstract sealed validated payload class | -| static class | [Schema15.Schema151BoxedString](#schema151boxedstring)
boxed class to store validated String payloads | +| sealed interface | [Schema15.Schema151Boxed](#schema151boxed)
sealed interface for validated payloads | +| record | [Schema15.Schema151BoxedString](#schema151boxedstring)
boxed class to store validated String payloads | | static class | [Schema15.Schema151](#schema151)
schema class | ## Schema151Boxed -public static abstract sealed class Schema151Boxed
+public sealed interface Schema151Boxed
permits
[Schema151BoxedString](#schema151boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema151BoxedString -public static final class Schema151BoxedString
-extends [Schema151Boxed](#schema151boxed) +public record Schema151BoxedString
+implements [Schema151Boxed](#schema151boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema151BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema151 public static class Schema151
diff --git a/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter16/Schema16.md b/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter16/Schema16.md index 0d04529ab64..059eeb943a7 100644 --- a/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter16/Schema16.md +++ b/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter16/Schema16.md @@ -3,38 +3,39 @@ public class Schema16
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Schema16.Schema161Boxed](#schema161boxed)
abstract sealed validated payload class | -| static class | [Schema16.Schema161BoxedString](#schema161boxedstring)
boxed class to store validated String payloads | +| sealed interface | [Schema16.Schema161Boxed](#schema161boxed)
sealed interface for validated payloads | +| record | [Schema16.Schema161BoxedString](#schema161boxedstring)
boxed class to store validated String payloads | | static class | [Schema16.Schema161](#schema161)
schema class | ## Schema161Boxed -public static abstract sealed class Schema161Boxed
+public sealed interface Schema161Boxed
permits
[Schema161BoxedString](#schema161boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema161BoxedString -public static final class Schema161BoxedString
-extends [Schema161Boxed](#schema161boxed) +public record Schema161BoxedString
+implements [Schema161Boxed](#schema161boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema161BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema161 public static class Schema161
diff --git a/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter17/Schema17.md b/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter17/Schema17.md index a2c5833aff7..4bf4ae7e510 100644 --- a/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter17/Schema17.md +++ b/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter17/Schema17.md @@ -3,38 +3,39 @@ public class Schema17
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Schema17.Schema171Boxed](#schema171boxed)
abstract sealed validated payload class | -| static class | [Schema17.Schema171BoxedString](#schema171boxedstring)
boxed class to store validated String payloads | +| sealed interface | [Schema17.Schema171Boxed](#schema171boxed)
sealed interface for validated payloads | +| record | [Schema17.Schema171BoxedString](#schema171boxedstring)
boxed class to store validated String payloads | | static class | [Schema17.Schema171](#schema171)
schema class | ## Schema171Boxed -public static abstract sealed class Schema171Boxed
+public sealed interface Schema171Boxed
permits
[Schema171BoxedString](#schema171boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema171BoxedString -public static final class Schema171BoxedString
-extends [Schema171Boxed](#schema171boxed) +public record Schema171BoxedString
+implements [Schema171Boxed](#schema171boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema171BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema171 public static class Schema171
diff --git a/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter18/Schema18.md b/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter18/Schema18.md index 97fcb76036e..962dca4cbb3 100644 --- a/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter18/Schema18.md +++ b/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter18/Schema18.md @@ -3,38 +3,39 @@ public class Schema18
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Schema18.Schema181Boxed](#schema181boxed)
abstract sealed validated payload class | -| static class | [Schema18.Schema181BoxedString](#schema181boxedstring)
boxed class to store validated String payloads | +| sealed interface | [Schema18.Schema181Boxed](#schema181boxed)
sealed interface for validated payloads | +| record | [Schema18.Schema181BoxedString](#schema181boxedstring)
boxed class to store validated String payloads | | static class | [Schema18.Schema181](#schema181)
schema class | ## Schema181Boxed -public static abstract sealed class Schema181Boxed
+public sealed interface Schema181Boxed
permits
[Schema181BoxedString](#schema181boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema181BoxedString -public static final class Schema181BoxedString
-extends [Schema181Boxed](#schema181boxed) +public record Schema181BoxedString
+implements [Schema181Boxed](#schema181boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema181BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema181 public static class Schema181
diff --git a/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter2/Schema2.md b/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter2/Schema2.md index e44ea1732a1..4a7d57953eb 100644 --- a/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter2/Schema2.md +++ b/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter2/Schema2.md @@ -3,38 +3,39 @@ public class Schema2
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Schema2.Schema21Boxed](#schema21boxed)
abstract sealed validated payload class | -| static class | [Schema2.Schema21BoxedString](#schema21boxedstring)
boxed class to store validated String payloads | +| sealed interface | [Schema2.Schema21Boxed](#schema21boxed)
sealed interface for validated payloads | +| record | [Schema2.Schema21BoxedString](#schema21boxedstring)
boxed class to store validated String payloads | | static class | [Schema2.Schema21](#schema21)
schema class | ## Schema21Boxed -public static abstract sealed class Schema21Boxed
+public sealed interface Schema21Boxed
permits
[Schema21BoxedString](#schema21boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema21BoxedString -public static final class Schema21BoxedString
-extends [Schema21Boxed](#schema21boxed) +public record Schema21BoxedString
+implements [Schema21Boxed](#schema21boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema21BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema21 public static class Schema21
diff --git a/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter3/Schema3.md b/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter3/Schema3.md index b09a6ef7f98..41d54a1d930 100644 --- a/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter3/Schema3.md +++ b/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter3/Schema3.md @@ -3,38 +3,39 @@ public class Schema3
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Schema3.Schema31Boxed](#schema31boxed)
abstract sealed validated payload class | -| static class | [Schema3.Schema31BoxedString](#schema31boxedstring)
boxed class to store validated String payloads | +| sealed interface | [Schema3.Schema31Boxed](#schema31boxed)
sealed interface for validated payloads | +| record | [Schema3.Schema31BoxedString](#schema31boxedstring)
boxed class to store validated String payloads | | static class | [Schema3.Schema31](#schema31)
schema class | ## Schema31Boxed -public static abstract sealed class Schema31Boxed
+public sealed interface Schema31Boxed
permits
[Schema31BoxedString](#schema31boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema31BoxedString -public static final class Schema31BoxedString
-extends [Schema31Boxed](#schema31boxed) +public record Schema31BoxedString
+implements [Schema31Boxed](#schema31boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema31BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema31 public static class Schema31
diff --git a/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter4/Schema4.md b/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter4/Schema4.md index 324717533a1..7bc2523d7af 100644 --- a/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter4/Schema4.md +++ b/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter4/Schema4.md @@ -3,38 +3,39 @@ public class Schema4
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Schema4.Schema41Boxed](#schema41boxed)
abstract sealed validated payload class | -| static class | [Schema4.Schema41BoxedString](#schema41boxedstring)
boxed class to store validated String payloads | +| sealed interface | [Schema4.Schema41Boxed](#schema41boxed)
sealed interface for validated payloads | +| record | [Schema4.Schema41BoxedString](#schema41boxedstring)
boxed class to store validated String payloads | | static class | [Schema4.Schema41](#schema41)
schema class | ## Schema41Boxed -public static abstract sealed class Schema41Boxed
+public sealed interface Schema41Boxed
permits
[Schema41BoxedString](#schema41boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema41BoxedString -public static final class Schema41BoxedString
-extends [Schema41Boxed](#schema41boxed) +public record Schema41BoxedString
+implements [Schema41Boxed](#schema41boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema41BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema41 public static class Schema41
diff --git a/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter5/Schema5.md b/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter5/Schema5.md index 731d54f677e..ff888c33afd 100644 --- a/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter5/Schema5.md +++ b/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter5/Schema5.md @@ -3,38 +3,39 @@ public class Schema5
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Schema5.Schema51Boxed](#schema51boxed)
abstract sealed validated payload class | -| static class | [Schema5.Schema51BoxedString](#schema51boxedstring)
boxed class to store validated String payloads | +| sealed interface | [Schema5.Schema51Boxed](#schema51boxed)
sealed interface for validated payloads | +| record | [Schema5.Schema51BoxedString](#schema51boxedstring)
boxed class to store validated String payloads | | static class | [Schema5.Schema51](#schema51)
schema class | ## Schema51Boxed -public static abstract sealed class Schema51Boxed
+public sealed interface Schema51Boxed
permits
[Schema51BoxedString](#schema51boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema51BoxedString -public static final class Schema51BoxedString
-extends [Schema51Boxed](#schema51boxed) +public record Schema51BoxedString
+implements [Schema51Boxed](#schema51boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema51BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema51 public static class Schema51
diff --git a/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter6/Schema6.md b/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter6/Schema6.md index 1faeac06048..ba0b2fad7df 100644 --- a/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter6/Schema6.md +++ b/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter6/Schema6.md @@ -3,38 +3,39 @@ public class Schema6
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Schema6.Schema61Boxed](#schema61boxed)
abstract sealed validated payload class | -| static class | [Schema6.Schema61BoxedString](#schema61boxedstring)
boxed class to store validated String payloads | +| sealed interface | [Schema6.Schema61Boxed](#schema61boxed)
sealed interface for validated payloads | +| record | [Schema6.Schema61BoxedString](#schema61boxedstring)
boxed class to store validated String payloads | | static class | [Schema6.Schema61](#schema61)
schema class | ## Schema61Boxed -public static abstract sealed class Schema61Boxed
+public sealed interface Schema61Boxed
permits
[Schema61BoxedString](#schema61boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema61BoxedString -public static final class Schema61BoxedString
-extends [Schema61Boxed](#schema61boxed) +public record Schema61BoxedString
+implements [Schema61Boxed](#schema61boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema61BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema61 public static class Schema61
diff --git a/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter7/Schema7.md b/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter7/Schema7.md index 017182a0f03..a4e0ad0106a 100644 --- a/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter7/Schema7.md +++ b/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter7/Schema7.md @@ -3,38 +3,39 @@ public class Schema7
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Schema7.Schema71Boxed](#schema71boxed)
abstract sealed validated payload class | -| static class | [Schema7.Schema71BoxedString](#schema71boxedstring)
boxed class to store validated String payloads | +| sealed interface | [Schema7.Schema71Boxed](#schema71boxed)
sealed interface for validated payloads | +| record | [Schema7.Schema71BoxedString](#schema71boxedstring)
boxed class to store validated String payloads | | static class | [Schema7.Schema71](#schema71)
schema class | ## Schema71Boxed -public static abstract sealed class Schema71Boxed
+public sealed interface Schema71Boxed
permits
[Schema71BoxedString](#schema71boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema71BoxedString -public static final class Schema71BoxedString
-extends [Schema71Boxed](#schema71boxed) +public record Schema71BoxedString
+implements [Schema71Boxed](#schema71boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema71BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema71 public static class Schema71
diff --git a/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter8/Schema8.md b/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter8/Schema8.md index 15e720fc4c1..63b13965df9 100644 --- a/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter8/Schema8.md +++ b/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter8/Schema8.md @@ -3,38 +3,39 @@ public class Schema8
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Schema8.Schema81Boxed](#schema81boxed)
abstract sealed validated payload class | -| static class | [Schema8.Schema81BoxedString](#schema81boxedstring)
boxed class to store validated String payloads | +| sealed interface | [Schema8.Schema81Boxed](#schema81boxed)
sealed interface for validated payloads | +| record | [Schema8.Schema81BoxedString](#schema81boxedstring)
boxed class to store validated String payloads | | static class | [Schema8.Schema81](#schema81)
schema class | ## Schema81Boxed -public static abstract sealed class Schema81Boxed
+public sealed interface Schema81Boxed
permits
[Schema81BoxedString](#schema81boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema81BoxedString -public static final class Schema81BoxedString
-extends [Schema81Boxed](#schema81boxed) +public record Schema81BoxedString
+implements [Schema81Boxed](#schema81boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema81BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema81 public static class Schema81
diff --git a/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter9/Schema9.md b/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter9/Schema9.md index 4ec07a72c46..359fd15e9c6 100644 --- a/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter9/Schema9.md +++ b/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter9/Schema9.md @@ -3,38 +3,39 @@ public class Schema9
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Schema9.Schema91Boxed](#schema91boxed)
abstract sealed validated payload class | -| static class | [Schema9.Schema91BoxedString](#schema91boxedstring)
boxed class to store validated String payloads | +| sealed interface | [Schema9.Schema91Boxed](#schema91boxed)
sealed interface for validated payloads | +| record | [Schema9.Schema91BoxedString](#schema91boxedstring)
boxed class to store validated String payloads | | static class | [Schema9.Schema91](#schema91)
schema class | ## Schema91Boxed -public static abstract sealed class Schema91Boxed
+public sealed interface Schema91Boxed
permits
[Schema91BoxedString](#schema91boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema91BoxedString -public static final class Schema91BoxedString
-extends [Schema91Boxed](#schema91boxed) +public record Schema91BoxedString
+implements [Schema91Boxed](#schema91boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema91BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema91 public static class Schema91
diff --git a/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/requestbody/content/applicationjson/ApplicationjsonSchema.md b/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/requestbody/content/applicationjson/ApplicationjsonSchema.md index 53da126ffca..98eb062fdd7 100644 --- a/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/requestbody/content/applicationjson/ApplicationjsonSchema.md +++ b/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/requestbody/content/applicationjson/ApplicationjsonSchema.md @@ -3,23 +3,23 @@ public class ApplicationjsonSchema
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed)
abstract sealed validated payload class | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedVoid](#applicationjsonschema1boxedvoid)
boxed class to store validated null payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedBoolean](#applicationjsonschema1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedNumber](#applicationjsonschema1boxednumber)
boxed class to store validated Number payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedString](#applicationjsonschema1boxedstring)
boxed class to store validated String payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedList](#applicationjsonschema1boxedlist)
boxed class to store validated List payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ApplicationjsonSchema.ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed)
sealed interface for validated payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedVoid](#applicationjsonschema1boxedvoid)
boxed class to store validated null payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedBoolean](#applicationjsonschema1boxedboolean)
boxed class to store validated boolean payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedNumber](#applicationjsonschema1boxednumber)
boxed class to store validated Number payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedString](#applicationjsonschema1boxedstring)
boxed class to store validated String payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedList](#applicationjsonschema1boxedlist)
boxed class to store validated List payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap)
boxed class to store validated Map payloads | | static class | [ApplicationjsonSchema.ApplicationjsonSchema1](#applicationjsonschema1)
schema class | ## ApplicationjsonSchema1Boxed -public static abstract sealed class ApplicationjsonSchema1Boxed
+public sealed interface ApplicationjsonSchema1Boxed
permits
[ApplicationjsonSchema1BoxedVoid](#applicationjsonschema1boxedvoid), [ApplicationjsonSchema1BoxedBoolean](#applicationjsonschema1boxedboolean), @@ -28,103 +28,109 @@ permits
[ApplicationjsonSchema1BoxedList](#applicationjsonschema1boxedlist), [ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ApplicationjsonSchema1BoxedVoid -public static final class ApplicationjsonSchema1BoxedVoid
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) +public record ApplicationjsonSchema1BoxedVoid
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ApplicationjsonSchema1BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ApplicationjsonSchema1BoxedBoolean -public static final class ApplicationjsonSchema1BoxedBoolean
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) +public record ApplicationjsonSchema1BoxedBoolean
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ApplicationjsonSchema1BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ApplicationjsonSchema1BoxedNumber -public static final class ApplicationjsonSchema1BoxedNumber
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) +public record ApplicationjsonSchema1BoxedNumber
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ApplicationjsonSchema1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ApplicationjsonSchema1BoxedString -public static final class ApplicationjsonSchema1BoxedString
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) +public record ApplicationjsonSchema1BoxedString
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ApplicationjsonSchema1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ApplicationjsonSchema1BoxedList -public static final class ApplicationjsonSchema1BoxedList
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) +public record ApplicationjsonSchema1BoxedList
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ApplicationjsonSchema1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ApplicationjsonSchema1BoxedMap -public static final class ApplicationjsonSchema1BoxedMap
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) +public record ApplicationjsonSchema1BoxedMap
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ApplicationjsonSchema1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ApplicationjsonSchema1 public static class ApplicationjsonSchema1
diff --git a/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md b/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md new file mode 100644 index 00000000000..98eb062fdd7 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md @@ -0,0 +1,144 @@ +# ApplicationjsonSchema +public class ApplicationjsonSchema
+ +A class that contains necessary nested +- schema classes (which validate payloads), extends JsonSchema +- sealed interfaces which store validated payloads, java version of a sum type +- boxed classes which store validated payloads, sealed permits class implementations + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | ---------------------- | +| sealed interface | [ApplicationjsonSchema.ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed)
sealed interface for validated payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedVoid](#applicationjsonschema1boxedvoid)
boxed class to store validated null payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedBoolean](#applicationjsonschema1boxedboolean)
boxed class to store validated boolean payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedNumber](#applicationjsonschema1boxednumber)
boxed class to store validated Number payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedString](#applicationjsonschema1boxedstring)
boxed class to store validated String payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedList](#applicationjsonschema1boxedlist)
boxed class to store validated List payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap)
boxed class to store validated Map payloads | +| static class | [ApplicationjsonSchema.ApplicationjsonSchema1](#applicationjsonschema1)
schema class | + +## ApplicationjsonSchema1Boxed +public sealed interface ApplicationjsonSchema1Boxed
+permits
+[ApplicationjsonSchema1BoxedVoid](#applicationjsonschema1boxedvoid), +[ApplicationjsonSchema1BoxedBoolean](#applicationjsonschema1boxedboolean), +[ApplicationjsonSchema1BoxedNumber](#applicationjsonschema1boxednumber), +[ApplicationjsonSchema1BoxedString](#applicationjsonschema1boxedstring), +[ApplicationjsonSchema1BoxedList](#applicationjsonschema1boxedlist), +[ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap) + +sealed interface that stores validated payloads using boxed classes + +## ApplicationjsonSchema1BoxedVoid +public record ApplicationjsonSchema1BoxedVoid
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) + +record that stores validated null payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonSchema1BoxedVoid(Void data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## ApplicationjsonSchema1BoxedBoolean +public record ApplicationjsonSchema1BoxedBoolean
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) + +record that stores validated boolean payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonSchema1BoxedBoolean(boolean data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## ApplicationjsonSchema1BoxedNumber +public record ApplicationjsonSchema1BoxedNumber
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) + +record that stores validated Number payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonSchema1BoxedNumber(Number data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## ApplicationjsonSchema1BoxedString +public record ApplicationjsonSchema1BoxedString
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) + +record that stores validated String payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonSchema1BoxedString(String data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## ApplicationjsonSchema1BoxedList +public record ApplicationjsonSchema1BoxedList
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) + +record that stores validated List payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonSchema1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## ApplicationjsonSchema1BoxedMap +public record ApplicationjsonSchema1BoxedMap
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonSchema1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## ApplicationjsonSchema1 +public static class ApplicationjsonSchema1
+extends AnyTypeJsonSchema.AnyTypeJsonSchema1 + +A schema class that validates payloads + +| Methods Inherited from class org.openapijsonschematools.client.schemas.AnyTypeJsonSchema.AnyTypeJsonSchema1 | +| ------------------------------------------------------------------ | +| validate | +| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/responses/response200/content/applicationjson/ApplicationjsonSchema.md b/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/responses/response200/content/applicationjson/ApplicationjsonSchema.md deleted file mode 100644 index 53da126ffca..00000000000 --- a/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/responses/response200/content/applicationjson/ApplicationjsonSchema.md +++ /dev/null @@ -1,138 +0,0 @@ -# ApplicationjsonSchema -public class ApplicationjsonSchema
- -A class that contains necessary nested -- schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type -- boxed classes which store validated payloads, sealed permits class implementations - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | ---------------------- | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed)
abstract sealed validated payload class | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedVoid](#applicationjsonschema1boxedvoid)
boxed class to store validated null payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedBoolean](#applicationjsonschema1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedNumber](#applicationjsonschema1boxednumber)
boxed class to store validated Number payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedString](#applicationjsonschema1boxedstring)
boxed class to store validated String payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedList](#applicationjsonschema1boxedlist)
boxed class to store validated List payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap)
boxed class to store validated Map payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1](#applicationjsonschema1)
schema class | - -## ApplicationjsonSchema1Boxed -public static abstract sealed class ApplicationjsonSchema1Boxed
-permits
-[ApplicationjsonSchema1BoxedVoid](#applicationjsonschema1boxedvoid), -[ApplicationjsonSchema1BoxedBoolean](#applicationjsonschema1boxedboolean), -[ApplicationjsonSchema1BoxedNumber](#applicationjsonschema1boxednumber), -[ApplicationjsonSchema1BoxedString](#applicationjsonschema1boxedstring), -[ApplicationjsonSchema1BoxedList](#applicationjsonschema1boxedlist), -[ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap) - -abstract sealed class that stores validated payloads using boxed classes - -## ApplicationjsonSchema1BoxedVoid -public static final class ApplicationjsonSchema1BoxedVoid
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) - -a boxed class to store validated null payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonSchema1BoxedVoid(Void data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| Void | data
validated payload | - -## ApplicationjsonSchema1BoxedBoolean -public static final class ApplicationjsonSchema1BoxedBoolean
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) - -a boxed class to store validated boolean payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonSchema1BoxedBoolean(boolean data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| boolean | data
validated payload | - -## ApplicationjsonSchema1BoxedNumber -public static final class ApplicationjsonSchema1BoxedNumber
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) - -a boxed class to store validated Number payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonSchema1BoxedNumber(Number data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| Number | data
validated payload | - -## ApplicationjsonSchema1BoxedString -public static final class ApplicationjsonSchema1BoxedString
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) - -a boxed class to store validated String payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonSchema1BoxedString(String data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| String | data
validated payload | - -## ApplicationjsonSchema1BoxedList -public static final class ApplicationjsonSchema1BoxedList
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) - -a boxed class to store validated List payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonSchema1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | - -## ApplicationjsonSchema1BoxedMap -public static final class ApplicationjsonSchema1BoxedMap
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) - -a boxed class to store validated Map payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonSchema1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | - -## ApplicationjsonSchema1 -public static class ApplicationjsonSchema1
-extends AnyTypeJsonSchema.AnyTypeJsonSchema1 - -A schema class that validates payloads - -| Methods Inherited from class org.openapijsonschematools.client.schemas.AnyTypeJsonSchema.AnyTypeJsonSchema1 | -| ------------------------------------------------------------------ | -| validate | -| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/fakepemcontenttype/get/requestbody/content/applicationxpemfile/ApplicationxpemfileSchema.md b/samples/client/petstore/java/docs/paths/fakepemcontenttype/get/requestbody/content/applicationxpemfile/ApplicationxpemfileSchema.md index 8c626d2131a..91a1e361623 100644 --- a/samples/client/petstore/java/docs/paths/fakepemcontenttype/get/requestbody/content/applicationxpemfile/ApplicationxpemfileSchema.md +++ b/samples/client/petstore/java/docs/paths/fakepemcontenttype/get/requestbody/content/applicationxpemfile/ApplicationxpemfileSchema.md @@ -3,38 +3,39 @@ public class ApplicationxpemfileSchema
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ApplicationxpemfileSchema.ApplicationxpemfileSchema1Boxed](#applicationxpemfileschema1boxed)
abstract sealed validated payload class | -| static class | [ApplicationxpemfileSchema.ApplicationxpemfileSchema1BoxedString](#applicationxpemfileschema1boxedstring)
boxed class to store validated String payloads | +| sealed interface | [ApplicationxpemfileSchema.ApplicationxpemfileSchema1Boxed](#applicationxpemfileschema1boxed)
sealed interface for validated payloads | +| record | [ApplicationxpemfileSchema.ApplicationxpemfileSchema1BoxedString](#applicationxpemfileschema1boxedstring)
boxed class to store validated String payloads | | static class | [ApplicationxpemfileSchema.ApplicationxpemfileSchema1](#applicationxpemfileschema1)
schema class | ## ApplicationxpemfileSchema1Boxed -public static abstract sealed class ApplicationxpemfileSchema1Boxed
+public sealed interface ApplicationxpemfileSchema1Boxed
permits
[ApplicationxpemfileSchema1BoxedString](#applicationxpemfileschema1boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ApplicationxpemfileSchema1BoxedString -public static final class ApplicationxpemfileSchema1BoxedString
-extends [ApplicationxpemfileSchema1Boxed](#applicationxpemfileschema1boxed) +public record ApplicationxpemfileSchema1BoxedString
+implements [ApplicationxpemfileSchema1Boxed](#applicationxpemfileschema1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ApplicationxpemfileSchema1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ApplicationxpemfileSchema1 public static class ApplicationxpemfileSchema1
diff --git a/samples/client/petstore/java/docs/paths/fakepemcontenttype/get/responses/response200/content/applicationxpemfile/ApplicationxpemfileSchema.md b/samples/client/petstore/java/docs/paths/fakepemcontenttype/get/responses/code200response/content/applicationxpemfile/ApplicationxpemfileSchema.md similarity index 60% rename from samples/client/petstore/java/docs/paths/fakepemcontenttype/get/responses/response200/content/applicationxpemfile/ApplicationxpemfileSchema.md rename to samples/client/petstore/java/docs/paths/fakepemcontenttype/get/responses/code200response/content/applicationxpemfile/ApplicationxpemfileSchema.md index 8c626d2131a..91a1e361623 100644 --- a/samples/client/petstore/java/docs/paths/fakepemcontenttype/get/responses/response200/content/applicationxpemfile/ApplicationxpemfileSchema.md +++ b/samples/client/petstore/java/docs/paths/fakepemcontenttype/get/responses/code200response/content/applicationxpemfile/ApplicationxpemfileSchema.md @@ -3,38 +3,39 @@ public class ApplicationxpemfileSchema
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ApplicationxpemfileSchema.ApplicationxpemfileSchema1Boxed](#applicationxpemfileschema1boxed)
abstract sealed validated payload class | -| static class | [ApplicationxpemfileSchema.ApplicationxpemfileSchema1BoxedString](#applicationxpemfileschema1boxedstring)
boxed class to store validated String payloads | +| sealed interface | [ApplicationxpemfileSchema.ApplicationxpemfileSchema1Boxed](#applicationxpemfileschema1boxed)
sealed interface for validated payloads | +| record | [ApplicationxpemfileSchema.ApplicationxpemfileSchema1BoxedString](#applicationxpemfileschema1boxedstring)
boxed class to store validated String payloads | | static class | [ApplicationxpemfileSchema.ApplicationxpemfileSchema1](#applicationxpemfileschema1)
schema class | ## ApplicationxpemfileSchema1Boxed -public static abstract sealed class ApplicationxpemfileSchema1Boxed
+public sealed interface ApplicationxpemfileSchema1Boxed
permits
[ApplicationxpemfileSchema1BoxedString](#applicationxpemfileschema1boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ApplicationxpemfileSchema1BoxedString -public static final class ApplicationxpemfileSchema1BoxedString
-extends [ApplicationxpemfileSchema1Boxed](#applicationxpemfileschema1boxed) +public record ApplicationxpemfileSchema1BoxedString
+implements [ApplicationxpemfileSchema1Boxed](#applicationxpemfileschema1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ApplicationxpemfileSchema1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ApplicationxpemfileSchema1 public static class ApplicationxpemfileSchema1
diff --git a/samples/client/petstore/java/docs/paths/fakepetiduploadimagewithrequiredfile/post/parameters/parameter0/Schema0.md b/samples/client/petstore/java/docs/paths/fakepetiduploadimagewithrequiredfile/post/parameters/parameter0/Schema0.md index f2092272f63..55e4e5cb238 100644 --- a/samples/client/petstore/java/docs/paths/fakepetiduploadimagewithrequiredfile/post/parameters/parameter0/Schema0.md +++ b/samples/client/petstore/java/docs/paths/fakepetiduploadimagewithrequiredfile/post/parameters/parameter0/Schema0.md @@ -3,38 +3,39 @@ public class Schema0
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Schema0.Schema01Boxed](#schema01boxed)
abstract sealed validated payload class | -| static class | [Schema0.Schema01BoxedNumber](#schema01boxednumber)
boxed class to store validated Number payloads | +| sealed interface | [Schema0.Schema01Boxed](#schema01boxed)
sealed interface for validated payloads | +| record | [Schema0.Schema01BoxedNumber](#schema01boxednumber)
boxed class to store validated Number payloads | | static class | [Schema0.Schema01](#schema01)
schema class | ## Schema01Boxed -public static abstract sealed class Schema01Boxed
+public sealed interface Schema01Boxed
permits
[Schema01BoxedNumber](#schema01boxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema01BoxedNumber -public static final class Schema01BoxedNumber
-extends [Schema01Boxed](#schema01boxed) +public record Schema01BoxedNumber
+implements [Schema01Boxed](#schema01boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema01BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema01 public static class Schema01
diff --git a/samples/client/petstore/java/docs/paths/fakepetiduploadimagewithrequiredfile/post/requestbody/content/multipartformdata/MultipartformdataSchema.md b/samples/client/petstore/java/docs/paths/fakepetiduploadimagewithrequiredfile/post/requestbody/content/multipartformdata/MultipartformdataSchema.md index 4191061e4b1..e639984564c 100644 --- a/samples/client/petstore/java/docs/paths/fakepetiduploadimagewithrequiredfile/post/requestbody/content/multipartformdata/MultipartformdataSchema.md +++ b/samples/client/petstore/java/docs/paths/fakepetiduploadimagewithrequiredfile/post/requestbody/content/multipartformdata/MultipartformdataSchema.md @@ -3,7 +3,7 @@ public class MultipartformdataSchema
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -11,39 +11,40 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [MultipartformdataSchema.MultipartformdataSchema1Boxed](#multipartformdataschema1boxed)
abstract sealed validated payload class | -| static class | [MultipartformdataSchema.MultipartformdataSchema1BoxedMap](#multipartformdataschema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [MultipartformdataSchema.MultipartformdataSchema1Boxed](#multipartformdataschema1boxed)
sealed interface for validated payloads | +| record | [MultipartformdataSchema.MultipartformdataSchema1BoxedMap](#multipartformdataschema1boxedmap)
boxed class to store validated Map payloads | | static class | [MultipartformdataSchema.MultipartformdataSchema1](#multipartformdataschema1)
schema class | | static class | [MultipartformdataSchema.MultipartformdataSchemaMapBuilder](#multipartformdataschemamapbuilder)
builder for Map payloads | | static class | [MultipartformdataSchema.MultipartformdataSchemaMap](#multipartformdataschemamap)
output class for Map payloads | -| static class | [MultipartformdataSchema.MultipartformdataRequiredFileBoxed](#multipartformdatarequiredfileboxed)
abstract sealed validated payload class | +| sealed interface | [MultipartformdataSchema.MultipartformdataRequiredFileBoxed](#multipartformdatarequiredfileboxed)
sealed interface for validated payloads | | static class | [MultipartformdataSchema.MultipartformdataRequiredFile](#multipartformdatarequiredfile)
schema class | -| static class | [MultipartformdataSchema.MultipartformdataAdditionalMetadataBoxed](#multipartformdataadditionalmetadataboxed)
abstract sealed validated payload class | -| static class | [MultipartformdataSchema.MultipartformdataAdditionalMetadataBoxedString](#multipartformdataadditionalmetadataboxedstring)
boxed class to store validated String payloads | +| sealed interface | [MultipartformdataSchema.MultipartformdataAdditionalMetadataBoxed](#multipartformdataadditionalmetadataboxed)
sealed interface for validated payloads | +| record | [MultipartformdataSchema.MultipartformdataAdditionalMetadataBoxedString](#multipartformdataadditionalmetadataboxedstring)
boxed class to store validated String payloads | | static class | [MultipartformdataSchema.MultipartformdataAdditionalMetadata](#multipartformdataadditionalmetadata)
schema class | ## MultipartformdataSchema1Boxed -public static abstract sealed class MultipartformdataSchema1Boxed
+public sealed interface MultipartformdataSchema1Boxed
permits
[MultipartformdataSchema1BoxedMap](#multipartformdataschema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## MultipartformdataSchema1BoxedMap -public static final class MultipartformdataSchema1BoxedMap
-extends [MultipartformdataSchema1Boxed](#multipartformdataschema1boxed) +public record MultipartformdataSchema1BoxedMap
+implements [MultipartformdataSchema1Boxed](#multipartformdataschema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MultipartformdataSchema1BoxedMap([MultipartformdataSchemaMap](#multipartformdataschemamap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [MultipartformdataSchemaMap](#multipartformdataschemamap) | data
validated payload | +| [MultipartformdataSchemaMap](#multipartformdataschemamap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MultipartformdataSchema1 public static class MultipartformdataSchema1
@@ -91,7 +92,9 @@ MultipartformdataSchema.MultipartformdataSchemaMap validatedPayload = | ----------------- | ---------------------- | | [MultipartformdataSchemaMap](#multipartformdataschemamap) | validate([Map<?, ?>](#multipartformdataschemamapbuilder) arg, SchemaConfiguration configuration) | | [MultipartformdataSchema1BoxedMap](#multipartformdataschema1boxedmap) | validateAndBox([Map<?, ?>](#multipartformdataschemamapbuilder) arg, SchemaConfiguration configuration) | +| [MultipartformdataSchema1Boxed](#multipartformdataschema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## MultipartformdataSchemaMap0Builder public class MultipartformdataSchemaMap0Builder
builder for `Map` @@ -149,10 +152,10 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## MultipartformdataRequiredFileBoxed -public static abstract sealed class MultipartformdataRequiredFileBoxed
+public sealed interface MultipartformdataRequiredFileBoxed
permits
-abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## MultipartformdataRequiredFile public static class MultipartformdataRequiredFile
@@ -164,27 +167,28 @@ A schema class that validates payloads file to upload ## MultipartformdataAdditionalMetadataBoxed -public static abstract sealed class MultipartformdataAdditionalMetadataBoxed
+public sealed interface MultipartformdataAdditionalMetadataBoxed
permits
[MultipartformdataAdditionalMetadataBoxedString](#multipartformdataadditionalmetadataboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## MultipartformdataAdditionalMetadataBoxedString -public static final class MultipartformdataAdditionalMetadataBoxedString
-extends [MultipartformdataAdditionalMetadataBoxed](#multipartformdataadditionalmetadataboxed) +public record MultipartformdataAdditionalMetadataBoxedString
+implements [MultipartformdataAdditionalMetadataBoxed](#multipartformdataadditionalmetadataboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MultipartformdataAdditionalMetadataBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MultipartformdataAdditionalMetadata public static class MultipartformdataAdditionalMetadata
diff --git a/samples/client/petstore/java/docs/paths/fakeuploadfile/post/responses/response200/content/applicationjson/ApplicationjsonSchema.md b/samples/client/petstore/java/docs/paths/fakepetiduploadimagewithrequiredfile/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md similarity index 90% rename from samples/client/petstore/java/docs/paths/fakeuploadfile/post/responses/response200/content/applicationjson/ApplicationjsonSchema.md rename to samples/client/petstore/java/docs/paths/fakepetiduploadimagewithrequiredfile/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md index 5b1a73c4aed..99e81a1b57d 100644 --- a/samples/client/petstore/java/docs/paths/fakeuploadfile/post/responses/response200/content/applicationjson/ApplicationjsonSchema.md +++ b/samples/client/petstore/java/docs/paths/fakepetiduploadimagewithrequiredfile/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md @@ -4,7 +4,7 @@ extends [ApiResponseSchema1](../../../../../../../../../components/schemas/ApiRe A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary diff --git a/samples/client/petstore/java/docs/paths/fakequeryparamwithjsoncontenttype/get/parameters/parameter0/content/applicationjson/Schema0.md b/samples/client/petstore/java/docs/paths/fakequeryparamwithjsoncontenttype/get/parameters/parameter0/content/applicationjson/Schema0.md index 83c8cd5f134..d2b7bf3b598 100644 --- a/samples/client/petstore/java/docs/paths/fakequeryparamwithjsoncontenttype/get/parameters/parameter0/content/applicationjson/Schema0.md +++ b/samples/client/petstore/java/docs/paths/fakequeryparamwithjsoncontenttype/get/parameters/parameter0/content/applicationjson/Schema0.md @@ -3,23 +3,23 @@ public class Schema0
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Schema0.Schema01Boxed](#schema01boxed)
abstract sealed validated payload class | -| static class | [Schema0.Schema01BoxedVoid](#schema01boxedvoid)
boxed class to store validated null payloads | -| static class | [Schema0.Schema01BoxedBoolean](#schema01boxedboolean)
boxed class to store validated boolean payloads | -| static class | [Schema0.Schema01BoxedNumber](#schema01boxednumber)
boxed class to store validated Number payloads | -| static class | [Schema0.Schema01BoxedString](#schema01boxedstring)
boxed class to store validated String payloads | -| static class | [Schema0.Schema01BoxedList](#schema01boxedlist)
boxed class to store validated List payloads | -| static class | [Schema0.Schema01BoxedMap](#schema01boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [Schema0.Schema01Boxed](#schema01boxed)
sealed interface for validated payloads | +| record | [Schema0.Schema01BoxedVoid](#schema01boxedvoid)
boxed class to store validated null payloads | +| record | [Schema0.Schema01BoxedBoolean](#schema01boxedboolean)
boxed class to store validated boolean payloads | +| record | [Schema0.Schema01BoxedNumber](#schema01boxednumber)
boxed class to store validated Number payloads | +| record | [Schema0.Schema01BoxedString](#schema01boxedstring)
boxed class to store validated String payloads | +| record | [Schema0.Schema01BoxedList](#schema01boxedlist)
boxed class to store validated List payloads | +| record | [Schema0.Schema01BoxedMap](#schema01boxedmap)
boxed class to store validated Map payloads | | static class | [Schema0.Schema01](#schema01)
schema class | ## Schema01Boxed -public static abstract sealed class Schema01Boxed
+public sealed interface Schema01Boxed
permits
[Schema01BoxedVoid](#schema01boxedvoid), [Schema01BoxedBoolean](#schema01boxedboolean), @@ -28,103 +28,109 @@ permits
[Schema01BoxedList](#schema01boxedlist), [Schema01BoxedMap](#schema01boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema01BoxedVoid -public static final class Schema01BoxedVoid
-extends [Schema01Boxed](#schema01boxed) +public record Schema01BoxedVoid
+implements [Schema01Boxed](#schema01boxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema01BoxedVoid(Void data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema01BoxedBoolean -public static final class Schema01BoxedBoolean
-extends [Schema01Boxed](#schema01boxed) +public record Schema01BoxedBoolean
+implements [Schema01Boxed](#schema01boxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema01BoxedBoolean(boolean data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema01BoxedNumber -public static final class Schema01BoxedNumber
-extends [Schema01Boxed](#schema01boxed) +public record Schema01BoxedNumber
+implements [Schema01Boxed](#schema01boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema01BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema01BoxedString -public static final class Schema01BoxedString
-extends [Schema01Boxed](#schema01boxed) +public record Schema01BoxedString
+implements [Schema01Boxed](#schema01boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema01BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema01BoxedList -public static final class Schema01BoxedList
-extends [Schema01Boxed](#schema01boxed) +public record Schema01BoxedList
+implements [Schema01Boxed](#schema01boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema01BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema01BoxedMap -public static final class Schema01BoxedMap
-extends [Schema01Boxed](#schema01boxed) +public record Schema01BoxedMap
+implements [Schema01Boxed](#schema01boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema01BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema01 public static class Schema01
diff --git a/samples/client/petstore/java/docs/paths/fakequeryparamwithjsoncontenttype/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md b/samples/client/petstore/java/docs/paths/fakequeryparamwithjsoncontenttype/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md new file mode 100644 index 00000000000..98eb062fdd7 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakequeryparamwithjsoncontenttype/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md @@ -0,0 +1,144 @@ +# ApplicationjsonSchema +public class ApplicationjsonSchema
+ +A class that contains necessary nested +- schema classes (which validate payloads), extends JsonSchema +- sealed interfaces which store validated payloads, java version of a sum type +- boxed classes which store validated payloads, sealed permits class implementations + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | ---------------------- | +| sealed interface | [ApplicationjsonSchema.ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed)
sealed interface for validated payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedVoid](#applicationjsonschema1boxedvoid)
boxed class to store validated null payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedBoolean](#applicationjsonschema1boxedboolean)
boxed class to store validated boolean payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedNumber](#applicationjsonschema1boxednumber)
boxed class to store validated Number payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedString](#applicationjsonschema1boxedstring)
boxed class to store validated String payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedList](#applicationjsonschema1boxedlist)
boxed class to store validated List payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap)
boxed class to store validated Map payloads | +| static class | [ApplicationjsonSchema.ApplicationjsonSchema1](#applicationjsonschema1)
schema class | + +## ApplicationjsonSchema1Boxed +public sealed interface ApplicationjsonSchema1Boxed
+permits
+[ApplicationjsonSchema1BoxedVoid](#applicationjsonschema1boxedvoid), +[ApplicationjsonSchema1BoxedBoolean](#applicationjsonschema1boxedboolean), +[ApplicationjsonSchema1BoxedNumber](#applicationjsonschema1boxednumber), +[ApplicationjsonSchema1BoxedString](#applicationjsonschema1boxedstring), +[ApplicationjsonSchema1BoxedList](#applicationjsonschema1boxedlist), +[ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap) + +sealed interface that stores validated payloads using boxed classes + +## ApplicationjsonSchema1BoxedVoid +public record ApplicationjsonSchema1BoxedVoid
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) + +record that stores validated null payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonSchema1BoxedVoid(Void data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## ApplicationjsonSchema1BoxedBoolean +public record ApplicationjsonSchema1BoxedBoolean
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) + +record that stores validated boolean payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonSchema1BoxedBoolean(boolean data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## ApplicationjsonSchema1BoxedNumber +public record ApplicationjsonSchema1BoxedNumber
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) + +record that stores validated Number payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonSchema1BoxedNumber(Number data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## ApplicationjsonSchema1BoxedString +public record ApplicationjsonSchema1BoxedString
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) + +record that stores validated String payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonSchema1BoxedString(String data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## ApplicationjsonSchema1BoxedList +public record ApplicationjsonSchema1BoxedList
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) + +record that stores validated List payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonSchema1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## ApplicationjsonSchema1BoxedMap +public record ApplicationjsonSchema1BoxedMap
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonSchema1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## ApplicationjsonSchema1 +public static class ApplicationjsonSchema1
+extends AnyTypeJsonSchema.AnyTypeJsonSchema1 + +A schema class that validates payloads + +| Methods Inherited from class org.openapijsonschematools.client.schemas.AnyTypeJsonSchema.AnyTypeJsonSchema1 | +| ------------------------------------------------------------------ | +| validate | +| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/fakequeryparamwithjsoncontenttype/get/responses/response200/content/applicationjson/ApplicationjsonSchema.md b/samples/client/petstore/java/docs/paths/fakequeryparamwithjsoncontenttype/get/responses/response200/content/applicationjson/ApplicationjsonSchema.md deleted file mode 100644 index 53da126ffca..00000000000 --- a/samples/client/petstore/java/docs/paths/fakequeryparamwithjsoncontenttype/get/responses/response200/content/applicationjson/ApplicationjsonSchema.md +++ /dev/null @@ -1,138 +0,0 @@ -# ApplicationjsonSchema -public class ApplicationjsonSchema
- -A class that contains necessary nested -- schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type -- boxed classes which store validated payloads, sealed permits class implementations - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | ---------------------- | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed)
abstract sealed validated payload class | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedVoid](#applicationjsonschema1boxedvoid)
boxed class to store validated null payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedBoolean](#applicationjsonschema1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedNumber](#applicationjsonschema1boxednumber)
boxed class to store validated Number payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedString](#applicationjsonschema1boxedstring)
boxed class to store validated String payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedList](#applicationjsonschema1boxedlist)
boxed class to store validated List payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap)
boxed class to store validated Map payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1](#applicationjsonschema1)
schema class | - -## ApplicationjsonSchema1Boxed -public static abstract sealed class ApplicationjsonSchema1Boxed
-permits
-[ApplicationjsonSchema1BoxedVoid](#applicationjsonschema1boxedvoid), -[ApplicationjsonSchema1BoxedBoolean](#applicationjsonschema1boxedboolean), -[ApplicationjsonSchema1BoxedNumber](#applicationjsonschema1boxednumber), -[ApplicationjsonSchema1BoxedString](#applicationjsonschema1boxedstring), -[ApplicationjsonSchema1BoxedList](#applicationjsonschema1boxedlist), -[ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap) - -abstract sealed class that stores validated payloads using boxed classes - -## ApplicationjsonSchema1BoxedVoid -public static final class ApplicationjsonSchema1BoxedVoid
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) - -a boxed class to store validated null payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonSchema1BoxedVoid(Void data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| Void | data
validated payload | - -## ApplicationjsonSchema1BoxedBoolean -public static final class ApplicationjsonSchema1BoxedBoolean
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) - -a boxed class to store validated boolean payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonSchema1BoxedBoolean(boolean data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| boolean | data
validated payload | - -## ApplicationjsonSchema1BoxedNumber -public static final class ApplicationjsonSchema1BoxedNumber
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) - -a boxed class to store validated Number payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonSchema1BoxedNumber(Number data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| Number | data
validated payload | - -## ApplicationjsonSchema1BoxedString -public static final class ApplicationjsonSchema1BoxedString
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) - -a boxed class to store validated String payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonSchema1BoxedString(String data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| String | data
validated payload | - -## ApplicationjsonSchema1BoxedList -public static final class ApplicationjsonSchema1BoxedList
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) - -a boxed class to store validated List payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonSchema1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | - -## ApplicationjsonSchema1BoxedMap -public static final class ApplicationjsonSchema1BoxedMap
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) - -a boxed class to store validated Map payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonSchema1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | - -## ApplicationjsonSchema1 -public static class ApplicationjsonSchema1
-extends AnyTypeJsonSchema.AnyTypeJsonSchema1 - -A schema class that validates payloads - -| Methods Inherited from class org.openapijsonschematools.client.schemas.AnyTypeJsonSchema.AnyTypeJsonSchema1 | -| ------------------------------------------------------------------ | -| validate | -| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/fakerefobjinquery/get/parameters/parameter0/Schema0.md b/samples/client/petstore/java/docs/paths/fakerefobjinquery/get/parameters/parameter0/Schema0.md index 82fb4bd74c3..22b82242cfb 100644 --- a/samples/client/petstore/java/docs/paths/fakerefobjinquery/get/parameters/parameter0/Schema0.md +++ b/samples/client/petstore/java/docs/paths/fakerefobjinquery/get/parameters/parameter0/Schema0.md @@ -4,7 +4,7 @@ extends [Foo1](../../../components/schemas/Foo.md#foo) A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary diff --git a/samples/client/petstore/java/docs/paths/fakerefsarraymodel/post/requestbody/content/applicationjson/ApplicationjsonSchema.md b/samples/client/petstore/java/docs/paths/fakerefsarraymodel/post/requestbody/content/applicationjson/ApplicationjsonSchema.md index 7c7951a4266..f4786efc35d 100644 --- a/samples/client/petstore/java/docs/paths/fakerefsarraymodel/post/requestbody/content/applicationjson/ApplicationjsonSchema.md +++ b/samples/client/petstore/java/docs/paths/fakerefsarraymodel/post/requestbody/content/applicationjson/ApplicationjsonSchema.md @@ -4,7 +4,7 @@ extends [AnimalFarm1](../../../../../../../components/schemas/AnimalFarm.md#anim A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary diff --git a/samples/client/petstore/java/docs/paths/fakerefsarraymodel/post/responses/response200/content/applicationjson/ApplicationjsonSchema.md b/samples/client/petstore/java/docs/paths/fakerefsarraymodel/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md similarity index 90% rename from samples/client/petstore/java/docs/paths/fakerefsarraymodel/post/responses/response200/content/applicationjson/ApplicationjsonSchema.md rename to samples/client/petstore/java/docs/paths/fakerefsarraymodel/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md index 027d9f13490..7eb02fafbcb 100644 --- a/samples/client/petstore/java/docs/paths/fakerefsarraymodel/post/responses/response200/content/applicationjson/ApplicationjsonSchema.md +++ b/samples/client/petstore/java/docs/paths/fakerefsarraymodel/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md @@ -4,7 +4,7 @@ extends [AnimalFarm1](../../../../../../../../../components/schemas/AnimalFarm.m A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary diff --git a/samples/client/petstore/java/docs/paths/fakerefsarrayofenums/post/requestbody/content/applicationjson/ApplicationjsonSchema.md b/samples/client/petstore/java/docs/paths/fakerefsarrayofenums/post/requestbody/content/applicationjson/ApplicationjsonSchema.md index c53dea03971..82450aa4900 100644 --- a/samples/client/petstore/java/docs/paths/fakerefsarrayofenums/post/requestbody/content/applicationjson/ApplicationjsonSchema.md +++ b/samples/client/petstore/java/docs/paths/fakerefsarrayofenums/post/requestbody/content/applicationjson/ApplicationjsonSchema.md @@ -4,7 +4,7 @@ extends [ArrayOfEnums1](../../../../../../../components/schemas/ArrayOfEnums.md# A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary diff --git a/samples/client/petstore/java/docs/paths/fakerefsarrayofenums/post/responses/response200/content/applicationjson/ApplicationjsonSchema.md b/samples/client/petstore/java/docs/paths/fakerefsarrayofenums/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md similarity index 90% rename from samples/client/petstore/java/docs/paths/fakerefsarrayofenums/post/responses/response200/content/applicationjson/ApplicationjsonSchema.md rename to samples/client/petstore/java/docs/paths/fakerefsarrayofenums/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md index a8038b9ace9..835e837b74a 100644 --- a/samples/client/petstore/java/docs/paths/fakerefsarrayofenums/post/responses/response200/content/applicationjson/ApplicationjsonSchema.md +++ b/samples/client/petstore/java/docs/paths/fakerefsarrayofenums/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md @@ -4,7 +4,7 @@ extends [ArrayOfEnums1](../../../../../../../../../components/schemas/ArrayOfEnu A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary diff --git a/samples/client/petstore/java/docs/paths/fakerefsboolean/post/requestbody/content/applicationjson/ApplicationjsonSchema.md b/samples/client/petstore/java/docs/paths/fakerefsboolean/post/requestbody/content/applicationjson/ApplicationjsonSchema.md index b4aee2dc72f..1694ac4a00a 100644 --- a/samples/client/petstore/java/docs/paths/fakerefsboolean/post/requestbody/content/applicationjson/ApplicationjsonSchema.md +++ b/samples/client/petstore/java/docs/paths/fakerefsboolean/post/requestbody/content/applicationjson/ApplicationjsonSchema.md @@ -4,7 +4,7 @@ extends [BooleanSchema1](../../../../../../../components/schemas/BooleanSchema.m A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary diff --git a/samples/client/petstore/java/docs/paths/fakerefsboolean/post/responses/response200/content/applicationjson/ApplicationjsonSchema.md b/samples/client/petstore/java/docs/paths/fakerefsboolean/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md similarity index 90% rename from samples/client/petstore/java/docs/paths/fakerefsboolean/post/responses/response200/content/applicationjson/ApplicationjsonSchema.md rename to samples/client/petstore/java/docs/paths/fakerefsboolean/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md index dbcf9db5b9d..29cc3b9d760 100644 --- a/samples/client/petstore/java/docs/paths/fakerefsboolean/post/responses/response200/content/applicationjson/ApplicationjsonSchema.md +++ b/samples/client/petstore/java/docs/paths/fakerefsboolean/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md @@ -4,7 +4,7 @@ extends [BooleanSchema1](../../../../../../../../../components/schemas/BooleanSc A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary diff --git a/samples/client/petstore/java/docs/paths/fakerefscomposedoneofnumberwithvalidations/post/requestbody/content/applicationjson/ApplicationjsonSchema.md b/samples/client/petstore/java/docs/paths/fakerefscomposedoneofnumberwithvalidations/post/requestbody/content/applicationjson/ApplicationjsonSchema.md index 8e7d6ab2801..1e3738551c2 100644 --- a/samples/client/petstore/java/docs/paths/fakerefscomposedoneofnumberwithvalidations/post/requestbody/content/applicationjson/ApplicationjsonSchema.md +++ b/samples/client/petstore/java/docs/paths/fakerefscomposedoneofnumberwithvalidations/post/requestbody/content/applicationjson/ApplicationjsonSchema.md @@ -4,7 +4,7 @@ extends [ComposedOneOfDifferentTypes1](../../../../../../../components/schemas/C A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary diff --git a/samples/client/petstore/java/docs/paths/fakerefscomposedoneofnumberwithvalidations/post/responses/response200/content/applicationjson/ApplicationjsonSchema.md b/samples/client/petstore/java/docs/paths/fakerefscomposedoneofnumberwithvalidations/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md similarity index 91% rename from samples/client/petstore/java/docs/paths/fakerefscomposedoneofnumberwithvalidations/post/responses/response200/content/applicationjson/ApplicationjsonSchema.md rename to samples/client/petstore/java/docs/paths/fakerefscomposedoneofnumberwithvalidations/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md index 467ca23ca63..a2c8d6c9559 100644 --- a/samples/client/petstore/java/docs/paths/fakerefscomposedoneofnumberwithvalidations/post/responses/response200/content/applicationjson/ApplicationjsonSchema.md +++ b/samples/client/petstore/java/docs/paths/fakerefscomposedoneofnumberwithvalidations/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md @@ -4,7 +4,7 @@ extends [ComposedOneOfDifferentTypes1](../../../../../../../../../components/sch A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary diff --git a/samples/client/petstore/java/docs/paths/fakerefsenum/post/requestbody/content/applicationjson/ApplicationjsonSchema.md b/samples/client/petstore/java/docs/paths/fakerefsenum/post/requestbody/content/applicationjson/ApplicationjsonSchema.md index aace8ee4545..2ac02fd09b9 100644 --- a/samples/client/petstore/java/docs/paths/fakerefsenum/post/requestbody/content/applicationjson/ApplicationjsonSchema.md +++ b/samples/client/petstore/java/docs/paths/fakerefsenum/post/requestbody/content/applicationjson/ApplicationjsonSchema.md @@ -4,7 +4,7 @@ extends [StringEnum1](../../../../../../../components/schemas/StringEnum.md#stri A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary diff --git a/samples/client/petstore/java/docs/paths/fakerefsenum/post/responses/response200/content/applicationjson/ApplicationjsonSchema.md b/samples/client/petstore/java/docs/paths/fakerefsenum/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md similarity index 90% rename from samples/client/petstore/java/docs/paths/fakerefsenum/post/responses/response200/content/applicationjson/ApplicationjsonSchema.md rename to samples/client/petstore/java/docs/paths/fakerefsenum/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md index a51193aa773..3d7b311e68f 100644 --- a/samples/client/petstore/java/docs/paths/fakerefsenum/post/responses/response200/content/applicationjson/ApplicationjsonSchema.md +++ b/samples/client/petstore/java/docs/paths/fakerefsenum/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md @@ -4,7 +4,7 @@ extends [StringEnum1](../../../../../../../../../components/schemas/StringEnum.m A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary diff --git a/samples/client/petstore/java/docs/paths/fakerefsmammal/post/requestbody/content/applicationjson/ApplicationjsonSchema.md b/samples/client/petstore/java/docs/paths/fakerefsmammal/post/requestbody/content/applicationjson/ApplicationjsonSchema.md index a3fb7378e69..f0a5b53544f 100644 --- a/samples/client/petstore/java/docs/paths/fakerefsmammal/post/requestbody/content/applicationjson/ApplicationjsonSchema.md +++ b/samples/client/petstore/java/docs/paths/fakerefsmammal/post/requestbody/content/applicationjson/ApplicationjsonSchema.md @@ -4,7 +4,7 @@ extends [Mammal1](../../../../../../../components/schemas/Mammal.md#mammal) A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary diff --git a/samples/client/petstore/java/docs/paths/fakerefsmammal/post/responses/response200/content/applicationjson/ApplicationjsonSchema.md b/samples/client/petstore/java/docs/paths/fakerefsmammal/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md similarity index 89% rename from samples/client/petstore/java/docs/paths/fakerefsmammal/post/responses/response200/content/applicationjson/ApplicationjsonSchema.md rename to samples/client/petstore/java/docs/paths/fakerefsmammal/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md index d3f939d94f9..41b8db552fa 100644 --- a/samples/client/petstore/java/docs/paths/fakerefsmammal/post/responses/response200/content/applicationjson/ApplicationjsonSchema.md +++ b/samples/client/petstore/java/docs/paths/fakerefsmammal/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md @@ -4,7 +4,7 @@ extends [Mammal1](../../../../../../../../../components/schemas/Mammal.md#mammal A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary diff --git a/samples/client/petstore/java/docs/paths/fakerefsnumber/post/requestbody/content/applicationjson/ApplicationjsonSchema.md b/samples/client/petstore/java/docs/paths/fakerefsnumber/post/requestbody/content/applicationjson/ApplicationjsonSchema.md index 32a1d8ad1a2..a903474b2ee 100644 --- a/samples/client/petstore/java/docs/paths/fakerefsnumber/post/requestbody/content/applicationjson/ApplicationjsonSchema.md +++ b/samples/client/petstore/java/docs/paths/fakerefsnumber/post/requestbody/content/applicationjson/ApplicationjsonSchema.md @@ -4,7 +4,7 @@ extends [NumberWithValidations1](../../../../../../../components/schemas/NumberW A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary diff --git a/samples/client/petstore/java/docs/paths/fakerefsnumber/post/responses/response200/content/applicationjson/ApplicationjsonSchema.md b/samples/client/petstore/java/docs/paths/fakerefsnumber/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md similarity index 91% rename from samples/client/petstore/java/docs/paths/fakerefsnumber/post/responses/response200/content/applicationjson/ApplicationjsonSchema.md rename to samples/client/petstore/java/docs/paths/fakerefsnumber/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md index 484c0df9d73..b92500c8220 100644 --- a/samples/client/petstore/java/docs/paths/fakerefsnumber/post/responses/response200/content/applicationjson/ApplicationjsonSchema.md +++ b/samples/client/petstore/java/docs/paths/fakerefsnumber/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md @@ -4,7 +4,7 @@ extends [NumberWithValidations1](../../../../../../../../../components/schemas/N A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary diff --git a/samples/client/petstore/java/docs/paths/fakerefsobjectmodelwithrefprops/post/requestbody/content/applicationjson/ApplicationjsonSchema.md b/samples/client/petstore/java/docs/paths/fakerefsobjectmodelwithrefprops/post/requestbody/content/applicationjson/ApplicationjsonSchema.md index 138ea0ad726..495e07e6094 100644 --- a/samples/client/petstore/java/docs/paths/fakerefsobjectmodelwithrefprops/post/requestbody/content/applicationjson/ApplicationjsonSchema.md +++ b/samples/client/petstore/java/docs/paths/fakerefsobjectmodelwithrefprops/post/requestbody/content/applicationjson/ApplicationjsonSchema.md @@ -4,7 +4,7 @@ extends [ObjectModelWithRefProps1](../../../../../../../components/schemas/Objec A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary diff --git a/samples/client/petstore/java/docs/paths/fakerefsobjectmodelwithrefprops/post/responses/response200/content/applicationjson/ApplicationjsonSchema.md b/samples/client/petstore/java/docs/paths/fakerefsobjectmodelwithrefprops/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md similarity index 91% rename from samples/client/petstore/java/docs/paths/fakerefsobjectmodelwithrefprops/post/responses/response200/content/applicationjson/ApplicationjsonSchema.md rename to samples/client/petstore/java/docs/paths/fakerefsobjectmodelwithrefprops/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md index 7888b2700a2..2bf27caf427 100644 --- a/samples/client/petstore/java/docs/paths/fakerefsobjectmodelwithrefprops/post/responses/response200/content/applicationjson/ApplicationjsonSchema.md +++ b/samples/client/petstore/java/docs/paths/fakerefsobjectmodelwithrefprops/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md @@ -4,7 +4,7 @@ extends [ObjectModelWithRefProps1](../../../../../../../../../components/schemas A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary diff --git a/samples/client/petstore/java/docs/paths/fakerefsstring/post/requestbody/content/applicationjson/ApplicationjsonSchema.md b/samples/client/petstore/java/docs/paths/fakerefsstring/post/requestbody/content/applicationjson/ApplicationjsonSchema.md index 5b0190c1a15..8fadd779761 100644 --- a/samples/client/petstore/java/docs/paths/fakerefsstring/post/requestbody/content/applicationjson/ApplicationjsonSchema.md +++ b/samples/client/petstore/java/docs/paths/fakerefsstring/post/requestbody/content/applicationjson/ApplicationjsonSchema.md @@ -4,7 +4,7 @@ extends [StringSchema1](../../../../../../../components/schemas/StringSchema.md# A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary diff --git a/samples/client/petstore/java/docs/paths/fakerefsstring/post/responses/response200/content/applicationjson/ApplicationjsonSchema.md b/samples/client/petstore/java/docs/paths/fakerefsstring/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md similarity index 90% rename from samples/client/petstore/java/docs/paths/fakerefsstring/post/responses/response200/content/applicationjson/ApplicationjsonSchema.md rename to samples/client/petstore/java/docs/paths/fakerefsstring/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md index 1a6cf54dc0b..182ab3570a2 100644 --- a/samples/client/petstore/java/docs/paths/fakerefsstring/post/responses/response200/content/applicationjson/ApplicationjsonSchema.md +++ b/samples/client/petstore/java/docs/paths/fakerefsstring/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md @@ -4,7 +4,7 @@ extends [StringSchema1](../../../../../../../../../components/schemas/StringSche A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary diff --git a/samples/client/petstore/java/docs/paths/faketestqueryparamters/put/parameters/parameter0/Schema0.md b/samples/client/petstore/java/docs/paths/faketestqueryparamters/put/parameters/parameter0/Schema0.md index 7ad494f7333..037912fe768 100644 --- a/samples/client/petstore/java/docs/paths/faketestqueryparamters/put/parameters/parameter0/Schema0.md +++ b/samples/client/petstore/java/docs/paths/faketestqueryparamters/put/parameters/parameter0/Schema0.md @@ -3,7 +3,7 @@ public class Schema0
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated list payloads, extends FrozenList - classes to build inputs for list payloads @@ -11,37 +11,38 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Schema0.Schema01Boxed](#schema01boxed)
abstract sealed validated payload class | -| static class | [Schema0.Schema01BoxedList](#schema01boxedlist)
boxed class to store validated List payloads | +| sealed interface | [Schema0.Schema01Boxed](#schema01boxed)
sealed interface for validated payloads | +| record | [Schema0.Schema01BoxedList](#schema01boxedlist)
boxed class to store validated List payloads | | static class | [Schema0.Schema01](#schema01)
schema class | | static class | [Schema0.SchemaListBuilder0](#schemalistbuilder0)
builder for List payloads | | static class | [Schema0.SchemaList0](#schemalist0)
output class for List payloads | -| static class | [Schema0.Items0Boxed](#items0boxed)
abstract sealed validated payload class | -| static class | [Schema0.Items0BoxedString](#items0boxedstring)
boxed class to store validated String payloads | +| sealed interface | [Schema0.Items0Boxed](#items0boxed)
sealed interface for validated payloads | +| record | [Schema0.Items0BoxedString](#items0boxedstring)
boxed class to store validated String payloads | | static class | [Schema0.Items0](#items0)
schema class | ## Schema01Boxed -public static abstract sealed class Schema01Boxed
+public sealed interface Schema01Boxed
permits
[Schema01BoxedList](#schema01boxedlist) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema01BoxedList -public static final class Schema01BoxedList
-extends [Schema01Boxed](#schema01boxed) +public record Schema01BoxedList
+implements [Schema01Boxed](#schema01boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema01BoxedList([SchemaList0](#schemalist0) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [SchemaList0](#schemalist0) | data
validated payload | +| [SchemaList0](#schemalist0) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema01 public static class Schema01
@@ -86,7 +87,9 @@ Schema0.SchemaList0 validatedPayload = | ----------------- | ---------------------- | | [SchemaList0](#schemalist0) | validate([List](#schemalistbuilder0) arg, SchemaConfiguration configuration) | | [Schema01BoxedList](#schema01boxedlist) | validateAndBox([List](#schemalistbuilder0) arg, SchemaConfiguration configuration) | +| [Schema01Boxed](#schema01boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## SchemaListBuilder0 public class SchemaListBuilder0
builder for `List` @@ -117,27 +120,28 @@ A class to store validated List payloads | static [SchemaList0](#schemalist0) | of([List](#schemalistbuilder0) arg, SchemaConfiguration configuration) | ## Items0Boxed -public static abstract sealed class Items0Boxed
+public sealed interface Items0Boxed
permits
[Items0BoxedString](#items0boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Items0BoxedString -public static final class Items0BoxedString
-extends [Items0Boxed](#items0boxed) +public record Items0BoxedString
+implements [Items0Boxed](#items0boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Items0BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Items0 public static class Items0
diff --git a/samples/client/petstore/java/docs/paths/faketestqueryparamters/put/parameters/parameter1/Schema1.md b/samples/client/petstore/java/docs/paths/faketestqueryparamters/put/parameters/parameter1/Schema1.md index 3217823effa..489e516237c 100644 --- a/samples/client/petstore/java/docs/paths/faketestqueryparamters/put/parameters/parameter1/Schema1.md +++ b/samples/client/petstore/java/docs/paths/faketestqueryparamters/put/parameters/parameter1/Schema1.md @@ -3,7 +3,7 @@ public class Schema1
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated list payloads, extends FrozenList - classes to build inputs for list payloads @@ -11,37 +11,38 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Schema1.Schema11Boxed](#schema11boxed)
abstract sealed validated payload class | -| static class | [Schema1.Schema11BoxedList](#schema11boxedlist)
boxed class to store validated List payloads | +| sealed interface | [Schema1.Schema11Boxed](#schema11boxed)
sealed interface for validated payloads | +| record | [Schema1.Schema11BoxedList](#schema11boxedlist)
boxed class to store validated List payloads | | static class | [Schema1.Schema11](#schema11)
schema class | | static class | [Schema1.SchemaListBuilder1](#schemalistbuilder1)
builder for List payloads | | static class | [Schema1.SchemaList1](#schemalist1)
output class for List payloads | -| static class | [Schema1.Items1Boxed](#items1boxed)
abstract sealed validated payload class | -| static class | [Schema1.Items1BoxedString](#items1boxedstring)
boxed class to store validated String payloads | +| sealed interface | [Schema1.Items1Boxed](#items1boxed)
sealed interface for validated payloads | +| record | [Schema1.Items1BoxedString](#items1boxedstring)
boxed class to store validated String payloads | | static class | [Schema1.Items1](#items1)
schema class | ## Schema11Boxed -public static abstract sealed class Schema11Boxed
+public sealed interface Schema11Boxed
permits
[Schema11BoxedList](#schema11boxedlist) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema11BoxedList -public static final class Schema11BoxedList
-extends [Schema11Boxed](#schema11boxed) +public record Schema11BoxedList
+implements [Schema11Boxed](#schema11boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema11BoxedList([SchemaList1](#schemalist1) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [SchemaList1](#schemalist1) | data
validated payload | +| [SchemaList1](#schemalist1) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema11 public static class Schema11
@@ -86,7 +87,9 @@ Schema1.SchemaList1 validatedPayload = | ----------------- | ---------------------- | | [SchemaList1](#schemalist1) | validate([List](#schemalistbuilder1) arg, SchemaConfiguration configuration) | | [Schema11BoxedList](#schema11boxedlist) | validateAndBox([List](#schemalistbuilder1) arg, SchemaConfiguration configuration) | +| [Schema11Boxed](#schema11boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## SchemaListBuilder1 public class SchemaListBuilder1
builder for `List` @@ -117,27 +120,28 @@ A class to store validated List payloads | static [SchemaList1](#schemalist1) | of([List](#schemalistbuilder1) arg, SchemaConfiguration configuration) | ## Items1Boxed -public static abstract sealed class Items1Boxed
+public sealed interface Items1Boxed
permits
[Items1BoxedString](#items1boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Items1BoxedString -public static final class Items1BoxedString
-extends [Items1Boxed](#items1boxed) +public record Items1BoxedString
+implements [Items1Boxed](#items1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Items1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Items1 public static class Items1
diff --git a/samples/client/petstore/java/docs/paths/faketestqueryparamters/put/parameters/parameter2/Schema2.md b/samples/client/petstore/java/docs/paths/faketestqueryparamters/put/parameters/parameter2/Schema2.md index 6ac20c19e6b..19b1f1859f2 100644 --- a/samples/client/petstore/java/docs/paths/faketestqueryparamters/put/parameters/parameter2/Schema2.md +++ b/samples/client/petstore/java/docs/paths/faketestqueryparamters/put/parameters/parameter2/Schema2.md @@ -3,7 +3,7 @@ public class Schema2
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated list payloads, extends FrozenList - classes to build inputs for list payloads @@ -11,37 +11,38 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Schema2.Schema21Boxed](#schema21boxed)
abstract sealed validated payload class | -| static class | [Schema2.Schema21BoxedList](#schema21boxedlist)
boxed class to store validated List payloads | +| sealed interface | [Schema2.Schema21Boxed](#schema21boxed)
sealed interface for validated payloads | +| record | [Schema2.Schema21BoxedList](#schema21boxedlist)
boxed class to store validated List payloads | | static class | [Schema2.Schema21](#schema21)
schema class | | static class | [Schema2.SchemaListBuilder2](#schemalistbuilder2)
builder for List payloads | | static class | [Schema2.SchemaList2](#schemalist2)
output class for List payloads | -| static class | [Schema2.Items2Boxed](#items2boxed)
abstract sealed validated payload class | -| static class | [Schema2.Items2BoxedString](#items2boxedstring)
boxed class to store validated String payloads | +| sealed interface | [Schema2.Items2Boxed](#items2boxed)
sealed interface for validated payloads | +| record | [Schema2.Items2BoxedString](#items2boxedstring)
boxed class to store validated String payloads | | static class | [Schema2.Items2](#items2)
schema class | ## Schema21Boxed -public static abstract sealed class Schema21Boxed
+public sealed interface Schema21Boxed
permits
[Schema21BoxedList](#schema21boxedlist) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema21BoxedList -public static final class Schema21BoxedList
-extends [Schema21Boxed](#schema21boxed) +public record Schema21BoxedList
+implements [Schema21Boxed](#schema21boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema21BoxedList([SchemaList2](#schemalist2) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [SchemaList2](#schemalist2) | data
validated payload | +| [SchemaList2](#schemalist2) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema21 public static class Schema21
@@ -86,7 +87,9 @@ Schema2.SchemaList2 validatedPayload = | ----------------- | ---------------------- | | [SchemaList2](#schemalist2) | validate([List](#schemalistbuilder2) arg, SchemaConfiguration configuration) | | [Schema21BoxedList](#schema21boxedlist) | validateAndBox([List](#schemalistbuilder2) arg, SchemaConfiguration configuration) | +| [Schema21Boxed](#schema21boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## SchemaListBuilder2 public class SchemaListBuilder2
builder for `List` @@ -117,27 +120,28 @@ A class to store validated List payloads | static [SchemaList2](#schemalist2) | of([List](#schemalistbuilder2) arg, SchemaConfiguration configuration) | ## Items2Boxed -public static abstract sealed class Items2Boxed
+public sealed interface Items2Boxed
permits
[Items2BoxedString](#items2boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Items2BoxedString -public static final class Items2BoxedString
-extends [Items2Boxed](#items2boxed) +public record Items2BoxedString
+implements [Items2Boxed](#items2boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Items2BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Items2 public static class Items2
diff --git a/samples/client/petstore/java/docs/paths/faketestqueryparamters/put/parameters/parameter3/Schema3.md b/samples/client/petstore/java/docs/paths/faketestqueryparamters/put/parameters/parameter3/Schema3.md index 4b4cb3fc22b..e49f8cced23 100644 --- a/samples/client/petstore/java/docs/paths/faketestqueryparamters/put/parameters/parameter3/Schema3.md +++ b/samples/client/petstore/java/docs/paths/faketestqueryparamters/put/parameters/parameter3/Schema3.md @@ -3,7 +3,7 @@ public class Schema3
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated list payloads, extends FrozenList - classes to build inputs for list payloads @@ -11,37 +11,38 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Schema3.Schema31Boxed](#schema31boxed)
abstract sealed validated payload class | -| static class | [Schema3.Schema31BoxedList](#schema31boxedlist)
boxed class to store validated List payloads | +| sealed interface | [Schema3.Schema31Boxed](#schema31boxed)
sealed interface for validated payloads | +| record | [Schema3.Schema31BoxedList](#schema31boxedlist)
boxed class to store validated List payloads | | static class | [Schema3.Schema31](#schema31)
schema class | | static class | [Schema3.SchemaListBuilder3](#schemalistbuilder3)
builder for List payloads | | static class | [Schema3.SchemaList3](#schemalist3)
output class for List payloads | -| static class | [Schema3.Items3Boxed](#items3boxed)
abstract sealed validated payload class | -| static class | [Schema3.Items3BoxedString](#items3boxedstring)
boxed class to store validated String payloads | +| sealed interface | [Schema3.Items3Boxed](#items3boxed)
sealed interface for validated payloads | +| record | [Schema3.Items3BoxedString](#items3boxedstring)
boxed class to store validated String payloads | | static class | [Schema3.Items3](#items3)
schema class | ## Schema31Boxed -public static abstract sealed class Schema31Boxed
+public sealed interface Schema31Boxed
permits
[Schema31BoxedList](#schema31boxedlist) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema31BoxedList -public static final class Schema31BoxedList
-extends [Schema31Boxed](#schema31boxed) +public record Schema31BoxedList
+implements [Schema31Boxed](#schema31boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema31BoxedList([SchemaList3](#schemalist3) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [SchemaList3](#schemalist3) | data
validated payload | +| [SchemaList3](#schemalist3) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema31 public static class Schema31
@@ -86,7 +87,9 @@ Schema3.SchemaList3 validatedPayload = | ----------------- | ---------------------- | | [SchemaList3](#schemalist3) | validate([List](#schemalistbuilder3) arg, SchemaConfiguration configuration) | | [Schema31BoxedList](#schema31boxedlist) | validateAndBox([List](#schemalistbuilder3) arg, SchemaConfiguration configuration) | +| [Schema31Boxed](#schema31boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## SchemaListBuilder3 public class SchemaListBuilder3
builder for `List` @@ -117,27 +120,28 @@ A class to store validated List payloads | static [SchemaList3](#schemalist3) | of([List](#schemalistbuilder3) arg, SchemaConfiguration configuration) | ## Items3Boxed -public static abstract sealed class Items3Boxed
+public sealed interface Items3Boxed
permits
[Items3BoxedString](#items3boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Items3BoxedString -public static final class Items3BoxedString
-extends [Items3Boxed](#items3boxed) +public record Items3BoxedString
+implements [Items3Boxed](#items3boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Items3BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Items3 public static class Items3
diff --git a/samples/client/petstore/java/docs/paths/faketestqueryparamters/put/parameters/parameter4/Schema4.md b/samples/client/petstore/java/docs/paths/faketestqueryparamters/put/parameters/parameter4/Schema4.md index b4176fb67db..f37dbb27dcd 100644 --- a/samples/client/petstore/java/docs/paths/faketestqueryparamters/put/parameters/parameter4/Schema4.md +++ b/samples/client/petstore/java/docs/paths/faketestqueryparamters/put/parameters/parameter4/Schema4.md @@ -3,7 +3,7 @@ public class Schema4
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated list payloads, extends FrozenList - classes to build inputs for list payloads @@ -11,37 +11,38 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Schema4.Schema41Boxed](#schema41boxed)
abstract sealed validated payload class | -| static class | [Schema4.Schema41BoxedList](#schema41boxedlist)
boxed class to store validated List payloads | +| sealed interface | [Schema4.Schema41Boxed](#schema41boxed)
sealed interface for validated payloads | +| record | [Schema4.Schema41BoxedList](#schema41boxedlist)
boxed class to store validated List payloads | | static class | [Schema4.Schema41](#schema41)
schema class | | static class | [Schema4.SchemaListBuilder4](#schemalistbuilder4)
builder for List payloads | | static class | [Schema4.SchemaList4](#schemalist4)
output class for List payloads | -| static class | [Schema4.Items4Boxed](#items4boxed)
abstract sealed validated payload class | -| static class | [Schema4.Items4BoxedString](#items4boxedstring)
boxed class to store validated String payloads | +| sealed interface | [Schema4.Items4Boxed](#items4boxed)
sealed interface for validated payloads | +| record | [Schema4.Items4BoxedString](#items4boxedstring)
boxed class to store validated String payloads | | static class | [Schema4.Items4](#items4)
schema class | ## Schema41Boxed -public static abstract sealed class Schema41Boxed
+public sealed interface Schema41Boxed
permits
[Schema41BoxedList](#schema41boxedlist) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema41BoxedList -public static final class Schema41BoxedList
-extends [Schema41Boxed](#schema41boxed) +public record Schema41BoxedList
+implements [Schema41Boxed](#schema41boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema41BoxedList([SchemaList4](#schemalist4) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [SchemaList4](#schemalist4) | data
validated payload | +| [SchemaList4](#schemalist4) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema41 public static class Schema41
@@ -86,7 +87,9 @@ Schema4.SchemaList4 validatedPayload = | ----------------- | ---------------------- | | [SchemaList4](#schemalist4) | validate([List](#schemalistbuilder4) arg, SchemaConfiguration configuration) | | [Schema41BoxedList](#schema41boxedlist) | validateAndBox([List](#schemalistbuilder4) arg, SchemaConfiguration configuration) | +| [Schema41Boxed](#schema41boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## SchemaListBuilder4 public class SchemaListBuilder4
builder for `List` @@ -117,27 +120,28 @@ A class to store validated List payloads | static [SchemaList4](#schemalist4) | of([List](#schemalistbuilder4) arg, SchemaConfiguration configuration) | ## Items4Boxed -public static abstract sealed class Items4Boxed
+public sealed interface Items4Boxed
permits
[Items4BoxedString](#items4boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Items4BoxedString -public static final class Items4BoxedString
-extends [Items4Boxed](#items4boxed) +public record Items4BoxedString
+implements [Items4Boxed](#items4boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Items4BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Items4 public static class Items4
diff --git a/samples/client/petstore/java/docs/paths/faketestqueryparamters/put/parameters/parameter5/Schema5.md b/samples/client/petstore/java/docs/paths/faketestqueryparamters/put/parameters/parameter5/Schema5.md index 8785b1adc2a..f566af62cf0 100644 --- a/samples/client/petstore/java/docs/paths/faketestqueryparamters/put/parameters/parameter5/Schema5.md +++ b/samples/client/petstore/java/docs/paths/faketestqueryparamters/put/parameters/parameter5/Schema5.md @@ -4,7 +4,7 @@ extends [StringWithValidation1](../../../components/schemas/StringWithValidation A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary diff --git a/samples/client/petstore/java/docs/paths/fakeuploaddownloadfile/post/requestbody/content/applicationoctetstream/ApplicationoctetstreamSchema.md b/samples/client/petstore/java/docs/paths/fakeuploaddownloadfile/post/requestbody/content/applicationoctetstream/ApplicationoctetstreamSchema.md index 00ef2a8bfd6..757329e0634 100644 --- a/samples/client/petstore/java/docs/paths/fakeuploaddownloadfile/post/requestbody/content/applicationoctetstream/ApplicationoctetstreamSchema.md +++ b/samples/client/petstore/java/docs/paths/fakeuploaddownloadfile/post/requestbody/content/applicationoctetstream/ApplicationoctetstreamSchema.md @@ -3,20 +3,20 @@ public class ApplicationoctetstreamSchema
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ApplicationoctetstreamSchema.ApplicationoctetstreamSchema1Boxed](#applicationoctetstreamschema1boxed)
abstract sealed validated payload class | +| sealed interface | [ApplicationoctetstreamSchema.ApplicationoctetstreamSchema1Boxed](#applicationoctetstreamschema1boxed)
sealed interface for validated payloads | | static class | [ApplicationoctetstreamSchema.ApplicationoctetstreamSchema1](#applicationoctetstreamschema1)
schema class | ## ApplicationoctetstreamSchema1Boxed -public static abstract sealed class ApplicationoctetstreamSchema1Boxed
+public sealed interface ApplicationoctetstreamSchema1Boxed
permits
-abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ApplicationoctetstreamSchema1 public static class ApplicationoctetstreamSchema1
diff --git a/samples/client/petstore/java/docs/paths/fakeuploaddownloadfile/post/responses/response200/content/applicationoctetstream/ApplicationoctetstreamSchema.md b/samples/client/petstore/java/docs/paths/fakeuploaddownloadfile/post/responses/code200response/content/applicationoctetstream/ApplicationoctetstreamSchema.md similarity index 65% rename from samples/client/petstore/java/docs/paths/fakeuploaddownloadfile/post/responses/response200/content/applicationoctetstream/ApplicationoctetstreamSchema.md rename to samples/client/petstore/java/docs/paths/fakeuploaddownloadfile/post/responses/code200response/content/applicationoctetstream/ApplicationoctetstreamSchema.md index 0f05a20ac4d..c1498d3a5a3 100644 --- a/samples/client/petstore/java/docs/paths/fakeuploaddownloadfile/post/responses/response200/content/applicationoctetstream/ApplicationoctetstreamSchema.md +++ b/samples/client/petstore/java/docs/paths/fakeuploaddownloadfile/post/responses/code200response/content/applicationoctetstream/ApplicationoctetstreamSchema.md @@ -3,20 +3,20 @@ public class ApplicationoctetstreamSchema
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ApplicationoctetstreamSchema.ApplicationoctetstreamSchema1Boxed](#applicationoctetstreamschema1boxed)
abstract sealed validated payload class | +| sealed interface | [ApplicationoctetstreamSchema.ApplicationoctetstreamSchema1Boxed](#applicationoctetstreamschema1boxed)
sealed interface for validated payloads | | static class | [ApplicationoctetstreamSchema.ApplicationoctetstreamSchema1](#applicationoctetstreamschema1)
schema class | ## ApplicationoctetstreamSchema1Boxed -public static abstract sealed class ApplicationoctetstreamSchema1Boxed
+public sealed interface ApplicationoctetstreamSchema1Boxed
permits
-abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ApplicationoctetstreamSchema1 public static class ApplicationoctetstreamSchema1
diff --git a/samples/client/petstore/java/docs/paths/fakeuploadfile/post/requestbody/content/multipartformdata/MultipartformdataSchema.md b/samples/client/petstore/java/docs/paths/fakeuploadfile/post/requestbody/content/multipartformdata/MultipartformdataSchema.md index 1f9c61a2286..dcec8012421 100644 --- a/samples/client/petstore/java/docs/paths/fakeuploadfile/post/requestbody/content/multipartformdata/MultipartformdataSchema.md +++ b/samples/client/petstore/java/docs/paths/fakeuploadfile/post/requestbody/content/multipartformdata/MultipartformdataSchema.md @@ -3,7 +3,7 @@ public class MultipartformdataSchema
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -11,39 +11,40 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [MultipartformdataSchema.MultipartformdataSchema1Boxed](#multipartformdataschema1boxed)
abstract sealed validated payload class | -| static class | [MultipartformdataSchema.MultipartformdataSchema1BoxedMap](#multipartformdataschema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [MultipartformdataSchema.MultipartformdataSchema1Boxed](#multipartformdataschema1boxed)
sealed interface for validated payloads | +| record | [MultipartformdataSchema.MultipartformdataSchema1BoxedMap](#multipartformdataschema1boxedmap)
boxed class to store validated Map payloads | | static class | [MultipartformdataSchema.MultipartformdataSchema1](#multipartformdataschema1)
schema class | | static class | [MultipartformdataSchema.MultipartformdataSchemaMapBuilder](#multipartformdataschemamapbuilder)
builder for Map payloads | | static class | [MultipartformdataSchema.MultipartformdataSchemaMap](#multipartformdataschemamap)
output class for Map payloads | -| static class | [MultipartformdataSchema.MultipartformdataFileBoxed](#multipartformdatafileboxed)
abstract sealed validated payload class | +| sealed interface | [MultipartformdataSchema.MultipartformdataFileBoxed](#multipartformdatafileboxed)
sealed interface for validated payloads | | static class | [MultipartformdataSchema.MultipartformdataFile](#multipartformdatafile)
schema class | -| static class | [MultipartformdataSchema.MultipartformdataAdditionalMetadataBoxed](#multipartformdataadditionalmetadataboxed)
abstract sealed validated payload class | -| static class | [MultipartformdataSchema.MultipartformdataAdditionalMetadataBoxedString](#multipartformdataadditionalmetadataboxedstring)
boxed class to store validated String payloads | +| sealed interface | [MultipartformdataSchema.MultipartformdataAdditionalMetadataBoxed](#multipartformdataadditionalmetadataboxed)
sealed interface for validated payloads | +| record | [MultipartformdataSchema.MultipartformdataAdditionalMetadataBoxedString](#multipartformdataadditionalmetadataboxedstring)
boxed class to store validated String payloads | | static class | [MultipartformdataSchema.MultipartformdataAdditionalMetadata](#multipartformdataadditionalmetadata)
schema class | ## MultipartformdataSchema1Boxed -public static abstract sealed class MultipartformdataSchema1Boxed
+public sealed interface MultipartformdataSchema1Boxed
permits
[MultipartformdataSchema1BoxedMap](#multipartformdataschema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## MultipartformdataSchema1BoxedMap -public static final class MultipartformdataSchema1BoxedMap
-extends [MultipartformdataSchema1Boxed](#multipartformdataschema1boxed) +public record MultipartformdataSchema1BoxedMap
+implements [MultipartformdataSchema1Boxed](#multipartformdataschema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MultipartformdataSchema1BoxedMap([MultipartformdataSchemaMap](#multipartformdataschemamap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [MultipartformdataSchemaMap](#multipartformdataschemamap) | data
validated payload | +| [MultipartformdataSchemaMap](#multipartformdataschemamap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MultipartformdataSchema1 public static class MultipartformdataSchema1
@@ -91,7 +92,9 @@ MultipartformdataSchema.MultipartformdataSchemaMap validatedPayload = | ----------------- | ---------------------- | | [MultipartformdataSchemaMap](#multipartformdataschemamap) | validate([Map<?, ?>](#multipartformdataschemamapbuilder) arg, SchemaConfiguration configuration) | | [MultipartformdataSchema1BoxedMap](#multipartformdataschema1boxedmap) | validateAndBox([Map<?, ?>](#multipartformdataschemamapbuilder) arg, SchemaConfiguration configuration) | +| [MultipartformdataSchema1Boxed](#multipartformdataschema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## MultipartformdataSchemaMap0Builder public class MultipartformdataSchemaMap0Builder
builder for `Map` @@ -149,10 +152,10 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## MultipartformdataFileBoxed -public static abstract sealed class MultipartformdataFileBoxed
+public sealed interface MultipartformdataFileBoxed
permits
-abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## MultipartformdataFile public static class MultipartformdataFile
@@ -164,27 +167,28 @@ A schema class that validates payloads file to upload ## MultipartformdataAdditionalMetadataBoxed -public static abstract sealed class MultipartformdataAdditionalMetadataBoxed
+public sealed interface MultipartformdataAdditionalMetadataBoxed
permits
[MultipartformdataAdditionalMetadataBoxedString](#multipartformdataadditionalmetadataboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## MultipartformdataAdditionalMetadataBoxedString -public static final class MultipartformdataAdditionalMetadataBoxedString
-extends [MultipartformdataAdditionalMetadataBoxed](#multipartformdataadditionalmetadataboxed) +public record MultipartformdataAdditionalMetadataBoxedString
+implements [MultipartformdataAdditionalMetadataBoxed](#multipartformdataadditionalmetadataboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MultipartformdataAdditionalMetadataBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MultipartformdataAdditionalMetadata public static class MultipartformdataAdditionalMetadata
diff --git a/samples/client/petstore/java/docs/paths/fakeuploadfiles/post/responses/response200/content/applicationjson/ApplicationjsonSchema.md b/samples/client/petstore/java/docs/paths/fakeuploadfile/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md similarity index 90% rename from samples/client/petstore/java/docs/paths/fakeuploadfiles/post/responses/response200/content/applicationjson/ApplicationjsonSchema.md rename to samples/client/petstore/java/docs/paths/fakeuploadfile/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md index 5b1a73c4aed..99e81a1b57d 100644 --- a/samples/client/petstore/java/docs/paths/fakeuploadfiles/post/responses/response200/content/applicationjson/ApplicationjsonSchema.md +++ b/samples/client/petstore/java/docs/paths/fakeuploadfile/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md @@ -4,7 +4,7 @@ extends [ApiResponseSchema1](../../../../../../../../../components/schemas/ApiRe A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary diff --git a/samples/client/petstore/java/docs/paths/fakeuploadfiles/post/requestbody/content/multipartformdata/MultipartformdataSchema.md b/samples/client/petstore/java/docs/paths/fakeuploadfiles/post/requestbody/content/multipartformdata/MultipartformdataSchema.md index f08d95469b7..57f9eaaf6e4 100644 --- a/samples/client/petstore/java/docs/paths/fakeuploadfiles/post/requestbody/content/multipartformdata/MultipartformdataSchema.md +++ b/samples/client/petstore/java/docs/paths/fakeuploadfiles/post/requestbody/content/multipartformdata/MultipartformdataSchema.md @@ -3,7 +3,7 @@ public class MultipartformdataSchema
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated list payloads, extends FrozenList - classes to build inputs for list payloads @@ -13,41 +13,42 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [MultipartformdataSchema.MultipartformdataSchema1Boxed](#multipartformdataschema1boxed)
abstract sealed validated payload class | -| static class | [MultipartformdataSchema.MultipartformdataSchema1BoxedMap](#multipartformdataschema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [MultipartformdataSchema.MultipartformdataSchema1Boxed](#multipartformdataschema1boxed)
sealed interface for validated payloads | +| record | [MultipartformdataSchema.MultipartformdataSchema1BoxedMap](#multipartformdataschema1boxedmap)
boxed class to store validated Map payloads | | static class | [MultipartformdataSchema.MultipartformdataSchema1](#multipartformdataschema1)
schema class | | static class | [MultipartformdataSchema.MultipartformdataSchemaMapBuilder](#multipartformdataschemamapbuilder)
builder for Map payloads | | static class | [MultipartformdataSchema.MultipartformdataSchemaMap](#multipartformdataschemamap)
output class for Map payloads | -| static class | [MultipartformdataSchema.MultipartformdataFilesBoxed](#multipartformdatafilesboxed)
abstract sealed validated payload class | -| static class | [MultipartformdataSchema.MultipartformdataFilesBoxedList](#multipartformdatafilesboxedlist)
boxed class to store validated List payloads | +| sealed interface | [MultipartformdataSchema.MultipartformdataFilesBoxed](#multipartformdatafilesboxed)
sealed interface for validated payloads | +| record | [MultipartformdataSchema.MultipartformdataFilesBoxedList](#multipartformdatafilesboxedlist)
boxed class to store validated List payloads | | static class | [MultipartformdataSchema.MultipartformdataFiles](#multipartformdatafiles)
schema class | | static class | [MultipartformdataSchema.MultipartformdataFilesListBuilder](#multipartformdatafileslistbuilder)
builder for List payloads | | static class | [MultipartformdataSchema.MultipartformdataFilesList](#multipartformdatafileslist)
output class for List payloads | -| static class | [MultipartformdataSchema.MultipartformdataItemsBoxed](#multipartformdataitemsboxed)
abstract sealed validated payload class | +| sealed interface | [MultipartformdataSchema.MultipartformdataItemsBoxed](#multipartformdataitemsboxed)
sealed interface for validated payloads | | static class | [MultipartformdataSchema.MultipartformdataItems](#multipartformdataitems)
schema class | ## MultipartformdataSchema1Boxed -public static abstract sealed class MultipartformdataSchema1Boxed
+public sealed interface MultipartformdataSchema1Boxed
permits
[MultipartformdataSchema1BoxedMap](#multipartformdataschema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## MultipartformdataSchema1BoxedMap -public static final class MultipartformdataSchema1BoxedMap
-extends [MultipartformdataSchema1Boxed](#multipartformdataschema1boxed) +public record MultipartformdataSchema1BoxedMap
+implements [MultipartformdataSchema1Boxed](#multipartformdataschema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MultipartformdataSchema1BoxedMap([MultipartformdataSchemaMap](#multipartformdataschemamap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [MultipartformdataSchemaMap](#multipartformdataschemamap) | data
validated payload | +| [MultipartformdataSchemaMap](#multipartformdataschemamap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MultipartformdataSchema1 public static class MultipartformdataSchema1
@@ -95,7 +96,9 @@ MultipartformdataSchema.MultipartformdataSchemaMap validatedPayload = | ----------------- | ---------------------- | | [MultipartformdataSchemaMap](#multipartformdataschemamap) | validate([Map<?, ?>](#multipartformdataschemamapbuilder) arg, SchemaConfiguration configuration) | | [MultipartformdataSchema1BoxedMap](#multipartformdataschema1boxedmap) | validateAndBox([Map<?, ?>](#multipartformdataschemamapbuilder) arg, SchemaConfiguration configuration) | +| [MultipartformdataSchema1Boxed](#multipartformdataschema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## MultipartformdataSchemaMapBuilder public class MultipartformdataSchemaMapBuilder
builder for `Map` @@ -136,27 +139,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## MultipartformdataFilesBoxed -public static abstract sealed class MultipartformdataFilesBoxed
+public sealed interface MultipartformdataFilesBoxed
permits
[MultipartformdataFilesBoxedList](#multipartformdatafilesboxedlist) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## MultipartformdataFilesBoxedList -public static final class MultipartformdataFilesBoxedList
-extends [MultipartformdataFilesBoxed](#multipartformdatafilesboxed) +public record MultipartformdataFilesBoxedList
+implements [MultipartformdataFilesBoxed](#multipartformdatafilesboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MultipartformdataFilesBoxedList([MultipartformdataFilesList](#multipartformdatafileslist) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [MultipartformdataFilesList](#multipartformdatafileslist) | data
validated payload | +| [MultipartformdataFilesList](#multipartformdatafileslist) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MultipartformdataFiles public static class MultipartformdataFiles
@@ -201,7 +205,9 @@ MultipartformdataSchema.MultipartformdataFilesList validatedPayload = | ----------------- | ---------------------- | | [MultipartformdataFilesList](#multipartformdatafileslist) | validate([List](#multipartformdatafileslistbuilder) arg, SchemaConfiguration configuration) | | [MultipartformdataFilesBoxedList](#multipartformdatafilesboxedlist) | validateAndBox([List](#multipartformdatafileslistbuilder) arg, SchemaConfiguration configuration) | +| [MultipartformdataFilesBoxed](#multipartformdatafilesboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## MultipartformdataFilesListBuilder public class MultipartformdataFilesListBuilder
builder for `List` @@ -232,10 +238,10 @@ A class to store validated List payloads | static [MultipartformdataFilesList](#multipartformdatafileslist) | of([List](#multipartformdatafileslistbuilder) arg, SchemaConfiguration configuration) | ## MultipartformdataItemsBoxed -public static abstract sealed class MultipartformdataItemsBoxed
+public sealed interface MultipartformdataItemsBoxed
permits
-abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## MultipartformdataItems public static class MultipartformdataItems
diff --git a/samples/client/petstore/java/docs/paths/fakepetiduploadimagewithrequiredfile/post/responses/response200/content/applicationjson/ApplicationjsonSchema.md b/samples/client/petstore/java/docs/paths/fakeuploadfiles/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md similarity index 90% rename from samples/client/petstore/java/docs/paths/fakepetiduploadimagewithrequiredfile/post/responses/response200/content/applicationjson/ApplicationjsonSchema.md rename to samples/client/petstore/java/docs/paths/fakeuploadfiles/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md index 5b1a73c4aed..99e81a1b57d 100644 --- a/samples/client/petstore/java/docs/paths/fakepetiduploadimagewithrequiredfile/post/responses/response200/content/applicationjson/ApplicationjsonSchema.md +++ b/samples/client/petstore/java/docs/paths/fakeuploadfiles/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md @@ -4,7 +4,7 @@ extends [ApiResponseSchema1](../../../../../../../../../components/schemas/ApiRe A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary diff --git a/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/responses/code1xxresponse/content/applicationjson/ApplicationjsonSchema.md b/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/responses/code1xxresponse/content/applicationjson/ApplicationjsonSchema.md new file mode 100644 index 00000000000..98eb062fdd7 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/responses/code1xxresponse/content/applicationjson/ApplicationjsonSchema.md @@ -0,0 +1,144 @@ +# ApplicationjsonSchema +public class ApplicationjsonSchema
+ +A class that contains necessary nested +- schema classes (which validate payloads), extends JsonSchema +- sealed interfaces which store validated payloads, java version of a sum type +- boxed classes which store validated payloads, sealed permits class implementations + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | ---------------------- | +| sealed interface | [ApplicationjsonSchema.ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed)
sealed interface for validated payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedVoid](#applicationjsonschema1boxedvoid)
boxed class to store validated null payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedBoolean](#applicationjsonschema1boxedboolean)
boxed class to store validated boolean payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedNumber](#applicationjsonschema1boxednumber)
boxed class to store validated Number payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedString](#applicationjsonschema1boxedstring)
boxed class to store validated String payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedList](#applicationjsonschema1boxedlist)
boxed class to store validated List payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap)
boxed class to store validated Map payloads | +| static class | [ApplicationjsonSchema.ApplicationjsonSchema1](#applicationjsonschema1)
schema class | + +## ApplicationjsonSchema1Boxed +public sealed interface ApplicationjsonSchema1Boxed
+permits
+[ApplicationjsonSchema1BoxedVoid](#applicationjsonschema1boxedvoid), +[ApplicationjsonSchema1BoxedBoolean](#applicationjsonschema1boxedboolean), +[ApplicationjsonSchema1BoxedNumber](#applicationjsonschema1boxednumber), +[ApplicationjsonSchema1BoxedString](#applicationjsonschema1boxedstring), +[ApplicationjsonSchema1BoxedList](#applicationjsonschema1boxedlist), +[ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap) + +sealed interface that stores validated payloads using boxed classes + +## ApplicationjsonSchema1BoxedVoid +public record ApplicationjsonSchema1BoxedVoid
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) + +record that stores validated null payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonSchema1BoxedVoid(Void data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## ApplicationjsonSchema1BoxedBoolean +public record ApplicationjsonSchema1BoxedBoolean
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) + +record that stores validated boolean payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonSchema1BoxedBoolean(boolean data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## ApplicationjsonSchema1BoxedNumber +public record ApplicationjsonSchema1BoxedNumber
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) + +record that stores validated Number payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonSchema1BoxedNumber(Number data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## ApplicationjsonSchema1BoxedString +public record ApplicationjsonSchema1BoxedString
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) + +record that stores validated String payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonSchema1BoxedString(String data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## ApplicationjsonSchema1BoxedList +public record ApplicationjsonSchema1BoxedList
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) + +record that stores validated List payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonSchema1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## ApplicationjsonSchema1BoxedMap +public record ApplicationjsonSchema1BoxedMap
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonSchema1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## ApplicationjsonSchema1 +public static class ApplicationjsonSchema1
+extends AnyTypeJsonSchema.AnyTypeJsonSchema1 + +A schema class that validates payloads + +| Methods Inherited from class org.openapijsonschematools.client.schemas.AnyTypeJsonSchema.AnyTypeJsonSchema1 | +| ------------------------------------------------------------------ | +| validate | +| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md b/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md new file mode 100644 index 00000000000..98eb062fdd7 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md @@ -0,0 +1,144 @@ +# ApplicationjsonSchema +public class ApplicationjsonSchema
+ +A class that contains necessary nested +- schema classes (which validate payloads), extends JsonSchema +- sealed interfaces which store validated payloads, java version of a sum type +- boxed classes which store validated payloads, sealed permits class implementations + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | ---------------------- | +| sealed interface | [ApplicationjsonSchema.ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed)
sealed interface for validated payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedVoid](#applicationjsonschema1boxedvoid)
boxed class to store validated null payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedBoolean](#applicationjsonschema1boxedboolean)
boxed class to store validated boolean payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedNumber](#applicationjsonschema1boxednumber)
boxed class to store validated Number payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedString](#applicationjsonschema1boxedstring)
boxed class to store validated String payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedList](#applicationjsonschema1boxedlist)
boxed class to store validated List payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap)
boxed class to store validated Map payloads | +| static class | [ApplicationjsonSchema.ApplicationjsonSchema1](#applicationjsonschema1)
schema class | + +## ApplicationjsonSchema1Boxed +public sealed interface ApplicationjsonSchema1Boxed
+permits
+[ApplicationjsonSchema1BoxedVoid](#applicationjsonschema1boxedvoid), +[ApplicationjsonSchema1BoxedBoolean](#applicationjsonschema1boxedboolean), +[ApplicationjsonSchema1BoxedNumber](#applicationjsonschema1boxednumber), +[ApplicationjsonSchema1BoxedString](#applicationjsonschema1boxedstring), +[ApplicationjsonSchema1BoxedList](#applicationjsonschema1boxedlist), +[ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap) + +sealed interface that stores validated payloads using boxed classes + +## ApplicationjsonSchema1BoxedVoid +public record ApplicationjsonSchema1BoxedVoid
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) + +record that stores validated null payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonSchema1BoxedVoid(Void data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## ApplicationjsonSchema1BoxedBoolean +public record ApplicationjsonSchema1BoxedBoolean
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) + +record that stores validated boolean payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonSchema1BoxedBoolean(boolean data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## ApplicationjsonSchema1BoxedNumber +public record ApplicationjsonSchema1BoxedNumber
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) + +record that stores validated Number payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonSchema1BoxedNumber(Number data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## ApplicationjsonSchema1BoxedString +public record ApplicationjsonSchema1BoxedString
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) + +record that stores validated String payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonSchema1BoxedString(String data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## ApplicationjsonSchema1BoxedList +public record ApplicationjsonSchema1BoxedList
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) + +record that stores validated List payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonSchema1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## ApplicationjsonSchema1BoxedMap +public record ApplicationjsonSchema1BoxedMap
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonSchema1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## ApplicationjsonSchema1 +public static class ApplicationjsonSchema1
+extends AnyTypeJsonSchema.AnyTypeJsonSchema1 + +A schema class that validates payloads + +| Methods Inherited from class org.openapijsonschematools.client.schemas.AnyTypeJsonSchema.AnyTypeJsonSchema1 | +| ------------------------------------------------------------------ | +| validate | +| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/responses/code2xxresponse/content/applicationjson/ApplicationjsonSchema.md b/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/responses/code2xxresponse/content/applicationjson/ApplicationjsonSchema.md new file mode 100644 index 00000000000..98eb062fdd7 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/responses/code2xxresponse/content/applicationjson/ApplicationjsonSchema.md @@ -0,0 +1,144 @@ +# ApplicationjsonSchema +public class ApplicationjsonSchema
+ +A class that contains necessary nested +- schema classes (which validate payloads), extends JsonSchema +- sealed interfaces which store validated payloads, java version of a sum type +- boxed classes which store validated payloads, sealed permits class implementations + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | ---------------------- | +| sealed interface | [ApplicationjsonSchema.ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed)
sealed interface for validated payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedVoid](#applicationjsonschema1boxedvoid)
boxed class to store validated null payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedBoolean](#applicationjsonschema1boxedboolean)
boxed class to store validated boolean payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedNumber](#applicationjsonschema1boxednumber)
boxed class to store validated Number payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedString](#applicationjsonschema1boxedstring)
boxed class to store validated String payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedList](#applicationjsonschema1boxedlist)
boxed class to store validated List payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap)
boxed class to store validated Map payloads | +| static class | [ApplicationjsonSchema.ApplicationjsonSchema1](#applicationjsonschema1)
schema class | + +## ApplicationjsonSchema1Boxed +public sealed interface ApplicationjsonSchema1Boxed
+permits
+[ApplicationjsonSchema1BoxedVoid](#applicationjsonschema1boxedvoid), +[ApplicationjsonSchema1BoxedBoolean](#applicationjsonschema1boxedboolean), +[ApplicationjsonSchema1BoxedNumber](#applicationjsonschema1boxednumber), +[ApplicationjsonSchema1BoxedString](#applicationjsonschema1boxedstring), +[ApplicationjsonSchema1BoxedList](#applicationjsonschema1boxedlist), +[ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap) + +sealed interface that stores validated payloads using boxed classes + +## ApplicationjsonSchema1BoxedVoid +public record ApplicationjsonSchema1BoxedVoid
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) + +record that stores validated null payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonSchema1BoxedVoid(Void data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## ApplicationjsonSchema1BoxedBoolean +public record ApplicationjsonSchema1BoxedBoolean
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) + +record that stores validated boolean payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonSchema1BoxedBoolean(boolean data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## ApplicationjsonSchema1BoxedNumber +public record ApplicationjsonSchema1BoxedNumber
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) + +record that stores validated Number payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonSchema1BoxedNumber(Number data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## ApplicationjsonSchema1BoxedString +public record ApplicationjsonSchema1BoxedString
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) + +record that stores validated String payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonSchema1BoxedString(String data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## ApplicationjsonSchema1BoxedList +public record ApplicationjsonSchema1BoxedList
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) + +record that stores validated List payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonSchema1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## ApplicationjsonSchema1BoxedMap +public record ApplicationjsonSchema1BoxedMap
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonSchema1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## ApplicationjsonSchema1 +public static class ApplicationjsonSchema1
+extends AnyTypeJsonSchema.AnyTypeJsonSchema1 + +A schema class that validates payloads + +| Methods Inherited from class org.openapijsonschematools.client.schemas.AnyTypeJsonSchema.AnyTypeJsonSchema1 | +| ------------------------------------------------------------------ | +| validate | +| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/responses/code3xxresponse/content/applicationjson/ApplicationjsonSchema.md b/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/responses/code3xxresponse/content/applicationjson/ApplicationjsonSchema.md new file mode 100644 index 00000000000..98eb062fdd7 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/responses/code3xxresponse/content/applicationjson/ApplicationjsonSchema.md @@ -0,0 +1,144 @@ +# ApplicationjsonSchema +public class ApplicationjsonSchema
+ +A class that contains necessary nested +- schema classes (which validate payloads), extends JsonSchema +- sealed interfaces which store validated payloads, java version of a sum type +- boxed classes which store validated payloads, sealed permits class implementations + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | ---------------------- | +| sealed interface | [ApplicationjsonSchema.ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed)
sealed interface for validated payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedVoid](#applicationjsonschema1boxedvoid)
boxed class to store validated null payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedBoolean](#applicationjsonschema1boxedboolean)
boxed class to store validated boolean payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedNumber](#applicationjsonschema1boxednumber)
boxed class to store validated Number payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedString](#applicationjsonschema1boxedstring)
boxed class to store validated String payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedList](#applicationjsonschema1boxedlist)
boxed class to store validated List payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap)
boxed class to store validated Map payloads | +| static class | [ApplicationjsonSchema.ApplicationjsonSchema1](#applicationjsonschema1)
schema class | + +## ApplicationjsonSchema1Boxed +public sealed interface ApplicationjsonSchema1Boxed
+permits
+[ApplicationjsonSchema1BoxedVoid](#applicationjsonschema1boxedvoid), +[ApplicationjsonSchema1BoxedBoolean](#applicationjsonschema1boxedboolean), +[ApplicationjsonSchema1BoxedNumber](#applicationjsonschema1boxednumber), +[ApplicationjsonSchema1BoxedString](#applicationjsonschema1boxedstring), +[ApplicationjsonSchema1BoxedList](#applicationjsonschema1boxedlist), +[ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap) + +sealed interface that stores validated payloads using boxed classes + +## ApplicationjsonSchema1BoxedVoid +public record ApplicationjsonSchema1BoxedVoid
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) + +record that stores validated null payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonSchema1BoxedVoid(Void data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## ApplicationjsonSchema1BoxedBoolean +public record ApplicationjsonSchema1BoxedBoolean
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) + +record that stores validated boolean payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonSchema1BoxedBoolean(boolean data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## ApplicationjsonSchema1BoxedNumber +public record ApplicationjsonSchema1BoxedNumber
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) + +record that stores validated Number payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonSchema1BoxedNumber(Number data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## ApplicationjsonSchema1BoxedString +public record ApplicationjsonSchema1BoxedString
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) + +record that stores validated String payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonSchema1BoxedString(String data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## ApplicationjsonSchema1BoxedList +public record ApplicationjsonSchema1BoxedList
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) + +record that stores validated List payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonSchema1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## ApplicationjsonSchema1BoxedMap +public record ApplicationjsonSchema1BoxedMap
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonSchema1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## ApplicationjsonSchema1 +public static class ApplicationjsonSchema1
+extends AnyTypeJsonSchema.AnyTypeJsonSchema1 + +A schema class that validates payloads + +| Methods Inherited from class org.openapijsonschematools.client.schemas.AnyTypeJsonSchema.AnyTypeJsonSchema1 | +| ------------------------------------------------------------------ | +| validate | +| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/responses/code4xxresponse/content/applicationjson/ApplicationjsonSchema.md b/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/responses/code4xxresponse/content/applicationjson/ApplicationjsonSchema.md new file mode 100644 index 00000000000..98eb062fdd7 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/responses/code4xxresponse/content/applicationjson/ApplicationjsonSchema.md @@ -0,0 +1,144 @@ +# ApplicationjsonSchema +public class ApplicationjsonSchema
+ +A class that contains necessary nested +- schema classes (which validate payloads), extends JsonSchema +- sealed interfaces which store validated payloads, java version of a sum type +- boxed classes which store validated payloads, sealed permits class implementations + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | ---------------------- | +| sealed interface | [ApplicationjsonSchema.ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed)
sealed interface for validated payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedVoid](#applicationjsonschema1boxedvoid)
boxed class to store validated null payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedBoolean](#applicationjsonschema1boxedboolean)
boxed class to store validated boolean payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedNumber](#applicationjsonschema1boxednumber)
boxed class to store validated Number payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedString](#applicationjsonschema1boxedstring)
boxed class to store validated String payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedList](#applicationjsonschema1boxedlist)
boxed class to store validated List payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap)
boxed class to store validated Map payloads | +| static class | [ApplicationjsonSchema.ApplicationjsonSchema1](#applicationjsonschema1)
schema class | + +## ApplicationjsonSchema1Boxed +public sealed interface ApplicationjsonSchema1Boxed
+permits
+[ApplicationjsonSchema1BoxedVoid](#applicationjsonschema1boxedvoid), +[ApplicationjsonSchema1BoxedBoolean](#applicationjsonschema1boxedboolean), +[ApplicationjsonSchema1BoxedNumber](#applicationjsonschema1boxednumber), +[ApplicationjsonSchema1BoxedString](#applicationjsonschema1boxedstring), +[ApplicationjsonSchema1BoxedList](#applicationjsonschema1boxedlist), +[ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap) + +sealed interface that stores validated payloads using boxed classes + +## ApplicationjsonSchema1BoxedVoid +public record ApplicationjsonSchema1BoxedVoid
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) + +record that stores validated null payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonSchema1BoxedVoid(Void data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## ApplicationjsonSchema1BoxedBoolean +public record ApplicationjsonSchema1BoxedBoolean
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) + +record that stores validated boolean payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonSchema1BoxedBoolean(boolean data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## ApplicationjsonSchema1BoxedNumber +public record ApplicationjsonSchema1BoxedNumber
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) + +record that stores validated Number payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonSchema1BoxedNumber(Number data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## ApplicationjsonSchema1BoxedString +public record ApplicationjsonSchema1BoxedString
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) + +record that stores validated String payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonSchema1BoxedString(String data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## ApplicationjsonSchema1BoxedList +public record ApplicationjsonSchema1BoxedList
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) + +record that stores validated List payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonSchema1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## ApplicationjsonSchema1BoxedMap +public record ApplicationjsonSchema1BoxedMap
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonSchema1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## ApplicationjsonSchema1 +public static class ApplicationjsonSchema1
+extends AnyTypeJsonSchema.AnyTypeJsonSchema1 + +A schema class that validates payloads + +| Methods Inherited from class org.openapijsonschematools.client.schemas.AnyTypeJsonSchema.AnyTypeJsonSchema1 | +| ------------------------------------------------------------------ | +| validate | +| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/responses/code5xxresponse/content/applicationjson/ApplicationjsonSchema.md b/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/responses/code5xxresponse/content/applicationjson/ApplicationjsonSchema.md new file mode 100644 index 00000000000..98eb062fdd7 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/responses/code5xxresponse/content/applicationjson/ApplicationjsonSchema.md @@ -0,0 +1,144 @@ +# ApplicationjsonSchema +public class ApplicationjsonSchema
+ +A class that contains necessary nested +- schema classes (which validate payloads), extends JsonSchema +- sealed interfaces which store validated payloads, java version of a sum type +- boxed classes which store validated payloads, sealed permits class implementations + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | ---------------------- | +| sealed interface | [ApplicationjsonSchema.ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed)
sealed interface for validated payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedVoid](#applicationjsonschema1boxedvoid)
boxed class to store validated null payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedBoolean](#applicationjsonschema1boxedboolean)
boxed class to store validated boolean payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedNumber](#applicationjsonschema1boxednumber)
boxed class to store validated Number payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedString](#applicationjsonschema1boxedstring)
boxed class to store validated String payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedList](#applicationjsonschema1boxedlist)
boxed class to store validated List payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap)
boxed class to store validated Map payloads | +| static class | [ApplicationjsonSchema.ApplicationjsonSchema1](#applicationjsonschema1)
schema class | + +## ApplicationjsonSchema1Boxed +public sealed interface ApplicationjsonSchema1Boxed
+permits
+[ApplicationjsonSchema1BoxedVoid](#applicationjsonschema1boxedvoid), +[ApplicationjsonSchema1BoxedBoolean](#applicationjsonschema1boxedboolean), +[ApplicationjsonSchema1BoxedNumber](#applicationjsonschema1boxednumber), +[ApplicationjsonSchema1BoxedString](#applicationjsonschema1boxedstring), +[ApplicationjsonSchema1BoxedList](#applicationjsonschema1boxedlist), +[ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap) + +sealed interface that stores validated payloads using boxed classes + +## ApplicationjsonSchema1BoxedVoid +public record ApplicationjsonSchema1BoxedVoid
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) + +record that stores validated null payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonSchema1BoxedVoid(Void data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## ApplicationjsonSchema1BoxedBoolean +public record ApplicationjsonSchema1BoxedBoolean
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) + +record that stores validated boolean payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonSchema1BoxedBoolean(boolean data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## ApplicationjsonSchema1BoxedNumber +public record ApplicationjsonSchema1BoxedNumber
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) + +record that stores validated Number payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonSchema1BoxedNumber(Number data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## ApplicationjsonSchema1BoxedString +public record ApplicationjsonSchema1BoxedString
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) + +record that stores validated String payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonSchema1BoxedString(String data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## ApplicationjsonSchema1BoxedList +public record ApplicationjsonSchema1BoxedList
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) + +record that stores validated List payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonSchema1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## ApplicationjsonSchema1BoxedMap +public record ApplicationjsonSchema1BoxedMap
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonSchema1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## ApplicationjsonSchema1 +public static class ApplicationjsonSchema1
+extends AnyTypeJsonSchema.AnyTypeJsonSchema1 + +A schema class that validates payloads + +| Methods Inherited from class org.openapijsonschematools.client.schemas.AnyTypeJsonSchema.AnyTypeJsonSchema1 | +| ------------------------------------------------------------------ | +| validate | +| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/responses/response1xx/content/applicationjson/ApplicationjsonSchema.md b/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/responses/response1xx/content/applicationjson/ApplicationjsonSchema.md deleted file mode 100644 index 53da126ffca..00000000000 --- a/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/responses/response1xx/content/applicationjson/ApplicationjsonSchema.md +++ /dev/null @@ -1,138 +0,0 @@ -# ApplicationjsonSchema -public class ApplicationjsonSchema
- -A class that contains necessary nested -- schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type -- boxed classes which store validated payloads, sealed permits class implementations - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | ---------------------- | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed)
abstract sealed validated payload class | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedVoid](#applicationjsonschema1boxedvoid)
boxed class to store validated null payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedBoolean](#applicationjsonschema1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedNumber](#applicationjsonschema1boxednumber)
boxed class to store validated Number payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedString](#applicationjsonschema1boxedstring)
boxed class to store validated String payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedList](#applicationjsonschema1boxedlist)
boxed class to store validated List payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap)
boxed class to store validated Map payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1](#applicationjsonschema1)
schema class | - -## ApplicationjsonSchema1Boxed -public static abstract sealed class ApplicationjsonSchema1Boxed
-permits
-[ApplicationjsonSchema1BoxedVoid](#applicationjsonschema1boxedvoid), -[ApplicationjsonSchema1BoxedBoolean](#applicationjsonschema1boxedboolean), -[ApplicationjsonSchema1BoxedNumber](#applicationjsonschema1boxednumber), -[ApplicationjsonSchema1BoxedString](#applicationjsonschema1boxedstring), -[ApplicationjsonSchema1BoxedList](#applicationjsonschema1boxedlist), -[ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap) - -abstract sealed class that stores validated payloads using boxed classes - -## ApplicationjsonSchema1BoxedVoid -public static final class ApplicationjsonSchema1BoxedVoid
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) - -a boxed class to store validated null payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonSchema1BoxedVoid(Void data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| Void | data
validated payload | - -## ApplicationjsonSchema1BoxedBoolean -public static final class ApplicationjsonSchema1BoxedBoolean
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) - -a boxed class to store validated boolean payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonSchema1BoxedBoolean(boolean data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| boolean | data
validated payload | - -## ApplicationjsonSchema1BoxedNumber -public static final class ApplicationjsonSchema1BoxedNumber
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) - -a boxed class to store validated Number payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonSchema1BoxedNumber(Number data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| Number | data
validated payload | - -## ApplicationjsonSchema1BoxedString -public static final class ApplicationjsonSchema1BoxedString
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) - -a boxed class to store validated String payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonSchema1BoxedString(String data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| String | data
validated payload | - -## ApplicationjsonSchema1BoxedList -public static final class ApplicationjsonSchema1BoxedList
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) - -a boxed class to store validated List payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonSchema1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | - -## ApplicationjsonSchema1BoxedMap -public static final class ApplicationjsonSchema1BoxedMap
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) - -a boxed class to store validated Map payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonSchema1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | - -## ApplicationjsonSchema1 -public static class ApplicationjsonSchema1
-extends AnyTypeJsonSchema.AnyTypeJsonSchema1 - -A schema class that validates payloads - -| Methods Inherited from class org.openapijsonschematools.client.schemas.AnyTypeJsonSchema.AnyTypeJsonSchema1 | -| ------------------------------------------------------------------ | -| validate | -| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/responses/response200/content/applicationjson/ApplicationjsonSchema.md b/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/responses/response200/content/applicationjson/ApplicationjsonSchema.md deleted file mode 100644 index 53da126ffca..00000000000 --- a/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/responses/response200/content/applicationjson/ApplicationjsonSchema.md +++ /dev/null @@ -1,138 +0,0 @@ -# ApplicationjsonSchema -public class ApplicationjsonSchema
- -A class that contains necessary nested -- schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type -- boxed classes which store validated payloads, sealed permits class implementations - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | ---------------------- | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed)
abstract sealed validated payload class | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedVoid](#applicationjsonschema1boxedvoid)
boxed class to store validated null payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedBoolean](#applicationjsonschema1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedNumber](#applicationjsonschema1boxednumber)
boxed class to store validated Number payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedString](#applicationjsonschema1boxedstring)
boxed class to store validated String payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedList](#applicationjsonschema1boxedlist)
boxed class to store validated List payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap)
boxed class to store validated Map payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1](#applicationjsonschema1)
schema class | - -## ApplicationjsonSchema1Boxed -public static abstract sealed class ApplicationjsonSchema1Boxed
-permits
-[ApplicationjsonSchema1BoxedVoid](#applicationjsonschema1boxedvoid), -[ApplicationjsonSchema1BoxedBoolean](#applicationjsonschema1boxedboolean), -[ApplicationjsonSchema1BoxedNumber](#applicationjsonschema1boxednumber), -[ApplicationjsonSchema1BoxedString](#applicationjsonschema1boxedstring), -[ApplicationjsonSchema1BoxedList](#applicationjsonschema1boxedlist), -[ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap) - -abstract sealed class that stores validated payloads using boxed classes - -## ApplicationjsonSchema1BoxedVoid -public static final class ApplicationjsonSchema1BoxedVoid
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) - -a boxed class to store validated null payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonSchema1BoxedVoid(Void data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| Void | data
validated payload | - -## ApplicationjsonSchema1BoxedBoolean -public static final class ApplicationjsonSchema1BoxedBoolean
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) - -a boxed class to store validated boolean payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonSchema1BoxedBoolean(boolean data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| boolean | data
validated payload | - -## ApplicationjsonSchema1BoxedNumber -public static final class ApplicationjsonSchema1BoxedNumber
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) - -a boxed class to store validated Number payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonSchema1BoxedNumber(Number data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| Number | data
validated payload | - -## ApplicationjsonSchema1BoxedString -public static final class ApplicationjsonSchema1BoxedString
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) - -a boxed class to store validated String payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonSchema1BoxedString(String data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| String | data
validated payload | - -## ApplicationjsonSchema1BoxedList -public static final class ApplicationjsonSchema1BoxedList
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) - -a boxed class to store validated List payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonSchema1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | - -## ApplicationjsonSchema1BoxedMap -public static final class ApplicationjsonSchema1BoxedMap
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) - -a boxed class to store validated Map payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonSchema1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | - -## ApplicationjsonSchema1 -public static class ApplicationjsonSchema1
-extends AnyTypeJsonSchema.AnyTypeJsonSchema1 - -A schema class that validates payloads - -| Methods Inherited from class org.openapijsonschematools.client.schemas.AnyTypeJsonSchema.AnyTypeJsonSchema1 | -| ------------------------------------------------------------------ | -| validate | -| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/responses/response2xx/content/applicationjson/ApplicationjsonSchema.md b/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/responses/response2xx/content/applicationjson/ApplicationjsonSchema.md deleted file mode 100644 index 53da126ffca..00000000000 --- a/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/responses/response2xx/content/applicationjson/ApplicationjsonSchema.md +++ /dev/null @@ -1,138 +0,0 @@ -# ApplicationjsonSchema -public class ApplicationjsonSchema
- -A class that contains necessary nested -- schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type -- boxed classes which store validated payloads, sealed permits class implementations - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | ---------------------- | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed)
abstract sealed validated payload class | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedVoid](#applicationjsonschema1boxedvoid)
boxed class to store validated null payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedBoolean](#applicationjsonschema1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedNumber](#applicationjsonschema1boxednumber)
boxed class to store validated Number payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedString](#applicationjsonschema1boxedstring)
boxed class to store validated String payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedList](#applicationjsonschema1boxedlist)
boxed class to store validated List payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap)
boxed class to store validated Map payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1](#applicationjsonschema1)
schema class | - -## ApplicationjsonSchema1Boxed -public static abstract sealed class ApplicationjsonSchema1Boxed
-permits
-[ApplicationjsonSchema1BoxedVoid](#applicationjsonschema1boxedvoid), -[ApplicationjsonSchema1BoxedBoolean](#applicationjsonschema1boxedboolean), -[ApplicationjsonSchema1BoxedNumber](#applicationjsonschema1boxednumber), -[ApplicationjsonSchema1BoxedString](#applicationjsonschema1boxedstring), -[ApplicationjsonSchema1BoxedList](#applicationjsonschema1boxedlist), -[ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap) - -abstract sealed class that stores validated payloads using boxed classes - -## ApplicationjsonSchema1BoxedVoid -public static final class ApplicationjsonSchema1BoxedVoid
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) - -a boxed class to store validated null payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonSchema1BoxedVoid(Void data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| Void | data
validated payload | - -## ApplicationjsonSchema1BoxedBoolean -public static final class ApplicationjsonSchema1BoxedBoolean
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) - -a boxed class to store validated boolean payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonSchema1BoxedBoolean(boolean data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| boolean | data
validated payload | - -## ApplicationjsonSchema1BoxedNumber -public static final class ApplicationjsonSchema1BoxedNumber
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) - -a boxed class to store validated Number payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonSchema1BoxedNumber(Number data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| Number | data
validated payload | - -## ApplicationjsonSchema1BoxedString -public static final class ApplicationjsonSchema1BoxedString
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) - -a boxed class to store validated String payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonSchema1BoxedString(String data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| String | data
validated payload | - -## ApplicationjsonSchema1BoxedList -public static final class ApplicationjsonSchema1BoxedList
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) - -a boxed class to store validated List payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonSchema1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | - -## ApplicationjsonSchema1BoxedMap -public static final class ApplicationjsonSchema1BoxedMap
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) - -a boxed class to store validated Map payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonSchema1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | - -## ApplicationjsonSchema1 -public static class ApplicationjsonSchema1
-extends AnyTypeJsonSchema.AnyTypeJsonSchema1 - -A schema class that validates payloads - -| Methods Inherited from class org.openapijsonschematools.client.schemas.AnyTypeJsonSchema.AnyTypeJsonSchema1 | -| ------------------------------------------------------------------ | -| validate | -| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/responses/response3xx/content/applicationjson/ApplicationjsonSchema.md b/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/responses/response3xx/content/applicationjson/ApplicationjsonSchema.md deleted file mode 100644 index 53da126ffca..00000000000 --- a/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/responses/response3xx/content/applicationjson/ApplicationjsonSchema.md +++ /dev/null @@ -1,138 +0,0 @@ -# ApplicationjsonSchema -public class ApplicationjsonSchema
- -A class that contains necessary nested -- schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type -- boxed classes which store validated payloads, sealed permits class implementations - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | ---------------------- | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed)
abstract sealed validated payload class | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedVoid](#applicationjsonschema1boxedvoid)
boxed class to store validated null payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedBoolean](#applicationjsonschema1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedNumber](#applicationjsonschema1boxednumber)
boxed class to store validated Number payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedString](#applicationjsonschema1boxedstring)
boxed class to store validated String payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedList](#applicationjsonschema1boxedlist)
boxed class to store validated List payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap)
boxed class to store validated Map payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1](#applicationjsonschema1)
schema class | - -## ApplicationjsonSchema1Boxed -public static abstract sealed class ApplicationjsonSchema1Boxed
-permits
-[ApplicationjsonSchema1BoxedVoid](#applicationjsonschema1boxedvoid), -[ApplicationjsonSchema1BoxedBoolean](#applicationjsonschema1boxedboolean), -[ApplicationjsonSchema1BoxedNumber](#applicationjsonschema1boxednumber), -[ApplicationjsonSchema1BoxedString](#applicationjsonschema1boxedstring), -[ApplicationjsonSchema1BoxedList](#applicationjsonschema1boxedlist), -[ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap) - -abstract sealed class that stores validated payloads using boxed classes - -## ApplicationjsonSchema1BoxedVoid -public static final class ApplicationjsonSchema1BoxedVoid
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) - -a boxed class to store validated null payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonSchema1BoxedVoid(Void data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| Void | data
validated payload | - -## ApplicationjsonSchema1BoxedBoolean -public static final class ApplicationjsonSchema1BoxedBoolean
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) - -a boxed class to store validated boolean payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonSchema1BoxedBoolean(boolean data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| boolean | data
validated payload | - -## ApplicationjsonSchema1BoxedNumber -public static final class ApplicationjsonSchema1BoxedNumber
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) - -a boxed class to store validated Number payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonSchema1BoxedNumber(Number data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| Number | data
validated payload | - -## ApplicationjsonSchema1BoxedString -public static final class ApplicationjsonSchema1BoxedString
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) - -a boxed class to store validated String payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonSchema1BoxedString(String data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| String | data
validated payload | - -## ApplicationjsonSchema1BoxedList -public static final class ApplicationjsonSchema1BoxedList
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) - -a boxed class to store validated List payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonSchema1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | - -## ApplicationjsonSchema1BoxedMap -public static final class ApplicationjsonSchema1BoxedMap
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) - -a boxed class to store validated Map payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonSchema1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | - -## ApplicationjsonSchema1 -public static class ApplicationjsonSchema1
-extends AnyTypeJsonSchema.AnyTypeJsonSchema1 - -A schema class that validates payloads - -| Methods Inherited from class org.openapijsonschematools.client.schemas.AnyTypeJsonSchema.AnyTypeJsonSchema1 | -| ------------------------------------------------------------------ | -| validate | -| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/responses/response4xx/content/applicationjson/ApplicationjsonSchema.md b/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/responses/response4xx/content/applicationjson/ApplicationjsonSchema.md deleted file mode 100644 index 53da126ffca..00000000000 --- a/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/responses/response4xx/content/applicationjson/ApplicationjsonSchema.md +++ /dev/null @@ -1,138 +0,0 @@ -# ApplicationjsonSchema -public class ApplicationjsonSchema
- -A class that contains necessary nested -- schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type -- boxed classes which store validated payloads, sealed permits class implementations - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | ---------------------- | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed)
abstract sealed validated payload class | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedVoid](#applicationjsonschema1boxedvoid)
boxed class to store validated null payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedBoolean](#applicationjsonschema1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedNumber](#applicationjsonschema1boxednumber)
boxed class to store validated Number payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedString](#applicationjsonschema1boxedstring)
boxed class to store validated String payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedList](#applicationjsonschema1boxedlist)
boxed class to store validated List payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap)
boxed class to store validated Map payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1](#applicationjsonschema1)
schema class | - -## ApplicationjsonSchema1Boxed -public static abstract sealed class ApplicationjsonSchema1Boxed
-permits
-[ApplicationjsonSchema1BoxedVoid](#applicationjsonschema1boxedvoid), -[ApplicationjsonSchema1BoxedBoolean](#applicationjsonschema1boxedboolean), -[ApplicationjsonSchema1BoxedNumber](#applicationjsonschema1boxednumber), -[ApplicationjsonSchema1BoxedString](#applicationjsonschema1boxedstring), -[ApplicationjsonSchema1BoxedList](#applicationjsonschema1boxedlist), -[ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap) - -abstract sealed class that stores validated payloads using boxed classes - -## ApplicationjsonSchema1BoxedVoid -public static final class ApplicationjsonSchema1BoxedVoid
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) - -a boxed class to store validated null payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonSchema1BoxedVoid(Void data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| Void | data
validated payload | - -## ApplicationjsonSchema1BoxedBoolean -public static final class ApplicationjsonSchema1BoxedBoolean
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) - -a boxed class to store validated boolean payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonSchema1BoxedBoolean(boolean data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| boolean | data
validated payload | - -## ApplicationjsonSchema1BoxedNumber -public static final class ApplicationjsonSchema1BoxedNumber
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) - -a boxed class to store validated Number payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonSchema1BoxedNumber(Number data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| Number | data
validated payload | - -## ApplicationjsonSchema1BoxedString -public static final class ApplicationjsonSchema1BoxedString
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) - -a boxed class to store validated String payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonSchema1BoxedString(String data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| String | data
validated payload | - -## ApplicationjsonSchema1BoxedList -public static final class ApplicationjsonSchema1BoxedList
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) - -a boxed class to store validated List payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonSchema1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | - -## ApplicationjsonSchema1BoxedMap -public static final class ApplicationjsonSchema1BoxedMap
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) - -a boxed class to store validated Map payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonSchema1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | - -## ApplicationjsonSchema1 -public static class ApplicationjsonSchema1
-extends AnyTypeJsonSchema.AnyTypeJsonSchema1 - -A schema class that validates payloads - -| Methods Inherited from class org.openapijsonschematools.client.schemas.AnyTypeJsonSchema.AnyTypeJsonSchema1 | -| ------------------------------------------------------------------ | -| validate | -| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/responses/response5xx/content/applicationjson/ApplicationjsonSchema.md b/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/responses/response5xx/content/applicationjson/ApplicationjsonSchema.md deleted file mode 100644 index 53da126ffca..00000000000 --- a/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/responses/response5xx/content/applicationjson/ApplicationjsonSchema.md +++ /dev/null @@ -1,138 +0,0 @@ -# ApplicationjsonSchema -public class ApplicationjsonSchema
- -A class that contains necessary nested -- schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type -- boxed classes which store validated payloads, sealed permits class implementations - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | ---------------------- | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed)
abstract sealed validated payload class | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedVoid](#applicationjsonschema1boxedvoid)
boxed class to store validated null payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedBoolean](#applicationjsonschema1boxedboolean)
boxed class to store validated boolean payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedNumber](#applicationjsonschema1boxednumber)
boxed class to store validated Number payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedString](#applicationjsonschema1boxedstring)
boxed class to store validated String payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedList](#applicationjsonschema1boxedlist)
boxed class to store validated List payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap)
boxed class to store validated Map payloads | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1](#applicationjsonschema1)
schema class | - -## ApplicationjsonSchema1Boxed -public static abstract sealed class ApplicationjsonSchema1Boxed
-permits
-[ApplicationjsonSchema1BoxedVoid](#applicationjsonschema1boxedvoid), -[ApplicationjsonSchema1BoxedBoolean](#applicationjsonschema1boxedboolean), -[ApplicationjsonSchema1BoxedNumber](#applicationjsonschema1boxednumber), -[ApplicationjsonSchema1BoxedString](#applicationjsonschema1boxedstring), -[ApplicationjsonSchema1BoxedList](#applicationjsonschema1boxedlist), -[ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap) - -abstract sealed class that stores validated payloads using boxed classes - -## ApplicationjsonSchema1BoxedVoid -public static final class ApplicationjsonSchema1BoxedVoid
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) - -a boxed class to store validated null payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonSchema1BoxedVoid(Void data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| Void | data
validated payload | - -## ApplicationjsonSchema1BoxedBoolean -public static final class ApplicationjsonSchema1BoxedBoolean
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) - -a boxed class to store validated boolean payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonSchema1BoxedBoolean(boolean data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| boolean | data
validated payload | - -## ApplicationjsonSchema1BoxedNumber -public static final class ApplicationjsonSchema1BoxedNumber
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) - -a boxed class to store validated Number payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonSchema1BoxedNumber(Number data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| Number | data
validated payload | - -## ApplicationjsonSchema1BoxedString -public static final class ApplicationjsonSchema1BoxedString
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) - -a boxed class to store validated String payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonSchema1BoxedString(String data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| String | data
validated payload | - -## ApplicationjsonSchema1BoxedList -public static final class ApplicationjsonSchema1BoxedList
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) - -a boxed class to store validated List payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonSchema1BoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | - -## ApplicationjsonSchema1BoxedMap -public static final class ApplicationjsonSchema1BoxedMap
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) - -a boxed class to store validated Map payloads, sealed permits class implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonSchema1BoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | - -## ApplicationjsonSchema1 -public static class ApplicationjsonSchema1
-extends AnyTypeJsonSchema.AnyTypeJsonSchema1 - -A schema class that validates payloads - -| Methods Inherited from class org.openapijsonschematools.client.schemas.AnyTypeJsonSchema.AnyTypeJsonSchema1 | -| ------------------------------------------------------------------ | -| validate | -| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/foo/get/responses/responsedefault/content/applicationjson/ApplicationjsonSchema.md b/samples/client/petstore/java/docs/paths/foo/get/responses/codedefaultresponse/content/applicationjson/ApplicationjsonSchema.md similarity index 84% rename from samples/client/petstore/java/docs/paths/foo/get/responses/responsedefault/content/applicationjson/ApplicationjsonSchema.md rename to samples/client/petstore/java/docs/paths/foo/get/responses/codedefaultresponse/content/applicationjson/ApplicationjsonSchema.md index 65fd5216ca4..16d7385957f 100644 --- a/samples/client/petstore/java/docs/paths/foo/get/responses/responsedefault/content/applicationjson/ApplicationjsonSchema.md +++ b/samples/client/petstore/java/docs/paths/foo/get/responses/codedefaultresponse/content/applicationjson/ApplicationjsonSchema.md @@ -3,7 +3,7 @@ public class ApplicationjsonSchema
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -11,34 +11,35 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed)
abstract sealed validated payload class | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ApplicationjsonSchema.ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed)
sealed interface for validated payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap)
boxed class to store validated Map payloads | | static class | [ApplicationjsonSchema.ApplicationjsonSchema1](#applicationjsonschema1)
schema class | | static class | [ApplicationjsonSchema.ApplicationjsonSchemaMapBuilder](#applicationjsonschemamapbuilder)
builder for Map payloads | | static class | [ApplicationjsonSchema.ApplicationjsonSchemaMap](#applicationjsonschemamap)
output class for Map payloads | ## ApplicationjsonSchema1Boxed -public static abstract sealed class ApplicationjsonSchema1Boxed
+public sealed interface ApplicationjsonSchema1Boxed
permits
[ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ApplicationjsonSchema1BoxedMap -public static final class ApplicationjsonSchema1BoxedMap
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) +public record ApplicationjsonSchema1BoxedMap
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ApplicationjsonSchema1BoxedMap([ApplicationjsonSchemaMap](#applicationjsonschemamap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [ApplicationjsonSchemaMap](#applicationjsonschemamap) | data
validated payload | +| [ApplicationjsonSchemaMap](#applicationjsonschemamap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ApplicationjsonSchema1 public static class ApplicationjsonSchema1
@@ -89,7 +90,9 @@ ApplicationjsonSchema.ApplicationjsonSchemaMap validatedPayload = | ----------------- | ---------------------- | | [ApplicationjsonSchemaMap](#applicationjsonschemamap) | validate([Map<?, ?>](#applicationjsonschemamapbuilder) arg, SchemaConfiguration configuration) | | [ApplicationjsonSchema1BoxedMap](#applicationjsonschema1boxedmap) | validateAndBox([Map<?, ?>](#applicationjsonschemamapbuilder) arg, SchemaConfiguration configuration) | +| [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ApplicationjsonSchemaMapBuilder public class ApplicationjsonSchemaMapBuilder
builder for `Map` diff --git a/samples/client/petstore/java/docs/paths/petfindbystatus/get/parameters/parameter0/Schema0.md b/samples/client/petstore/java/docs/paths/petfindbystatus/get/parameters/parameter0/Schema0.md index d40847bbbc4..768242ca972 100644 --- a/samples/client/petstore/java/docs/paths/petfindbystatus/get/parameters/parameter0/Schema0.md +++ b/samples/client/petstore/java/docs/paths/petfindbystatus/get/parameters/parameter0/Schema0.md @@ -3,7 +3,7 @@ public class Schema0
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated list payloads, extends FrozenList - classes to build inputs for list payloads @@ -12,38 +12,39 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Schema0.Schema01Boxed](#schema01boxed)
abstract sealed validated payload class | -| static class | [Schema0.Schema01BoxedList](#schema01boxedlist)
boxed class to store validated List payloads | +| sealed interface | [Schema0.Schema01Boxed](#schema01boxed)
sealed interface for validated payloads | +| record | [Schema0.Schema01BoxedList](#schema01boxedlist)
boxed class to store validated List payloads | | static class | [Schema0.Schema01](#schema01)
schema class | | static class | [Schema0.SchemaListBuilder0](#schemalistbuilder0)
builder for List payloads | | static class | [Schema0.SchemaList0](#schemalist0)
output class for List payloads | -| static class | [Schema0.Items0Boxed](#items0boxed)
abstract sealed validated payload class | -| static class | [Schema0.Items0BoxedString](#items0boxedstring)
boxed class to store validated String payloads | +| sealed interface | [Schema0.Items0Boxed](#items0boxed)
sealed interface for validated payloads | +| record | [Schema0.Items0BoxedString](#items0boxedstring)
boxed class to store validated String payloads | | static class | [Schema0.Items0](#items0)
schema class | | enum | [Schema0.StringItemsEnums0](#stringitemsenums0)
String enum | ## Schema01Boxed -public static abstract sealed class Schema01Boxed
+public sealed interface Schema01Boxed
permits
[Schema01BoxedList](#schema01boxedlist) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema01BoxedList -public static final class Schema01BoxedList
-extends [Schema01Boxed](#schema01boxed) +public record Schema01BoxedList
+implements [Schema01Boxed](#schema01boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema01BoxedList([SchemaList0](#schemalist0) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [SchemaList0](#schemalist0) | data
validated payload | +| [SchemaList0](#schemalist0) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema01 public static class Schema01
@@ -88,7 +89,9 @@ Schema0.SchemaList0 validatedPayload = | ----------------- | ---------------------- | | [SchemaList0](#schemalist0) | validate([List](#schemalistbuilder0) arg, SchemaConfiguration configuration) | | [Schema01BoxedList](#schema01boxedlist) | validateAndBox([List](#schemalistbuilder0) arg, SchemaConfiguration configuration) | +| [Schema01Boxed](#schema01boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## SchemaListBuilder0 public class SchemaListBuilder0
builder for `List` @@ -120,27 +123,28 @@ A class to store validated List payloads | static [SchemaList0](#schemalist0) | of([List](#schemalistbuilder0) arg, SchemaConfiguration configuration) | ## Items0Boxed -public static abstract sealed class Items0Boxed
+public sealed interface Items0Boxed
permits
[Items0BoxedString](#items0boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Items0BoxedString -public static final class Items0BoxedString
-extends [Items0Boxed](#items0boxed) +public record Items0BoxedString
+implements [Items0Boxed](#items0boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Items0BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Items0 public static class Items0
@@ -183,7 +187,9 @@ String validatedPayload = Schema0.Items0.validate( | String | validate(String arg, SchemaConfiguration configuration) | | String | validate([StringItemsEnums0](#stringitemsenums0) arg, SchemaConfiguration configuration) | | [Items0BoxedString](#items0boxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [Items0Boxed](#items0boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## StringItemsEnums0 public enum StringItemsEnums0
extends `Enum` diff --git a/samples/client/petstore/java/docs/paths/petfindbytags/get/parameters/parameter0/Schema0.md b/samples/client/petstore/java/docs/paths/petfindbytags/get/parameters/parameter0/Schema0.md index 7ad494f7333..037912fe768 100644 --- a/samples/client/petstore/java/docs/paths/petfindbytags/get/parameters/parameter0/Schema0.md +++ b/samples/client/petstore/java/docs/paths/petfindbytags/get/parameters/parameter0/Schema0.md @@ -3,7 +3,7 @@ public class Schema0
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated list payloads, extends FrozenList - classes to build inputs for list payloads @@ -11,37 +11,38 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Schema0.Schema01Boxed](#schema01boxed)
abstract sealed validated payload class | -| static class | [Schema0.Schema01BoxedList](#schema01boxedlist)
boxed class to store validated List payloads | +| sealed interface | [Schema0.Schema01Boxed](#schema01boxed)
sealed interface for validated payloads | +| record | [Schema0.Schema01BoxedList](#schema01boxedlist)
boxed class to store validated List payloads | | static class | [Schema0.Schema01](#schema01)
schema class | | static class | [Schema0.SchemaListBuilder0](#schemalistbuilder0)
builder for List payloads | | static class | [Schema0.SchemaList0](#schemalist0)
output class for List payloads | -| static class | [Schema0.Items0Boxed](#items0boxed)
abstract sealed validated payload class | -| static class | [Schema0.Items0BoxedString](#items0boxedstring)
boxed class to store validated String payloads | +| sealed interface | [Schema0.Items0Boxed](#items0boxed)
sealed interface for validated payloads | +| record | [Schema0.Items0BoxedString](#items0boxedstring)
boxed class to store validated String payloads | | static class | [Schema0.Items0](#items0)
schema class | ## Schema01Boxed -public static abstract sealed class Schema01Boxed
+public sealed interface Schema01Boxed
permits
[Schema01BoxedList](#schema01boxedlist) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema01BoxedList -public static final class Schema01BoxedList
-extends [Schema01Boxed](#schema01boxed) +public record Schema01BoxedList
+implements [Schema01Boxed](#schema01boxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema01BoxedList([SchemaList0](#schemalist0) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [SchemaList0](#schemalist0) | data
validated payload | +| [SchemaList0](#schemalist0) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema01 public static class Schema01
@@ -86,7 +87,9 @@ Schema0.SchemaList0 validatedPayload = | ----------------- | ---------------------- | | [SchemaList0](#schemalist0) | validate([List](#schemalistbuilder0) arg, SchemaConfiguration configuration) | | [Schema01BoxedList](#schema01boxedlist) | validateAndBox([List](#schemalistbuilder0) arg, SchemaConfiguration configuration) | +| [Schema01Boxed](#schema01boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## SchemaListBuilder0 public class SchemaListBuilder0
builder for `List` @@ -117,27 +120,28 @@ A class to store validated List payloads | static [SchemaList0](#schemalist0) | of([List](#schemalistbuilder0) arg, SchemaConfiguration configuration) | ## Items0Boxed -public static abstract sealed class Items0Boxed
+public sealed interface Items0Boxed
permits
[Items0BoxedString](#items0boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Items0BoxedString -public static final class Items0BoxedString
-extends [Items0Boxed](#items0boxed) +public record Items0BoxedString
+implements [Items0Boxed](#items0boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Items0BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Items0 public static class Items0
diff --git a/samples/client/petstore/java/docs/paths/petpetid/delete/parameters/parameter0/Schema0.md b/samples/client/petstore/java/docs/paths/petpetid/delete/parameters/parameter0/Schema0.md index 34951cbef92..9ff90e0bc35 100644 --- a/samples/client/petstore/java/docs/paths/petpetid/delete/parameters/parameter0/Schema0.md +++ b/samples/client/petstore/java/docs/paths/petpetid/delete/parameters/parameter0/Schema0.md @@ -3,38 +3,39 @@ public class Schema0
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Schema0.Schema01Boxed](#schema01boxed)
abstract sealed validated payload class | -| static class | [Schema0.Schema01BoxedString](#schema01boxedstring)
boxed class to store validated String payloads | +| sealed interface | [Schema0.Schema01Boxed](#schema01boxed)
sealed interface for validated payloads | +| record | [Schema0.Schema01BoxedString](#schema01boxedstring)
boxed class to store validated String payloads | | static class | [Schema0.Schema01](#schema01)
schema class | ## Schema01Boxed -public static abstract sealed class Schema01Boxed
+public sealed interface Schema01Boxed
permits
[Schema01BoxedString](#schema01boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema01BoxedString -public static final class Schema01BoxedString
-extends [Schema01Boxed](#schema01boxed) +public record Schema01BoxedString
+implements [Schema01Boxed](#schema01boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema01BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema01 public static class Schema01
diff --git a/samples/client/petstore/java/docs/paths/petpetid/delete/parameters/parameter1/Schema1.md b/samples/client/petstore/java/docs/paths/petpetid/delete/parameters/parameter1/Schema1.md index d5929ec2391..d8a770d95a5 100644 --- a/samples/client/petstore/java/docs/paths/petpetid/delete/parameters/parameter1/Schema1.md +++ b/samples/client/petstore/java/docs/paths/petpetid/delete/parameters/parameter1/Schema1.md @@ -3,38 +3,39 @@ public class Schema1
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Schema1.Schema11Boxed](#schema11boxed)
abstract sealed validated payload class | -| static class | [Schema1.Schema11BoxedNumber](#schema11boxednumber)
boxed class to store validated Number payloads | +| sealed interface | [Schema1.Schema11Boxed](#schema11boxed)
sealed interface for validated payloads | +| record | [Schema1.Schema11BoxedNumber](#schema11boxednumber)
boxed class to store validated Number payloads | | static class | [Schema1.Schema11](#schema11)
schema class | ## Schema11Boxed -public static abstract sealed class Schema11Boxed
+public sealed interface Schema11Boxed
permits
[Schema11BoxedNumber](#schema11boxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema11BoxedNumber -public static final class Schema11BoxedNumber
-extends [Schema11Boxed](#schema11boxed) +public record Schema11BoxedNumber
+implements [Schema11Boxed](#schema11boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema11BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema11 public static class Schema11
diff --git a/samples/client/petstore/java/docs/paths/petpetid/get/parameters/parameter0/Schema0.md b/samples/client/petstore/java/docs/paths/petpetid/get/parameters/parameter0/Schema0.md index f2092272f63..55e4e5cb238 100644 --- a/samples/client/petstore/java/docs/paths/petpetid/get/parameters/parameter0/Schema0.md +++ b/samples/client/petstore/java/docs/paths/petpetid/get/parameters/parameter0/Schema0.md @@ -3,38 +3,39 @@ public class Schema0
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Schema0.Schema01Boxed](#schema01boxed)
abstract sealed validated payload class | -| static class | [Schema0.Schema01BoxedNumber](#schema01boxednumber)
boxed class to store validated Number payloads | +| sealed interface | [Schema0.Schema01Boxed](#schema01boxed)
sealed interface for validated payloads | +| record | [Schema0.Schema01BoxedNumber](#schema01boxednumber)
boxed class to store validated Number payloads | | static class | [Schema0.Schema01](#schema01)
schema class | ## Schema01Boxed -public static abstract sealed class Schema01Boxed
+public sealed interface Schema01Boxed
permits
[Schema01BoxedNumber](#schema01boxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema01BoxedNumber -public static final class Schema01BoxedNumber
-extends [Schema01Boxed](#schema01boxed) +public record Schema01BoxedNumber
+implements [Schema01Boxed](#schema01boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema01BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema01 public static class Schema01
diff --git a/samples/client/petstore/java/docs/paths/petpetid/get/responses/response200/content/applicationjson/ApplicationjsonSchema.md b/samples/client/petstore/java/docs/paths/petpetid/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md similarity index 89% rename from samples/client/petstore/java/docs/paths/petpetid/get/responses/response200/content/applicationjson/ApplicationjsonSchema.md rename to samples/client/petstore/java/docs/paths/petpetid/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md index 915091b82ab..9a4a76df105 100644 --- a/samples/client/petstore/java/docs/paths/petpetid/get/responses/response200/content/applicationjson/ApplicationjsonSchema.md +++ b/samples/client/petstore/java/docs/paths/petpetid/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md @@ -4,7 +4,7 @@ extends [RefPet1](../../../../../../../../../components/schemas/RefPet.md#refpet A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary diff --git a/samples/client/petstore/java/docs/paths/petpetid/get/responses/response200/content/applicationxml/ApplicationxmlSchema.md b/samples/client/petstore/java/docs/paths/petpetid/get/responses/code200response/content/applicationxml/ApplicationxmlSchema.md similarity index 89% rename from samples/client/petstore/java/docs/paths/petpetid/get/responses/response200/content/applicationxml/ApplicationxmlSchema.md rename to samples/client/petstore/java/docs/paths/petpetid/get/responses/code200response/content/applicationxml/ApplicationxmlSchema.md index c4fa2d01442..a5b62a5f42c 100644 --- a/samples/client/petstore/java/docs/paths/petpetid/get/responses/response200/content/applicationxml/ApplicationxmlSchema.md +++ b/samples/client/petstore/java/docs/paths/petpetid/get/responses/code200response/content/applicationxml/ApplicationxmlSchema.md @@ -4,7 +4,7 @@ extends [Pet1](../../../../../../../../../components/schemas/Pet.md#pet) A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary diff --git a/samples/client/petstore/java/docs/paths/petpetid/post/parameters/parameter0/Schema0.md b/samples/client/petstore/java/docs/paths/petpetid/post/parameters/parameter0/Schema0.md index f2092272f63..55e4e5cb238 100644 --- a/samples/client/petstore/java/docs/paths/petpetid/post/parameters/parameter0/Schema0.md +++ b/samples/client/petstore/java/docs/paths/petpetid/post/parameters/parameter0/Schema0.md @@ -3,38 +3,39 @@ public class Schema0
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Schema0.Schema01Boxed](#schema01boxed)
abstract sealed validated payload class | -| static class | [Schema0.Schema01BoxedNumber](#schema01boxednumber)
boxed class to store validated Number payloads | +| sealed interface | [Schema0.Schema01Boxed](#schema01boxed)
sealed interface for validated payloads | +| record | [Schema0.Schema01BoxedNumber](#schema01boxednumber)
boxed class to store validated Number payloads | | static class | [Schema0.Schema01](#schema01)
schema class | ## Schema01Boxed -public static abstract sealed class Schema01Boxed
+public sealed interface Schema01Boxed
permits
[Schema01BoxedNumber](#schema01boxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema01BoxedNumber -public static final class Schema01BoxedNumber
-extends [Schema01Boxed](#schema01boxed) +public record Schema01BoxedNumber
+implements [Schema01Boxed](#schema01boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema01BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema01 public static class Schema01
diff --git a/samples/client/petstore/java/docs/paths/petpetid/post/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.md b/samples/client/petstore/java/docs/paths/petpetid/post/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.md index 2aa2dbd4074..145c7f4860a 100644 --- a/samples/client/petstore/java/docs/paths/petpetid/post/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.md +++ b/samples/client/petstore/java/docs/paths/petpetid/post/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.md @@ -3,7 +3,7 @@ public class ApplicationxwwwformurlencodedSchema
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -11,40 +11,41 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1Boxed](#applicationxwwwformurlencodedschema1boxed)
abstract sealed validated payload class | -| static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1BoxedMap](#applicationxwwwformurlencodedschema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1Boxed](#applicationxwwwformurlencodedschema1boxed)
sealed interface for validated payloads | +| record | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1BoxedMap](#applicationxwwwformurlencodedschema1boxedmap)
boxed class to store validated Map payloads | | static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1](#applicationxwwwformurlencodedschema1)
schema class | | static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchemaMapBuilder](#applicationxwwwformurlencodedschemamapbuilder)
builder for Map payloads | | static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchemaMap](#applicationxwwwformurlencodedschemamap)
output class for Map payloads | -| static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedStatusBoxed](#applicationxwwwformurlencodedstatusboxed)
abstract sealed validated payload class | -| static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedStatusBoxedString](#applicationxwwwformurlencodedstatusboxedstring)
boxed class to store validated String payloads | +| sealed interface | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedStatusBoxed](#applicationxwwwformurlencodedstatusboxed)
sealed interface for validated payloads | +| record | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedStatusBoxedString](#applicationxwwwformurlencodedstatusboxedstring)
boxed class to store validated String payloads | | static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedStatus](#applicationxwwwformurlencodedstatus)
schema class | -| static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedNameBoxed](#applicationxwwwformurlencodednameboxed)
abstract sealed validated payload class | -| static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedNameBoxedString](#applicationxwwwformurlencodednameboxedstring)
boxed class to store validated String payloads | +| sealed interface | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedNameBoxed](#applicationxwwwformurlencodednameboxed)
sealed interface for validated payloads | +| record | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedNameBoxedString](#applicationxwwwformurlencodednameboxedstring)
boxed class to store validated String payloads | | static class | [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedName](#applicationxwwwformurlencodedname)
schema class | ## ApplicationxwwwformurlencodedSchema1Boxed -public static abstract sealed class ApplicationxwwwformurlencodedSchema1Boxed
+public sealed interface ApplicationxwwwformurlencodedSchema1Boxed
permits
[ApplicationxwwwformurlencodedSchema1BoxedMap](#applicationxwwwformurlencodedschema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ApplicationxwwwformurlencodedSchema1BoxedMap -public static final class ApplicationxwwwformurlencodedSchema1BoxedMap
-extends [ApplicationxwwwformurlencodedSchema1Boxed](#applicationxwwwformurlencodedschema1boxed) +public record ApplicationxwwwformurlencodedSchema1BoxedMap
+implements [ApplicationxwwwformurlencodedSchema1Boxed](#applicationxwwwformurlencodedschema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ApplicationxwwwformurlencodedSchema1BoxedMap([ApplicationxwwwformurlencodedSchemaMap](#applicationxwwwformurlencodedschemamap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [ApplicationxwwwformurlencodedSchemaMap](#applicationxwwwformurlencodedschemamap) | data
validated payload | +| [ApplicationxwwwformurlencodedSchemaMap](#applicationxwwwformurlencodedschemamap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ApplicationxwwwformurlencodedSchema1 public static class ApplicationxwwwformurlencodedSchema1
@@ -91,7 +92,9 @@ ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchemaMap valid | ----------------- | ---------------------- | | [ApplicationxwwwformurlencodedSchemaMap](#applicationxwwwformurlencodedschemamap) | validate([Map<?, ?>](#applicationxwwwformurlencodedschemamapbuilder) arg, SchemaConfiguration configuration) | | [ApplicationxwwwformurlencodedSchema1BoxedMap](#applicationxwwwformurlencodedschema1boxedmap) | validateAndBox([Map<?, ?>](#applicationxwwwformurlencodedschemamapbuilder) arg, SchemaConfiguration configuration) | +| [ApplicationxwwwformurlencodedSchema1Boxed](#applicationxwwwformurlencodedschema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## ApplicationxwwwformurlencodedSchemaMapBuilder public class ApplicationxwwwformurlencodedSchemaMapBuilder
builder for `Map` @@ -134,27 +137,28 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## ApplicationxwwwformurlencodedStatusBoxed -public static abstract sealed class ApplicationxwwwformurlencodedStatusBoxed
+public sealed interface ApplicationxwwwformurlencodedStatusBoxed
permits
[ApplicationxwwwformurlencodedStatusBoxedString](#applicationxwwwformurlencodedstatusboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ApplicationxwwwformurlencodedStatusBoxedString -public static final class ApplicationxwwwformurlencodedStatusBoxedString
-extends [ApplicationxwwwformurlencodedStatusBoxed](#applicationxwwwformurlencodedstatusboxed) +public record ApplicationxwwwformurlencodedStatusBoxedString
+implements [ApplicationxwwwformurlencodedStatusBoxed](#applicationxwwwformurlencodedstatusboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ApplicationxwwwformurlencodedStatusBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ApplicationxwwwformurlencodedStatus public static class ApplicationxwwwformurlencodedStatus
@@ -171,27 +175,28 @@ Updated status of the pet | validateAndBox | ## ApplicationxwwwformurlencodedNameBoxed -public static abstract sealed class ApplicationxwwwformurlencodedNameBoxed
+public sealed interface ApplicationxwwwformurlencodedNameBoxed
permits
[ApplicationxwwwformurlencodedNameBoxedString](#applicationxwwwformurlencodednameboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ApplicationxwwwformurlencodedNameBoxedString -public static final class ApplicationxwwwformurlencodedNameBoxedString
-extends [ApplicationxwwwformurlencodedNameBoxed](#applicationxwwwformurlencodednameboxed) +public record ApplicationxwwwformurlencodedNameBoxedString
+implements [ApplicationxwwwformurlencodedNameBoxed](#applicationxwwwformurlencodednameboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ApplicationxwwwformurlencodedNameBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ApplicationxwwwformurlencodedName public static class ApplicationxwwwformurlencodedName
diff --git a/samples/client/petstore/java/docs/paths/petpetiduploadimage/post/parameters/parameter0/Schema0.md b/samples/client/petstore/java/docs/paths/petpetiduploadimage/post/parameters/parameter0/Schema0.md index f2092272f63..55e4e5cb238 100644 --- a/samples/client/petstore/java/docs/paths/petpetiduploadimage/post/parameters/parameter0/Schema0.md +++ b/samples/client/petstore/java/docs/paths/petpetiduploadimage/post/parameters/parameter0/Schema0.md @@ -3,38 +3,39 @@ public class Schema0
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Schema0.Schema01Boxed](#schema01boxed)
abstract sealed validated payload class | -| static class | [Schema0.Schema01BoxedNumber](#schema01boxednumber)
boxed class to store validated Number payloads | +| sealed interface | [Schema0.Schema01Boxed](#schema01boxed)
sealed interface for validated payloads | +| record | [Schema0.Schema01BoxedNumber](#schema01boxednumber)
boxed class to store validated Number payloads | | static class | [Schema0.Schema01](#schema01)
schema class | ## Schema01Boxed -public static abstract sealed class Schema01Boxed
+public sealed interface Schema01Boxed
permits
[Schema01BoxedNumber](#schema01boxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema01BoxedNumber -public static final class Schema01BoxedNumber
-extends [Schema01Boxed](#schema01boxed) +public record Schema01BoxedNumber
+implements [Schema01Boxed](#schema01boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema01BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema01 public static class Schema01
diff --git a/samples/client/petstore/java/docs/paths/petpetiduploadimage/post/requestbody/content/multipartformdata/MultipartformdataSchema.md b/samples/client/petstore/java/docs/paths/petpetiduploadimage/post/requestbody/content/multipartformdata/MultipartformdataSchema.md index 20c88307735..d100971b029 100644 --- a/samples/client/petstore/java/docs/paths/petpetiduploadimage/post/requestbody/content/multipartformdata/MultipartformdataSchema.md +++ b/samples/client/petstore/java/docs/paths/petpetiduploadimage/post/requestbody/content/multipartformdata/MultipartformdataSchema.md @@ -3,7 +3,7 @@ public class MultipartformdataSchema
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -11,39 +11,40 @@ A class that contains necessary nested ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [MultipartformdataSchema.MultipartformdataSchema1Boxed](#multipartformdataschema1boxed)
abstract sealed validated payload class | -| static class | [MultipartformdataSchema.MultipartformdataSchema1BoxedMap](#multipartformdataschema1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [MultipartformdataSchema.MultipartformdataSchema1Boxed](#multipartformdataschema1boxed)
sealed interface for validated payloads | +| record | [MultipartformdataSchema.MultipartformdataSchema1BoxedMap](#multipartformdataschema1boxedmap)
boxed class to store validated Map payloads | | static class | [MultipartformdataSchema.MultipartformdataSchema1](#multipartformdataschema1)
schema class | | static class | [MultipartformdataSchema.MultipartformdataSchemaMapBuilder](#multipartformdataschemamapbuilder)
builder for Map payloads | | static class | [MultipartformdataSchema.MultipartformdataSchemaMap](#multipartformdataschemamap)
output class for Map payloads | -| static class | [MultipartformdataSchema.MultipartformdataFileBoxed](#multipartformdatafileboxed)
abstract sealed validated payload class | +| sealed interface | [MultipartformdataSchema.MultipartformdataFileBoxed](#multipartformdatafileboxed)
sealed interface for validated payloads | | static class | [MultipartformdataSchema.MultipartformdataFile](#multipartformdatafile)
schema class | -| static class | [MultipartformdataSchema.MultipartformdataAdditionalMetadataBoxed](#multipartformdataadditionalmetadataboxed)
abstract sealed validated payload class | -| static class | [MultipartformdataSchema.MultipartformdataAdditionalMetadataBoxedString](#multipartformdataadditionalmetadataboxedstring)
boxed class to store validated String payloads | +| sealed interface | [MultipartformdataSchema.MultipartformdataAdditionalMetadataBoxed](#multipartformdataadditionalmetadataboxed)
sealed interface for validated payloads | +| record | [MultipartformdataSchema.MultipartformdataAdditionalMetadataBoxedString](#multipartformdataadditionalmetadataboxedstring)
boxed class to store validated String payloads | | static class | [MultipartformdataSchema.MultipartformdataAdditionalMetadata](#multipartformdataadditionalmetadata)
schema class | ## MultipartformdataSchema1Boxed -public static abstract sealed class MultipartformdataSchema1Boxed
+public sealed interface MultipartformdataSchema1Boxed
permits
[MultipartformdataSchema1BoxedMap](#multipartformdataschema1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## MultipartformdataSchema1BoxedMap -public static final class MultipartformdataSchema1BoxedMap
-extends [MultipartformdataSchema1Boxed](#multipartformdataschema1boxed) +public record MultipartformdataSchema1BoxedMap
+implements [MultipartformdataSchema1Boxed](#multipartformdataschema1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MultipartformdataSchema1BoxedMap([MultipartformdataSchemaMap](#multipartformdataschemamap) data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [MultipartformdataSchemaMap](#multipartformdataschemamap) | data
validated payload | +| [MultipartformdataSchemaMap](#multipartformdataschemamap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MultipartformdataSchema1 public static class MultipartformdataSchema1
@@ -90,7 +91,9 @@ MultipartformdataSchema.MultipartformdataSchemaMap validatedPayload = | ----------------- | ---------------------- | | [MultipartformdataSchemaMap](#multipartformdataschemamap) | validate([Map<?, ?>](#multipartformdataschemamapbuilder) arg, SchemaConfiguration configuration) | | [MultipartformdataSchema1BoxedMap](#multipartformdataschema1boxedmap) | validateAndBox([Map<?, ?>](#multipartformdataschemamapbuilder) arg, SchemaConfiguration configuration) | +| [MultipartformdataSchema1Boxed](#multipartformdataschema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ## MultipartformdataSchemaMapBuilder public class MultipartformdataSchemaMapBuilder
builder for `Map` @@ -133,10 +136,10 @@ A class to store validated Map payloads | @Nullable Object | getAdditionalProperty(String name)
provides type safety for additional properties | ## MultipartformdataFileBoxed -public static abstract sealed class MultipartformdataFileBoxed
+public sealed interface MultipartformdataFileBoxed
permits
-abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## MultipartformdataFile public static class MultipartformdataFile
@@ -148,27 +151,28 @@ A schema class that validates payloads file to upload ## MultipartformdataAdditionalMetadataBoxed -public static abstract sealed class MultipartformdataAdditionalMetadataBoxed
+public sealed interface MultipartformdataAdditionalMetadataBoxed
permits
[MultipartformdataAdditionalMetadataBoxedString](#multipartformdataadditionalmetadataboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## MultipartformdataAdditionalMetadataBoxedString -public static final class MultipartformdataAdditionalMetadataBoxedString
-extends [MultipartformdataAdditionalMetadataBoxed](#multipartformdataadditionalmetadataboxed) +public record MultipartformdataAdditionalMetadataBoxedString
+implements [MultipartformdataAdditionalMetadataBoxed](#multipartformdataadditionalmetadataboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | MultipartformdataAdditionalMetadataBoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## MultipartformdataAdditionalMetadata public static class MultipartformdataAdditionalMetadata
diff --git a/samples/client/petstore/java/docs/paths/storeorder/post/requestbody/content/applicationjson/ApplicationjsonSchema.md b/samples/client/petstore/java/docs/paths/storeorder/post/requestbody/content/applicationjson/ApplicationjsonSchema.md index c63efed4d0a..e069f9c21c8 100644 --- a/samples/client/petstore/java/docs/paths/storeorder/post/requestbody/content/applicationjson/ApplicationjsonSchema.md +++ b/samples/client/petstore/java/docs/paths/storeorder/post/requestbody/content/applicationjson/ApplicationjsonSchema.md @@ -4,7 +4,7 @@ extends [Order1](../../../../../../../components/schemas/Order.md#order) A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary diff --git a/samples/client/petstore/java/docs/paths/storeorder/post/responses/response200/content/applicationjson/ApplicationjsonSchema.md b/samples/client/petstore/java/docs/paths/storeorder/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md similarity index 89% rename from samples/client/petstore/java/docs/paths/storeorder/post/responses/response200/content/applicationjson/ApplicationjsonSchema.md rename to samples/client/petstore/java/docs/paths/storeorder/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md index 50b51e2a865..ff8a34dc488 100644 --- a/samples/client/petstore/java/docs/paths/storeorder/post/responses/response200/content/applicationjson/ApplicationjsonSchema.md +++ b/samples/client/petstore/java/docs/paths/storeorder/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md @@ -4,7 +4,7 @@ extends [Order1](../../../../../../../../../components/schemas/Order.md#order) A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary diff --git a/samples/client/petstore/java/docs/paths/storeorderorderid/get/responses/response200/content/applicationxml/ApplicationxmlSchema.md b/samples/client/petstore/java/docs/paths/storeorder/post/responses/code200response/content/applicationxml/ApplicationxmlSchema.md similarity index 89% rename from samples/client/petstore/java/docs/paths/storeorderorderid/get/responses/response200/content/applicationxml/ApplicationxmlSchema.md rename to samples/client/petstore/java/docs/paths/storeorder/post/responses/code200response/content/applicationxml/ApplicationxmlSchema.md index 1b8ffc8acf6..44082af145c 100644 --- a/samples/client/petstore/java/docs/paths/storeorderorderid/get/responses/response200/content/applicationxml/ApplicationxmlSchema.md +++ b/samples/client/petstore/java/docs/paths/storeorder/post/responses/code200response/content/applicationxml/ApplicationxmlSchema.md @@ -4,7 +4,7 @@ extends [Order1](../../../../../../../../../components/schemas/Order.md#order) A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary diff --git a/samples/client/petstore/java/docs/paths/storeorderorderid/delete/parameters/parameter0/Schema0.md b/samples/client/petstore/java/docs/paths/storeorderorderid/delete/parameters/parameter0/Schema0.md index 34951cbef92..9ff90e0bc35 100644 --- a/samples/client/petstore/java/docs/paths/storeorderorderid/delete/parameters/parameter0/Schema0.md +++ b/samples/client/petstore/java/docs/paths/storeorderorderid/delete/parameters/parameter0/Schema0.md @@ -3,38 +3,39 @@ public class Schema0
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Schema0.Schema01Boxed](#schema01boxed)
abstract sealed validated payload class | -| static class | [Schema0.Schema01BoxedString](#schema01boxedstring)
boxed class to store validated String payloads | +| sealed interface | [Schema0.Schema01Boxed](#schema01boxed)
sealed interface for validated payloads | +| record | [Schema0.Schema01BoxedString](#schema01boxedstring)
boxed class to store validated String payloads | | static class | [Schema0.Schema01](#schema01)
schema class | ## Schema01Boxed -public static abstract sealed class Schema01Boxed
+public sealed interface Schema01Boxed
permits
[Schema01BoxedString](#schema01boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema01BoxedString -public static final class Schema01BoxedString
-extends [Schema01Boxed](#schema01boxed) +public record Schema01BoxedString
+implements [Schema01Boxed](#schema01boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema01BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema01 public static class Schema01
diff --git a/samples/client/petstore/java/docs/paths/storeorderorderid/get/parameters/parameter0/Schema0.md b/samples/client/petstore/java/docs/paths/storeorderorderid/get/parameters/parameter0/Schema0.md index 4c5753300b1..c30a68b3c51 100644 --- a/samples/client/petstore/java/docs/paths/storeorderorderid/get/parameters/parameter0/Schema0.md +++ b/samples/client/petstore/java/docs/paths/storeorderorderid/get/parameters/parameter0/Schema0.md @@ -3,38 +3,39 @@ public class Schema0
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Schema0.Schema01Boxed](#schema01boxed)
abstract sealed validated payload class | -| static class | [Schema0.Schema01BoxedNumber](#schema01boxednumber)
boxed class to store validated Number payloads | +| sealed interface | [Schema0.Schema01Boxed](#schema01boxed)
sealed interface for validated payloads | +| record | [Schema0.Schema01BoxedNumber](#schema01boxednumber)
boxed class to store validated Number payloads | | static class | [Schema0.Schema01](#schema01)
schema class | ## Schema01Boxed -public static abstract sealed class Schema01Boxed
+public sealed interface Schema01Boxed
permits
[Schema01BoxedNumber](#schema01boxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema01BoxedNumber -public static final class Schema01BoxedNumber
-extends [Schema01Boxed](#schema01boxed) +public record Schema01BoxedNumber
+implements [Schema01Boxed](#schema01boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema01BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema01 public static class Schema01
@@ -77,4 +78,5 @@ long validatedPayload = Schema0.Schema01.validate( | ----------------- | ---------------------- | | long | validate(long arg, SchemaConfiguration configuration) | | [Schema01BoxedNumber](#schema01boxednumber) | validateAndBox(Number arg, SchemaConfiguration configuration) | -| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | \ No newline at end of file +| [Schema01Boxed](#schema01boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | +| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | diff --git a/samples/client/petstore/java/docs/paths/storeorderorderid/get/responses/response200/content/applicationjson/ApplicationjsonSchema.md b/samples/client/petstore/java/docs/paths/storeorderorderid/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md similarity index 89% rename from samples/client/petstore/java/docs/paths/storeorderorderid/get/responses/response200/content/applicationjson/ApplicationjsonSchema.md rename to samples/client/petstore/java/docs/paths/storeorderorderid/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md index 50b51e2a865..ff8a34dc488 100644 --- a/samples/client/petstore/java/docs/paths/storeorderorderid/get/responses/response200/content/applicationjson/ApplicationjsonSchema.md +++ b/samples/client/petstore/java/docs/paths/storeorderorderid/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md @@ -4,7 +4,7 @@ extends [Order1](../../../../../../../../../components/schemas/Order.md#order) A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary diff --git a/samples/client/petstore/java/docs/paths/storeorder/post/responses/response200/content/applicationxml/ApplicationxmlSchema.md b/samples/client/petstore/java/docs/paths/storeorderorderid/get/responses/code200response/content/applicationxml/ApplicationxmlSchema.md similarity index 89% rename from samples/client/petstore/java/docs/paths/storeorder/post/responses/response200/content/applicationxml/ApplicationxmlSchema.md rename to samples/client/petstore/java/docs/paths/storeorderorderid/get/responses/code200response/content/applicationxml/ApplicationxmlSchema.md index 1b8ffc8acf6..44082af145c 100644 --- a/samples/client/petstore/java/docs/paths/storeorder/post/responses/response200/content/applicationxml/ApplicationxmlSchema.md +++ b/samples/client/petstore/java/docs/paths/storeorderorderid/get/responses/code200response/content/applicationxml/ApplicationxmlSchema.md @@ -4,7 +4,7 @@ extends [Order1](../../../../../../../../../components/schemas/Order.md#order) A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary diff --git a/samples/client/petstore/java/docs/paths/user/post/requestbody/content/applicationjson/ApplicationjsonSchema.md b/samples/client/petstore/java/docs/paths/user/post/requestbody/content/applicationjson/ApplicationjsonSchema.md index f2e3fc91680..3433b43b8a4 100644 --- a/samples/client/petstore/java/docs/paths/user/post/requestbody/content/applicationjson/ApplicationjsonSchema.md +++ b/samples/client/petstore/java/docs/paths/user/post/requestbody/content/applicationjson/ApplicationjsonSchema.md @@ -4,7 +4,7 @@ extends [User1](../../../../../../../components/schemas/User.md#user) A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary diff --git a/samples/client/petstore/java/docs/paths/userlogin/get/parameters/parameter0/Schema0.md b/samples/client/petstore/java/docs/paths/userlogin/get/parameters/parameter0/Schema0.md index 34951cbef92..9ff90e0bc35 100644 --- a/samples/client/petstore/java/docs/paths/userlogin/get/parameters/parameter0/Schema0.md +++ b/samples/client/petstore/java/docs/paths/userlogin/get/parameters/parameter0/Schema0.md @@ -3,38 +3,39 @@ public class Schema0
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Schema0.Schema01Boxed](#schema01boxed)
abstract sealed validated payload class | -| static class | [Schema0.Schema01BoxedString](#schema01boxedstring)
boxed class to store validated String payloads | +| sealed interface | [Schema0.Schema01Boxed](#schema01boxed)
sealed interface for validated payloads | +| record | [Schema0.Schema01BoxedString](#schema01boxedstring)
boxed class to store validated String payloads | | static class | [Schema0.Schema01](#schema01)
schema class | ## Schema01Boxed -public static abstract sealed class Schema01Boxed
+public sealed interface Schema01Boxed
permits
[Schema01BoxedString](#schema01boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema01BoxedString -public static final class Schema01BoxedString
-extends [Schema01Boxed](#schema01boxed) +public record Schema01BoxedString
+implements [Schema01Boxed](#schema01boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema01BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema01 public static class Schema01
diff --git a/samples/client/petstore/java/docs/paths/userlogin/get/parameters/parameter1/Schema1.md b/samples/client/petstore/java/docs/paths/userlogin/get/parameters/parameter1/Schema1.md index dc73fa004df..63ec3a884fc 100644 --- a/samples/client/petstore/java/docs/paths/userlogin/get/parameters/parameter1/Schema1.md +++ b/samples/client/petstore/java/docs/paths/userlogin/get/parameters/parameter1/Schema1.md @@ -3,38 +3,39 @@ public class Schema1
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Schema1.Schema11Boxed](#schema11boxed)
abstract sealed validated payload class | -| static class | [Schema1.Schema11BoxedString](#schema11boxedstring)
boxed class to store validated String payloads | +| sealed interface | [Schema1.Schema11Boxed](#schema11boxed)
sealed interface for validated payloads | +| record | [Schema1.Schema11BoxedString](#schema11boxedstring)
boxed class to store validated String payloads | | static class | [Schema1.Schema11](#schema11)
schema class | ## Schema11Boxed -public static abstract sealed class Schema11Boxed
+public sealed interface Schema11Boxed
permits
[Schema11BoxedString](#schema11boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## Schema11BoxedString -public static final class Schema11BoxedString
-extends [Schema11Boxed](#schema11boxed) +public record Schema11BoxedString
+implements [Schema11Boxed](#schema11boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | Schema11BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## Schema11 public static class Schema11
diff --git a/samples/client/petstore/java/docs/paths/userlogin/get/responses/response200/content/applicationjson/ApplicationjsonSchema.md b/samples/client/petstore/java/docs/paths/userlogin/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md similarity index 60% rename from samples/client/petstore/java/docs/paths/userlogin/get/responses/response200/content/applicationjson/ApplicationjsonSchema.md rename to samples/client/petstore/java/docs/paths/userlogin/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md index ae31bdfd5a9..fe0b32c3b81 100644 --- a/samples/client/petstore/java/docs/paths/userlogin/get/responses/response200/content/applicationjson/ApplicationjsonSchema.md +++ b/samples/client/petstore/java/docs/paths/userlogin/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md @@ -3,38 +3,39 @@ public class ApplicationjsonSchema
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed)
abstract sealed validated payload class | -| static class | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedString](#applicationjsonschema1boxedstring)
boxed class to store validated String payloads | +| sealed interface | [ApplicationjsonSchema.ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed)
sealed interface for validated payloads | +| record | [ApplicationjsonSchema.ApplicationjsonSchema1BoxedString](#applicationjsonschema1boxedstring)
boxed class to store validated String payloads | | static class | [ApplicationjsonSchema.ApplicationjsonSchema1](#applicationjsonschema1)
schema class | ## ApplicationjsonSchema1Boxed -public static abstract sealed class ApplicationjsonSchema1Boxed
+public sealed interface ApplicationjsonSchema1Boxed
permits
[ApplicationjsonSchema1BoxedString](#applicationjsonschema1boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ApplicationjsonSchema1BoxedString -public static final class ApplicationjsonSchema1BoxedString
-extends [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) +public record ApplicationjsonSchema1BoxedString
+implements [ApplicationjsonSchema1Boxed](#applicationjsonschema1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ApplicationjsonSchema1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ApplicationjsonSchema1 public static class ApplicationjsonSchema1
diff --git a/samples/client/petstore/java/docs/paths/userlogin/get/responses/response200/content/applicationxml/ApplicationxmlSchema.md b/samples/client/petstore/java/docs/paths/userlogin/get/responses/code200response/content/applicationxml/ApplicationxmlSchema.md similarity index 60% rename from samples/client/petstore/java/docs/paths/userlogin/get/responses/response200/content/applicationxml/ApplicationxmlSchema.md rename to samples/client/petstore/java/docs/paths/userlogin/get/responses/code200response/content/applicationxml/ApplicationxmlSchema.md index 844a63025bd..81b5c1d6689 100644 --- a/samples/client/petstore/java/docs/paths/userlogin/get/responses/response200/content/applicationxml/ApplicationxmlSchema.md +++ b/samples/client/petstore/java/docs/paths/userlogin/get/responses/code200response/content/applicationxml/ApplicationxmlSchema.md @@ -3,38 +3,39 @@ public class ApplicationxmlSchema
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [ApplicationxmlSchema.ApplicationxmlSchema1Boxed](#applicationxmlschema1boxed)
abstract sealed validated payload class | -| static class | [ApplicationxmlSchema.ApplicationxmlSchema1BoxedString](#applicationxmlschema1boxedstring)
boxed class to store validated String payloads | +| sealed interface | [ApplicationxmlSchema.ApplicationxmlSchema1Boxed](#applicationxmlschema1boxed)
sealed interface for validated payloads | +| record | [ApplicationxmlSchema.ApplicationxmlSchema1BoxedString](#applicationxmlschema1boxedstring)
boxed class to store validated String payloads | | static class | [ApplicationxmlSchema.ApplicationxmlSchema1](#applicationxmlschema1)
schema class | ## ApplicationxmlSchema1Boxed -public static abstract sealed class ApplicationxmlSchema1Boxed
+public sealed interface ApplicationxmlSchema1Boxed
permits
[ApplicationxmlSchema1BoxedString](#applicationxmlschema1boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## ApplicationxmlSchema1BoxedString -public static final class ApplicationxmlSchema1BoxedString
-extends [ApplicationxmlSchema1Boxed](#applicationxmlschema1boxed) +public record ApplicationxmlSchema1BoxedString
+implements [ApplicationxmlSchema1Boxed](#applicationxmlschema1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | ApplicationxmlSchema1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## ApplicationxmlSchema1 public static class ApplicationxmlSchema1
diff --git a/samples/client/petstore/java/docs/paths/userlogin/get/responses/response200/headers/xexpiresafter/XExpiresAfterSchema.md b/samples/client/petstore/java/docs/paths/userlogin/get/responses/code200response/headers/xexpiresafter/XExpiresAfterSchema.md similarity index 60% rename from samples/client/petstore/java/docs/paths/userlogin/get/responses/response200/headers/xexpiresafter/XExpiresAfterSchema.md rename to samples/client/petstore/java/docs/paths/userlogin/get/responses/code200response/headers/xexpiresafter/XExpiresAfterSchema.md index 627d8c8f55e..20c88d889d0 100644 --- a/samples/client/petstore/java/docs/paths/userlogin/get/responses/response200/headers/xexpiresafter/XExpiresAfterSchema.md +++ b/samples/client/petstore/java/docs/paths/userlogin/get/responses/code200response/headers/xexpiresafter/XExpiresAfterSchema.md @@ -3,38 +3,39 @@ public class XExpiresAfterSchema
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [XExpiresAfterSchema.XExpiresAfterSchema1Boxed](#xexpiresafterschema1boxed)
abstract sealed validated payload class | -| static class | [XExpiresAfterSchema.XExpiresAfterSchema1BoxedString](#xexpiresafterschema1boxedstring)
boxed class to store validated String payloads | +| sealed interface | [XExpiresAfterSchema.XExpiresAfterSchema1Boxed](#xexpiresafterschema1boxed)
sealed interface for validated payloads | +| record | [XExpiresAfterSchema.XExpiresAfterSchema1BoxedString](#xexpiresafterschema1boxedstring)
boxed class to store validated String payloads | | static class | [XExpiresAfterSchema.XExpiresAfterSchema1](#xexpiresafterschema1)
schema class | ## XExpiresAfterSchema1Boxed -public static abstract sealed class XExpiresAfterSchema1Boxed
+public sealed interface XExpiresAfterSchema1Boxed
permits
[XExpiresAfterSchema1BoxedString](#xexpiresafterschema1boxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## XExpiresAfterSchema1BoxedString -public static final class XExpiresAfterSchema1BoxedString
-extends [XExpiresAfterSchema1Boxed](#xexpiresafterschema1boxed) +public record XExpiresAfterSchema1BoxedString
+implements [XExpiresAfterSchema1Boxed](#xexpiresafterschema1boxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | XExpiresAfterSchema1BoxedString(String data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## XExpiresAfterSchema1 public static class XExpiresAfterSchema1
diff --git a/samples/client/petstore/java/docs/paths/userlogin/get/responses/response200/headers/xratelimit/content/applicationjson/XRateLimitSchema.md b/samples/client/petstore/java/docs/paths/userlogin/get/responses/code200response/headers/xratelimit/content/applicationjson/XRateLimitSchema.md similarity index 60% rename from samples/client/petstore/java/docs/paths/userlogin/get/responses/response200/headers/xratelimit/content/applicationjson/XRateLimitSchema.md rename to samples/client/petstore/java/docs/paths/userlogin/get/responses/code200response/headers/xratelimit/content/applicationjson/XRateLimitSchema.md index 8a6ce8a1475..76dfd4f33af 100644 --- a/samples/client/petstore/java/docs/paths/userlogin/get/responses/response200/headers/xratelimit/content/applicationjson/XRateLimitSchema.md +++ b/samples/client/petstore/java/docs/paths/userlogin/get/responses/code200response/headers/xratelimit/content/applicationjson/XRateLimitSchema.md @@ -3,38 +3,39 @@ public class XRateLimitSchema
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [XRateLimitSchema.XRateLimitSchema1Boxed](#xratelimitschema1boxed)
abstract sealed validated payload class | -| static class | [XRateLimitSchema.XRateLimitSchema1BoxedNumber](#xratelimitschema1boxednumber)
boxed class to store validated Number payloads | +| sealed interface | [XRateLimitSchema.XRateLimitSchema1Boxed](#xratelimitschema1boxed)
sealed interface for validated payloads | +| record | [XRateLimitSchema.XRateLimitSchema1BoxedNumber](#xratelimitschema1boxednumber)
boxed class to store validated Number payloads | | static class | [XRateLimitSchema.XRateLimitSchema1](#xratelimitschema1)
schema class | ## XRateLimitSchema1Boxed -public static abstract sealed class XRateLimitSchema1Boxed
+public sealed interface XRateLimitSchema1Boxed
permits
[XRateLimitSchema1BoxedNumber](#xratelimitschema1boxednumber) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ## XRateLimitSchema1BoxedNumber -public static final class XRateLimitSchema1BoxedNumber
-extends [XRateLimitSchema1Boxed](#xratelimitschema1boxed) +public record XRateLimitSchema1BoxedNumber
+implements [XRateLimitSchema1Boxed](#xratelimitschema1boxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation ### Constructor Summary | Constructor and Description | | --------------------------- | | XRateLimitSchema1BoxedNumber(Number data)
Creates an instance, private visibility | -### Field Summary -| Modifier and Type | Field and Description | +### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ## XRateLimitSchema1 public static class XRateLimitSchema1
diff --git a/samples/client/petstore/java/docs/paths/userusername/get/responses/response200/content/applicationjson/ApplicationjsonSchema.md b/samples/client/petstore/java/docs/paths/userusername/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md similarity index 89% rename from samples/client/petstore/java/docs/paths/userusername/get/responses/response200/content/applicationjson/ApplicationjsonSchema.md rename to samples/client/petstore/java/docs/paths/userusername/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md index 57e5223ee10..a3f14691ea8 100644 --- a/samples/client/petstore/java/docs/paths/userusername/get/responses/response200/content/applicationjson/ApplicationjsonSchema.md +++ b/samples/client/petstore/java/docs/paths/userusername/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md @@ -4,7 +4,7 @@ extends [User1](../../../../../../../../../components/schemas/User.md#user) A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary diff --git a/samples/client/petstore/java/docs/paths/userusername/get/responses/response200/content/applicationxml/ApplicationxmlSchema.md b/samples/client/petstore/java/docs/paths/userusername/get/responses/code200response/content/applicationxml/ApplicationxmlSchema.md similarity index 89% rename from samples/client/petstore/java/docs/paths/userusername/get/responses/response200/content/applicationxml/ApplicationxmlSchema.md rename to samples/client/petstore/java/docs/paths/userusername/get/responses/code200response/content/applicationxml/ApplicationxmlSchema.md index dd9ec7af4f3..28956f30c63 100644 --- a/samples/client/petstore/java/docs/paths/userusername/get/responses/response200/content/applicationxml/ApplicationxmlSchema.md +++ b/samples/client/petstore/java/docs/paths/userusername/get/responses/code200response/content/applicationxml/ApplicationxmlSchema.md @@ -4,7 +4,7 @@ extends [User1](../../../../../../../../../components/schemas/User.md#user) A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary diff --git a/samples/client/petstore/java/docs/paths/userusername/put/requestbody/content/applicationjson/ApplicationjsonSchema.md b/samples/client/petstore/java/docs/paths/userusername/put/requestbody/content/applicationjson/ApplicationjsonSchema.md index f2e3fc91680..3433b43b8a4 100644 --- a/samples/client/petstore/java/docs/paths/userusername/put/requestbody/content/applicationjson/ApplicationjsonSchema.md +++ b/samples/client/petstore/java/docs/paths/userusername/put/requestbody/content/applicationjson/ApplicationjsonSchema.md @@ -4,7 +4,7 @@ extends [User1](../../../../../../../components/schemas/User.md#user) A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations ## Nested Class Summary diff --git a/samples/client/petstore/java/docs/servers/Server0.md b/samples/client/petstore/java/docs/servers/Server0.md index b2fe4276f49..7e5a7f19f1e 100644 --- a/samples/client/petstore/java/docs/servers/Server0.md +++ b/samples/client/petstore/java/docs/servers/Server0.md @@ -24,7 +24,7 @@ public class Variables
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -33,50 +33,51 @@ A class that contains necessary nested ### Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Variables.Variables1Boxed](#variables1boxed)
abstract sealed validated payload class | -| static class | [Variables.Variables1BoxedMap](#variables1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [Variables.Variables1Boxed](#variables1boxed)
sealed interface for validated payloads | +| record | [Variables.Variables1BoxedMap](#variables1boxedmap)
boxed class to store validated Map payloads | | static class | [Variables.Variables1](#variables1)
schema class | | static class | [Variables.VariablesMapBuilder](#variablesmapbuilder)
builder for Map payloads | | static class | [Variables.VariablesMap](#variablesmap)
output class for Map payloads | -| static class | [Variables.PortBoxed](#portboxed)
abstract sealed validated payload class | -| static class | [Variables.PortBoxedString](#portboxedstring)
boxed class to store validated String payloads | +| sealed interface | [Variables.PortBoxed](#portboxed)
sealed interface for validated payloads | +| record | [Variables.PortBoxedString](#portboxedstring)
boxed class to store validated String payloads | | static class | [Variables.Port](#port)
schema class | | enum | [Variables.StringPortEnums](#stringportenums)
String enum | -| static class | [Variables.ServerBoxed](#serverboxed)
abstract sealed validated payload class | -| static class | [Variables.ServerBoxedString](#serverboxedstring)
boxed class to store validated String payloads | +| sealed interface | [Variables.ServerBoxed](#serverboxed)
sealed interface for validated payloads | +| record | [Variables.ServerBoxedString](#serverboxedstring)
boxed class to store validated String payloads | | static class | [Variables.Server](#server)
schema class | | enum | [Variables.StringServerEnums](#stringserverenums)
String enum | -| static class | [Variables.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
abstract sealed validated payload class | -| static class | [Variables.AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid)
boxed class to store validated null payloads | -| static class | [Variables.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | -| static class | [Variables.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | -| static class | [Variables.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | -| static class | [Variables.AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist)
boxed class to store validated List payloads | -| static class | [Variables.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [Variables.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
sealed interface for validated payloads | +| record | [Variables.AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid)
boxed class to store validated null payloads | +| record | [Variables.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | +| record | [Variables.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | +| record | [Variables.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | +| record | [Variables.AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist)
boxed class to store validated List payloads | +| record | [Variables.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | | static class | [Variables.AdditionalProperties](#additionalproperties)
schema class | ### Variables1Boxed -public static abstract sealed class Variables1Boxed
+public sealed interface Variables1Boxed
permits
[Variables1BoxedMap](#variables1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ### Variables1BoxedMap -public static final class Variables1BoxedMap
-extends [Variables1Boxed](#variables1boxed) +public record Variables1BoxedMap
+implements [Variables1Boxed](#variables1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation #### Constructor Summary | Constructor and Description | | --------------------------- | | Variables1BoxedMap([VariablesMap](#variablesmap) data)
Creates an instance, private visibility | -#### Field Summary -| Modifier and Type | Field and Description | +#### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [VariablesMap](#variablesmap) | data
validated payload | +| [VariablesMap](#variablesmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ### Variables1 public static class Variables1
@@ -125,7 +126,9 @@ Variables.VariablesMap validatedPayload = | ----------------- | ---------------------- | | [VariablesMap](#variablesmap) | validate([Map<?, ?>](#variablesmapbuilder) arg, SchemaConfiguration configuration) | | [Variables1BoxedMap](#variables1boxedmap) | validateAndBox([Map<?, ?>](#variablesmapbuilder) arg, SchemaConfiguration configuration) | +| [Variables1Boxed](#variables1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ### VariablesMap00Builder public class VariablesMap00Builder
builder for `Map` @@ -209,27 +212,28 @@ A class to store validated Map payloads | String | server()
must be one of ["petstore", "qa-petstore", "dev-petstore"] if omitted the server will use the default value of petstore | ### PortBoxed -public static abstract sealed class PortBoxed
+public sealed interface PortBoxed
permits
[PortBoxedString](#portboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ### PortBoxedString -public static final class PortBoxedString
-extends [PortBoxed](#portboxed) +public record PortBoxedString
+implements [PortBoxed](#portboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation #### Constructor Summary | Constructor and Description | | --------------------------- | | PortBoxedString(String data)
Creates an instance, private visibility | -#### Field Summary -| Modifier and Type | Field and Description | +#### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ### Port public static class Port
@@ -275,7 +279,9 @@ String validatedPayload = Variables.Port.validate( | String | validate(String arg, SchemaConfiguration configuration) | | String | validate([StringPortEnums](#stringportenums) arg, SchemaConfiguration configuration) | | [PortBoxedString](#portboxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [PortBoxed](#portboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ### StringPortEnums public enum StringPortEnums
extends `Enum` @@ -289,27 +295,28 @@ A class that stores String enum values | POSITIVE_8080 | value = "8080" | ### ServerBoxed -public static abstract sealed class ServerBoxed
+public sealed interface ServerBoxed
permits
[ServerBoxedString](#serverboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ### ServerBoxedString -public static final class ServerBoxedString
-extends [ServerBoxed](#serverboxed) +public record ServerBoxedString
+implements [ServerBoxed](#serverboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation #### Constructor Summary | Constructor and Description | | --------------------------- | | ServerBoxedString(String data)
Creates an instance, private visibility | -#### Field Summary -| Modifier and Type | Field and Description | +#### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ### Server public static class Server
@@ -355,7 +362,9 @@ String validatedPayload = Variables.Server.validate( | String | validate(String arg, SchemaConfiguration configuration) | | String | validate([StringServerEnums](#stringserverenums) arg, SchemaConfiguration configuration) | | [ServerBoxedString](#serverboxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [ServerBoxed](#serverboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ### StringServerEnums public enum StringServerEnums
extends `Enum` @@ -370,7 +379,7 @@ A class that stores String enum values | DEV_HYPHEN_MINUS_PETSTORE | value = "dev-petstore" | ### AdditionalPropertiesBoxed -public static abstract sealed class AdditionalPropertiesBoxed
+public sealed interface AdditionalPropertiesBoxed
permits
[AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid), [AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean), @@ -379,103 +388,109 @@ permits
[AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist), [AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ### AdditionalPropertiesBoxedVoid -public static final class AdditionalPropertiesBoxedVoid
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedVoid
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation #### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | -#### Field Summary -| Modifier and Type | Field and Description | +#### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ### AdditionalPropertiesBoxedBoolean -public static final class AdditionalPropertiesBoxedBoolean
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedBoolean
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation #### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | -#### Field Summary -| Modifier and Type | Field and Description | +#### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ### AdditionalPropertiesBoxedNumber -public static final class AdditionalPropertiesBoxedNumber
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedNumber
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation #### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | -#### Field Summary -| Modifier and Type | Field and Description | +#### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ### AdditionalPropertiesBoxedString -public static final class AdditionalPropertiesBoxedString
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedString
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation #### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | -#### Field Summary -| Modifier and Type | Field and Description | +#### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ### AdditionalPropertiesBoxedList -public static final class AdditionalPropertiesBoxedList
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedList
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation #### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -#### Field Summary -| Modifier and Type | Field and Description | +#### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ### AdditionalPropertiesBoxedMap -public static final class AdditionalPropertiesBoxedMap
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedMap
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation #### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -#### Field Summary -| Modifier and Type | Field and Description | +#### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ### AdditionalProperties public static class AdditionalProperties
diff --git a/samples/client/petstore/java/docs/servers/Server1.md b/samples/client/petstore/java/docs/servers/Server1.md index ab132bfaca2..a3b5f2d8879 100644 --- a/samples/client/petstore/java/docs/servers/Server1.md +++ b/samples/client/petstore/java/docs/servers/Server1.md @@ -24,7 +24,7 @@ public class Variables
A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations - classes to store validated map payloads, extends FrozenMap - classes to build inputs for map payloads @@ -33,46 +33,47 @@ A class that contains necessary nested ### Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | ---------------------- | -| static class | [Variables.Variables1Boxed](#variables1boxed)
abstract sealed validated payload class | -| static class | [Variables.Variables1BoxedMap](#variables1boxedmap)
boxed class to store validated Map payloads | +| sealed interface | [Variables.Variables1Boxed](#variables1boxed)
sealed interface for validated payloads | +| record | [Variables.Variables1BoxedMap](#variables1boxedmap)
boxed class to store validated Map payloads | | static class | [Variables.Variables1](#variables1)
schema class | | static class | [Variables.VariablesMapBuilder](#variablesmapbuilder)
builder for Map payloads | | static class | [Variables.VariablesMap](#variablesmap)
output class for Map payloads | -| static class | [Variables.VersionBoxed](#versionboxed)
abstract sealed validated payload class | -| static class | [Variables.VersionBoxedString](#versionboxedstring)
boxed class to store validated String payloads | +| sealed interface | [Variables.VersionBoxed](#versionboxed)
sealed interface for validated payloads | +| record | [Variables.VersionBoxedString](#versionboxedstring)
boxed class to store validated String payloads | | static class | [Variables.Version](#version)
schema class | | enum | [Variables.StringVersionEnums](#stringversionenums)
String enum | -| static class | [Variables.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
abstract sealed validated payload class | -| static class | [Variables.AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid)
boxed class to store validated null payloads | -| static class | [Variables.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | -| static class | [Variables.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | -| static class | [Variables.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | -| static class | [Variables.AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist)
boxed class to store validated List payloads | -| static class | [Variables.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | +| sealed interface | [Variables.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
sealed interface for validated payloads | +| record | [Variables.AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid)
boxed class to store validated null payloads | +| record | [Variables.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | +| record | [Variables.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | +| record | [Variables.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | +| record | [Variables.AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist)
boxed class to store validated List payloads | +| record | [Variables.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | | static class | [Variables.AdditionalProperties](#additionalproperties)
schema class | ### Variables1Boxed -public static abstract sealed class Variables1Boxed
+public sealed interface Variables1Boxed
permits
[Variables1BoxedMap](#variables1boxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ### Variables1BoxedMap -public static final class Variables1BoxedMap
-extends [Variables1Boxed](#variables1boxed) +public record Variables1BoxedMap
+implements [Variables1Boxed](#variables1boxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation #### Constructor Summary | Constructor and Description | | --------------------------- | | Variables1BoxedMap([VariablesMap](#variablesmap) data)
Creates an instance, private visibility | -#### Field Summary -| Modifier and Type | Field and Description | +#### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| [VariablesMap](#variablesmap) | data
validated payload | +| [VariablesMap](#variablesmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | ### Variables1 public static class Variables1
@@ -119,7 +120,9 @@ Variables.VariablesMap validatedPayload = | ----------------- | ---------------------- | | [VariablesMap](#variablesmap) | validate([Map<?, ?>](#variablesmapbuilder) arg, SchemaConfiguration configuration) | | [Variables1BoxedMap](#variables1boxedmap) | validateAndBox([Map<?, ?>](#variablesmapbuilder) arg, SchemaConfiguration configuration) | +| [Variables1Boxed](#variables1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ### VariablesMap0Builder public class VariablesMap0Builder
builder for `Map` @@ -166,27 +169,28 @@ A class to store validated Map payloads | String | version()
must be one of ["v1", "v2"] if omitted the server will use the default value of v2 | ### VersionBoxed -public static abstract sealed class VersionBoxed
+public sealed interface VersionBoxed
permits
[VersionBoxedString](#versionboxedstring) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ### VersionBoxedString -public static final class VersionBoxedString
-extends [VersionBoxed](#versionboxed) +public record VersionBoxedString
+implements [VersionBoxed](#versionboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation #### Constructor Summary | Constructor and Description | | --------------------------- | | VersionBoxedString(String data)
Creates an instance, private visibility | -#### Field Summary -| Modifier and Type | Field and Description | +#### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ### Version public static class Version
@@ -229,7 +233,9 @@ String validatedPayload = Variables.Version.validate( | String | validate(String arg, SchemaConfiguration configuration) | | String | validate([StringVersionEnums](#stringversionenums) arg, SchemaConfiguration configuration) | | [VersionBoxedString](#versionboxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | +| [VersionBoxed](#versionboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | | @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + ### StringVersionEnums public enum StringVersionEnums
extends `Enum` @@ -243,7 +249,7 @@ A class that stores String enum values | V2 | value = "v2" | ### AdditionalPropertiesBoxed -public static abstract sealed class AdditionalPropertiesBoxed
+public sealed interface AdditionalPropertiesBoxed
permits
[AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid), [AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean), @@ -252,103 +258,109 @@ permits
[AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist), [AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap) -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes ### AdditionalPropertiesBoxedVoid -public static final class AdditionalPropertiesBoxedVoid
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedVoid
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation #### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | -#### Field Summary -| Modifier and Type | Field and Description | +#### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | ### AdditionalPropertiesBoxedBoolean -public static final class AdditionalPropertiesBoxedBoolean
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedBoolean
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation #### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | -#### Field Summary -| Modifier and Type | Field and Description | +#### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | ### AdditionalPropertiesBoxedNumber -public static final class AdditionalPropertiesBoxedNumber
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedNumber
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation #### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | -#### Field Summary -| Modifier and Type | Field and Description | +#### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | ### AdditionalPropertiesBoxedString -public static final class AdditionalPropertiesBoxedString
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedString
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation #### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | -#### Field Summary -| Modifier and Type | Field and Description | +#### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | ### AdditionalPropertiesBoxedList -public static final class AdditionalPropertiesBoxedList
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedList
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation #### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | -#### Field Summary -| Modifier and Type | Field and Description | +#### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data
validated payload | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ### AdditionalPropertiesBoxedMap -public static final class AdditionalPropertiesBoxedMap
-extends [AdditionalPropertiesBoxed](#additionalpropertiesboxed) +public record AdditionalPropertiesBoxedMap
+implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation #### Constructor Summary | Constructor and Description | | --------------------------- | | AdditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | -#### Field Summary -| Modifier and Type | Field and Description | +#### Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data
validated payload | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | ### AdditionalProperties public static class AdditionalProperties
diff --git a/samples/client/petstore/java/pom.xml b/samples/client/petstore/java/pom.xml index 94d259e0b66..d87b77db520 100644 --- a/samples/client/petstore/java/pom.xml +++ b/samples/client/petstore/java/pom.xml @@ -94,7 +94,7 @@ org.apache.maven.plugins maven-surefire-plugin - 2.12 + 3.2.5 @@ -103,8 +103,8 @@ -Xms512m -Xmx1500m - methods - pertest + classes + true diff --git a/samples/client/petstore/java/src/main/java/module-info.java b/samples/client/petstore/java/src/main/java/module-info.java new file mode 100644 index 00000000000..8ecf42d96a1 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/module-info.java @@ -0,0 +1,5 @@ +module org.openapijsonschematools.client { + requires java.net.http; + requires org.checkerframework.checker.qual; + requires com.google.gson; +} \ No newline at end of file diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/requestbodies/Client.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/requestbodies/Client.java index bcaea3e38c3..4c4ca5901c7 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/requestbodies/Client.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/requestbodies/Client.java @@ -6,22 +6,27 @@ import org.openapijsonschematools.client.requestbody.RequestBodySerializer; import org.openapijsonschematools.client.requestbody.GenericRequestBody; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; import org.openapijsonschematools.client.mediatype.MediaType; import org.openapijsonschematools.client.components.requestbodies.client.content.applicationjson.ApplicationjsonSchema; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; import java.util.AbstractMap; import java.util.Map; public class Client { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} - public static class ApplicationjsonMediaType extends MediaType { + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { public ApplicationjsonMediaType() { - super(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; } } - public static class Client1 extends RequestBodySerializer { + public static class Client1 extends RequestBodySerializer { public Client1() { super( Map.ofEntries( @@ -33,26 +38,15 @@ public Client1() { public SerializedRequestBody serialize(SealedRequestBody requestBody) { ApplicationjsonRequestBody requestBody0 = (ApplicationjsonRequestBody) requestBody; - return serialize(requestBody0.contentType(), requestBody0.body().data()); + return serialize(requestBody0.contentType(), requestBody0.body().getData()); } } - public static abstract sealed class SealedRequestBody permits ApplicationjsonRequestBody {} - public static final class ApplicationjsonRequestBody extends SealedRequestBody implements GenericRequestBody { - private final String contentType; - private final ApplicationjsonSchema.Client1Boxed body; - public ApplicationjsonRequestBody(ApplicationjsonSchema.Client1Boxed body) { - contentType = "application/json"; - this.body = body; - } + public sealed interface SealedRequestBody permits ApplicationjsonRequestBody {} + public record ApplicationjsonRequestBody(ApplicationjsonSchema.Client1Boxed body) implements SealedRequestBody, GenericRequestBody { @Override public String contentType() { - return contentType; - } - - @Override - public ApplicationjsonSchema.Client1Boxed body() { - return body; + return "application/json"; } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/requestbodies/Pet.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/requestbodies/Pet.java index 9f5c4af3529..8a7f7c6e732 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/requestbodies/Pet.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/requestbodies/Pet.java @@ -6,29 +6,38 @@ import org.openapijsonschematools.client.requestbody.RequestBodySerializer; import org.openapijsonschematools.client.requestbody.GenericRequestBody; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; import org.openapijsonschematools.client.mediatype.MediaType; import org.openapijsonschematools.client.components.requestbodies.pet.content.applicationjson.ApplicationjsonSchema; import org.openapijsonschematools.client.components.requestbodies.pet.content.applicationxml.ApplicationxmlSchema; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; import java.util.AbstractMap; import java.util.Map; public class Pet { + public sealed interface SealedMediaType permits ApplicationjsonMediaType, ApplicationxmlMediaType {} - public static class ApplicationjsonMediaType extends MediaType { + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { public ApplicationjsonMediaType() { - super(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; } } - public static class ApplicationxmlMediaType extends MediaType { + public record ApplicationxmlMediaType(ApplicationxmlSchema.ApplicationxmlSchema1 schema) implements SealedMediaType, MediaType { public ApplicationxmlMediaType() { - super(ApplicationxmlSchema.ApplicationxmlSchema1.getInstance()); + this(ApplicationxmlSchema.ApplicationxmlSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; } } - public static class Pet1 extends RequestBodySerializer { + public static class Pet1 extends RequestBodySerializer { public Pet1() { super( Map.ofEntries( @@ -41,47 +50,25 @@ public Pet1() { public SerializedRequestBody serialize(SealedRequestBody requestBody) { if (requestBody instanceof ApplicationjsonRequestBody requestBody0) { - return serialize(requestBody0.contentType(), requestBody0.body().data()); + return serialize(requestBody0.contentType(), requestBody0.body().getData()); } else { ApplicationxmlRequestBody requestBody1 = (ApplicationxmlRequestBody) requestBody; - return serialize(requestBody1.contentType(), requestBody1.body().data()); + return serialize(requestBody1.contentType(), requestBody1.body().getData()); } } } - public static abstract sealed class SealedRequestBody permits ApplicationjsonRequestBody, ApplicationxmlRequestBody {} - public static final class ApplicationjsonRequestBody extends SealedRequestBody implements GenericRequestBody { - private final String contentType; - private final ApplicationjsonSchema.Pet1Boxed body; - public ApplicationjsonRequestBody(ApplicationjsonSchema.Pet1Boxed body) { - contentType = "application/json"; - this.body = body; - } + public sealed interface SealedRequestBody permits ApplicationjsonRequestBody, ApplicationxmlRequestBody {} + public record ApplicationjsonRequestBody(ApplicationjsonSchema.Pet1Boxed body) implements SealedRequestBody, GenericRequestBody { @Override public String contentType() { - return contentType; - } - - @Override - public ApplicationjsonSchema.Pet1Boxed body() { - return body; + return "application/json"; } } - public static final class ApplicationxmlRequestBody extends SealedRequestBody implements GenericRequestBody { - private final String contentType; - private final ApplicationxmlSchema.Pet1Boxed body; - public ApplicationxmlRequestBody(ApplicationxmlSchema.Pet1Boxed body) { - contentType = "application/xml"; - this.body = body; - } + public record ApplicationxmlRequestBody(ApplicationxmlSchema.Pet1Boxed body) implements SealedRequestBody, GenericRequestBody { @Override public String contentType() { - return contentType; - } - - @Override - public ApplicationxmlSchema.Pet1Boxed body() { - return body; + return "application/xml"; } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/requestbodies/UserArray.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/requestbodies/UserArray.java index 6869263d25c..f94e5690f59 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/requestbodies/UserArray.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/requestbodies/UserArray.java @@ -6,22 +6,27 @@ import org.openapijsonschematools.client.requestbody.RequestBodySerializer; import org.openapijsonschematools.client.requestbody.GenericRequestBody; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; import org.openapijsonschematools.client.mediatype.MediaType; import org.openapijsonschematools.client.components.requestbodies.userarray.content.applicationjson.ApplicationjsonSchema; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; import java.util.AbstractMap; import java.util.Map; public class UserArray { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} - public static class ApplicationjsonMediaType extends MediaType { + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { public ApplicationjsonMediaType() { - super(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; } } - public static class UserArray1 extends RequestBodySerializer { + public static class UserArray1 extends RequestBodySerializer { public UserArray1() { super( Map.ofEntries( @@ -33,26 +38,15 @@ public UserArray1() { public SerializedRequestBody serialize(SealedRequestBody requestBody) { ApplicationjsonRequestBody requestBody0 = (ApplicationjsonRequestBody) requestBody; - return serialize(requestBody0.contentType(), requestBody0.body().data()); + return serialize(requestBody0.contentType(), requestBody0.body().getData()); } } - public static abstract sealed class SealedRequestBody permits ApplicationjsonRequestBody {} - public static final class ApplicationjsonRequestBody extends SealedRequestBody implements GenericRequestBody { - private final String contentType; - private final ApplicationjsonSchema.ApplicationjsonSchema1Boxed body; - public ApplicationjsonRequestBody(ApplicationjsonSchema.ApplicationjsonSchema1Boxed body) { - contentType = "application/json"; - this.body = body; - } + public sealed interface SealedRequestBody permits ApplicationjsonRequestBody {} + public record ApplicationjsonRequestBody(ApplicationjsonSchema.ApplicationjsonSchema1Boxed body) implements SealedRequestBody, GenericRequestBody { @Override public String contentType() { - return contentType; - } - - @Override - public ApplicationjsonSchema.ApplicationjsonSchema1Boxed body() { - return body; + return "application/json"; } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/requestbodies/userarray/content/applicationjson/ApplicationjsonSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/requestbodies/userarray/content/applicationjson/ApplicationjsonSchema.java index 991ffc18c20..9e4ba1794ae 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/requestbodies/userarray/content/applicationjson/ApplicationjsonSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/requestbodies/userarray/content/applicationjson/ApplicationjsonSchema.java @@ -57,24 +57,20 @@ public ApplicationjsonSchemaListBuilder add(Map item) } - public static abstract sealed class ApplicationjsonSchema1Boxed permits ApplicationjsonSchema1BoxedList { - public abstract @Nullable Object data(); + public sealed interface ApplicationjsonSchema1Boxed permits ApplicationjsonSchema1BoxedList { + @Nullable Object getData(); } - public static final class ApplicationjsonSchema1BoxedList extends ApplicationjsonSchema1Boxed { - public final ApplicationjsonSchemaList data; - private ApplicationjsonSchema1BoxedList(ApplicationjsonSchemaList data) { - this.data = data; - } + public record ApplicationjsonSchema1BoxedList(ApplicationjsonSchemaList data) implements ApplicationjsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ApplicationjsonSchema1 extends JsonSchema implements ListSchemaValidator { + public static class ApplicationjsonSchema1 extends JsonSchema implements ListSchemaValidator { private static @Nullable ApplicationjsonSchema1 instance = null; protected ApplicationjsonSchema1() { @@ -98,11 +94,11 @@ public ApplicationjsonSchemaList getNewInstance(List arg, List pathTo for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof User.UserMap)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -142,5 +138,12 @@ public ApplicationjsonSchemaList validate(List arg, SchemaConfiguration confi public ApplicationjsonSchema1BoxedList validateAndBox(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ApplicationjsonSchema1BoxedList(validate(arg, configuration)); } + @Override + public ApplicationjsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/responses/HeadersWithNoBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/responses/HeadersWithNoBody.java new file mode 100644 index 00000000000..f6f9acdb1f5 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/responses/HeadersWithNoBody.java @@ -0,0 +1,30 @@ +package org.openapijsonschematools.client.components.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.schemas.validation.MapUtils; + +import java.util.Map; +import java.net.http.HttpHeaders; + +public class HeadersWithNoBody { + + public static class HeadersWithNoBody1 extends ResponseDeserializer { + public HeadersWithNoBody1() { + super( + MapUtils.makeMap( + ) + ); + } + + @Override + protected Void getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + return null; + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/responses/RefSuccessDescriptionOnly.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/responses/RefSuccessDescriptionOnly.java new file mode 100644 index 00000000000..13509546a1f --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/responses/RefSuccessDescriptionOnly.java @@ -0,0 +1,6 @@ +package org.openapijsonschematools.client.components.responses; + + +public class RefSuccessDescriptionOnly extends SuccessDescriptionOnly { + public static class RefSuccessDescriptionOnly1 extends SuccessDescriptionOnly1 {} +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/responses/RefSuccessfulXmlAndJsonArrayOfPet.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/responses/RefSuccessfulXmlAndJsonArrayOfPet.java new file mode 100644 index 00000000000..c4276b6db9c --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/responses/RefSuccessfulXmlAndJsonArrayOfPet.java @@ -0,0 +1,6 @@ +package org.openapijsonschematools.client.components.responses; + + +public class RefSuccessfulXmlAndJsonArrayOfPet extends SuccessfulXmlAndJsonArrayOfPet { + public static class RefSuccessfulXmlAndJsonArrayOfPet1 extends SuccessfulXmlAndJsonArrayOfPet1 {} +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/responses/SuccessDescriptionOnly.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/responses/SuccessDescriptionOnly.java new file mode 100644 index 00000000000..6967e1461da --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/responses/SuccessDescriptionOnly.java @@ -0,0 +1,30 @@ +package org.openapijsonschematools.client.components.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.schemas.validation.MapUtils; + +import java.util.Map; +import java.net.http.HttpHeaders; + +public class SuccessDescriptionOnly { + + public static class SuccessDescriptionOnly1 extends ResponseDeserializer { + public SuccessDescriptionOnly1() { + super( + MapUtils.makeMap( + ) + ); + } + + @Override + protected Void getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + return null; + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/responses/SuccessInlineContentAndHeader.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/responses/SuccessInlineContentAndHeader.java new file mode 100644 index 00000000000..fa7b442f693 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/responses/SuccessInlineContentAndHeader.java @@ -0,0 +1,54 @@ +package org.openapijsonschematools.client.components.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.components.responses.successinlinecontentandheader.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpHeaders; + +public class SuccessInlineContentAndHeader { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} + public record ApplicationjsonResponseBody(ApplicationjsonSchema.ApplicationjsonSchema1Boxed body) implements SealedResponseBody { } + + public static class SuccessInlineContentAndHeader1 extends ResponseDeserializer { + public SuccessInlineContentAndHeader1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + SealedMediaType mediaType = content.get(contentType); + if (mediaType == null) { + throw new RuntimeException("Invalid contentType was received back from the server that does not exist in the openapi document"); + } + if (mediaType instanceof ApplicationjsonMediaType thisMediaType) { + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } + throw new RuntimeException("contentType="+contentType+" returned by the server is unknown and does not exist in the openapi document"); + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/responses/SuccessWithJsonApiResponse.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/responses/SuccessWithJsonApiResponse.java new file mode 100644 index 00000000000..08677e4d19e --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/responses/SuccessWithJsonApiResponse.java @@ -0,0 +1,54 @@ +package org.openapijsonschematools.client.components.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.components.responses.successwithjsonapiresponse.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpHeaders; + +public class SuccessWithJsonApiResponse { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} + public record ApplicationjsonResponseBody(ApplicationjsonSchema.ApiResponseSchema1Boxed body) implements SealedResponseBody { } + + public static class SuccessWithJsonApiResponse1 extends ResponseDeserializer { + public SuccessWithJsonApiResponse1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + SealedMediaType mediaType = content.get(contentType); + if (mediaType == null) { + throw new RuntimeException("Invalid contentType was received back from the server that does not exist in the openapi document"); + } + if (mediaType instanceof ApplicationjsonMediaType thisMediaType) { + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } + throw new RuntimeException("contentType="+contentType+" returned by the server is unknown and does not exist in the openapi document"); + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/responses/SuccessfulXmlAndJsonArrayOfPet.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/responses/SuccessfulXmlAndJsonArrayOfPet.java new file mode 100644 index 00000000000..919db831be2 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/responses/SuccessfulXmlAndJsonArrayOfPet.java @@ -0,0 +1,70 @@ +package org.openapijsonschematools.client.components.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.components.responses.successfulxmlandjsonarrayofpet.content.applicationxml.ApplicationxmlSchema; +import org.openapijsonschematools.client.components.responses.successfulxmlandjsonarrayofpet.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpHeaders; + +public class SuccessfulXmlAndJsonArrayOfPet { + public sealed interface SealedMediaType permits ApplicationxmlMediaType, ApplicationjsonMediaType {} + + public record ApplicationxmlMediaType(ApplicationxmlSchema.ApplicationxmlSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationxmlMediaType() { + this(ApplicationxmlSchema.ApplicationxmlSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationxmlResponseBody, ApplicationjsonResponseBody {} + public record ApplicationxmlResponseBody(ApplicationxmlSchema.ApplicationxmlSchema1Boxed body) implements SealedResponseBody { } + public record ApplicationjsonResponseBody(ApplicationjsonSchema.ApplicationjsonSchema1Boxed body) implements SealedResponseBody { } + + public static class SuccessfulXmlAndJsonArrayOfPet1 extends ResponseDeserializer { + public SuccessfulXmlAndJsonArrayOfPet1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/xml", new ApplicationxmlMediaType()), + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + SealedMediaType mediaType = content.get(contentType); + if (mediaType == null) { + throw new RuntimeException("Invalid contentType was received back from the server that does not exist in the openapi document"); + } + if (mediaType instanceof ApplicationxmlMediaType thisMediaType) { + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationxmlResponseBody(deserializedBody); + } else if (mediaType instanceof ApplicationjsonMediaType thisMediaType) { + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } + throw new RuntimeException("contentType="+contentType+" returned by the server is unknown and does not exist in the openapi document"); + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/responses/headerswithnobody/Headers.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/responses/headerswithnobody/Headers.java index c9dc12884ad..5a4894c3c3a 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/responses/headerswithnobody/Headers.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/responses/headerswithnobody/Headers.java @@ -93,23 +93,19 @@ public HeadersMapBuilder getBuilderAfterLocation(Map instance) { } - public static abstract sealed class Headers1Boxed permits Headers1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Headers1Boxed permits Headers1BoxedMap { + @Nullable Object getData(); } - public static final class Headers1BoxedMap extends Headers1Boxed { - public final HeadersMap data; - private Headers1BoxedMap(HeadersMap data) { - this.data = data; - } + public record Headers1BoxedMap(HeadersMap data) implements Headers1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Headers1 extends JsonSchema implements MapSchemaValidator { + public static class Headers1 extends JsonSchema implements MapSchemaValidator { private static @Nullable Headers1 instance = null; protected Headers1() { @@ -140,11 +136,11 @@ public HeadersMap getNewInstance(Map arg, List pathToItem, PathToS List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof String)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -184,6 +180,13 @@ public HeadersMap validate(Map arg, SchemaConfiguration configuration) thr public Headers1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Headers1BoxedMap(validate(arg, configuration)); } + @Override + public Headers1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/responses/successfulxmlandjsonarrayofpet/content/applicationjson/ApplicationjsonSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/responses/successfulxmlandjsonarrayofpet/content/applicationjson/ApplicationjsonSchema.java index e069906bf11..cf00c44021c 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/responses/successfulxmlandjsonarrayofpet/content/applicationjson/ApplicationjsonSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/responses/successfulxmlandjsonarrayofpet/content/applicationjson/ApplicationjsonSchema.java @@ -58,24 +58,20 @@ public ApplicationjsonSchemaListBuilder add(Map item) } - public static abstract sealed class ApplicationjsonSchema1Boxed permits ApplicationjsonSchema1BoxedList { - public abstract @Nullable Object data(); + public sealed interface ApplicationjsonSchema1Boxed permits ApplicationjsonSchema1BoxedList { + @Nullable Object getData(); } - public static final class ApplicationjsonSchema1BoxedList extends ApplicationjsonSchema1Boxed { - public final ApplicationjsonSchemaList data; - private ApplicationjsonSchema1BoxedList(ApplicationjsonSchemaList data) { - this.data = data; - } + public record ApplicationjsonSchema1BoxedList(ApplicationjsonSchemaList data) implements ApplicationjsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ApplicationjsonSchema1 extends JsonSchema implements ListSchemaValidator { + public static class ApplicationjsonSchema1 extends JsonSchema implements ListSchemaValidator { private static @Nullable ApplicationjsonSchema1 instance = null; protected ApplicationjsonSchema1() { @@ -99,11 +95,11 @@ public ApplicationjsonSchemaList getNewInstance(List arg, List pathTo for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Pet.PetMap)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -143,5 +139,12 @@ public ApplicationjsonSchemaList validate(List arg, SchemaConfiguration confi public ApplicationjsonSchema1BoxedList validateAndBox(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ApplicationjsonSchema1BoxedList(validate(arg, configuration)); } + @Override + public ApplicationjsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/responses/successfulxmlandjsonarrayofpet/content/applicationxml/ApplicationxmlSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/responses/successfulxmlandjsonarrayofpet/content/applicationxml/ApplicationxmlSchema.java index 95700c7fcb5..0ed36ee6a42 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/responses/successfulxmlandjsonarrayofpet/content/applicationxml/ApplicationxmlSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/responses/successfulxmlandjsonarrayofpet/content/applicationxml/ApplicationxmlSchema.java @@ -57,24 +57,20 @@ public ApplicationxmlSchemaListBuilder add(Map item) { } - public static abstract sealed class ApplicationxmlSchema1Boxed permits ApplicationxmlSchema1BoxedList { - public abstract @Nullable Object data(); + public sealed interface ApplicationxmlSchema1Boxed permits ApplicationxmlSchema1BoxedList { + @Nullable Object getData(); } - public static final class ApplicationxmlSchema1BoxedList extends ApplicationxmlSchema1Boxed { - public final ApplicationxmlSchemaList data; - private ApplicationxmlSchema1BoxedList(ApplicationxmlSchemaList data) { - this.data = data; - } + public record ApplicationxmlSchema1BoxedList(ApplicationxmlSchemaList data) implements ApplicationxmlSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ApplicationxmlSchema1 extends JsonSchema implements ListSchemaValidator { + public static class ApplicationxmlSchema1 extends JsonSchema implements ListSchemaValidator { private static @Nullable ApplicationxmlSchema1 instance = null; protected ApplicationxmlSchema1() { @@ -98,11 +94,11 @@ public ApplicationxmlSchemaList getNewInstance(List arg, List pathToI for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Pet.PetMap)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -142,5 +138,12 @@ public ApplicationxmlSchemaList validate(List arg, SchemaConfiguration config public ApplicationxmlSchema1BoxedList validateAndBox(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ApplicationxmlSchema1BoxedList(validate(arg, configuration)); } + @Override + public ApplicationxmlSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/responses/successinlinecontentandheader/Headers.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/responses/successinlinecontentandheader/Headers.java index 350ad24ad13..209447c856e 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/responses/successinlinecontentandheader/Headers.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/responses/successinlinecontentandheader/Headers.java @@ -93,23 +93,19 @@ public HeadersMapBuilder getBuilderAfterSomeHeader(Map instance) } - public static abstract sealed class Headers1Boxed permits Headers1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Headers1Boxed permits Headers1BoxedMap { + @Nullable Object getData(); } - public static final class Headers1BoxedMap extends Headers1Boxed { - public final HeadersMap data; - private Headers1BoxedMap(HeadersMap data) { - this.data = data; - } + public record Headers1BoxedMap(HeadersMap data) implements Headers1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Headers1 extends JsonSchema implements MapSchemaValidator { + public static class Headers1 extends JsonSchema implements MapSchemaValidator { private static @Nullable Headers1 instance = null; protected Headers1() { @@ -140,11 +136,11 @@ public HeadersMap getNewInstance(Map arg, List pathToItem, PathToS List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof String)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -184,6 +180,13 @@ public HeadersMap validate(Map arg, SchemaConfiguration configuration) thr public Headers1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Headers1BoxedMap(validate(arg, configuration)); } + @Override + public Headers1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/responses/successinlinecontentandheader/content/applicationjson/ApplicationjsonSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/responses/successinlinecontentandheader/content/applicationjson/ApplicationjsonSchema.java index 93ddecadad1..7d1f6c17975 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/responses/successinlinecontentandheader/content/applicationjson/ApplicationjsonSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/responses/successinlinecontentandheader/content/applicationjson/ApplicationjsonSchema.java @@ -95,23 +95,19 @@ public ApplicationjsonSchemaMapBuilder getBuilderAfterAdditionalProperty(Map { + public static class ApplicationjsonSchema1 extends JsonSchema implements MapSchemaValidator { private static @Nullable ApplicationjsonSchema1 instance = null; protected ApplicationjsonSchema1() { @@ -139,11 +135,11 @@ public ApplicationjsonSchemaMap getNewInstance(Map arg, List pathT List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Number)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -183,6 +179,13 @@ public ApplicationjsonSchemaMap validate(Map arg, SchemaConfiguration conf public ApplicationjsonSchema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ApplicationjsonSchema1BoxedMap(validate(arg, configuration)); } + @Override + public ApplicationjsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/responses/successwithjsonapiresponse/Headers.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/responses/successwithjsonapiresponse/Headers.java index 5152cbcbc0b..4e0a0752df7 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/responses/successwithjsonapiresponse/Headers.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/responses/successwithjsonapiresponse/Headers.java @@ -423,23 +423,19 @@ public HeadersMap1110Builder getBuilderAfterStringHeader(Map { + public static class Headers1 extends JsonSchema implements MapSchemaValidator { private static @Nullable Headers1 instance = null; protected Headers1() { @@ -480,11 +476,11 @@ public HeadersMap getNewInstance(Map arg, List pathToItem, PathToS List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -521,6 +517,13 @@ public HeadersMap validate(Map arg, SchemaConfiguration configuration) thr public Headers1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Headers1BoxedMap(validate(arg, configuration)); } + @Override + public Headers1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/AbstractStepMessage.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/AbstractStepMessage.java index 244726c3603..0491701ee19 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/AbstractStepMessage.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/AbstractStepMessage.java @@ -337,23 +337,19 @@ public AbstractStepMessageMap110Builder getBuilderAfterSequenceNumber(Map { + public static class AbstractStepMessage1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -399,11 +395,11 @@ public AbstractStepMessageMap getNewInstance(Map arg, List pathToI List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -440,6 +436,13 @@ public AbstractStepMessageMap validate(Map arg, SchemaConfiguration config public AbstractStepMessage1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new AbstractStepMessage1BoxedMap(validate(arg, configuration)); } + @Override + public AbstractStepMessage1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalPropertiesClass.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalPropertiesClass.java index 19ff9f8be0c..e5c4d17f293 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalPropertiesClass.java @@ -93,23 +93,19 @@ public MapPropertyMapBuilder getBuilderAfterAdditionalProperty(Map { + public static class MapProperty extends JsonSchema implements MapSchemaValidator { private static @Nullable MapProperty instance = null; protected MapProperty() { @@ -137,11 +133,11 @@ public MapPropertyMap getNewInstance(Map arg, List pathToItem, Pat List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof String)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -181,6 +177,13 @@ public MapPropertyMap validate(Map arg, SchemaConfiguration configuration) public MapPropertyBoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new MapPropertyBoxedMap(validate(arg, configuration)); } + @Override + public MapPropertyBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } @@ -244,23 +247,19 @@ public AdditionalPropertiesMapBuilder2 getBuilderAfterAdditionalProperty(Map { + public static class AdditionalProperties1 extends JsonSchema implements MapSchemaValidator { private static @Nullable AdditionalProperties1 instance = null; protected AdditionalProperties1() { @@ -288,11 +287,11 @@ public AdditionalPropertiesMap getNewInstance(Map arg, List pathTo List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof String)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -332,6 +331,13 @@ public AdditionalPropertiesMap validate(Map arg, SchemaConfiguration confi public AdditionalProperties1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new AdditionalProperties1BoxedMap(validate(arg, configuration)); } + @Override + public AdditionalProperties1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } @@ -384,23 +390,19 @@ public MapOfMapPropertyMapBuilder getBuilderAfterAdditionalProperty(Map { + public static class MapOfMapProperty extends JsonSchema implements MapSchemaValidator { private static @Nullable MapOfMapProperty instance = null; protected MapOfMapProperty() { @@ -428,11 +430,11 @@ public MapOfMapPropertyMap getNewInstance(Map arg, List pathToItem List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof AdditionalPropertiesMap)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -472,6 +474,13 @@ public MapOfMapPropertyMap validate(Map arg, SchemaConfiguration configura public MapOfMapPropertyBoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new MapOfMapPropertyBoxedMap(validate(arg, configuration)); } + @Override + public MapOfMapPropertyBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } @@ -624,23 +633,19 @@ public MapWithUndeclaredPropertiesAnytype3MapBuilder getBuilderAfterAdditionalPr } - public static abstract sealed class MapWithUndeclaredPropertiesAnytype3Boxed permits MapWithUndeclaredPropertiesAnytype3BoxedMap { - public abstract @Nullable Object data(); + public sealed interface MapWithUndeclaredPropertiesAnytype3Boxed permits MapWithUndeclaredPropertiesAnytype3BoxedMap { + @Nullable Object getData(); } - public static final class MapWithUndeclaredPropertiesAnytype3BoxedMap extends MapWithUndeclaredPropertiesAnytype3Boxed { - public final MapWithUndeclaredPropertiesAnytype3Map data; - private MapWithUndeclaredPropertiesAnytype3BoxedMap(MapWithUndeclaredPropertiesAnytype3Map data) { - this.data = data; - } + public record MapWithUndeclaredPropertiesAnytype3BoxedMap(MapWithUndeclaredPropertiesAnytype3Map data) implements MapWithUndeclaredPropertiesAnytype3Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class MapWithUndeclaredPropertiesAnytype3 extends JsonSchema implements MapSchemaValidator { + public static class MapWithUndeclaredPropertiesAnytype3 extends JsonSchema implements MapSchemaValidator { private static @Nullable MapWithUndeclaredPropertiesAnytype3 instance = null; protected MapWithUndeclaredPropertiesAnytype3() { @@ -668,11 +673,11 @@ public MapWithUndeclaredPropertiesAnytype3Map getNewInstance(Map arg, List List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -709,6 +714,13 @@ public MapWithUndeclaredPropertiesAnytype3Map validate(Map arg, SchemaConf public MapWithUndeclaredPropertiesAnytype3BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new MapWithUndeclaredPropertiesAnytype3BoxedMap(validate(arg, configuration)); } + @Override + public MapWithUndeclaredPropertiesAnytype3Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } @@ -751,23 +763,19 @@ public EmptyMapMapBuilder() { } - public static abstract sealed class EmptyMapBoxed permits EmptyMapBoxedMap { - public abstract @Nullable Object data(); + public sealed interface EmptyMapBoxed permits EmptyMapBoxedMap { + @Nullable Object getData(); } - public static final class EmptyMapBoxedMap extends EmptyMapBoxed { - public final EmptyMapMap data; - private EmptyMapBoxedMap(EmptyMapMap data) { - this.data = data; - } + public record EmptyMapBoxedMap(EmptyMapMap data) implements EmptyMapBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class EmptyMap extends JsonSchema implements MapSchemaValidator { + public static class EmptyMap extends JsonSchema implements MapSchemaValidator { private static @Nullable EmptyMap instance = null; protected EmptyMap() { @@ -795,11 +803,11 @@ public EmptyMapMap getNewInstance(Map arg, List pathToItem, PathTo List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -836,6 +844,13 @@ public EmptyMapMap validate(Map arg, SchemaConfiguration configuration) th public EmptyMapBoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new EmptyMapBoxedMap(validate(arg, configuration)); } + @Override + public EmptyMapBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } @@ -899,23 +914,19 @@ public MapWithUndeclaredPropertiesStringMapBuilder getBuilderAfterAdditionalProp } - public static abstract sealed class MapWithUndeclaredPropertiesStringBoxed permits MapWithUndeclaredPropertiesStringBoxedMap { - public abstract @Nullable Object data(); + public sealed interface MapWithUndeclaredPropertiesStringBoxed permits MapWithUndeclaredPropertiesStringBoxedMap { + @Nullable Object getData(); } - public static final class MapWithUndeclaredPropertiesStringBoxedMap extends MapWithUndeclaredPropertiesStringBoxed { - public final MapWithUndeclaredPropertiesStringMap data; - private MapWithUndeclaredPropertiesStringBoxedMap(MapWithUndeclaredPropertiesStringMap data) { - this.data = data; - } + public record MapWithUndeclaredPropertiesStringBoxedMap(MapWithUndeclaredPropertiesStringMap data) implements MapWithUndeclaredPropertiesStringBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class MapWithUndeclaredPropertiesString extends JsonSchema implements MapSchemaValidator { + public static class MapWithUndeclaredPropertiesString extends JsonSchema implements MapSchemaValidator { private static @Nullable MapWithUndeclaredPropertiesString instance = null; protected MapWithUndeclaredPropertiesString() { @@ -943,11 +954,11 @@ public MapWithUndeclaredPropertiesStringMap getNewInstance(Map arg, List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof String)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -987,6 +998,13 @@ public MapWithUndeclaredPropertiesStringMap validate(Map arg, SchemaConfig public MapWithUndeclaredPropertiesStringBoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new MapWithUndeclaredPropertiesStringBoxedMap(validate(arg, configuration)); } + @Override + public MapWithUndeclaredPropertiesStringBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } @@ -1280,23 +1298,19 @@ public AdditionalPropertiesClassMapBuilder getBuilderAfterAdditionalProperty(Map } - public static abstract sealed class AdditionalPropertiesClass1Boxed permits AdditionalPropertiesClass1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface AdditionalPropertiesClass1Boxed permits AdditionalPropertiesClass1BoxedMap { + @Nullable Object getData(); } - public static final class AdditionalPropertiesClass1BoxedMap extends AdditionalPropertiesClass1Boxed { - public final AdditionalPropertiesClassMap data; - private AdditionalPropertiesClass1BoxedMap(AdditionalPropertiesClassMap data) { - this.data = data; - } + public record AdditionalPropertiesClass1BoxedMap(AdditionalPropertiesClassMap data) implements AdditionalPropertiesClass1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class AdditionalPropertiesClass1 extends JsonSchema implements MapSchemaValidator { + public static class AdditionalPropertiesClass1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -1339,11 +1353,11 @@ public AdditionalPropertiesClassMap getNewInstance(Map arg, List p List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -1380,6 +1394,13 @@ public AdditionalPropertiesClassMap validate(Map arg, SchemaConfiguration public AdditionalPropertiesClass1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new AdditionalPropertiesClass1BoxedMap(validate(arg, configuration)); } + @Override + public AdditionalPropertiesClass1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalPropertiesSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalPropertiesSchema.java index 621f2af9a2d..6cc2511dad8 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalPropertiesSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalPropertiesSchema.java @@ -154,23 +154,19 @@ public Schema0MapBuilder getBuilderAfterAdditionalProperty(Map { + public static class Schema0 extends JsonSchema implements MapSchemaValidator { private static @Nullable Schema0 instance = null; protected Schema0() { @@ -198,11 +194,11 @@ public Schema0Map getNewInstance(Map arg, List pathToItem, PathToS List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -239,81 +235,64 @@ public Schema0Map validate(Map arg, SchemaConfiguration configuration) thr public Schema0BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema0BoxedMap(validate(arg, configuration)); } + @Override + public Schema0Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class AdditionalProperties1Boxed permits AdditionalProperties1BoxedVoid, AdditionalProperties1BoxedBoolean, AdditionalProperties1BoxedNumber, AdditionalProperties1BoxedString, AdditionalProperties1BoxedList, AdditionalProperties1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface AdditionalProperties1Boxed permits AdditionalProperties1BoxedVoid, AdditionalProperties1BoxedBoolean, AdditionalProperties1BoxedNumber, AdditionalProperties1BoxedString, AdditionalProperties1BoxedList, AdditionalProperties1BoxedMap { + @Nullable Object getData(); } - public static final class AdditionalProperties1BoxedVoid extends AdditionalProperties1Boxed { - public final Void data; - private AdditionalProperties1BoxedVoid(Void data) { - this.data = data; - } + public record AdditionalProperties1BoxedVoid(Void data) implements AdditionalProperties1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AdditionalProperties1BoxedBoolean extends AdditionalProperties1Boxed { - public final boolean data; - private AdditionalProperties1BoxedBoolean(boolean data) { - this.data = data; - } + public record AdditionalProperties1BoxedBoolean(boolean data) implements AdditionalProperties1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AdditionalProperties1BoxedNumber extends AdditionalProperties1Boxed { - public final Number data; - private AdditionalProperties1BoxedNumber(Number data) { - this.data = data; - } + public record AdditionalProperties1BoxedNumber(Number data) implements AdditionalProperties1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AdditionalProperties1BoxedString extends AdditionalProperties1Boxed { - public final String data; - private AdditionalProperties1BoxedString(String data) { - this.data = data; - } + public record AdditionalProperties1BoxedString(String data) implements AdditionalProperties1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AdditionalProperties1BoxedList extends AdditionalProperties1Boxed { - public final FrozenList<@Nullable Object> data; - private AdditionalProperties1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record AdditionalProperties1BoxedList(FrozenList<@Nullable Object> data) implements AdditionalProperties1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AdditionalProperties1BoxedMap extends AdditionalProperties1Boxed { - public final FrozenMap<@Nullable Object> data; - private AdditionalProperties1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record AdditionalProperties1BoxedMap(FrozenMap<@Nullable Object> data) implements AdditionalProperties1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class AdditionalProperties1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, AdditionalProperties1BoxedList>, MapSchemaValidator, AdditionalProperties1BoxedMap> { + public static class AdditionalProperties1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, AdditionalProperties1BoxedList>, MapSchemaValidator, AdditionalProperties1BoxedMap> { private static @Nullable AdditionalProperties1 instance = null; protected AdditionalProperties1() { @@ -412,11 +391,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -447,11 +426,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -530,6 +509,25 @@ public AdditionalProperties1BoxedList validateAndBox(List arg, SchemaConfigur public AdditionalProperties1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new AdditionalProperties1BoxedMap(validate(arg, configuration)); } + @Override + public AdditionalProperties1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class Schema1Map extends FrozenMap<@Nullable Object> { @@ -637,23 +635,19 @@ public Schema1MapBuilder getBuilderAfterAdditionalProperty(Map { + public static class Schema1 extends JsonSchema implements MapSchemaValidator { private static @Nullable Schema1 instance = null; protected Schema1() { @@ -681,11 +675,11 @@ public Schema1Map getNewInstance(Map arg, List pathToItem, PathToS List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -722,81 +716,64 @@ public Schema1Map validate(Map arg, SchemaConfiguration configuration) thr public Schema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema1BoxedMap(validate(arg, configuration)); } + @Override + public Schema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class AdditionalProperties2Boxed permits AdditionalProperties2BoxedVoid, AdditionalProperties2BoxedBoolean, AdditionalProperties2BoxedNumber, AdditionalProperties2BoxedString, AdditionalProperties2BoxedList, AdditionalProperties2BoxedMap { - public abstract @Nullable Object data(); + public sealed interface AdditionalProperties2Boxed permits AdditionalProperties2BoxedVoid, AdditionalProperties2BoxedBoolean, AdditionalProperties2BoxedNumber, AdditionalProperties2BoxedString, AdditionalProperties2BoxedList, AdditionalProperties2BoxedMap { + @Nullable Object getData(); } - public static final class AdditionalProperties2BoxedVoid extends AdditionalProperties2Boxed { - public final Void data; - private AdditionalProperties2BoxedVoid(Void data) { - this.data = data; - } + public record AdditionalProperties2BoxedVoid(Void data) implements AdditionalProperties2Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AdditionalProperties2BoxedBoolean extends AdditionalProperties2Boxed { - public final boolean data; - private AdditionalProperties2BoxedBoolean(boolean data) { - this.data = data; - } + public record AdditionalProperties2BoxedBoolean(boolean data) implements AdditionalProperties2Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AdditionalProperties2BoxedNumber extends AdditionalProperties2Boxed { - public final Number data; - private AdditionalProperties2BoxedNumber(Number data) { - this.data = data; - } + public record AdditionalProperties2BoxedNumber(Number data) implements AdditionalProperties2Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AdditionalProperties2BoxedString extends AdditionalProperties2Boxed { - public final String data; - private AdditionalProperties2BoxedString(String data) { - this.data = data; - } + public record AdditionalProperties2BoxedString(String data) implements AdditionalProperties2Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AdditionalProperties2BoxedList extends AdditionalProperties2Boxed { - public final FrozenList<@Nullable Object> data; - private AdditionalProperties2BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record AdditionalProperties2BoxedList(FrozenList<@Nullable Object> data) implements AdditionalProperties2Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AdditionalProperties2BoxedMap extends AdditionalProperties2Boxed { - public final FrozenMap<@Nullable Object> data; - private AdditionalProperties2BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record AdditionalProperties2BoxedMap(FrozenMap<@Nullable Object> data) implements AdditionalProperties2Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class AdditionalProperties2 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, AdditionalProperties2BoxedList>, MapSchemaValidator, AdditionalProperties2BoxedMap> { + public static class AdditionalProperties2 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, AdditionalProperties2BoxedList>, MapSchemaValidator, AdditionalProperties2BoxedMap> { private static @Nullable AdditionalProperties2 instance = null; protected AdditionalProperties2() { @@ -895,11 +872,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -930,11 +907,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -1013,6 +990,25 @@ public AdditionalProperties2BoxedList validateAndBox(List arg, SchemaConfigur public AdditionalProperties2BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new AdditionalProperties2BoxedMap(validate(arg, configuration)); } + @Override + public AdditionalProperties2Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class Schema2Map extends FrozenMap<@Nullable Object> { @@ -1120,23 +1116,19 @@ public Schema2MapBuilder getBuilderAfterAdditionalProperty(Map { + public static class Schema2 extends JsonSchema implements MapSchemaValidator { private static @Nullable Schema2 instance = null; protected Schema2() { @@ -1164,11 +1156,11 @@ public Schema2Map getNewInstance(Map arg, List pathToItem, PathToS List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -1205,26 +1197,29 @@ public Schema2Map validate(Map arg, SchemaConfiguration configuration) thr public Schema2BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema2BoxedMap(validate(arg, configuration)); } + @Override + public Schema2Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class AdditionalPropertiesSchema1Boxed permits AdditionalPropertiesSchema1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface AdditionalPropertiesSchema1Boxed permits AdditionalPropertiesSchema1BoxedMap { + @Nullable Object getData(); } - public static final class AdditionalPropertiesSchema1BoxedMap extends AdditionalPropertiesSchema1Boxed { - public final FrozenMap<@Nullable Object> data; - private AdditionalPropertiesSchema1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record AdditionalPropertiesSchema1BoxedMap(FrozenMap<@Nullable Object> data) implements AdditionalPropertiesSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class AdditionalPropertiesSchema1 extends JsonSchema implements MapSchemaValidator, AdditionalPropertiesSchema1BoxedMap> { + public static class AdditionalPropertiesSchema1 extends JsonSchema implements MapSchemaValidator, AdditionalPropertiesSchema1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -1262,11 +1257,11 @@ public static AdditionalPropertiesSchema1 getInstance() { List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -1303,6 +1298,13 @@ public static AdditionalPropertiesSchema1 getInstance() { public AdditionalPropertiesSchema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new AdditionalPropertiesSchema1BoxedMap(validate(arg, configuration)); } + @Override + public AdditionalPropertiesSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalPropertiesWithArrayOfEnums.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalPropertiesWithArrayOfEnums.java index 3d460de6410..bcbef03c5d4 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalPropertiesWithArrayOfEnums.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/AdditionalPropertiesWithArrayOfEnums.java @@ -66,24 +66,20 @@ public List build() { } - public static abstract sealed class AdditionalPropertiesBoxed permits AdditionalPropertiesBoxedList { - public abstract @Nullable Object data(); + public sealed interface AdditionalPropertiesBoxed permits AdditionalPropertiesBoxedList { + @Nullable Object getData(); } - public static final class AdditionalPropertiesBoxedList extends AdditionalPropertiesBoxed { - public final AdditionalPropertiesList data; - private AdditionalPropertiesBoxedList(AdditionalPropertiesList data) { - this.data = data; - } + public record AdditionalPropertiesBoxedList(AdditionalPropertiesList data) implements AdditionalPropertiesBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class AdditionalProperties extends JsonSchema implements ListSchemaValidator { + public static class AdditionalProperties extends JsonSchema implements ListSchemaValidator { private static @Nullable AdditionalProperties instance = null; protected AdditionalProperties() { @@ -107,11 +103,11 @@ public AdditionalPropertiesList getNewInstance(List arg, List pathToI for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof String)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -151,6 +147,13 @@ public AdditionalPropertiesList validate(List arg, SchemaConfiguration config public AdditionalPropertiesBoxedList validateAndBox(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new AdditionalPropertiesBoxedList(validate(arg, configuration)); } + @Override + public AdditionalPropertiesBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class AdditionalPropertiesWithArrayOfEnumsMap extends FrozenMap { @@ -206,23 +209,19 @@ public AdditionalPropertiesWithArrayOfEnumsMapBuilder getBuilderAfterAdditionalP } - public static abstract sealed class AdditionalPropertiesWithArrayOfEnums1Boxed permits AdditionalPropertiesWithArrayOfEnums1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface AdditionalPropertiesWithArrayOfEnums1Boxed permits AdditionalPropertiesWithArrayOfEnums1BoxedMap { + @Nullable Object getData(); } - public static final class AdditionalPropertiesWithArrayOfEnums1BoxedMap extends AdditionalPropertiesWithArrayOfEnums1Boxed { - public final AdditionalPropertiesWithArrayOfEnumsMap data; - private AdditionalPropertiesWithArrayOfEnums1BoxedMap(AdditionalPropertiesWithArrayOfEnumsMap data) { - this.data = data; - } + public record AdditionalPropertiesWithArrayOfEnums1BoxedMap(AdditionalPropertiesWithArrayOfEnumsMap data) implements AdditionalPropertiesWithArrayOfEnums1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class AdditionalPropertiesWithArrayOfEnums1 extends JsonSchema implements MapSchemaValidator { + public static class AdditionalPropertiesWithArrayOfEnums1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -256,11 +255,11 @@ public AdditionalPropertiesWithArrayOfEnumsMap getNewInstance(Map arg, Lis List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof AdditionalPropertiesList)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -300,6 +299,13 @@ public AdditionalPropertiesWithArrayOfEnumsMap validate(Map arg, SchemaCon public AdditionalPropertiesWithArrayOfEnums1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new AdditionalPropertiesWithArrayOfEnums1BoxedMap(validate(arg, configuration)); } + @Override + public AdditionalPropertiesWithArrayOfEnums1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Address.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Address.java index 34f6d35e856..b0ed926c90e 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Address.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Address.java @@ -109,23 +109,19 @@ public AddressMapBuilder getBuilderAfterAdditionalProperty(Map i } - public static abstract sealed class Address1Boxed permits Address1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Address1Boxed permits Address1BoxedMap { + @Nullable Object getData(); } - public static final class Address1BoxedMap extends Address1Boxed { - public final AddressMap data; - private Address1BoxedMap(AddressMap data) { - this.data = data; - } + public record Address1BoxedMap(AddressMap data) implements Address1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Address1 extends JsonSchema implements MapSchemaValidator { + public static class Address1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -159,11 +155,11 @@ public AddressMap getNewInstance(Map arg, List pathToItem, PathToS List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Number)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -203,6 +199,13 @@ public AddressMap validate(Map arg, SchemaConfiguration configuration) thr public Address1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Address1BoxedMap(validate(arg, configuration)); } + @Override + public Address1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Animal.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Animal.java index eb9f725d8d2..bb25f8c14eb 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Animal.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Animal.java @@ -42,24 +42,20 @@ public static ClassName getInstance() { } - public static abstract sealed class ColorBoxed permits ColorBoxedString { - public abstract @Nullable Object data(); + public sealed interface ColorBoxed permits ColorBoxedString { + @Nullable Object getData(); } - public static final class ColorBoxedString extends ColorBoxed { - public final String data; - private ColorBoxedString(String data) { - this.data = data; - } + public record ColorBoxedString(String data) implements ColorBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Color extends JsonSchema implements StringSchemaValidator, DefaultValueMethod { + public static class Color extends JsonSchema implements StringSchemaValidator, DefaultValueMethod { private static @Nullable Color instance = null; protected Color() { @@ -113,6 +109,13 @@ public String defaultValue() { public ColorBoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ColorBoxedString(validate(arg, configuration)); } + @Override + public ColorBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class AnimalMap extends FrozenMap<@Nullable Object> { @@ -216,23 +219,19 @@ public AnimalMap0Builder getBuilderAfterClassName(Map } - public static abstract sealed class Animal1Boxed permits Animal1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Animal1Boxed permits Animal1BoxedMap { + @Nullable Object getData(); } - public static final class Animal1BoxedMap extends Animal1Boxed { - public final AnimalMap data; - private Animal1BoxedMap(AnimalMap data) { - this.data = data; - } + public record Animal1BoxedMap(AnimalMap data) implements Animal1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Animal1 extends JsonSchema implements MapSchemaValidator { + public static class Animal1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -272,11 +271,11 @@ public AnimalMap getNewInstance(Map arg, List pathToItem, PathToSc List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -313,6 +312,13 @@ public AnimalMap validate(Map arg, SchemaConfiguration configuration) thro public Animal1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Animal1BoxedMap(validate(arg, configuration)); } + @Override + public Animal1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnimalFarm.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnimalFarm.java index 5351f2ba435..e6ee613c3e1 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnimalFarm.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnimalFarm.java @@ -56,24 +56,20 @@ public AnimalFarmListBuilder add(Map item) { } - public static abstract sealed class AnimalFarm1Boxed permits AnimalFarm1BoxedList { - public abstract @Nullable Object data(); + public sealed interface AnimalFarm1Boxed permits AnimalFarm1BoxedList { + @Nullable Object getData(); } - public static final class AnimalFarm1BoxedList extends AnimalFarm1Boxed { - public final AnimalFarmList data; - private AnimalFarm1BoxedList(AnimalFarmList data) { - this.data = data; - } + public record AnimalFarm1BoxedList(AnimalFarmList data) implements AnimalFarm1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class AnimalFarm1 extends JsonSchema implements ListSchemaValidator { + public static class AnimalFarm1 extends JsonSchema implements ListSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -103,11 +99,11 @@ public AnimalFarmList getNewInstance(List arg, List pathToItem, PathT for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Animal.AnimalMap)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -147,5 +143,12 @@ public AnimalFarmList validate(List arg, SchemaConfiguration configuration) t public AnimalFarm1BoxedList validateAndBox(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new AnimalFarm1BoxedList(validate(arg, configuration)); } + @Override + public AnimalFarm1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyTypeAndFormat.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyTypeAndFormat.java index 7dce56be246..e3dc79b70c1 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyTypeAndFormat.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyTypeAndFormat.java @@ -37,78 +37,54 @@ public class AnyTypeAndFormat { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class UuidSchemaBoxed permits UuidSchemaBoxedVoid, UuidSchemaBoxedBoolean, UuidSchemaBoxedNumber, UuidSchemaBoxedString, UuidSchemaBoxedList, UuidSchemaBoxedMap { - public abstract @Nullable Object data(); + public sealed interface UuidSchemaBoxed permits UuidSchemaBoxedVoid, UuidSchemaBoxedBoolean, UuidSchemaBoxedNumber, UuidSchemaBoxedString, UuidSchemaBoxedList, UuidSchemaBoxedMap { + @Nullable Object getData(); } - public static final class UuidSchemaBoxedVoid extends UuidSchemaBoxed { - public final Void data; - private UuidSchemaBoxedVoid(Void data) { - this.data = data; - } + public record UuidSchemaBoxedVoid(Void data) implements UuidSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UuidSchemaBoxedBoolean extends UuidSchemaBoxed { - public final boolean data; - private UuidSchemaBoxedBoolean(boolean data) { - this.data = data; - } + public record UuidSchemaBoxedBoolean(boolean data) implements UuidSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UuidSchemaBoxedNumber extends UuidSchemaBoxed { - public final Number data; - private UuidSchemaBoxedNumber(Number data) { - this.data = data; - } + public record UuidSchemaBoxedNumber(Number data) implements UuidSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UuidSchemaBoxedString extends UuidSchemaBoxed { - public final String data; - private UuidSchemaBoxedString(String data) { - this.data = data; - } + public record UuidSchemaBoxedString(String data) implements UuidSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UuidSchemaBoxedList extends UuidSchemaBoxed { - public final FrozenList<@Nullable Object> data; - private UuidSchemaBoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record UuidSchemaBoxedList(FrozenList<@Nullable Object> data) implements UuidSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UuidSchemaBoxedMap extends UuidSchemaBoxed { - public final FrozenMap<@Nullable Object> data; - private UuidSchemaBoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record UuidSchemaBoxedMap(FrozenMap<@Nullable Object> data) implements UuidSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class UuidSchema extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, UuidSchemaBoxedList>, MapSchemaValidator, UuidSchemaBoxedMap> { + public static class UuidSchema extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, UuidSchemaBoxedList>, MapSchemaValidator, UuidSchemaBoxedMap> { private static @Nullable UuidSchema instance = null; protected UuidSchema() { @@ -207,11 +183,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -242,11 +218,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -325,80 +301,75 @@ public UuidSchemaBoxedList validateAndBox(List arg, SchemaConfiguration confi public UuidSchemaBoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new UuidSchemaBoxedMap(validate(arg, configuration)); } + @Override + public UuidSchemaBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class DateBoxed permits DateBoxedVoid, DateBoxedBoolean, DateBoxedNumber, DateBoxedString, DateBoxedList, DateBoxedMap { - public abstract @Nullable Object data(); + public sealed interface DateBoxed permits DateBoxedVoid, DateBoxedBoolean, DateBoxedNumber, DateBoxedString, DateBoxedList, DateBoxedMap { + @Nullable Object getData(); } - public static final class DateBoxedVoid extends DateBoxed { - public final Void data; - private DateBoxedVoid(Void data) { - this.data = data; - } + public record DateBoxedVoid(Void data) implements DateBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class DateBoxedBoolean extends DateBoxed { - public final boolean data; - private DateBoxedBoolean(boolean data) { - this.data = data; - } + public record DateBoxedBoolean(boolean data) implements DateBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class DateBoxedNumber extends DateBoxed { - public final Number data; - private DateBoxedNumber(Number data) { - this.data = data; - } + public record DateBoxedNumber(Number data) implements DateBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class DateBoxedString extends DateBoxed { - public final String data; - private DateBoxedString(String data) { - this.data = data; - } + public record DateBoxedString(String data) implements DateBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class DateBoxedList extends DateBoxed { - public final FrozenList<@Nullable Object> data; - private DateBoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record DateBoxedList(FrozenList<@Nullable Object> data) implements DateBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class DateBoxedMap extends DateBoxed { - public final FrozenMap<@Nullable Object> data; - private DateBoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record DateBoxedMap(FrozenMap<@Nullable Object> data) implements DateBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Date extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, DateBoxedList>, MapSchemaValidator, DateBoxedMap> { + public static class Date extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, DateBoxedList>, MapSchemaValidator, DateBoxedMap> { private static @Nullable Date instance = null; protected Date() { @@ -497,11 +468,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -532,11 +503,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -615,80 +586,75 @@ public DateBoxedList validateAndBox(List arg, SchemaConfiguration configurati public DateBoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new DateBoxedMap(validate(arg, configuration)); } + @Override + public DateBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class DatetimeBoxed permits DatetimeBoxedVoid, DatetimeBoxedBoolean, DatetimeBoxedNumber, DatetimeBoxedString, DatetimeBoxedList, DatetimeBoxedMap { - public abstract @Nullable Object data(); + public sealed interface DatetimeBoxed permits DatetimeBoxedVoid, DatetimeBoxedBoolean, DatetimeBoxedNumber, DatetimeBoxedString, DatetimeBoxedList, DatetimeBoxedMap { + @Nullable Object getData(); } - public static final class DatetimeBoxedVoid extends DatetimeBoxed { - public final Void data; - private DatetimeBoxedVoid(Void data) { - this.data = data; - } + public record DatetimeBoxedVoid(Void data) implements DatetimeBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class DatetimeBoxedBoolean extends DatetimeBoxed { - public final boolean data; - private DatetimeBoxedBoolean(boolean data) { - this.data = data; - } + public record DatetimeBoxedBoolean(boolean data) implements DatetimeBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class DatetimeBoxedNumber extends DatetimeBoxed { - public final Number data; - private DatetimeBoxedNumber(Number data) { - this.data = data; - } + public record DatetimeBoxedNumber(Number data) implements DatetimeBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class DatetimeBoxedString extends DatetimeBoxed { - public final String data; - private DatetimeBoxedString(String data) { - this.data = data; - } + public record DatetimeBoxedString(String data) implements DatetimeBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class DatetimeBoxedList extends DatetimeBoxed { - public final FrozenList<@Nullable Object> data; - private DatetimeBoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record DatetimeBoxedList(FrozenList<@Nullable Object> data) implements DatetimeBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class DatetimeBoxedMap extends DatetimeBoxed { - public final FrozenMap<@Nullable Object> data; - private DatetimeBoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record DatetimeBoxedMap(FrozenMap<@Nullable Object> data) implements DatetimeBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Datetime extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, DatetimeBoxedList>, MapSchemaValidator, DatetimeBoxedMap> { + public static class Datetime extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, DatetimeBoxedList>, MapSchemaValidator, DatetimeBoxedMap> { private static @Nullable Datetime instance = null; protected Datetime() { @@ -787,11 +753,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -822,11 +788,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -905,80 +871,75 @@ public DatetimeBoxedList validateAndBox(List arg, SchemaConfiguration configu public DatetimeBoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new DatetimeBoxedMap(validate(arg, configuration)); } + @Override + public DatetimeBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class NumberSchemaBoxed permits NumberSchemaBoxedVoid, NumberSchemaBoxedBoolean, NumberSchemaBoxedNumber, NumberSchemaBoxedString, NumberSchemaBoxedList, NumberSchemaBoxedMap { - public abstract @Nullable Object data(); + public sealed interface NumberSchemaBoxed permits NumberSchemaBoxedVoid, NumberSchemaBoxedBoolean, NumberSchemaBoxedNumber, NumberSchemaBoxedString, NumberSchemaBoxedList, NumberSchemaBoxedMap { + @Nullable Object getData(); } - public static final class NumberSchemaBoxedVoid extends NumberSchemaBoxed { - public final Void data; - private NumberSchemaBoxedVoid(Void data) { - this.data = data; - } + public record NumberSchemaBoxedVoid(Void data) implements NumberSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NumberSchemaBoxedBoolean extends NumberSchemaBoxed { - public final boolean data; - private NumberSchemaBoxedBoolean(boolean data) { - this.data = data; - } + public record NumberSchemaBoxedBoolean(boolean data) implements NumberSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NumberSchemaBoxedNumber extends NumberSchemaBoxed { - public final Number data; - private NumberSchemaBoxedNumber(Number data) { - this.data = data; - } + public record NumberSchemaBoxedNumber(Number data) implements NumberSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NumberSchemaBoxedString extends NumberSchemaBoxed { - public final String data; - private NumberSchemaBoxedString(String data) { - this.data = data; - } + public record NumberSchemaBoxedString(String data) implements NumberSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NumberSchemaBoxedList extends NumberSchemaBoxed { - public final FrozenList<@Nullable Object> data; - private NumberSchemaBoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record NumberSchemaBoxedList(FrozenList<@Nullable Object> data) implements NumberSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NumberSchemaBoxedMap extends NumberSchemaBoxed { - public final FrozenMap<@Nullable Object> data; - private NumberSchemaBoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record NumberSchemaBoxedMap(FrozenMap<@Nullable Object> data) implements NumberSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class NumberSchema extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, NumberSchemaBoxedList>, MapSchemaValidator, NumberSchemaBoxedMap> { + public static class NumberSchema extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, NumberSchemaBoxedList>, MapSchemaValidator, NumberSchemaBoxedMap> { private static @Nullable NumberSchema instance = null; protected NumberSchema() { @@ -1077,11 +1038,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -1112,11 +1073,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -1195,80 +1156,75 @@ public NumberSchemaBoxedList validateAndBox(List arg, SchemaConfiguration con public NumberSchemaBoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new NumberSchemaBoxedMap(validate(arg, configuration)); } + @Override + public NumberSchemaBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class BinaryBoxed permits BinaryBoxedVoid, BinaryBoxedBoolean, BinaryBoxedNumber, BinaryBoxedString, BinaryBoxedList, BinaryBoxedMap { - public abstract @Nullable Object data(); + public sealed interface BinaryBoxed permits BinaryBoxedVoid, BinaryBoxedBoolean, BinaryBoxedNumber, BinaryBoxedString, BinaryBoxedList, BinaryBoxedMap { + @Nullable Object getData(); } - public static final class BinaryBoxedVoid extends BinaryBoxed { - public final Void data; - private BinaryBoxedVoid(Void data) { - this.data = data; - } + public record BinaryBoxedVoid(Void data) implements BinaryBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class BinaryBoxedBoolean extends BinaryBoxed { - public final boolean data; - private BinaryBoxedBoolean(boolean data) { - this.data = data; - } + public record BinaryBoxedBoolean(boolean data) implements BinaryBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class BinaryBoxedNumber extends BinaryBoxed { - public final Number data; - private BinaryBoxedNumber(Number data) { - this.data = data; - } + public record BinaryBoxedNumber(Number data) implements BinaryBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class BinaryBoxedString extends BinaryBoxed { - public final String data; - private BinaryBoxedString(String data) { - this.data = data; - } + public record BinaryBoxedString(String data) implements BinaryBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class BinaryBoxedList extends BinaryBoxed { - public final FrozenList<@Nullable Object> data; - private BinaryBoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record BinaryBoxedList(FrozenList<@Nullable Object> data) implements BinaryBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class BinaryBoxedMap extends BinaryBoxed { - public final FrozenMap<@Nullable Object> data; - private BinaryBoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record BinaryBoxedMap(FrozenMap<@Nullable Object> data) implements BinaryBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Binary extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, BinaryBoxedList>, MapSchemaValidator, BinaryBoxedMap> { + public static class Binary extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, BinaryBoxedList>, MapSchemaValidator, BinaryBoxedMap> { private static @Nullable Binary instance = null; protected Binary() { @@ -1367,11 +1323,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -1402,11 +1358,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -1485,80 +1441,75 @@ public BinaryBoxedList validateAndBox(List arg, SchemaConfiguration configura public BinaryBoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new BinaryBoxedMap(validate(arg, configuration)); } + @Override + public BinaryBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class Int32Boxed permits Int32BoxedVoid, Int32BoxedBoolean, Int32BoxedNumber, Int32BoxedString, Int32BoxedList, Int32BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Int32Boxed permits Int32BoxedVoid, Int32BoxedBoolean, Int32BoxedNumber, Int32BoxedString, Int32BoxedList, Int32BoxedMap { + @Nullable Object getData(); } - public static final class Int32BoxedVoid extends Int32Boxed { - public final Void data; - private Int32BoxedVoid(Void data) { - this.data = data; - } + public record Int32BoxedVoid(Void data) implements Int32Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Int32BoxedBoolean extends Int32Boxed { - public final boolean data; - private Int32BoxedBoolean(boolean data) { - this.data = data; - } + public record Int32BoxedBoolean(boolean data) implements Int32Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Int32BoxedNumber extends Int32Boxed { - public final Number data; - private Int32BoxedNumber(Number data) { - this.data = data; - } + public record Int32BoxedNumber(Number data) implements Int32Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Int32BoxedString extends Int32Boxed { - public final String data; - private Int32BoxedString(String data) { - this.data = data; - } + public record Int32BoxedString(String data) implements Int32Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Int32BoxedList extends Int32Boxed { - public final FrozenList<@Nullable Object> data; - private Int32BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Int32BoxedList(FrozenList<@Nullable Object> data) implements Int32Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Int32BoxedMap extends Int32Boxed { - public final FrozenMap<@Nullable Object> data; - private Int32BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record Int32BoxedMap(FrozenMap<@Nullable Object> data) implements Int32Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Int32 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Int32BoxedList>, MapSchemaValidator, Int32BoxedMap> { + public static class Int32 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Int32BoxedList>, MapSchemaValidator, Int32BoxedMap> { private static @Nullable Int32 instance = null; protected Int32() { @@ -1657,11 +1608,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -1692,11 +1643,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -1775,80 +1726,75 @@ public Int32BoxedList validateAndBox(List arg, SchemaConfiguration configurat public Int32BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Int32BoxedMap(validate(arg, configuration)); } + @Override + public Int32Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class Int64Boxed permits Int64BoxedVoid, Int64BoxedBoolean, Int64BoxedNumber, Int64BoxedString, Int64BoxedList, Int64BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Int64Boxed permits Int64BoxedVoid, Int64BoxedBoolean, Int64BoxedNumber, Int64BoxedString, Int64BoxedList, Int64BoxedMap { + @Nullable Object getData(); } - public static final class Int64BoxedVoid extends Int64Boxed { - public final Void data; - private Int64BoxedVoid(Void data) { - this.data = data; - } + public record Int64BoxedVoid(Void data) implements Int64Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Int64BoxedBoolean extends Int64Boxed { - public final boolean data; - private Int64BoxedBoolean(boolean data) { - this.data = data; - } + public record Int64BoxedBoolean(boolean data) implements Int64Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Int64BoxedNumber extends Int64Boxed { - public final Number data; - private Int64BoxedNumber(Number data) { - this.data = data; - } + public record Int64BoxedNumber(Number data) implements Int64Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Int64BoxedString extends Int64Boxed { - public final String data; - private Int64BoxedString(String data) { - this.data = data; - } + public record Int64BoxedString(String data) implements Int64Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Int64BoxedList extends Int64Boxed { - public final FrozenList<@Nullable Object> data; - private Int64BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Int64BoxedList(FrozenList<@Nullable Object> data) implements Int64Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Int64BoxedMap extends Int64Boxed { - public final FrozenMap<@Nullable Object> data; - private Int64BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record Int64BoxedMap(FrozenMap<@Nullable Object> data) implements Int64Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Int64 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Int64BoxedList>, MapSchemaValidator, Int64BoxedMap> { + public static class Int64 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Int64BoxedList>, MapSchemaValidator, Int64BoxedMap> { private static @Nullable Int64 instance = null; protected Int64() { @@ -1947,11 +1893,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -1982,11 +1928,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -2065,80 +2011,75 @@ public Int64BoxedList validateAndBox(List arg, SchemaConfiguration configurat public Int64BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Int64BoxedMap(validate(arg, configuration)); } + @Override + public Int64Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class DoubleSchemaBoxed permits DoubleSchemaBoxedVoid, DoubleSchemaBoxedBoolean, DoubleSchemaBoxedNumber, DoubleSchemaBoxedString, DoubleSchemaBoxedList, DoubleSchemaBoxedMap { - public abstract @Nullable Object data(); + public sealed interface DoubleSchemaBoxed permits DoubleSchemaBoxedVoid, DoubleSchemaBoxedBoolean, DoubleSchemaBoxedNumber, DoubleSchemaBoxedString, DoubleSchemaBoxedList, DoubleSchemaBoxedMap { + @Nullable Object getData(); } - public static final class DoubleSchemaBoxedVoid extends DoubleSchemaBoxed { - public final Void data; - private DoubleSchemaBoxedVoid(Void data) { - this.data = data; - } + public record DoubleSchemaBoxedVoid(Void data) implements DoubleSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class DoubleSchemaBoxedBoolean extends DoubleSchemaBoxed { - public final boolean data; - private DoubleSchemaBoxedBoolean(boolean data) { - this.data = data; - } + public record DoubleSchemaBoxedBoolean(boolean data) implements DoubleSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class DoubleSchemaBoxedNumber extends DoubleSchemaBoxed { - public final Number data; - private DoubleSchemaBoxedNumber(Number data) { - this.data = data; - } + public record DoubleSchemaBoxedNumber(Number data) implements DoubleSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class DoubleSchemaBoxedString extends DoubleSchemaBoxed { - public final String data; - private DoubleSchemaBoxedString(String data) { - this.data = data; - } + public record DoubleSchemaBoxedString(String data) implements DoubleSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class DoubleSchemaBoxedList extends DoubleSchemaBoxed { - public final FrozenList<@Nullable Object> data; - private DoubleSchemaBoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record DoubleSchemaBoxedList(FrozenList<@Nullable Object> data) implements DoubleSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class DoubleSchemaBoxedMap extends DoubleSchemaBoxed { - public final FrozenMap<@Nullable Object> data; - private DoubleSchemaBoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record DoubleSchemaBoxedMap(FrozenMap<@Nullable Object> data) implements DoubleSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class DoubleSchema extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, DoubleSchemaBoxedList>, MapSchemaValidator, DoubleSchemaBoxedMap> { + public static class DoubleSchema extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, DoubleSchemaBoxedList>, MapSchemaValidator, DoubleSchemaBoxedMap> { private static @Nullable DoubleSchema instance = null; protected DoubleSchema() { @@ -2237,11 +2178,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -2272,11 +2213,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -2355,80 +2296,75 @@ public DoubleSchemaBoxedList validateAndBox(List arg, SchemaConfiguration con public DoubleSchemaBoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new DoubleSchemaBoxedMap(validate(arg, configuration)); } + @Override + public DoubleSchemaBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class FloatSchemaBoxed permits FloatSchemaBoxedVoid, FloatSchemaBoxedBoolean, FloatSchemaBoxedNumber, FloatSchemaBoxedString, FloatSchemaBoxedList, FloatSchemaBoxedMap { - public abstract @Nullable Object data(); + public sealed interface FloatSchemaBoxed permits FloatSchemaBoxedVoid, FloatSchemaBoxedBoolean, FloatSchemaBoxedNumber, FloatSchemaBoxedString, FloatSchemaBoxedList, FloatSchemaBoxedMap { + @Nullable Object getData(); } - public static final class FloatSchemaBoxedVoid extends FloatSchemaBoxed { - public final Void data; - private FloatSchemaBoxedVoid(Void data) { - this.data = data; - } + public record FloatSchemaBoxedVoid(Void data) implements FloatSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class FloatSchemaBoxedBoolean extends FloatSchemaBoxed { - public final boolean data; - private FloatSchemaBoxedBoolean(boolean data) { - this.data = data; - } + public record FloatSchemaBoxedBoolean(boolean data) implements FloatSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class FloatSchemaBoxedNumber extends FloatSchemaBoxed { - public final Number data; - private FloatSchemaBoxedNumber(Number data) { - this.data = data; - } + public record FloatSchemaBoxedNumber(Number data) implements FloatSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class FloatSchemaBoxedString extends FloatSchemaBoxed { - public final String data; - private FloatSchemaBoxedString(String data) { - this.data = data; - } + public record FloatSchemaBoxedString(String data) implements FloatSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class FloatSchemaBoxedList extends FloatSchemaBoxed { - public final FrozenList<@Nullable Object> data; - private FloatSchemaBoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record FloatSchemaBoxedList(FrozenList<@Nullable Object> data) implements FloatSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class FloatSchemaBoxedMap extends FloatSchemaBoxed { - public final FrozenMap<@Nullable Object> data; - private FloatSchemaBoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record FloatSchemaBoxedMap(FrozenMap<@Nullable Object> data) implements FloatSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class FloatSchema extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, FloatSchemaBoxedList>, MapSchemaValidator, FloatSchemaBoxedMap> { + public static class FloatSchema extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, FloatSchemaBoxedList>, MapSchemaValidator, FloatSchemaBoxedMap> { private static @Nullable FloatSchema instance = null; protected FloatSchema() { @@ -2527,11 +2463,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -2562,11 +2498,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -2645,6 +2581,25 @@ public FloatSchemaBoxedList validateAndBox(List arg, SchemaConfiguration conf public FloatSchemaBoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new FloatSchemaBoxedMap(validate(arg, configuration)); } + @Override + public FloatSchemaBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class AnyTypeAndFormatMap extends FrozenMap<@Nullable Object> { @@ -3279,23 +3234,19 @@ public AnyTypeAndFormatMapBuilder getBuilderAfterAdditionalProperty(Map { + public static class AnyTypeAndFormat1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -3339,11 +3290,11 @@ public AnyTypeAndFormatMap getNewInstance(Map arg, List pathToItem List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -3380,6 +3331,13 @@ public AnyTypeAndFormatMap validate(Map arg, SchemaConfiguration configura public AnyTypeAndFormat1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new AnyTypeAndFormat1BoxedMap(validate(arg, configuration)); } + @Override + public AnyTypeAndFormat1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyTypeNotString.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyTypeNotString.java index 2a7eb0870cb..13dfb48e9a9 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyTypeNotString.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/AnyTypeNotString.java @@ -47,78 +47,54 @@ public static Not getInstance() { } - public static abstract sealed class AnyTypeNotString1Boxed permits AnyTypeNotString1BoxedVoid, AnyTypeNotString1BoxedBoolean, AnyTypeNotString1BoxedNumber, AnyTypeNotString1BoxedString, AnyTypeNotString1BoxedList, AnyTypeNotString1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface AnyTypeNotString1Boxed permits AnyTypeNotString1BoxedVoid, AnyTypeNotString1BoxedBoolean, AnyTypeNotString1BoxedNumber, AnyTypeNotString1BoxedString, AnyTypeNotString1BoxedList, AnyTypeNotString1BoxedMap { + @Nullable Object getData(); } - public static final class AnyTypeNotString1BoxedVoid extends AnyTypeNotString1Boxed { - public final Void data; - private AnyTypeNotString1BoxedVoid(Void data) { - this.data = data; - } + public record AnyTypeNotString1BoxedVoid(Void data) implements AnyTypeNotString1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AnyTypeNotString1BoxedBoolean extends AnyTypeNotString1Boxed { - public final boolean data; - private AnyTypeNotString1BoxedBoolean(boolean data) { - this.data = data; - } + public record AnyTypeNotString1BoxedBoolean(boolean data) implements AnyTypeNotString1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AnyTypeNotString1BoxedNumber extends AnyTypeNotString1Boxed { - public final Number data; - private AnyTypeNotString1BoxedNumber(Number data) { - this.data = data; - } + public record AnyTypeNotString1BoxedNumber(Number data) implements AnyTypeNotString1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AnyTypeNotString1BoxedString extends AnyTypeNotString1Boxed { - public final String data; - private AnyTypeNotString1BoxedString(String data) { - this.data = data; - } + public record AnyTypeNotString1BoxedString(String data) implements AnyTypeNotString1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AnyTypeNotString1BoxedList extends AnyTypeNotString1Boxed { - public final FrozenList<@Nullable Object> data; - private AnyTypeNotString1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record AnyTypeNotString1BoxedList(FrozenList<@Nullable Object> data) implements AnyTypeNotString1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AnyTypeNotString1BoxedMap extends AnyTypeNotString1Boxed { - public final FrozenMap<@Nullable Object> data; - private AnyTypeNotString1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record AnyTypeNotString1BoxedMap(FrozenMap<@Nullable Object> data) implements AnyTypeNotString1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class AnyTypeNotString1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, AnyTypeNotString1BoxedList>, MapSchemaValidator, AnyTypeNotString1BoxedMap> { + public static class AnyTypeNotString1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, AnyTypeNotString1BoxedList>, MapSchemaValidator, AnyTypeNotString1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -223,11 +199,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -258,11 +234,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -341,5 +317,24 @@ public AnyTypeNotString1BoxedList validateAndBox(List arg, SchemaConfiguratio public AnyTypeNotString1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new AnyTypeNotString1BoxedMap(validate(arg, configuration)); } + @Override + public AnyTypeNotString1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ApiResponseSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ApiResponseSchema.java index d38de5b9a6b..19681cbe576 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ApiResponseSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ApiResponseSchema.java @@ -187,23 +187,19 @@ public ApiResponseMapBuilder getBuilderAfterAdditionalProperty(Map { + public static class ApiResponseSchema1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -241,11 +237,11 @@ public ApiResponseMap getNewInstance(Map arg, List pathToItem, Pat List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -282,6 +278,13 @@ public ApiResponseMap validate(Map arg, SchemaConfiguration configuration) public ApiResponseSchema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ApiResponseSchema1BoxedMap(validate(arg, configuration)); } + @Override + public ApiResponseSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Apple.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Apple.java index a9a067c2793..1ff84d0d77f 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Apple.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Apple.java @@ -31,24 +31,20 @@ public class Apple { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class CultivarBoxed permits CultivarBoxedString { - public abstract @Nullable Object data(); + public sealed interface CultivarBoxed permits CultivarBoxedString { + @Nullable Object getData(); } - public static final class CultivarBoxedString extends CultivarBoxed { - public final String data; - private CultivarBoxedString(String data) { - this.data = data; - } + public record CultivarBoxedString(String data) implements CultivarBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Cultivar extends JsonSchema implements StringSchemaValidator { + public static class Cultivar extends JsonSchema implements StringSchemaValidator { private static @Nullable Cultivar instance = null; protected Cultivar() { @@ -98,26 +94,29 @@ public String validate(String arg, SchemaConfiguration configuration) throws Val public CultivarBoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new CultivarBoxedString(validate(arg, configuration)); } + @Override + public CultivarBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class OriginBoxed permits OriginBoxedString { - public abstract @Nullable Object data(); + public sealed interface OriginBoxed permits OriginBoxedString { + @Nullable Object getData(); } - public static final class OriginBoxedString extends OriginBoxed { - public final String data; - private OriginBoxedString(String data) { - this.data = data; - } + public record OriginBoxedString(String data) implements OriginBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Origin extends JsonSchema implements StringSchemaValidator { + public static class Origin extends JsonSchema implements StringSchemaValidator { private static @Nullable Origin instance = null; protected Origin() { @@ -168,6 +167,13 @@ public String validate(String arg, SchemaConfiguration configuration) throws Val public OriginBoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new OriginBoxedString(validate(arg, configuration)); } + @Override + public OriginBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class AppleMap extends FrozenMap<@Nullable Object> { @@ -271,34 +277,26 @@ public AppleMap0Builder getBuilderAfterCultivar(Map in } - public static abstract sealed class Apple1Boxed permits Apple1BoxedVoid, Apple1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Apple1Boxed permits Apple1BoxedVoid, Apple1BoxedMap { + @Nullable Object getData(); } - public static final class Apple1BoxedVoid extends Apple1Boxed { - public final Void data; - private Apple1BoxedVoid(Void data) { - this.data = data; - } + public record Apple1BoxedVoid(Void data) implements Apple1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Apple1BoxedMap extends Apple1Boxed { - public final AppleMap data; - private Apple1BoxedMap(AppleMap data) { - this.data = data; - } + public record Apple1BoxedMap(AppleMap data) implements Apple1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Apple1 extends JsonSchema implements NullSchemaValidator, MapSchemaValidator { + public static class Apple1 extends JsonSchema implements NullSchemaValidator, MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -352,11 +350,11 @@ public AppleMap getNewInstance(Map arg, List pathToItem, PathToSch List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -401,5 +399,15 @@ public Apple1BoxedVoid validateAndBox(Void arg, SchemaConfiguration configuratio public Apple1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Apple1BoxedMap(validate(arg, configuration)); } + @Override + public Apple1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/AppleReq.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/AppleReq.java index 91786696908..e5e5ec8123c 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/AppleReq.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/AppleReq.java @@ -157,23 +157,19 @@ public AppleReqMap0Builder getBuilderAfterCultivar(Map instance) } - public static abstract sealed class AppleReq1Boxed permits AppleReq1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface AppleReq1Boxed permits AppleReq1BoxedMap { + @Nullable Object getData(); } - public static final class AppleReq1BoxedMap extends AppleReq1Boxed { - public final AppleReqMap data; - private AppleReq1BoxedMap(AppleReqMap data) { - this.data = data; - } + public record AppleReq1BoxedMap(AppleReqMap data) implements AppleReq1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class AppleReq1 extends JsonSchema implements MapSchemaValidator { + public static class AppleReq1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -214,11 +210,11 @@ public AppleReqMap getNewInstance(Map arg, List pathToItem, PathTo List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -258,6 +254,13 @@ public AppleReqMap validate(Map arg, SchemaConfiguration configuration) th public AppleReq1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new AppleReq1BoxedMap(validate(arg, configuration)); } + @Override + public AppleReq1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ArrayHoldingAnyType.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ArrayHoldingAnyType.java index dd6efb9716c..6b80d6a622a 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ArrayHoldingAnyType.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ArrayHoldingAnyType.java @@ -107,24 +107,20 @@ public ArrayHoldingAnyTypeListBuilder add(Map item) { } - public static abstract sealed class ArrayHoldingAnyType1Boxed permits ArrayHoldingAnyType1BoxedList { - public abstract @Nullable Object data(); + public sealed interface ArrayHoldingAnyType1Boxed permits ArrayHoldingAnyType1BoxedList { + @Nullable Object getData(); } - public static final class ArrayHoldingAnyType1BoxedList extends ArrayHoldingAnyType1Boxed { - public final ArrayHoldingAnyTypeList data; - private ArrayHoldingAnyType1BoxedList(ArrayHoldingAnyTypeList data) { - this.data = data; - } + public record ArrayHoldingAnyType1BoxedList(ArrayHoldingAnyTypeList data) implements ArrayHoldingAnyType1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ArrayHoldingAnyType1 extends JsonSchema implements ListSchemaValidator { + public static class ArrayHoldingAnyType1 extends JsonSchema implements ListSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -154,11 +150,11 @@ public ArrayHoldingAnyTypeList getNewInstance(List arg, List pathToIt for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -195,5 +191,12 @@ public ArrayHoldingAnyTypeList validate(List arg, SchemaConfiguration configu public ArrayHoldingAnyType1BoxedList validateAndBox(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ArrayHoldingAnyType1BoxedList(validate(arg, configuration)); } + @Override + public ArrayHoldingAnyType1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ArrayOfArrayOfNumberOnly.java index a6f32f80b08..b7f9fd7e937 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ArrayOfArrayOfNumberOnly.java @@ -89,24 +89,20 @@ public List build() { } - public static abstract sealed class ItemsBoxed permits ItemsBoxedList { - public abstract @Nullable Object data(); + public sealed interface ItemsBoxed permits ItemsBoxedList { + @Nullable Object getData(); } - public static final class ItemsBoxedList extends ItemsBoxed { - public final ItemsList data; - private ItemsBoxedList(ItemsList data) { - this.data = data; - } + public record ItemsBoxedList(ItemsList data) implements ItemsBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Items extends JsonSchema implements ListSchemaValidator { + public static class Items extends JsonSchema implements ListSchemaValidator { private static @Nullable Items instance = null; protected Items() { @@ -130,11 +126,11 @@ public ItemsList getNewInstance(List arg, List pathToItem, PathToSche for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Number)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -174,6 +170,13 @@ public ItemsList validate(List arg, SchemaConfiguration configuration) throws public ItemsBoxedList validateAndBox(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ItemsBoxedList(validate(arg, configuration)); } + @Override + public ItemsBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class ArrayArrayNumberList extends FrozenList { @@ -208,24 +211,20 @@ public List> build() { } - public static abstract sealed class ArrayArrayNumberBoxed permits ArrayArrayNumberBoxedList { - public abstract @Nullable Object data(); + public sealed interface ArrayArrayNumberBoxed permits ArrayArrayNumberBoxedList { + @Nullable Object getData(); } - public static final class ArrayArrayNumberBoxedList extends ArrayArrayNumberBoxed { - public final ArrayArrayNumberList data; - private ArrayArrayNumberBoxedList(ArrayArrayNumberList data) { - this.data = data; - } + public record ArrayArrayNumberBoxedList(ArrayArrayNumberList data) implements ArrayArrayNumberBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ArrayArrayNumber extends JsonSchema implements ListSchemaValidator { + public static class ArrayArrayNumber extends JsonSchema implements ListSchemaValidator { private static @Nullable ArrayArrayNumber instance = null; protected ArrayArrayNumber() { @@ -249,11 +248,11 @@ public ArrayArrayNumberList getNewInstance(List arg, List pathToItem, for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof ItemsList)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -293,6 +292,13 @@ public ArrayArrayNumberList validate(List arg, SchemaConfiguration configurat public ArrayArrayNumberBoxedList validateAndBox(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ArrayArrayNumberBoxedList(validate(arg, configuration)); } + @Override + public ArrayArrayNumberBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class ArrayOfArrayOfNumberOnlyMap extends FrozenMap<@Nullable Object> { @@ -361,23 +367,19 @@ public ArrayOfArrayOfNumberOnlyMapBuilder getBuilderAfterAdditionalProperty(Map< } - public static abstract sealed class ArrayOfArrayOfNumberOnly1Boxed permits ArrayOfArrayOfNumberOnly1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface ArrayOfArrayOfNumberOnly1Boxed permits ArrayOfArrayOfNumberOnly1BoxedMap { + @Nullable Object getData(); } - public static final class ArrayOfArrayOfNumberOnly1BoxedMap extends ArrayOfArrayOfNumberOnly1Boxed { - public final ArrayOfArrayOfNumberOnlyMap data; - private ArrayOfArrayOfNumberOnly1BoxedMap(ArrayOfArrayOfNumberOnlyMap data) { - this.data = data; - } + public record ArrayOfArrayOfNumberOnly1BoxedMap(ArrayOfArrayOfNumberOnlyMap data) implements ArrayOfArrayOfNumberOnly1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ArrayOfArrayOfNumberOnly1 extends JsonSchema implements MapSchemaValidator { + public static class ArrayOfArrayOfNumberOnly1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -413,11 +415,11 @@ public ArrayOfArrayOfNumberOnlyMap getNewInstance(Map arg, List pa List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -454,6 +456,13 @@ public ArrayOfArrayOfNumberOnlyMap validate(Map arg, SchemaConfiguration c public ArrayOfArrayOfNumberOnly1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ArrayOfArrayOfNumberOnly1BoxedMap(validate(arg, configuration)); } + @Override + public ArrayOfArrayOfNumberOnly1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ArrayOfEnums.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ArrayOfEnums.java index b7c1da85ed5..8364d46380d 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ArrayOfEnums.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ArrayOfEnums.java @@ -69,24 +69,20 @@ public ArrayOfEnumsListBuilder add(StringEnum.NullStringEnumEnums item) { } - public static abstract sealed class ArrayOfEnums1Boxed permits ArrayOfEnums1BoxedList { - public abstract @Nullable Object data(); + public sealed interface ArrayOfEnums1Boxed permits ArrayOfEnums1BoxedList { + @Nullable Object getData(); } - public static final class ArrayOfEnums1BoxedList extends ArrayOfEnums1Boxed { - public final ArrayOfEnumsList data; - private ArrayOfEnums1BoxedList(ArrayOfEnumsList data) { - this.data = data; - } + public record ArrayOfEnums1BoxedList(ArrayOfEnumsList data) implements ArrayOfEnums1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ArrayOfEnums1 extends JsonSchema implements ListSchemaValidator { + public static class ArrayOfEnums1 extends JsonSchema implements ListSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -116,11 +112,11 @@ public ArrayOfEnumsList getNewInstance(List arg, List pathToItem, Pat for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof String)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -160,5 +156,12 @@ public ArrayOfEnumsList validate(List arg, SchemaConfiguration configuration) public ArrayOfEnums1BoxedList validateAndBox(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ArrayOfEnums1BoxedList(validate(arg, configuration)); } + @Override + public ArrayOfEnums1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ArrayOfNumberOnly.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ArrayOfNumberOnly.java index 2263421bc9b..03b7659a3c1 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ArrayOfNumberOnly.java @@ -89,24 +89,20 @@ public List build() { } - public static abstract sealed class ArrayNumberBoxed permits ArrayNumberBoxedList { - public abstract @Nullable Object data(); + public sealed interface ArrayNumberBoxed permits ArrayNumberBoxedList { + @Nullable Object getData(); } - public static final class ArrayNumberBoxedList extends ArrayNumberBoxed { - public final ArrayNumberList data; - private ArrayNumberBoxedList(ArrayNumberList data) { - this.data = data; - } + public record ArrayNumberBoxedList(ArrayNumberList data) implements ArrayNumberBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ArrayNumber extends JsonSchema implements ListSchemaValidator { + public static class ArrayNumber extends JsonSchema implements ListSchemaValidator { private static @Nullable ArrayNumber instance = null; protected ArrayNumber() { @@ -130,11 +126,11 @@ public ArrayNumberList getNewInstance(List arg, List pathToItem, Path for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Number)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -174,6 +170,13 @@ public ArrayNumberList validate(List arg, SchemaConfiguration configuration) public ArrayNumberBoxedList validateAndBox(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ArrayNumberBoxedList(validate(arg, configuration)); } + @Override + public ArrayNumberBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class ArrayOfNumberOnlyMap extends FrozenMap<@Nullable Object> { @@ -242,23 +245,19 @@ public ArrayOfNumberOnlyMapBuilder getBuilderAfterAdditionalProperty(Map { + public static class ArrayOfNumberOnly1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -294,11 +293,11 @@ public ArrayOfNumberOnlyMap getNewInstance(Map arg, List pathToIte List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -335,6 +334,13 @@ public ArrayOfNumberOnlyMap validate(Map arg, SchemaConfiguration configur public ArrayOfNumberOnly1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ArrayOfNumberOnly1BoxedMap(validate(arg, configuration)); } + @Override + public ArrayOfNumberOnly1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ArrayTest.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ArrayTest.java index a60094aa093..a6de7bc8168 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ArrayTest.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ArrayTest.java @@ -75,24 +75,20 @@ public List build() { } - public static abstract sealed class ArrayOfStringBoxed permits ArrayOfStringBoxedList { - public abstract @Nullable Object data(); + public sealed interface ArrayOfStringBoxed permits ArrayOfStringBoxedList { + @Nullable Object getData(); } - public static final class ArrayOfStringBoxedList extends ArrayOfStringBoxed { - public final ArrayOfStringList data; - private ArrayOfStringBoxedList(ArrayOfStringList data) { - this.data = data; - } + public record ArrayOfStringBoxedList(ArrayOfStringList data) implements ArrayOfStringBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ArrayOfString extends JsonSchema implements ListSchemaValidator { + public static class ArrayOfString extends JsonSchema implements ListSchemaValidator { private static @Nullable ArrayOfString instance = null; protected ArrayOfString() { @@ -116,11 +112,11 @@ public ArrayOfStringList getNewInstance(List arg, List pathToItem, Pa for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof String)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -160,6 +156,13 @@ public ArrayOfStringList validate(List arg, SchemaConfiguration configuration public ArrayOfStringBoxedList validateAndBox(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ArrayOfStringBoxedList(validate(arg, configuration)); } + @Override + public ArrayOfStringBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class Items2 extends Int64JsonSchema.Int64JsonSchema1 { @@ -220,24 +223,20 @@ public List build() { } - public static abstract sealed class Items1Boxed permits Items1BoxedList { - public abstract @Nullable Object data(); + public sealed interface Items1Boxed permits Items1BoxedList { + @Nullable Object getData(); } - public static final class Items1BoxedList extends Items1Boxed { - public final ItemsList data; - private Items1BoxedList(ItemsList data) { - this.data = data; - } + public record Items1BoxedList(ItemsList data) implements Items1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Items1 extends JsonSchema implements ListSchemaValidator { + public static class Items1 extends JsonSchema implements ListSchemaValidator { private static @Nullable Items1 instance = null; protected Items1() { @@ -261,11 +260,11 @@ public ItemsList getNewInstance(List arg, List pathToItem, PathToSche for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Number)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -305,6 +304,13 @@ public ItemsList validate(List arg, SchemaConfiguration configuration) throws public Items1BoxedList validateAndBox(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Items1BoxedList(validate(arg, configuration)); } + @Override + public Items1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class ArrayArrayOfIntegerList extends FrozenList { @@ -339,24 +345,20 @@ public List> build() { } - public static abstract sealed class ArrayArrayOfIntegerBoxed permits ArrayArrayOfIntegerBoxedList { - public abstract @Nullable Object data(); + public sealed interface ArrayArrayOfIntegerBoxed permits ArrayArrayOfIntegerBoxedList { + @Nullable Object getData(); } - public static final class ArrayArrayOfIntegerBoxedList extends ArrayArrayOfIntegerBoxed { - public final ArrayArrayOfIntegerList data; - private ArrayArrayOfIntegerBoxedList(ArrayArrayOfIntegerList data) { - this.data = data; - } + public record ArrayArrayOfIntegerBoxedList(ArrayArrayOfIntegerList data) implements ArrayArrayOfIntegerBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ArrayArrayOfInteger extends JsonSchema implements ListSchemaValidator { + public static class ArrayArrayOfInteger extends JsonSchema implements ListSchemaValidator { private static @Nullable ArrayArrayOfInteger instance = null; protected ArrayArrayOfInteger() { @@ -380,11 +382,11 @@ public ArrayArrayOfIntegerList getNewInstance(List arg, List pathToIt for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof ItemsList)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -424,6 +426,13 @@ public ArrayArrayOfIntegerList validate(List arg, SchemaConfiguration configu public ArrayArrayOfIntegerBoxedList validateAndBox(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ArrayArrayOfIntegerBoxedList(validate(arg, configuration)); } + @Override + public ArrayArrayOfIntegerBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class ItemsList1 extends FrozenList { @@ -458,24 +467,20 @@ public ItemsListBuilder1 add(Map item) { } - public static abstract sealed class Items3Boxed permits Items3BoxedList { - public abstract @Nullable Object data(); + public sealed interface Items3Boxed permits Items3BoxedList { + @Nullable Object getData(); } - public static final class Items3BoxedList extends Items3Boxed { - public final ItemsList1 data; - private Items3BoxedList(ItemsList1 data) { - this.data = data; - } + public record Items3BoxedList(ItemsList1 data) implements Items3Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Items3 extends JsonSchema implements ListSchemaValidator { + public static class Items3 extends JsonSchema implements ListSchemaValidator { private static @Nullable Items3 instance = null; protected Items3() { @@ -499,11 +504,11 @@ public ItemsList1 getNewInstance(List arg, List pathToItem, PathToSch for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof ReadOnlyFirst.ReadOnlyFirstMap)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -543,6 +548,13 @@ public ItemsList1 validate(List arg, SchemaConfiguration configuration) throw public Items3BoxedList validateAndBox(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Items3BoxedList(validate(arg, configuration)); } + @Override + public Items3Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class ArrayArrayOfModelList extends FrozenList { @@ -577,24 +589,20 @@ public ArrayArrayOfModelListBuilder add(List> item } - public static abstract sealed class ArrayArrayOfModelBoxed permits ArrayArrayOfModelBoxedList { - public abstract @Nullable Object data(); + public sealed interface ArrayArrayOfModelBoxed permits ArrayArrayOfModelBoxedList { + @Nullable Object getData(); } - public static final class ArrayArrayOfModelBoxedList extends ArrayArrayOfModelBoxed { - public final ArrayArrayOfModelList data; - private ArrayArrayOfModelBoxedList(ArrayArrayOfModelList data) { - this.data = data; - } + public record ArrayArrayOfModelBoxedList(ArrayArrayOfModelList data) implements ArrayArrayOfModelBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ArrayArrayOfModel extends JsonSchema implements ListSchemaValidator { + public static class ArrayArrayOfModel extends JsonSchema implements ListSchemaValidator { private static @Nullable ArrayArrayOfModel instance = null; protected ArrayArrayOfModel() { @@ -618,11 +626,11 @@ public ArrayArrayOfModelList getNewInstance(List arg, List pathToItem for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof ItemsList1)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -662,6 +670,13 @@ public ArrayArrayOfModelList validate(List arg, SchemaConfiguration configura public ArrayArrayOfModelBoxedList validateAndBox(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ArrayArrayOfModelBoxedList(validate(arg, configuration)); } + @Override + public ArrayArrayOfModelBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class ArrayTestMap extends FrozenMap<@Nullable Object> { @@ -782,23 +797,19 @@ public ArrayTestMapBuilder getBuilderAfterAdditionalProperty(Map { + public static class ArrayTest1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -836,11 +847,11 @@ public ArrayTestMap getNewInstance(Map arg, List pathToItem, PathT List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -877,6 +888,13 @@ public ArrayTestMap validate(Map arg, SchemaConfiguration configuration) t public ArrayTest1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ArrayTest1BoxedMap(validate(arg, configuration)); } + @Override + public ArrayTest1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ArrayWithValidationsInItems.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ArrayWithValidationsInItems.java index 9ecd062654b..99a7c45a8d2 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ArrayWithValidationsInItems.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ArrayWithValidationsInItems.java @@ -23,24 +23,20 @@ public class ArrayWithValidationsInItems { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class ItemsBoxed permits ItemsBoxedNumber { - public abstract @Nullable Object data(); + public sealed interface ItemsBoxed permits ItemsBoxedNumber { + @Nullable Object getData(); } - public static final class ItemsBoxedNumber extends ItemsBoxed { - public final Number data; - private ItemsBoxedNumber(Number data) { - this.data = data; - } + public record ItemsBoxedNumber(Number data) implements ItemsBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Items extends JsonSchema implements NumberSchemaValidator { + public static class Items extends JsonSchema implements NumberSchemaValidator { private static @Nullable Items instance = null; protected Items() { @@ -108,6 +104,13 @@ public double validate(double arg, SchemaConfiguration configuration) throws Val public ItemsBoxedNumber validateAndBox(Number arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ItemsBoxedNumber(validate(arg, configuration)); } + @Override + public ItemsBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class ArrayWithValidationsInItemsList extends FrozenList { @@ -157,24 +160,20 @@ public List build() { } - public static abstract sealed class ArrayWithValidationsInItems1Boxed permits ArrayWithValidationsInItems1BoxedList { - public abstract @Nullable Object data(); + public sealed interface ArrayWithValidationsInItems1Boxed permits ArrayWithValidationsInItems1BoxedList { + @Nullable Object getData(); } - public static final class ArrayWithValidationsInItems1BoxedList extends ArrayWithValidationsInItems1Boxed { - public final ArrayWithValidationsInItemsList data; - private ArrayWithValidationsInItems1BoxedList(ArrayWithValidationsInItemsList data) { - this.data = data; - } + public record ArrayWithValidationsInItems1BoxedList(ArrayWithValidationsInItemsList data) implements ArrayWithValidationsInItems1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ArrayWithValidationsInItems1 extends JsonSchema implements ListSchemaValidator { + public static class ArrayWithValidationsInItems1 extends JsonSchema implements ListSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -205,11 +204,11 @@ public ArrayWithValidationsInItemsList getNewInstance(List arg, List for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Number)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -249,5 +248,12 @@ public ArrayWithValidationsInItemsList validate(List arg, SchemaConfiguration public ArrayWithValidationsInItems1BoxedList validateAndBox(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ArrayWithValidationsInItems1BoxedList(validate(arg, configuration)); } + @Override + public ArrayWithValidationsInItems1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Banana.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Banana.java index 280663d76a4..ffa0682bd6c 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Banana.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Banana.java @@ -132,23 +132,19 @@ public BananaMap0Builder getBuilderAfterLengthCm(Map i } - public static abstract sealed class Banana1Boxed permits Banana1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Banana1Boxed permits Banana1BoxedMap { + @Nullable Object getData(); } - public static final class Banana1BoxedMap extends Banana1Boxed { - public final BananaMap data; - private Banana1BoxedMap(BananaMap data) { - this.data = data; - } + public record Banana1BoxedMap(BananaMap data) implements Banana1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Banana1 extends JsonSchema implements MapSchemaValidator { + public static class Banana1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -187,11 +183,11 @@ public BananaMap getNewInstance(Map arg, List pathToItem, PathToSc List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -228,6 +224,13 @@ public BananaMap validate(Map arg, SchemaConfiguration configuration) thro public Banana1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Banana1BoxedMap(validate(arg, configuration)); } + @Override + public Banana1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/BananaReq.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/BananaReq.java index a520a7bce47..9ca17cb18fc 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/BananaReq.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/BananaReq.java @@ -175,23 +175,19 @@ public BananaReqMap0Builder getBuilderAfterLengthCm(Map instance } - public static abstract sealed class BananaReq1Boxed permits BananaReq1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface BananaReq1Boxed permits BananaReq1BoxedMap { + @Nullable Object getData(); } - public static final class BananaReq1BoxedMap extends BananaReq1Boxed { - public final BananaReqMap data; - private BananaReq1BoxedMap(BananaReqMap data) { - this.data = data; - } + public record BananaReq1BoxedMap(BananaReqMap data) implements BananaReq1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class BananaReq1 extends JsonSchema implements MapSchemaValidator { + public static class BananaReq1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -232,11 +228,11 @@ public BananaReqMap getNewInstance(Map arg, List pathToItem, PathT List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -276,6 +272,13 @@ public BananaReqMap validate(Map arg, SchemaConfiguration configuration) t public BananaReq1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new BananaReq1BoxedMap(validate(arg, configuration)); } + @Override + public BananaReq1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Bar.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Bar.java index d4ca10c513d..a46435968b3 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Bar.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Bar.java @@ -20,24 +20,20 @@ public class Bar { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class Bar1Boxed permits Bar1BoxedString { - public abstract @Nullable Object data(); + public sealed interface Bar1Boxed permits Bar1BoxedString { + @Nullable Object getData(); } - public static final class Bar1BoxedString extends Bar1Boxed { - public final String data; - private Bar1BoxedString(String data) { - this.data = data; - } + public record Bar1BoxedString(String data) implements Bar1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Bar1 extends JsonSchema implements StringSchemaValidator, DefaultValueMethod { + public static class Bar1 extends JsonSchema implements StringSchemaValidator, DefaultValueMethod { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -97,5 +93,12 @@ public String defaultValue() { public Bar1BoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Bar1BoxedString(validate(arg, configuration)); } + @Override + public Bar1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/BasquePig.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/BasquePig.java index e5b8689f397..826127d11ee 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/BasquePig.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/BasquePig.java @@ -44,24 +44,20 @@ public String value() { } - public static abstract sealed class ClassNameBoxed permits ClassNameBoxedString { - public abstract @Nullable Object data(); + public sealed interface ClassNameBoxed permits ClassNameBoxedString { + @Nullable Object getData(); } - public static final class ClassNameBoxedString extends ClassNameBoxed { - public final String data; - private ClassNameBoxedString(String data) { - this.data = data; - } + public record ClassNameBoxedString(String data) implements ClassNameBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ClassName extends JsonSchema implements StringSchemaValidator, StringEnumValidator { + public static class ClassName extends JsonSchema implements StringSchemaValidator, StringEnumValidator { private static @Nullable ClassName instance = null; protected ClassName() { @@ -116,6 +112,13 @@ public String validate(StringClassNameEnums arg,SchemaConfiguration configuratio public ClassNameBoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ClassNameBoxedString(validate(arg, configuration)); } + @Override + public ClassNameBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class BasquePigMap extends FrozenMap<@Nullable Object> { @@ -198,23 +201,19 @@ public BasquePigMap0Builder getBuilderAfterClassName(Map { + public static class BasquePig1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -253,11 +252,11 @@ public BasquePigMap getNewInstance(Map arg, List pathToItem, PathT List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -294,6 +293,13 @@ public BasquePigMap validate(Map arg, SchemaConfiguration configuration) t public BasquePig1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new BasquePig1BoxedMap(validate(arg, configuration)); } + @Override + public BasquePig1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/BooleanEnum.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/BooleanEnum.java index e8338530362..0681c9d4961 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/BooleanEnum.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/BooleanEnum.java @@ -34,24 +34,20 @@ public boolean value() { } - public static abstract sealed class BooleanEnum1Boxed permits BooleanEnum1BoxedBoolean { - public abstract @Nullable Object data(); + public sealed interface BooleanEnum1Boxed permits BooleanEnum1BoxedBoolean { + @Nullable Object getData(); } - public static final class BooleanEnum1BoxedBoolean extends BooleanEnum1Boxed { - public final boolean data; - private BooleanEnum1BoxedBoolean(boolean data) { - this.data = data; - } + public record BooleanEnum1BoxedBoolean(boolean data) implements BooleanEnum1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class BooleanEnum1 extends JsonSchema implements BooleanSchemaValidator, BooleanEnumValidator { + public static class BooleanEnum1 extends JsonSchema implements BooleanSchemaValidator, BooleanEnumValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -112,5 +108,13 @@ public boolean validate(BooleanBooleanEnumEnums arg,SchemaConfiguration configur public BooleanEnum1BoxedBoolean validateAndBox(boolean arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new BooleanEnum1BoxedBoolean(validate(arg, configuration)); } + @Override + public BooleanEnum1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Capitalization.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Capitalization.java index a2f2dc72070..d5fb609e4e8 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Capitalization.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Capitalization.java @@ -291,23 +291,19 @@ public CapitalizationMapBuilder getBuilderAfterAdditionalProperty(Map { + public static class Capitalization1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -348,11 +344,11 @@ public CapitalizationMap getNewInstance(Map arg, List pathToItem, List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -389,6 +385,13 @@ public CapitalizationMap validate(Map arg, SchemaConfiguration configurati public Capitalization1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Capitalization1BoxedMap(validate(arg, configuration)); } + @Override + public Capitalization1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Cat.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Cat.java index a9ac6299a55..b05aec208e2 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Cat.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Cat.java @@ -115,23 +115,19 @@ public Schema1MapBuilder getBuilderAfterAdditionalProperty(Map { + public static class Schema1 extends JsonSchema implements MapSchemaValidator { private static @Nullable Schema1 instance = null; protected Schema1() { @@ -161,11 +157,11 @@ public Schema1Map getNewInstance(Map arg, List pathToItem, PathToS List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -202,81 +198,64 @@ public Schema1Map validate(Map arg, SchemaConfiguration configuration) thr public Schema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema1BoxedMap(validate(arg, configuration)); } + @Override + public Schema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class Cat1Boxed permits Cat1BoxedVoid, Cat1BoxedBoolean, Cat1BoxedNumber, Cat1BoxedString, Cat1BoxedList, Cat1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Cat1Boxed permits Cat1BoxedVoid, Cat1BoxedBoolean, Cat1BoxedNumber, Cat1BoxedString, Cat1BoxedList, Cat1BoxedMap { + @Nullable Object getData(); } - public static final class Cat1BoxedVoid extends Cat1Boxed { - public final Void data; - private Cat1BoxedVoid(Void data) { - this.data = data; - } + public record Cat1BoxedVoid(Void data) implements Cat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Cat1BoxedBoolean extends Cat1Boxed { - public final boolean data; - private Cat1BoxedBoolean(boolean data) { - this.data = data; - } + public record Cat1BoxedBoolean(boolean data) implements Cat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Cat1BoxedNumber extends Cat1Boxed { - public final Number data; - private Cat1BoxedNumber(Number data) { - this.data = data; - } + public record Cat1BoxedNumber(Number data) implements Cat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Cat1BoxedString extends Cat1Boxed { - public final String data; - private Cat1BoxedString(String data) { - this.data = data; - } + public record Cat1BoxedString(String data) implements Cat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Cat1BoxedList extends Cat1Boxed { - public final FrozenList<@Nullable Object> data; - private Cat1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Cat1BoxedList(FrozenList<@Nullable Object> data) implements Cat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Cat1BoxedMap extends Cat1Boxed { - public final FrozenMap<@Nullable Object> data; - private Cat1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record Cat1BoxedMap(FrozenMap<@Nullable Object> data) implements Cat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Cat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Cat1BoxedList>, MapSchemaValidator, Cat1BoxedMap> { + public static class Cat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Cat1BoxedList>, MapSchemaValidator, Cat1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -384,11 +363,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -419,11 +398,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -502,5 +481,24 @@ public Cat1BoxedList validateAndBox(List arg, SchemaConfiguration configurati public Cat1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Cat1BoxedMap(validate(arg, configuration)); } + @Override + public Cat1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Category.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Category.java index 945659e8c5f..b19f935049b 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Category.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Category.java @@ -42,24 +42,20 @@ public static Id getInstance() { } - public static abstract sealed class NameBoxed permits NameBoxedString { - public abstract @Nullable Object data(); + public sealed interface NameBoxed permits NameBoxedString { + @Nullable Object getData(); } - public static final class NameBoxedString extends NameBoxed { - public final String data; - private NameBoxedString(String data) { - this.data = data; - } + public record NameBoxedString(String data) implements NameBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Name extends JsonSchema implements StringSchemaValidator, DefaultValueMethod { + public static class Name extends JsonSchema implements StringSchemaValidator, DefaultValueMethod { private static @Nullable Name instance = null; protected Name() { @@ -113,6 +109,13 @@ public String defaultValue() { public NameBoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new NameBoxedString(validate(arg, configuration)); } + @Override + public NameBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class CategoryMap extends FrozenMap<@Nullable Object> { @@ -234,23 +237,19 @@ public CategoryMap0Builder getBuilderAfterName(Map ins } - public static abstract sealed class Category1Boxed permits Category1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Category1Boxed permits Category1BoxedMap { + @Nullable Object getData(); } - public static final class Category1BoxedMap extends Category1Boxed { - public final CategoryMap data; - private Category1BoxedMap(CategoryMap data) { - this.data = data; - } + public record Category1BoxedMap(CategoryMap data) implements Category1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Category1 extends JsonSchema implements MapSchemaValidator { + public static class Category1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -290,11 +289,11 @@ public CategoryMap getNewInstance(Map arg, List pathToItem, PathTo List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -331,6 +330,13 @@ public CategoryMap validate(Map arg, SchemaConfiguration configuration) th public Category1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Category1BoxedMap(validate(arg, configuration)); } + @Override + public Category1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ChildCat.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ChildCat.java index 6f0c1be972b..fdb76bf0d38 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ChildCat.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ChildCat.java @@ -115,23 +115,19 @@ public Schema1MapBuilder getBuilderAfterAdditionalProperty(Map { + public static class Schema1 extends JsonSchema implements MapSchemaValidator { private static @Nullable Schema1 instance = null; protected Schema1() { @@ -161,11 +157,11 @@ public Schema1Map getNewInstance(Map arg, List pathToItem, PathToS List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -202,81 +198,64 @@ public Schema1Map validate(Map arg, SchemaConfiguration configuration) thr public Schema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema1BoxedMap(validate(arg, configuration)); } + @Override + public Schema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class ChildCat1Boxed permits ChildCat1BoxedVoid, ChildCat1BoxedBoolean, ChildCat1BoxedNumber, ChildCat1BoxedString, ChildCat1BoxedList, ChildCat1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface ChildCat1Boxed permits ChildCat1BoxedVoid, ChildCat1BoxedBoolean, ChildCat1BoxedNumber, ChildCat1BoxedString, ChildCat1BoxedList, ChildCat1BoxedMap { + @Nullable Object getData(); } - public static final class ChildCat1BoxedVoid extends ChildCat1Boxed { - public final Void data; - private ChildCat1BoxedVoid(Void data) { - this.data = data; - } + public record ChildCat1BoxedVoid(Void data) implements ChildCat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ChildCat1BoxedBoolean extends ChildCat1Boxed { - public final boolean data; - private ChildCat1BoxedBoolean(boolean data) { - this.data = data; - } + public record ChildCat1BoxedBoolean(boolean data) implements ChildCat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ChildCat1BoxedNumber extends ChildCat1Boxed { - public final Number data; - private ChildCat1BoxedNumber(Number data) { - this.data = data; - } + public record ChildCat1BoxedNumber(Number data) implements ChildCat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ChildCat1BoxedString extends ChildCat1Boxed { - public final String data; - private ChildCat1BoxedString(String data) { - this.data = data; - } + public record ChildCat1BoxedString(String data) implements ChildCat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ChildCat1BoxedList extends ChildCat1Boxed { - public final FrozenList<@Nullable Object> data; - private ChildCat1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record ChildCat1BoxedList(FrozenList<@Nullable Object> data) implements ChildCat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ChildCat1BoxedMap extends ChildCat1Boxed { - public final FrozenMap<@Nullable Object> data; - private ChildCat1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record ChildCat1BoxedMap(FrozenMap<@Nullable Object> data) implements ChildCat1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ChildCat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ChildCat1BoxedList>, MapSchemaValidator, ChildCat1BoxedMap> { + public static class ChildCat1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ChildCat1BoxedList>, MapSchemaValidator, ChildCat1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -384,11 +363,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -419,11 +398,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -502,5 +481,24 @@ public ChildCat1BoxedList validateAndBox(List arg, SchemaConfiguration config public ChildCat1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ChildCat1BoxedMap(validate(arg, configuration)); } + @Override + public ChildCat1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ClassModel.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ClassModel.java index 9d5147fb103..65855781634 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ClassModel.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ClassModel.java @@ -105,78 +105,54 @@ public ClassModelMapBuilder getBuilderAfterAdditionalProperty(Map data; - private ClassModel1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record ClassModel1BoxedList(FrozenList<@Nullable Object> data) implements ClassModel1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ClassModel1BoxedMap extends ClassModel1Boxed { - public final ClassModelMap data; - private ClassModel1BoxedMap(ClassModelMap data) { - this.data = data; - } + public record ClassModel1BoxedMap(ClassModelMap data) implements ClassModel1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ClassModel1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ClassModel1BoxedList>, MapSchemaValidator { + public static class ClassModel1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ClassModel1BoxedList>, MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -285,11 +261,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -320,11 +296,11 @@ public ClassModelMap getNewInstance(Map arg, List pathToItem, Path List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -403,5 +379,24 @@ public ClassModel1BoxedList validateAndBox(List arg, SchemaConfiguration conf public ClassModel1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ClassModel1BoxedMap(validate(arg, configuration)); } + @Override + public ClassModel1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Client.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Client.java index c9b948e6c50..9cd4880d680 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Client.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Client.java @@ -106,23 +106,19 @@ public ClientMapBuilder1 getBuilderAfterAdditionalProperty(Map { + public static class Client1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -158,11 +154,11 @@ public ClientMap getNewInstance(Map arg, List pathToItem, PathToSc List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -199,6 +195,13 @@ public ClientMap validate(Map arg, SchemaConfiguration configuration) thro public Client1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Client1BoxedMap(validate(arg, configuration)); } + @Override + public Client1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ComplexQuadrilateral.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ComplexQuadrilateral.java index 1190634544e..0f5fe34f199 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ComplexQuadrilateral.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ComplexQuadrilateral.java @@ -52,24 +52,20 @@ public String value() { } - public static abstract sealed class QuadrilateralTypeBoxed permits QuadrilateralTypeBoxedString { - public abstract @Nullable Object data(); + public sealed interface QuadrilateralTypeBoxed permits QuadrilateralTypeBoxedString { + @Nullable Object getData(); } - public static final class QuadrilateralTypeBoxedString extends QuadrilateralTypeBoxed { - public final String data; - private QuadrilateralTypeBoxedString(String data) { - this.data = data; - } + public record QuadrilateralTypeBoxedString(String data) implements QuadrilateralTypeBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class QuadrilateralType extends JsonSchema implements StringSchemaValidator, StringEnumValidator { + public static class QuadrilateralType extends JsonSchema implements StringSchemaValidator, StringEnumValidator { private static @Nullable QuadrilateralType instance = null; protected QuadrilateralType() { @@ -124,6 +120,13 @@ public String validate(StringQuadrilateralTypeEnums arg,SchemaConfiguration conf public QuadrilateralTypeBoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new QuadrilateralTypeBoxedString(validate(arg, configuration)); } + @Override + public QuadrilateralTypeBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class Schema1Map extends FrozenMap<@Nullable Object> { @@ -198,23 +201,19 @@ public Schema1MapBuilder getBuilderAfterAdditionalProperty(Map { + public static class Schema1 extends JsonSchema implements MapSchemaValidator { private static @Nullable Schema1 instance = null; protected Schema1() { @@ -244,11 +243,11 @@ public Schema1Map getNewInstance(Map arg, List pathToItem, PathToS List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -285,81 +284,64 @@ public Schema1Map validate(Map arg, SchemaConfiguration configuration) thr public Schema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema1BoxedMap(validate(arg, configuration)); } + @Override + public Schema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class ComplexQuadrilateral1Boxed permits ComplexQuadrilateral1BoxedVoid, ComplexQuadrilateral1BoxedBoolean, ComplexQuadrilateral1BoxedNumber, ComplexQuadrilateral1BoxedString, ComplexQuadrilateral1BoxedList, ComplexQuadrilateral1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface ComplexQuadrilateral1Boxed permits ComplexQuadrilateral1BoxedVoid, ComplexQuadrilateral1BoxedBoolean, ComplexQuadrilateral1BoxedNumber, ComplexQuadrilateral1BoxedString, ComplexQuadrilateral1BoxedList, ComplexQuadrilateral1BoxedMap { + @Nullable Object getData(); } - public static final class ComplexQuadrilateral1BoxedVoid extends ComplexQuadrilateral1Boxed { - public final Void data; - private ComplexQuadrilateral1BoxedVoid(Void data) { - this.data = data; - } + public record ComplexQuadrilateral1BoxedVoid(Void data) implements ComplexQuadrilateral1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ComplexQuadrilateral1BoxedBoolean extends ComplexQuadrilateral1Boxed { - public final boolean data; - private ComplexQuadrilateral1BoxedBoolean(boolean data) { - this.data = data; - } + public record ComplexQuadrilateral1BoxedBoolean(boolean data) implements ComplexQuadrilateral1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ComplexQuadrilateral1BoxedNumber extends ComplexQuadrilateral1Boxed { - public final Number data; - private ComplexQuadrilateral1BoxedNumber(Number data) { - this.data = data; - } + public record ComplexQuadrilateral1BoxedNumber(Number data) implements ComplexQuadrilateral1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ComplexQuadrilateral1BoxedString extends ComplexQuadrilateral1Boxed { - public final String data; - private ComplexQuadrilateral1BoxedString(String data) { - this.data = data; - } + public record ComplexQuadrilateral1BoxedString(String data) implements ComplexQuadrilateral1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ComplexQuadrilateral1BoxedList extends ComplexQuadrilateral1Boxed { - public final FrozenList<@Nullable Object> data; - private ComplexQuadrilateral1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record ComplexQuadrilateral1BoxedList(FrozenList<@Nullable Object> data) implements ComplexQuadrilateral1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ComplexQuadrilateral1BoxedMap extends ComplexQuadrilateral1Boxed { - public final FrozenMap<@Nullable Object> data; - private ComplexQuadrilateral1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record ComplexQuadrilateral1BoxedMap(FrozenMap<@Nullable Object> data) implements ComplexQuadrilateral1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ComplexQuadrilateral1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ComplexQuadrilateral1BoxedList>, MapSchemaValidator, ComplexQuadrilateral1BoxedMap> { + public static class ComplexQuadrilateral1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ComplexQuadrilateral1BoxedList>, MapSchemaValidator, ComplexQuadrilateral1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -467,11 +449,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -502,11 +484,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -585,5 +567,24 @@ public ComplexQuadrilateral1BoxedList validateAndBox(List arg, SchemaConfigur public ComplexQuadrilateral1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ComplexQuadrilateral1BoxedMap(validate(arg, configuration)); } + @Override + public ComplexQuadrilateral1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ComposedAnyOfDifferentTypesNoValidations.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ComposedAnyOfDifferentTypesNoValidations.java index 2cc4c08b50a..688e2a66912 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ComposedAnyOfDifferentTypesNoValidations.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ComposedAnyOfDifferentTypesNoValidations.java @@ -231,24 +231,20 @@ public Schema9ListBuilder add(Map item) { } - public static abstract sealed class Schema9Boxed permits Schema9BoxedList { - public abstract @Nullable Object data(); + public sealed interface Schema9Boxed permits Schema9BoxedList { + @Nullable Object getData(); } - public static final class Schema9BoxedList extends Schema9Boxed { - public final Schema9List data; - private Schema9BoxedList(Schema9List data) { - this.data = data; - } + public record Schema9BoxedList(Schema9List data) implements Schema9Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema9 extends JsonSchema implements ListSchemaValidator { + public static class Schema9 extends JsonSchema implements ListSchemaValidator { private static @Nullable Schema9 instance = null; protected Schema9() { @@ -272,11 +268,11 @@ public Schema9List getNewInstance(List arg, List pathToItem, PathToSc for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -313,6 +309,13 @@ public Schema9List validate(List arg, SchemaConfiguration configuration) thro public Schema9BoxedList validateAndBox(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema9BoxedList(validate(arg, configuration)); } + @Override + public Schema9Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class Schema10 extends NumberJsonSchema.NumberJsonSchema1 { @@ -381,78 +384,54 @@ public static Schema15 getInstance() { } - public static abstract sealed class ComposedAnyOfDifferentTypesNoValidations1Boxed permits ComposedAnyOfDifferentTypesNoValidations1BoxedVoid, ComposedAnyOfDifferentTypesNoValidations1BoxedBoolean, ComposedAnyOfDifferentTypesNoValidations1BoxedNumber, ComposedAnyOfDifferentTypesNoValidations1BoxedString, ComposedAnyOfDifferentTypesNoValidations1BoxedList, ComposedAnyOfDifferentTypesNoValidations1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface ComposedAnyOfDifferentTypesNoValidations1Boxed permits ComposedAnyOfDifferentTypesNoValidations1BoxedVoid, ComposedAnyOfDifferentTypesNoValidations1BoxedBoolean, ComposedAnyOfDifferentTypesNoValidations1BoxedNumber, ComposedAnyOfDifferentTypesNoValidations1BoxedString, ComposedAnyOfDifferentTypesNoValidations1BoxedList, ComposedAnyOfDifferentTypesNoValidations1BoxedMap { + @Nullable Object getData(); } - public static final class ComposedAnyOfDifferentTypesNoValidations1BoxedVoid extends ComposedAnyOfDifferentTypesNoValidations1Boxed { - public final Void data; - private ComposedAnyOfDifferentTypesNoValidations1BoxedVoid(Void data) { - this.data = data; - } + public record ComposedAnyOfDifferentTypesNoValidations1BoxedVoid(Void data) implements ComposedAnyOfDifferentTypesNoValidations1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ComposedAnyOfDifferentTypesNoValidations1BoxedBoolean extends ComposedAnyOfDifferentTypesNoValidations1Boxed { - public final boolean data; - private ComposedAnyOfDifferentTypesNoValidations1BoxedBoolean(boolean data) { - this.data = data; - } + public record ComposedAnyOfDifferentTypesNoValidations1BoxedBoolean(boolean data) implements ComposedAnyOfDifferentTypesNoValidations1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ComposedAnyOfDifferentTypesNoValidations1BoxedNumber extends ComposedAnyOfDifferentTypesNoValidations1Boxed { - public final Number data; - private ComposedAnyOfDifferentTypesNoValidations1BoxedNumber(Number data) { - this.data = data; - } + public record ComposedAnyOfDifferentTypesNoValidations1BoxedNumber(Number data) implements ComposedAnyOfDifferentTypesNoValidations1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ComposedAnyOfDifferentTypesNoValidations1BoxedString extends ComposedAnyOfDifferentTypesNoValidations1Boxed { - public final String data; - private ComposedAnyOfDifferentTypesNoValidations1BoxedString(String data) { - this.data = data; - } + public record ComposedAnyOfDifferentTypesNoValidations1BoxedString(String data) implements ComposedAnyOfDifferentTypesNoValidations1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ComposedAnyOfDifferentTypesNoValidations1BoxedList extends ComposedAnyOfDifferentTypesNoValidations1Boxed { - public final FrozenList<@Nullable Object> data; - private ComposedAnyOfDifferentTypesNoValidations1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record ComposedAnyOfDifferentTypesNoValidations1BoxedList(FrozenList<@Nullable Object> data) implements ComposedAnyOfDifferentTypesNoValidations1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ComposedAnyOfDifferentTypesNoValidations1BoxedMap extends ComposedAnyOfDifferentTypesNoValidations1Boxed { - public final FrozenMap<@Nullable Object> data; - private ComposedAnyOfDifferentTypesNoValidations1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record ComposedAnyOfDifferentTypesNoValidations1BoxedMap(FrozenMap<@Nullable Object> data) implements ComposedAnyOfDifferentTypesNoValidations1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ComposedAnyOfDifferentTypesNoValidations1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ComposedAnyOfDifferentTypesNoValidations1BoxedList>, MapSchemaValidator, ComposedAnyOfDifferentTypesNoValidations1BoxedMap> { + public static class ComposedAnyOfDifferentTypesNoValidations1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ComposedAnyOfDifferentTypesNoValidations1BoxedList>, MapSchemaValidator, ComposedAnyOfDifferentTypesNoValidations1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -574,11 +553,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -609,11 +588,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -692,5 +671,24 @@ public ComposedAnyOfDifferentTypesNoValidations1BoxedList validateAndBox(List public ComposedAnyOfDifferentTypesNoValidations1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ComposedAnyOfDifferentTypesNoValidations1BoxedMap(validate(arg, configuration)); } + @Override + public ComposedAnyOfDifferentTypesNoValidations1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ComposedArray.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ComposedArray.java index 44aab844c66..924341f499f 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ComposedArray.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ComposedArray.java @@ -107,24 +107,20 @@ public ComposedArrayListBuilder add(Map item) { } - public static abstract sealed class ComposedArray1Boxed permits ComposedArray1BoxedList { - public abstract @Nullable Object data(); + public sealed interface ComposedArray1Boxed permits ComposedArray1BoxedList { + @Nullable Object getData(); } - public static final class ComposedArray1BoxedList extends ComposedArray1Boxed { - public final ComposedArrayList data; - private ComposedArray1BoxedList(ComposedArrayList data) { - this.data = data; - } + public record ComposedArray1BoxedList(ComposedArrayList data) implements ComposedArray1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ComposedArray1 extends JsonSchema implements ListSchemaValidator { + public static class ComposedArray1 extends JsonSchema implements ListSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -154,11 +150,11 @@ public ComposedArrayList getNewInstance(List arg, List pathToItem, Pa for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -195,5 +191,12 @@ public ComposedArrayList validate(List arg, SchemaConfiguration configuration public ComposedArray1BoxedList validateAndBox(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ComposedArray1BoxedList(validate(arg, configuration)); } + @Override + public ComposedArray1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ComposedBool.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ComposedBool.java index c6df97b1ceb..ec600363510 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ComposedBool.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ComposedBool.java @@ -31,24 +31,20 @@ public static Schema0 getInstance() { } - public static abstract sealed class ComposedBool1Boxed permits ComposedBool1BoxedBoolean { - public abstract @Nullable Object data(); + public sealed interface ComposedBool1Boxed permits ComposedBool1BoxedBoolean { + @Nullable Object getData(); } - public static final class ComposedBool1BoxedBoolean extends ComposedBool1Boxed { - public final boolean data; - private ComposedBool1BoxedBoolean(boolean data) { - this.data = data; - } + public record ComposedBool1BoxedBoolean(boolean data) implements ComposedBool1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ComposedBool1 extends JsonSchema implements BooleanSchemaValidator { + public static class ComposedBool1 extends JsonSchema implements BooleanSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -104,5 +100,13 @@ public boolean validate(boolean arg, SchemaConfiguration configuration) throws V public ComposedBool1BoxedBoolean validateAndBox(boolean arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ComposedBool1BoxedBoolean(validate(arg, configuration)); } + @Override + public ComposedBool1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ComposedNone.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ComposedNone.java index e4bb45b6768..bee61f4d10f 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ComposedNone.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ComposedNone.java @@ -31,24 +31,20 @@ public static Schema0 getInstance() { } - public static abstract sealed class ComposedNone1Boxed permits ComposedNone1BoxedVoid { - public abstract @Nullable Object data(); + public sealed interface ComposedNone1Boxed permits ComposedNone1BoxedVoid { + @Nullable Object getData(); } - public static final class ComposedNone1BoxedVoid extends ComposedNone1Boxed { - public final Void data; - private ComposedNone1BoxedVoid(Void data) { - this.data = data; - } + public record ComposedNone1BoxedVoid(Void data) implements ComposedNone1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ComposedNone1 extends JsonSchema implements NullSchemaValidator { + public static class ComposedNone1 extends JsonSchema implements NullSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -102,5 +98,13 @@ public Void validate(Void arg, SchemaConfiguration configuration) throws Validat public ComposedNone1BoxedVoid validateAndBox(Void arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ComposedNone1BoxedVoid(validate(arg, configuration)); } + @Override + public ComposedNone1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ComposedNumber.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ComposedNumber.java index d3a7d9c807f..37c4b6c7c2c 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ComposedNumber.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ComposedNumber.java @@ -31,24 +31,20 @@ public static Schema0 getInstance() { } - public static abstract sealed class ComposedNumber1Boxed permits ComposedNumber1BoxedNumber { - public abstract @Nullable Object data(); + public sealed interface ComposedNumber1Boxed permits ComposedNumber1BoxedNumber { + @Nullable Object getData(); } - public static final class ComposedNumber1BoxedNumber extends ComposedNumber1Boxed { - public final Number data; - private ComposedNumber1BoxedNumber(Number data) { - this.data = data; - } + public record ComposedNumber1BoxedNumber(Number data) implements ComposedNumber1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ComposedNumber1 extends JsonSchema implements NumberSchemaValidator { + public static class ComposedNumber1 extends JsonSchema implements NumberSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -123,5 +119,12 @@ public double validate(double arg, SchemaConfiguration configuration) throws Val public ComposedNumber1BoxedNumber validateAndBox(Number arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ComposedNumber1BoxedNumber(validate(arg, configuration)); } + @Override + public ComposedNumber1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ComposedObject.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ComposedObject.java index e9f2e9ab7da..89afb88c828 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ComposedObject.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ComposedObject.java @@ -38,23 +38,19 @@ public static Schema0 getInstance() { } - public static abstract sealed class ComposedObject1Boxed permits ComposedObject1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface ComposedObject1Boxed permits ComposedObject1BoxedMap { + @Nullable Object getData(); } - public static final class ComposedObject1BoxedMap extends ComposedObject1Boxed { - public final FrozenMap<@Nullable Object> data; - private ComposedObject1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record ComposedObject1BoxedMap(FrozenMap<@Nullable Object> data) implements ComposedObject1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ComposedObject1 extends JsonSchema implements MapSchemaValidator, ComposedObject1BoxedMap> { + public static class ComposedObject1 extends JsonSchema implements MapSchemaValidator, ComposedObject1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -90,11 +86,11 @@ public static ComposedObject1 getInstance() { List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -131,6 +127,13 @@ public static ComposedObject1 getInstance() { public ComposedObject1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ComposedObject1BoxedMap(validate(arg, configuration)); } + @Override + public ComposedObject1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ComposedOneOfDifferentTypes.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ComposedOneOfDifferentTypes.java index 6a5e4a09c00..100e117efda 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ComposedOneOfDifferentTypes.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ComposedOneOfDifferentTypes.java @@ -61,23 +61,19 @@ public static Schema3 getInstance() { } - public static abstract sealed class Schema4Boxed permits Schema4BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Schema4Boxed permits Schema4BoxedMap { + @Nullable Object getData(); } - public static final class Schema4BoxedMap extends Schema4Boxed { - public final FrozenMap<@Nullable Object> data; - private Schema4BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record Schema4BoxedMap(FrozenMap<@Nullable Object> data) implements Schema4Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema4 extends JsonSchema implements MapSchemaValidator, Schema4BoxedMap> { + public static class Schema4 extends JsonSchema implements MapSchemaValidator, Schema4BoxedMap> { private static @Nullable Schema4 instance = null; protected Schema4() { @@ -106,11 +102,11 @@ public static Schema4 getInstance() { List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -147,6 +143,13 @@ public static Schema4 getInstance() { public Schema4BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema4BoxedMap(validate(arg, configuration)); } + @Override + public Schema4Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } @@ -233,24 +236,20 @@ public Schema5ListBuilder add(Map item) { } - public static abstract sealed class Schema5Boxed permits Schema5BoxedList { - public abstract @Nullable Object data(); + public sealed interface Schema5Boxed permits Schema5BoxedList { + @Nullable Object getData(); } - public static final class Schema5BoxedList extends Schema5Boxed { - public final Schema5List data; - private Schema5BoxedList(Schema5List data) { - this.data = data; - } + public record Schema5BoxedList(Schema5List data) implements Schema5Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema5 extends JsonSchema implements ListSchemaValidator { + public static class Schema5 extends JsonSchema implements ListSchemaValidator { private static @Nullable Schema5 instance = null; protected Schema5() { @@ -276,11 +275,11 @@ public Schema5List getNewInstance(List arg, List pathToItem, PathToSc for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -317,26 +316,29 @@ public Schema5List validate(List arg, SchemaConfiguration configuration) thro public Schema5BoxedList validateAndBox(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema5BoxedList(validate(arg, configuration)); } + @Override + public Schema5Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class Schema6Boxed permits Schema6BoxedString { - public abstract @Nullable Object data(); + public sealed interface Schema6Boxed permits Schema6BoxedString { + @Nullable Object getData(); } - public static final class Schema6BoxedString extends Schema6Boxed { - public final String data; - private Schema6BoxedString(String data) { - this.data = data; - } + public record Schema6BoxedString(String data) implements Schema6Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema6 extends JsonSchema implements StringSchemaValidator { + public static class Schema6 extends JsonSchema implements StringSchemaValidator { private static @Nullable Schema6 instance = null; protected Schema6() { @@ -387,80 +389,63 @@ public String validate(String arg, SchemaConfiguration configuration) throws Val public Schema6BoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema6BoxedString(validate(arg, configuration)); } + @Override + public Schema6Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class ComposedOneOfDifferentTypes1Boxed permits ComposedOneOfDifferentTypes1BoxedVoid, ComposedOneOfDifferentTypes1BoxedBoolean, ComposedOneOfDifferentTypes1BoxedNumber, ComposedOneOfDifferentTypes1BoxedString, ComposedOneOfDifferentTypes1BoxedList, ComposedOneOfDifferentTypes1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface ComposedOneOfDifferentTypes1Boxed permits ComposedOneOfDifferentTypes1BoxedVoid, ComposedOneOfDifferentTypes1BoxedBoolean, ComposedOneOfDifferentTypes1BoxedNumber, ComposedOneOfDifferentTypes1BoxedString, ComposedOneOfDifferentTypes1BoxedList, ComposedOneOfDifferentTypes1BoxedMap { + @Nullable Object getData(); } - public static final class ComposedOneOfDifferentTypes1BoxedVoid extends ComposedOneOfDifferentTypes1Boxed { - public final Void data; - private ComposedOneOfDifferentTypes1BoxedVoid(Void data) { - this.data = data; - } + public record ComposedOneOfDifferentTypes1BoxedVoid(Void data) implements ComposedOneOfDifferentTypes1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ComposedOneOfDifferentTypes1BoxedBoolean extends ComposedOneOfDifferentTypes1Boxed { - public final boolean data; - private ComposedOneOfDifferentTypes1BoxedBoolean(boolean data) { - this.data = data; - } + public record ComposedOneOfDifferentTypes1BoxedBoolean(boolean data) implements ComposedOneOfDifferentTypes1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ComposedOneOfDifferentTypes1BoxedNumber extends ComposedOneOfDifferentTypes1Boxed { - public final Number data; - private ComposedOneOfDifferentTypes1BoxedNumber(Number data) { - this.data = data; - } + public record ComposedOneOfDifferentTypes1BoxedNumber(Number data) implements ComposedOneOfDifferentTypes1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ComposedOneOfDifferentTypes1BoxedString extends ComposedOneOfDifferentTypes1Boxed { - public final String data; - private ComposedOneOfDifferentTypes1BoxedString(String data) { - this.data = data; - } + public record ComposedOneOfDifferentTypes1BoxedString(String data) implements ComposedOneOfDifferentTypes1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ComposedOneOfDifferentTypes1BoxedList extends ComposedOneOfDifferentTypes1Boxed { - public final FrozenList<@Nullable Object> data; - private ComposedOneOfDifferentTypes1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record ComposedOneOfDifferentTypes1BoxedList(FrozenList<@Nullable Object> data) implements ComposedOneOfDifferentTypes1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ComposedOneOfDifferentTypes1BoxedMap extends ComposedOneOfDifferentTypes1Boxed { - public final FrozenMap<@Nullable Object> data; - private ComposedOneOfDifferentTypes1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record ComposedOneOfDifferentTypes1BoxedMap(FrozenMap<@Nullable Object> data) implements ComposedOneOfDifferentTypes1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ComposedOneOfDifferentTypes1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ComposedOneOfDifferentTypes1BoxedList>, MapSchemaValidator, ComposedOneOfDifferentTypes1BoxedMap> { + public static class ComposedOneOfDifferentTypes1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ComposedOneOfDifferentTypes1BoxedList>, MapSchemaValidator, ComposedOneOfDifferentTypes1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -575,11 +560,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -610,11 +595,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -693,5 +678,24 @@ public ComposedOneOfDifferentTypes1BoxedList validateAndBox(List arg, SchemaC public ComposedOneOfDifferentTypes1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ComposedOneOfDifferentTypes1BoxedMap(validate(arg, configuration)); } + @Override + public ComposedOneOfDifferentTypes1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ComposedString.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ComposedString.java index 907ba037006..d4dc9ec084f 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ComposedString.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ComposedString.java @@ -31,24 +31,20 @@ public static Schema0 getInstance() { } - public static abstract sealed class ComposedString1Boxed permits ComposedString1BoxedString { - public abstract @Nullable Object data(); + public sealed interface ComposedString1Boxed permits ComposedString1BoxedString { + @Nullable Object getData(); } - public static final class ComposedString1BoxedString extends ComposedString1Boxed { - public final String data; - private ComposedString1BoxedString(String data) { - this.data = data; - } + public record ComposedString1BoxedString(String data) implements ComposedString1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ComposedString1 extends JsonSchema implements StringSchemaValidator { + public static class ComposedString1 extends JsonSchema implements StringSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -104,5 +100,12 @@ public String validate(String arg, SchemaConfiguration configuration) throws Val public ComposedString1BoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ComposedString1BoxedString(validate(arg, configuration)); } + @Override + public ComposedString1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Currency.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Currency.java index d779307a390..cc540c8c2f9 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Currency.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Currency.java @@ -35,24 +35,20 @@ public String value() { } - public static abstract sealed class Currency1Boxed permits Currency1BoxedString { - public abstract @Nullable Object data(); + public sealed interface Currency1Boxed permits Currency1BoxedString { + @Nullable Object getData(); } - public static final class Currency1BoxedString extends Currency1Boxed { - public final String data; - private Currency1BoxedString(String data) { - this.data = data; - } + public record Currency1BoxedString(String data) implements Currency1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Currency1 extends JsonSchema implements StringSchemaValidator, StringEnumValidator { + public static class Currency1 extends JsonSchema implements StringSchemaValidator, StringEnumValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -114,5 +110,12 @@ public String validate(StringCurrencyEnums arg,SchemaConfiguration configuration public Currency1BoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Currency1BoxedString(validate(arg, configuration)); } + @Override + public Currency1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/DanishPig.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/DanishPig.java index df6bf49c1cd..9b28b43a094 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/DanishPig.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/DanishPig.java @@ -44,24 +44,20 @@ public String value() { } - public static abstract sealed class ClassNameBoxed permits ClassNameBoxedString { - public abstract @Nullable Object data(); + public sealed interface ClassNameBoxed permits ClassNameBoxedString { + @Nullable Object getData(); } - public static final class ClassNameBoxedString extends ClassNameBoxed { - public final String data; - private ClassNameBoxedString(String data) { - this.data = data; - } + public record ClassNameBoxedString(String data) implements ClassNameBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ClassName extends JsonSchema implements StringSchemaValidator, StringEnumValidator { + public static class ClassName extends JsonSchema implements StringSchemaValidator, StringEnumValidator { private static @Nullable ClassName instance = null; protected ClassName() { @@ -116,6 +112,13 @@ public String validate(StringClassNameEnums arg,SchemaConfiguration configuratio public ClassNameBoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ClassNameBoxedString(validate(arg, configuration)); } + @Override + public ClassNameBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class DanishPigMap extends FrozenMap<@Nullable Object> { @@ -198,23 +201,19 @@ public DanishPigMap0Builder getBuilderAfterClassName(Map { + public static class DanishPig1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -253,11 +252,11 @@ public DanishPigMap getNewInstance(Map arg, List pathToItem, PathT List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -294,6 +293,13 @@ public DanishPigMap validate(Map arg, SchemaConfiguration configuration) t public DanishPig1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new DanishPig1BoxedMap(validate(arg, configuration)); } + @Override + public DanishPig1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateTimeTest.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateTimeTest.java index ba4e1ec581e..5d34b2dc7b9 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateTimeTest.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateTimeTest.java @@ -21,24 +21,20 @@ public class DateTimeTest { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class DateTimeTest1Boxed permits DateTimeTest1BoxedString { - public abstract @Nullable Object data(); + public sealed interface DateTimeTest1Boxed permits DateTimeTest1BoxedString { + @Nullable Object getData(); } - public static final class DateTimeTest1BoxedString extends DateTimeTest1Boxed { - public final String data; - private DateTimeTest1BoxedString(String data) { - this.data = data; - } + public record DateTimeTest1BoxedString(String data) implements DateTimeTest1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class DateTimeTest1 extends JsonSchema implements StringSchemaValidator, DefaultValueMethod { + public static class DateTimeTest1 extends JsonSchema implements StringSchemaValidator, DefaultValueMethod { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -99,5 +95,12 @@ public String defaultValue() { public DateTimeTest1BoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new DateTimeTest1BoxedString(validate(arg, configuration)); } + @Override + public DateTimeTest1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateTimeWithValidations.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateTimeWithValidations.java index e3622a68c6a..eadd8a76100 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateTimeWithValidations.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateTimeWithValidations.java @@ -21,24 +21,20 @@ public class DateTimeWithValidations { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class DateTimeWithValidations1Boxed permits DateTimeWithValidations1BoxedString { - public abstract @Nullable Object data(); + public sealed interface DateTimeWithValidations1Boxed permits DateTimeWithValidations1BoxedString { + @Nullable Object getData(); } - public static final class DateTimeWithValidations1BoxedString extends DateTimeWithValidations1Boxed { - public final String data; - private DateTimeWithValidations1BoxedString(String data) { - this.data = data; - } + public record DateTimeWithValidations1BoxedString(String data) implements DateTimeWithValidations1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class DateTimeWithValidations1 extends JsonSchema implements StringSchemaValidator { + public static class DateTimeWithValidations1 extends JsonSchema implements StringSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -95,5 +91,12 @@ public String validate(String arg, SchemaConfiguration configuration) throws Val public DateTimeWithValidations1BoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new DateTimeWithValidations1BoxedString(validate(arg, configuration)); } + @Override + public DateTimeWithValidations1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateWithValidations.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateWithValidations.java index 05f61c57f0d..c30a44c17dd 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateWithValidations.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/DateWithValidations.java @@ -21,24 +21,20 @@ public class DateWithValidations { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class DateWithValidations1Boxed permits DateWithValidations1BoxedString { - public abstract @Nullable Object data(); + public sealed interface DateWithValidations1Boxed permits DateWithValidations1BoxedString { + @Nullable Object getData(); } - public static final class DateWithValidations1BoxedString extends DateWithValidations1Boxed { - public final String data; - private DateWithValidations1BoxedString(String data) { - this.data = data; - } + public record DateWithValidations1BoxedString(String data) implements DateWithValidations1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class DateWithValidations1 extends JsonSchema implements StringSchemaValidator { + public static class DateWithValidations1 extends JsonSchema implements StringSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -95,5 +91,12 @@ public String validate(String arg, SchemaConfiguration configuration) throws Val public DateWithValidations1BoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new DateWithValidations1BoxedString(validate(arg, configuration)); } + @Override + public DateWithValidations1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Dog.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Dog.java index 523dd5c2661..4732a7167ce 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Dog.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Dog.java @@ -115,23 +115,19 @@ public Schema1MapBuilder getBuilderAfterAdditionalProperty(Map { + public static class Schema1 extends JsonSchema implements MapSchemaValidator { private static @Nullable Schema1 instance = null; protected Schema1() { @@ -161,11 +157,11 @@ public Schema1Map getNewInstance(Map arg, List pathToItem, PathToS List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -202,81 +198,64 @@ public Schema1Map validate(Map arg, SchemaConfiguration configuration) thr public Schema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema1BoxedMap(validate(arg, configuration)); } + @Override + public Schema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class Dog1Boxed permits Dog1BoxedVoid, Dog1BoxedBoolean, Dog1BoxedNumber, Dog1BoxedString, Dog1BoxedList, Dog1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Dog1Boxed permits Dog1BoxedVoid, Dog1BoxedBoolean, Dog1BoxedNumber, Dog1BoxedString, Dog1BoxedList, Dog1BoxedMap { + @Nullable Object getData(); } - public static final class Dog1BoxedVoid extends Dog1Boxed { - public final Void data; - private Dog1BoxedVoid(Void data) { - this.data = data; - } + public record Dog1BoxedVoid(Void data) implements Dog1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Dog1BoxedBoolean extends Dog1Boxed { - public final boolean data; - private Dog1BoxedBoolean(boolean data) { - this.data = data; - } + public record Dog1BoxedBoolean(boolean data) implements Dog1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Dog1BoxedNumber extends Dog1Boxed { - public final Number data; - private Dog1BoxedNumber(Number data) { - this.data = data; - } + public record Dog1BoxedNumber(Number data) implements Dog1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Dog1BoxedString extends Dog1Boxed { - public final String data; - private Dog1BoxedString(String data) { - this.data = data; - } + public record Dog1BoxedString(String data) implements Dog1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Dog1BoxedList extends Dog1Boxed { - public final FrozenList<@Nullable Object> data; - private Dog1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Dog1BoxedList(FrozenList<@Nullable Object> data) implements Dog1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Dog1BoxedMap extends Dog1Boxed { - public final FrozenMap<@Nullable Object> data; - private Dog1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record Dog1BoxedMap(FrozenMap<@Nullable Object> data) implements Dog1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Dog1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Dog1BoxedList>, MapSchemaValidator, Dog1BoxedMap> { + public static class Dog1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Dog1BoxedList>, MapSchemaValidator, Dog1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -384,11 +363,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -419,11 +398,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -502,5 +481,24 @@ public Dog1BoxedList validateAndBox(List arg, SchemaConfiguration configurati public Dog1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Dog1BoxedMap(validate(arg, configuration)); } + @Override + public Dog1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Drawing.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Drawing.java index 42d7cd95c8f..9af29e766a2 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Drawing.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Drawing.java @@ -102,24 +102,20 @@ public ShapesListBuilder add(Map item) { } - public static abstract sealed class ShapesBoxed permits ShapesBoxedList { - public abstract @Nullable Object data(); + public sealed interface ShapesBoxed permits ShapesBoxedList { + @Nullable Object getData(); } - public static final class ShapesBoxedList extends ShapesBoxed { - public final ShapesList data; - private ShapesBoxedList(ShapesList data) { - this.data = data; - } + public record ShapesBoxedList(ShapesList data) implements ShapesBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Shapes extends JsonSchema implements ListSchemaValidator { + public static class Shapes extends JsonSchema implements ListSchemaValidator { private static @Nullable Shapes instance = null; protected Shapes() { @@ -143,11 +139,11 @@ public ShapesList getNewInstance(List arg, List pathToItem, PathToSch for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Object)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -187,6 +183,13 @@ public ShapesList validate(List arg, SchemaConfiguration configuration) throw public ShapesBoxedList validateAndBox(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ShapesBoxedList(validate(arg, configuration)); } + @Override + public ShapesBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class DrawingMap extends FrozenMap<@Nullable Object> { @@ -549,23 +552,19 @@ public DrawingMapBuilder getBuilderAfterAdditionalProperty(Map { + public static class Drawing1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -605,11 +604,11 @@ public DrawingMap getNewInstance(Map arg, List pathToItem, PathToS List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -646,6 +645,13 @@ public DrawingMap validate(Map arg, SchemaConfiguration configuration) thr public Drawing1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Drawing1BoxedMap(validate(arg, configuration)); } + @Override + public Drawing1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumArrays.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumArrays.java index e25ac5d579c..1cb148337ee 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumArrays.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumArrays.java @@ -47,24 +47,20 @@ public String value() { } - public static abstract sealed class JustSymbolBoxed permits JustSymbolBoxedString { - public abstract @Nullable Object data(); + public sealed interface JustSymbolBoxed permits JustSymbolBoxedString { + @Nullable Object getData(); } - public static final class JustSymbolBoxedString extends JustSymbolBoxed { - public final String data; - private JustSymbolBoxedString(String data) { - this.data = data; - } + public record JustSymbolBoxedString(String data) implements JustSymbolBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class JustSymbol extends JsonSchema implements StringSchemaValidator, StringEnumValidator { + public static class JustSymbol extends JsonSchema implements StringSchemaValidator, StringEnumValidator { private static @Nullable JustSymbol instance = null; protected JustSymbol() { @@ -120,6 +116,13 @@ public String validate(StringJustSymbolEnums arg,SchemaConfiguration configurati public JustSymbolBoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new JustSymbolBoxedString(validate(arg, configuration)); } + @Override + public JustSymbolBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public enum StringItemsEnums implements StringValueMethod { FISH("fish"), @@ -135,24 +138,20 @@ public String value() { } - public static abstract sealed class ItemsBoxed permits ItemsBoxedString { - public abstract @Nullable Object data(); + public sealed interface ItemsBoxed permits ItemsBoxedString { + @Nullable Object getData(); } - public static final class ItemsBoxedString extends ItemsBoxed { - public final String data; - private ItemsBoxedString(String data) { - this.data = data; - } + public record ItemsBoxedString(String data) implements ItemsBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Items extends JsonSchema implements StringSchemaValidator, StringEnumValidator { + public static class Items extends JsonSchema implements StringSchemaValidator, StringEnumValidator { private static @Nullable Items instance = null; protected Items() { @@ -208,6 +207,13 @@ public String validate(StringItemsEnums arg,SchemaConfiguration configuration) t public ItemsBoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ItemsBoxedString(validate(arg, configuration)); } + @Override + public ItemsBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class ArrayEnumList extends FrozenList { @@ -247,24 +253,20 @@ public List build() { } - public static abstract sealed class ArrayEnumBoxed permits ArrayEnumBoxedList { - public abstract @Nullable Object data(); + public sealed interface ArrayEnumBoxed permits ArrayEnumBoxedList { + @Nullable Object getData(); } - public static final class ArrayEnumBoxedList extends ArrayEnumBoxed { - public final ArrayEnumList data; - private ArrayEnumBoxedList(ArrayEnumList data) { - this.data = data; - } + public record ArrayEnumBoxedList(ArrayEnumList data) implements ArrayEnumBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ArrayEnum extends JsonSchema implements ListSchemaValidator { + public static class ArrayEnum extends JsonSchema implements ListSchemaValidator { private static @Nullable ArrayEnum instance = null; protected ArrayEnum() { @@ -288,11 +290,11 @@ public ArrayEnumList getNewInstance(List arg, List pathToItem, PathTo for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof String)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -332,6 +334,13 @@ public ArrayEnumList validate(List arg, SchemaConfiguration configuration) th public ArrayEnumBoxedList validateAndBox(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ArrayEnumBoxedList(validate(arg, configuration)); } + @Override + public ArrayEnumBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class EnumArraysMap extends FrozenMap<@Nullable Object> { @@ -432,23 +441,19 @@ public EnumArraysMapBuilder getBuilderAfterAdditionalProperty(Map { + public static class EnumArrays1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -485,11 +490,11 @@ public EnumArraysMap getNewInstance(Map arg, List pathToItem, Path List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -526,6 +531,13 @@ public EnumArraysMap validate(Map arg, SchemaConfiguration configuration) public EnumArrays1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new EnumArrays1BoxedMap(validate(arg, configuration)); } + @Override + public EnumArrays1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumClass.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumClass.java index 6029de2bde9..bea73702102 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumClass.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumClass.java @@ -39,24 +39,20 @@ public String value() { } - public static abstract sealed class EnumClass1Boxed permits EnumClass1BoxedString { - public abstract @Nullable Object data(); + public sealed interface EnumClass1Boxed permits EnumClass1BoxedString { + @Nullable Object getData(); } - public static final class EnumClass1BoxedString extends EnumClass1Boxed { - public final String data; - private EnumClass1BoxedString(String data) { - this.data = data; - } + public record EnumClass1BoxedString(String data) implements EnumClass1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class EnumClass1 extends JsonSchema implements StringSchemaValidator, StringEnumValidator, DefaultValueMethod { + public static class EnumClass1 extends JsonSchema implements StringSchemaValidator, StringEnumValidator, DefaultValueMethod { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -128,5 +124,12 @@ public String defaultValue() { public EnumClass1BoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new EnumClass1BoxedString(validate(arg, configuration)); } + @Override + public EnumClass1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumTest.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumTest.java index a1ff312d2a3..b0ab185439e 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumTest.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/EnumTest.java @@ -56,24 +56,20 @@ public String value() { } - public static abstract sealed class EnumStringBoxed permits EnumStringBoxedString { - public abstract @Nullable Object data(); + public sealed interface EnumStringBoxed permits EnumStringBoxedString { + @Nullable Object getData(); } - public static final class EnumStringBoxedString extends EnumStringBoxed { - public final String data; - private EnumStringBoxedString(String data) { - this.data = data; - } + public record EnumStringBoxedString(String data) implements EnumStringBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class EnumString extends JsonSchema implements StringSchemaValidator, StringEnumValidator { + public static class EnumString extends JsonSchema implements StringSchemaValidator, StringEnumValidator { private static @Nullable EnumString instance = null; protected EnumString() { @@ -130,6 +126,13 @@ public String validate(StringEnumStringEnums arg,SchemaConfiguration configurati public EnumStringBoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new EnumStringBoxedString(validate(arg, configuration)); } + @Override + public EnumStringBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public enum StringEnumStringRequiredEnums implements StringValueMethod { UPPER("UPPER"), @@ -146,24 +149,20 @@ public String value() { } - public static abstract sealed class EnumStringRequiredBoxed permits EnumStringRequiredBoxedString { - public abstract @Nullable Object data(); + public sealed interface EnumStringRequiredBoxed permits EnumStringRequiredBoxedString { + @Nullable Object getData(); } - public static final class EnumStringRequiredBoxedString extends EnumStringRequiredBoxed { - public final String data; - private EnumStringRequiredBoxedString(String data) { - this.data = data; - } + public record EnumStringRequiredBoxedString(String data) implements EnumStringRequiredBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class EnumStringRequired extends JsonSchema implements StringSchemaValidator, StringEnumValidator { + public static class EnumStringRequired extends JsonSchema implements StringSchemaValidator, StringEnumValidator { private static @Nullable EnumStringRequired instance = null; protected EnumStringRequired() { @@ -220,6 +219,13 @@ public String validate(StringEnumStringRequiredEnums arg,SchemaConfiguration con public EnumStringRequiredBoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new EnumStringRequiredBoxedString(validate(arg, configuration)); } + @Override + public EnumStringRequiredBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public enum IntegerEnumIntegerEnums implements IntegerValueMethod { POSITIVE_1(1), @@ -274,24 +280,20 @@ public double value() { } - public static abstract sealed class EnumIntegerBoxed permits EnumIntegerBoxedNumber { - public abstract @Nullable Object data(); + public sealed interface EnumIntegerBoxed permits EnumIntegerBoxedNumber { + @Nullable Object getData(); } - public static final class EnumIntegerBoxedNumber extends EnumIntegerBoxed { - public final Number data; - private EnumIntegerBoxedNumber(Number data) { - this.data = data; - } + public record EnumIntegerBoxedNumber(Number data) implements EnumIntegerBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class EnumInteger extends JsonSchema implements IntegerEnumValidator, LongEnumValidator, FloatEnumValidator, DoubleEnumValidator, NumberSchemaValidator { + public static class EnumInteger extends JsonSchema implements IntegerEnumValidator, LongEnumValidator, FloatEnumValidator, DoubleEnumValidator, NumberSchemaValidator { private static @Nullable EnumInteger instance = null; protected EnumInteger() { @@ -374,6 +376,13 @@ public double validate(DoubleEnumIntegerEnums arg,SchemaConfiguration configurat public EnumIntegerBoxedNumber validateAndBox(Number arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new EnumIntegerBoxedNumber(validate(arg, configuration)); } + @Override + public EnumIntegerBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public enum DoubleEnumNumberEnums implements DoubleValueMethod { POSITIVE_1_PT_1(1.1d), @@ -402,24 +411,20 @@ public float value() { } - public static abstract sealed class EnumNumberBoxed permits EnumNumberBoxedNumber { - public abstract @Nullable Object data(); + public sealed interface EnumNumberBoxed permits EnumNumberBoxedNumber { + @Nullable Object getData(); } - public static final class EnumNumberBoxedNumber extends EnumNumberBoxed { - public final Number data; - private EnumNumberBoxedNumber(Number data) { - this.data = data; - } + public record EnumNumberBoxedNumber(Number data) implements EnumNumberBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class EnumNumber extends JsonSchema implements FloatEnumValidator, DoubleEnumValidator, NumberSchemaValidator { + public static class EnumNumber extends JsonSchema implements FloatEnumValidator, DoubleEnumValidator, NumberSchemaValidator { private static @Nullable EnumNumber instance = null; protected EnumNumber() { @@ -487,6 +492,13 @@ public double validate(DoubleEnumNumberEnums arg,SchemaConfiguration configurati public EnumNumberBoxedNumber validateAndBox(Number arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new EnumNumberBoxedNumber(validate(arg, configuration)); } + @Override + public EnumNumberBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class EnumTestMap extends FrozenMap<@Nullable Object> { @@ -994,23 +1006,19 @@ public EnumTestMap0Builder getBuilderAfterEnumStringRequired(Map { + public static class EnumTest1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -1057,11 +1065,11 @@ public EnumTestMap getNewInstance(Map arg, List pathToItem, PathTo List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -1098,6 +1106,13 @@ public EnumTestMap validate(Map arg, SchemaConfiguration configuration) th public EnumTest1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new EnumTest1BoxedMap(validate(arg, configuration)); } + @Override + public EnumTest1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/EquilateralTriangle.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/EquilateralTriangle.java index 1a96759cff4..511d329cb47 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/EquilateralTriangle.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/EquilateralTriangle.java @@ -52,24 +52,20 @@ public String value() { } - public static abstract sealed class TriangleTypeBoxed permits TriangleTypeBoxedString { - public abstract @Nullable Object data(); + public sealed interface TriangleTypeBoxed permits TriangleTypeBoxedString { + @Nullable Object getData(); } - public static final class TriangleTypeBoxedString extends TriangleTypeBoxed { - public final String data; - private TriangleTypeBoxedString(String data) { - this.data = data; - } + public record TriangleTypeBoxedString(String data) implements TriangleTypeBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class TriangleType extends JsonSchema implements StringSchemaValidator, StringEnumValidator { + public static class TriangleType extends JsonSchema implements StringSchemaValidator, StringEnumValidator { private static @Nullable TriangleType instance = null; protected TriangleType() { @@ -124,6 +120,13 @@ public String validate(StringTriangleTypeEnums arg,SchemaConfiguration configura public TriangleTypeBoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new TriangleTypeBoxedString(validate(arg, configuration)); } + @Override + public TriangleTypeBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class Schema1Map extends FrozenMap<@Nullable Object> { @@ -198,23 +201,19 @@ public Schema1MapBuilder getBuilderAfterAdditionalProperty(Map { + public static class Schema1 extends JsonSchema implements MapSchemaValidator { private static @Nullable Schema1 instance = null; protected Schema1() { @@ -244,11 +243,11 @@ public Schema1Map getNewInstance(Map arg, List pathToItem, PathToS List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -285,81 +284,64 @@ public Schema1Map validate(Map arg, SchemaConfiguration configuration) thr public Schema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema1BoxedMap(validate(arg, configuration)); } + @Override + public Schema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class EquilateralTriangle1Boxed permits EquilateralTriangle1BoxedVoid, EquilateralTriangle1BoxedBoolean, EquilateralTriangle1BoxedNumber, EquilateralTriangle1BoxedString, EquilateralTriangle1BoxedList, EquilateralTriangle1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface EquilateralTriangle1Boxed permits EquilateralTriangle1BoxedVoid, EquilateralTriangle1BoxedBoolean, EquilateralTriangle1BoxedNumber, EquilateralTriangle1BoxedString, EquilateralTriangle1BoxedList, EquilateralTriangle1BoxedMap { + @Nullable Object getData(); } - public static final class EquilateralTriangle1BoxedVoid extends EquilateralTriangle1Boxed { - public final Void data; - private EquilateralTriangle1BoxedVoid(Void data) { - this.data = data; - } + public record EquilateralTriangle1BoxedVoid(Void data) implements EquilateralTriangle1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class EquilateralTriangle1BoxedBoolean extends EquilateralTriangle1Boxed { - public final boolean data; - private EquilateralTriangle1BoxedBoolean(boolean data) { - this.data = data; - } + public record EquilateralTriangle1BoxedBoolean(boolean data) implements EquilateralTriangle1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class EquilateralTriangle1BoxedNumber extends EquilateralTriangle1Boxed { - public final Number data; - private EquilateralTriangle1BoxedNumber(Number data) { - this.data = data; - } + public record EquilateralTriangle1BoxedNumber(Number data) implements EquilateralTriangle1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class EquilateralTriangle1BoxedString extends EquilateralTriangle1Boxed { - public final String data; - private EquilateralTriangle1BoxedString(String data) { - this.data = data; - } + public record EquilateralTriangle1BoxedString(String data) implements EquilateralTriangle1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class EquilateralTriangle1BoxedList extends EquilateralTriangle1Boxed { - public final FrozenList<@Nullable Object> data; - private EquilateralTriangle1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record EquilateralTriangle1BoxedList(FrozenList<@Nullable Object> data) implements EquilateralTriangle1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class EquilateralTriangle1BoxedMap extends EquilateralTriangle1Boxed { - public final FrozenMap<@Nullable Object> data; - private EquilateralTriangle1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record EquilateralTriangle1BoxedMap(FrozenMap<@Nullable Object> data) implements EquilateralTriangle1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class EquilateralTriangle1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, EquilateralTriangle1BoxedList>, MapSchemaValidator, EquilateralTriangle1BoxedMap> { + public static class EquilateralTriangle1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, EquilateralTriangle1BoxedList>, MapSchemaValidator, EquilateralTriangle1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -467,11 +449,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -502,11 +484,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -585,5 +567,24 @@ public EquilateralTriangle1BoxedList validateAndBox(List arg, SchemaConfigura public EquilateralTriangle1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new EquilateralTriangle1BoxedMap(validate(arg, configuration)); } + @Override + public EquilateralTriangle1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/File.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/File.java index 3a3c733a70c..4b2eb51f91e 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/File.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/File.java @@ -106,23 +106,19 @@ public FileMapBuilder getBuilderAfterAdditionalProperty(Map { + public static class File1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -160,11 +156,11 @@ public FileMap getNewInstance(Map arg, List pathToItem, PathToSche List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -201,6 +197,13 @@ public FileMap validate(Map arg, SchemaConfiguration configuration) throws public File1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new File1BoxedMap(validate(arg, configuration)); } + @Override + public File1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/FileSchemaTestClass.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/FileSchemaTestClass.java index 35144a1bc0c..cc4f912d614 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/FileSchemaTestClass.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/FileSchemaTestClass.java @@ -62,24 +62,20 @@ public FilesListBuilder add(Map item) { } - public static abstract sealed class FilesBoxed permits FilesBoxedList { - public abstract @Nullable Object data(); + public sealed interface FilesBoxed permits FilesBoxedList { + @Nullable Object getData(); } - public static final class FilesBoxedList extends FilesBoxed { - public final FilesList data; - private FilesBoxedList(FilesList data) { - this.data = data; - } + public record FilesBoxedList(FilesList data) implements FilesBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Files extends JsonSchema implements ListSchemaValidator { + public static class Files extends JsonSchema implements ListSchemaValidator { private static @Nullable Files instance = null; protected Files() { @@ -103,11 +99,11 @@ public FilesList getNewInstance(List arg, List pathToItem, PathToSche for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof File.FileMap)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -147,6 +143,13 @@ public FilesList validate(List arg, SchemaConfiguration configuration) throws public FilesBoxedList validateAndBox(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new FilesBoxedList(validate(arg, configuration)); } + @Override + public FilesBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class FileSchemaTestClassMap extends FrozenMap<@Nullable Object> { @@ -241,23 +244,19 @@ public FileSchemaTestClassMapBuilder getBuilderAfterAdditionalProperty(Map { + public static class FileSchemaTestClass1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -294,11 +293,11 @@ public FileSchemaTestClassMap getNewInstance(Map arg, List pathToI List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -335,6 +334,13 @@ public FileSchemaTestClassMap validate(Map arg, SchemaConfiguration config public FileSchemaTestClass1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new FileSchemaTestClass1BoxedMap(validate(arg, configuration)); } + @Override + public FileSchemaTestClass1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Foo.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Foo.java index e5c3faa9d6f..a14f1cb5451 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Foo.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Foo.java @@ -94,23 +94,19 @@ public FooMapBuilder getBuilderAfterAdditionalProperty(Map { + public static class Foo1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -146,11 +142,11 @@ public FooMap getNewInstance(Map arg, List pathToItem, PathToSchem List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -187,6 +183,13 @@ public FooMap validate(Map arg, SchemaConfiguration configuration) throws public Foo1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Foo1BoxedMap(validate(arg, configuration)); } + @Override + public Foo1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/FormatTest.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/FormatTest.java index 8e57d44e2d2..ed61c57c7c5 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/FormatTest.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/FormatTest.java @@ -44,24 +44,20 @@ public class FormatTest { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class IntegerSchemaBoxed permits IntegerSchemaBoxedNumber { - public abstract @Nullable Object data(); + public sealed interface IntegerSchemaBoxed permits IntegerSchemaBoxedNumber { + @Nullable Object getData(); } - public static final class IntegerSchemaBoxedNumber extends IntegerSchemaBoxed { - public final Number data; - private IntegerSchemaBoxedNumber(Number data) { - this.data = data; - } + public record IntegerSchemaBoxedNumber(Number data) implements IntegerSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class IntegerSchema extends JsonSchema implements NumberSchemaValidator { + public static class IntegerSchema extends JsonSchema implements NumberSchemaValidator { private static @Nullable IntegerSchema instance = null; protected IntegerSchema() { @@ -131,6 +127,13 @@ public double validate(double arg, SchemaConfiguration configuration) throws Val public IntegerSchemaBoxedNumber validateAndBox(Number arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new IntegerSchemaBoxedNumber(validate(arg, configuration)); } + @Override + public IntegerSchemaBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class Int32 extends Int32JsonSchema.Int32JsonSchema1 { @@ -144,24 +147,20 @@ public static Int32 getInstance() { } - public static abstract sealed class Int32withValidationsBoxed permits Int32withValidationsBoxedNumber { - public abstract @Nullable Object data(); + public sealed interface Int32withValidationsBoxed permits Int32withValidationsBoxedNumber { + @Nullable Object getData(); } - public static final class Int32withValidationsBoxedNumber extends Int32withValidationsBoxed { - public final Number data; - private Int32withValidationsBoxedNumber(Number data) { - this.data = data; - } + public record Int32withValidationsBoxedNumber(Number data) implements Int32withValidationsBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Int32withValidations extends JsonSchema implements NumberSchemaValidator { + public static class Int32withValidations extends JsonSchema implements NumberSchemaValidator { private static @Nullable Int32withValidations instance = null; protected Int32withValidations() { @@ -222,6 +221,13 @@ public float validate(float arg, SchemaConfiguration configuration) throws Valid public Int32withValidationsBoxedNumber validateAndBox(Number arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Int32withValidationsBoxedNumber(validate(arg, configuration)); } + @Override + public Int32withValidationsBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class Int64 extends Int64JsonSchema.Int64JsonSchema1 { @@ -235,24 +241,20 @@ public static Int64 getInstance() { } - public static abstract sealed class NumberSchemaBoxed permits NumberSchemaBoxedNumber { - public abstract @Nullable Object data(); + public sealed interface NumberSchemaBoxed permits NumberSchemaBoxedNumber { + @Nullable Object getData(); } - public static final class NumberSchemaBoxedNumber extends NumberSchemaBoxed { - public final Number data; - private NumberSchemaBoxedNumber(Number data) { - this.data = data; - } + public record NumberSchemaBoxedNumber(Number data) implements NumberSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class NumberSchema extends JsonSchema implements NumberSchemaValidator { + public static class NumberSchema extends JsonSchema implements NumberSchemaValidator { private static @Nullable NumberSchema instance = null; protected NumberSchema() { @@ -321,26 +323,29 @@ public double validate(double arg, SchemaConfiguration configuration) throws Val public NumberSchemaBoxedNumber validateAndBox(Number arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new NumberSchemaBoxedNumber(validate(arg, configuration)); } + @Override + public NumberSchemaBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class FloatSchemaBoxed permits FloatSchemaBoxedNumber { - public abstract @Nullable Object data(); + public sealed interface FloatSchemaBoxed permits FloatSchemaBoxedNumber { + @Nullable Object getData(); } - public static final class FloatSchemaBoxedNumber extends FloatSchemaBoxed { - public final Number data; - private FloatSchemaBoxedNumber(Number data) { - this.data = data; - } + public record FloatSchemaBoxedNumber(Number data) implements FloatSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class FloatSchema extends JsonSchema implements NumberSchemaValidator { + public static class FloatSchema extends JsonSchema implements NumberSchemaValidator { private static @Nullable FloatSchema instance = null; protected FloatSchema() { @@ -396,6 +401,13 @@ public float validate(float arg, SchemaConfiguration configuration) throws Valid public FloatSchemaBoxedNumber validateAndBox(Number arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new FloatSchemaBoxedNumber(validate(arg, configuration)); } + @Override + public FloatSchemaBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class Float32 extends FloatJsonSchema.FloatJsonSchema1 { @@ -409,24 +421,20 @@ public static Float32 getInstance() { } - public static abstract sealed class DoubleSchemaBoxed permits DoubleSchemaBoxedNumber { - public abstract @Nullable Object data(); + public sealed interface DoubleSchemaBoxed permits DoubleSchemaBoxedNumber { + @Nullable Object getData(); } - public static final class DoubleSchemaBoxedNumber extends DoubleSchemaBoxed { - public final Number data; - private DoubleSchemaBoxedNumber(Number data) { - this.data = data; - } + public record DoubleSchemaBoxedNumber(Number data) implements DoubleSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class DoubleSchema extends JsonSchema implements NumberSchemaValidator { + public static class DoubleSchema extends JsonSchema implements NumberSchemaValidator { private static @Nullable DoubleSchema instance = null; protected DoubleSchema() { @@ -482,6 +490,13 @@ public double validate(double arg, SchemaConfiguration configuration) throws Val public DoubleSchemaBoxedNumber validateAndBox(Number arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new DoubleSchemaBoxedNumber(validate(arg, configuration)); } + @Override + public DoubleSchemaBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class Float64 extends DoubleJsonSchema.DoubleJsonSchema1 { @@ -553,24 +568,20 @@ public List build() { } - public static abstract sealed class ArrayWithUniqueItemsBoxed permits ArrayWithUniqueItemsBoxedList { - public abstract @Nullable Object data(); + public sealed interface ArrayWithUniqueItemsBoxed permits ArrayWithUniqueItemsBoxedList { + @Nullable Object getData(); } - public static final class ArrayWithUniqueItemsBoxedList extends ArrayWithUniqueItemsBoxed { - public final ArrayWithUniqueItemsList data; - private ArrayWithUniqueItemsBoxedList(ArrayWithUniqueItemsList data) { - this.data = data; - } + public record ArrayWithUniqueItemsBoxedList(ArrayWithUniqueItemsList data) implements ArrayWithUniqueItemsBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ArrayWithUniqueItems extends JsonSchema implements ListSchemaValidator { + public static class ArrayWithUniqueItems extends JsonSchema implements ListSchemaValidator { private static @Nullable ArrayWithUniqueItems instance = null; protected ArrayWithUniqueItems() { @@ -595,11 +606,11 @@ public ArrayWithUniqueItemsList getNewInstance(List arg, List pathToI for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Number)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -639,26 +650,29 @@ public ArrayWithUniqueItemsList validate(List arg, SchemaConfiguration config public ArrayWithUniqueItemsBoxedList validateAndBox(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ArrayWithUniqueItemsBoxedList(validate(arg, configuration)); } + @Override + public ArrayWithUniqueItemsBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class StringSchemaBoxed permits StringSchemaBoxedString { - public abstract @Nullable Object data(); + public sealed interface StringSchemaBoxed permits StringSchemaBoxedString { + @Nullable Object getData(); } - public static final class StringSchemaBoxedString extends StringSchemaBoxed { - public final String data; - private StringSchemaBoxedString(String data) { - this.data = data; - } + public record StringSchemaBoxedString(String data) implements StringSchemaBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class StringSchema extends JsonSchema implements StringSchemaValidator { + public static class StringSchema extends JsonSchema implements StringSchemaValidator { private static @Nullable StringSchema instance = null; protected StringSchema() { @@ -709,6 +723,13 @@ public String validate(String arg, SchemaConfiguration configuration) throws Val public StringSchemaBoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new StringSchemaBoxedString(validate(arg, configuration)); } + @Override + public StringSchemaBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class ByteSchema extends StringJsonSchema.StringJsonSchema1 { @@ -778,24 +799,20 @@ public static UuidNoExample getInstance() { } - public static abstract sealed class PasswordBoxed permits PasswordBoxedString { - public abstract @Nullable Object data(); + public sealed interface PasswordBoxed permits PasswordBoxedString { + @Nullable Object getData(); } - public static final class PasswordBoxedString extends PasswordBoxed { - public final String data; - private PasswordBoxedString(String data) { - this.data = data; - } + public record PasswordBoxedString(String data) implements PasswordBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Password extends JsonSchema implements StringSchemaValidator { + public static class Password extends JsonSchema implements StringSchemaValidator { private static @Nullable Password instance = null; protected Password() { @@ -845,26 +862,29 @@ public String validate(String arg, SchemaConfiguration configuration) throws Val public PasswordBoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new PasswordBoxedString(validate(arg, configuration)); } + @Override + public PasswordBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class PatternWithDigitsBoxed permits PatternWithDigitsBoxedString { - public abstract @Nullable Object data(); + public sealed interface PatternWithDigitsBoxed permits PatternWithDigitsBoxedString { + @Nullable Object getData(); } - public static final class PatternWithDigitsBoxedString extends PatternWithDigitsBoxed { - public final String data; - private PatternWithDigitsBoxedString(String data) { - this.data = data; - } + public record PatternWithDigitsBoxedString(String data) implements PatternWithDigitsBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class PatternWithDigits extends JsonSchema implements StringSchemaValidator { + public static class PatternWithDigits extends JsonSchema implements StringSchemaValidator { private static @Nullable PatternWithDigits instance = null; protected PatternWithDigits() { @@ -914,26 +934,29 @@ public String validate(String arg, SchemaConfiguration configuration) throws Val public PatternWithDigitsBoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new PatternWithDigitsBoxedString(validate(arg, configuration)); } + @Override + public PatternWithDigitsBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class PatternWithDigitsAndDelimiterBoxed permits PatternWithDigitsAndDelimiterBoxedString { - public abstract @Nullable Object data(); + public sealed interface PatternWithDigitsAndDelimiterBoxed permits PatternWithDigitsAndDelimiterBoxedString { + @Nullable Object getData(); } - public static final class PatternWithDigitsAndDelimiterBoxedString extends PatternWithDigitsAndDelimiterBoxed { - public final String data; - private PatternWithDigitsAndDelimiterBoxedString(String data) { - this.data = data; - } + public record PatternWithDigitsAndDelimiterBoxedString(String data) implements PatternWithDigitsAndDelimiterBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class PatternWithDigitsAndDelimiter extends JsonSchema implements StringSchemaValidator { + public static class PatternWithDigitsAndDelimiter extends JsonSchema implements StringSchemaValidator { private static @Nullable PatternWithDigitsAndDelimiter instance = null; protected PatternWithDigitsAndDelimiter() { @@ -984,6 +1007,13 @@ public String validate(String arg, SchemaConfiguration configuration) throws Val public PatternWithDigitsAndDelimiterBoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new PatternWithDigitsAndDelimiterBoxedString(validate(arg, configuration)); } + @Override + public PatternWithDigitsAndDelimiterBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class NoneProp extends NullJsonSchema.NullJsonSchema1 { @@ -1882,23 +1912,19 @@ public FormatTestMap1110Builder getBuilderAfterPassword(Map { + public static class FormatTest1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -1960,11 +1986,11 @@ public FormatTestMap getNewInstance(Map arg, List pathToItem, Path List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -2001,6 +2027,13 @@ public FormatTestMap validate(Map arg, SchemaConfiguration configuration) public FormatTest1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new FormatTest1BoxedMap(validate(arg, configuration)); } + @Override + public FormatTest1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/FromSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/FromSchema.java index 252fa6ebcb9..5692157bda6 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/FromSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/FromSchema.java @@ -162,23 +162,19 @@ public FromSchemaMapBuilder getBuilderAfterAdditionalProperty(Map { + public static class FromSchema1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -215,11 +211,11 @@ public FromSchemaMap getNewInstance(Map arg, List pathToItem, Path List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -256,6 +252,13 @@ public FromSchemaMap validate(Map arg, SchemaConfiguration configuration) public FromSchema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new FromSchema1BoxedMap(validate(arg, configuration)); } + @Override + public FromSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Fruit.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Fruit.java index 78ef7427b9b..275d87f5474 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Fruit.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Fruit.java @@ -115,78 +115,54 @@ public FruitMapBuilder getBuilderAfterAdditionalProperty(Map data; - private Fruit1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Fruit1BoxedList(FrozenList<@Nullable Object> data) implements Fruit1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Fruit1BoxedMap extends Fruit1Boxed { - public final FruitMap data; - private Fruit1BoxedMap(FruitMap data) { - this.data = data; - } + public record Fruit1BoxedMap(FruitMap data) implements Fruit1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Fruit1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Fruit1BoxedList>, MapSchemaValidator { + public static class Fruit1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Fruit1BoxedList>, MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -297,11 +273,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -332,11 +308,11 @@ public FruitMap getNewInstance(Map arg, List pathToItem, PathToSch List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -415,5 +391,24 @@ public Fruit1BoxedList validateAndBox(List arg, SchemaConfiguration configura public Fruit1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Fruit1BoxedMap(validate(arg, configuration)); } + @Override + public Fruit1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/FruitReq.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/FruitReq.java index 0893dd2b246..e5d97263a06 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/FruitReq.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/FruitReq.java @@ -47,78 +47,54 @@ public static Schema0 getInstance() { } - public static abstract sealed class FruitReq1Boxed permits FruitReq1BoxedVoid, FruitReq1BoxedBoolean, FruitReq1BoxedNumber, FruitReq1BoxedString, FruitReq1BoxedList, FruitReq1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface FruitReq1Boxed permits FruitReq1BoxedVoid, FruitReq1BoxedBoolean, FruitReq1BoxedNumber, FruitReq1BoxedString, FruitReq1BoxedList, FruitReq1BoxedMap { + @Nullable Object getData(); } - public static final class FruitReq1BoxedVoid extends FruitReq1Boxed { - public final Void data; - private FruitReq1BoxedVoid(Void data) { - this.data = data; - } + public record FruitReq1BoxedVoid(Void data) implements FruitReq1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class FruitReq1BoxedBoolean extends FruitReq1Boxed { - public final boolean data; - private FruitReq1BoxedBoolean(boolean data) { - this.data = data; - } + public record FruitReq1BoxedBoolean(boolean data) implements FruitReq1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class FruitReq1BoxedNumber extends FruitReq1Boxed { - public final Number data; - private FruitReq1BoxedNumber(Number data) { - this.data = data; - } + public record FruitReq1BoxedNumber(Number data) implements FruitReq1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class FruitReq1BoxedString extends FruitReq1Boxed { - public final String data; - private FruitReq1BoxedString(String data) { - this.data = data; - } + public record FruitReq1BoxedString(String data) implements FruitReq1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class FruitReq1BoxedList extends FruitReq1Boxed { - public final FrozenList<@Nullable Object> data; - private FruitReq1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record FruitReq1BoxedList(FrozenList<@Nullable Object> data) implements FruitReq1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class FruitReq1BoxedMap extends FruitReq1Boxed { - public final FrozenMap<@Nullable Object> data; - private FruitReq1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record FruitReq1BoxedMap(FrozenMap<@Nullable Object> data) implements FruitReq1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class FruitReq1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, FruitReq1BoxedList>, MapSchemaValidator, FruitReq1BoxedMap> { + public static class FruitReq1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, FruitReq1BoxedList>, MapSchemaValidator, FruitReq1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -227,11 +203,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -262,11 +238,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -345,5 +321,24 @@ public FruitReq1BoxedList validateAndBox(List arg, SchemaConfiguration config public FruitReq1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new FruitReq1BoxedMap(validate(arg, configuration)); } + @Override + public FruitReq1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/GmFruit.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/GmFruit.java index 3ea54cff594..cb3f4599c5b 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/GmFruit.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/GmFruit.java @@ -115,78 +115,54 @@ public GmFruitMapBuilder getBuilderAfterAdditionalProperty(Map data; - private GmFruit1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record GmFruit1BoxedList(FrozenList<@Nullable Object> data) implements GmFruit1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class GmFruit1BoxedMap extends GmFruit1Boxed { - public final GmFruitMap data; - private GmFruit1BoxedMap(GmFruitMap data) { - this.data = data; - } + public record GmFruit1BoxedMap(GmFruitMap data) implements GmFruit1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class GmFruit1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, GmFruit1BoxedList>, MapSchemaValidator { + public static class GmFruit1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, GmFruit1BoxedList>, MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -297,11 +273,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -332,11 +308,11 @@ public GmFruitMap getNewInstance(Map arg, List pathToItem, PathToS List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -415,5 +391,24 @@ public GmFruit1BoxedList validateAndBox(List arg, SchemaConfiguration configu public GmFruit1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new GmFruit1BoxedMap(validate(arg, configuration)); } + @Override + public GmFruit1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/GrandparentAnimal.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/GrandparentAnimal.java index c66c837aa4f..4734ddc65a3 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/GrandparentAnimal.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/GrandparentAnimal.java @@ -114,23 +114,19 @@ public GrandparentAnimalMap0Builder getBuilderAfterPetType(Map { + public static class GrandparentAnimal1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -169,11 +165,11 @@ public GrandparentAnimalMap getNewInstance(Map arg, List pathToIte List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -210,6 +206,13 @@ public GrandparentAnimalMap validate(Map arg, SchemaConfiguration configur public GrandparentAnimal1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new GrandparentAnimal1BoxedMap(validate(arg, configuration)); } + @Override + public GrandparentAnimal1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/HasOnlyReadOnly.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/HasOnlyReadOnly.java index e877949225f..4687de450d9 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/HasOnlyReadOnly.java @@ -143,23 +143,19 @@ public HasOnlyReadOnlyMapBuilder getBuilderAfterAdditionalProperty(Map { + public static class HasOnlyReadOnly1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -196,11 +192,11 @@ public HasOnlyReadOnlyMap getNewInstance(Map arg, List pathToItem, List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -237,6 +233,13 @@ public HasOnlyReadOnlyMap validate(Map arg, SchemaConfiguration configurat public HasOnlyReadOnly1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new HasOnlyReadOnly1BoxedMap(validate(arg, configuration)); } + @Override + public HasOnlyReadOnly1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/HealthCheckResult.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/HealthCheckResult.java index 64089428167..a499676d162 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/HealthCheckResult.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/HealthCheckResult.java @@ -30,35 +30,27 @@ public class HealthCheckResult { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class NullableMessageBoxed permits NullableMessageBoxedVoid, NullableMessageBoxedString { - public abstract @Nullable Object data(); + public sealed interface NullableMessageBoxed permits NullableMessageBoxedVoid, NullableMessageBoxedString { + @Nullable Object getData(); } - public static final class NullableMessageBoxedVoid extends NullableMessageBoxed { - public final Void data; - private NullableMessageBoxedVoid(Void data) { - this.data = data; - } + public record NullableMessageBoxedVoid(Void data) implements NullableMessageBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NullableMessageBoxedString extends NullableMessageBoxed { - public final String data; - private NullableMessageBoxedString(String data) { - this.data = data; - } + public record NullableMessageBoxedString(String data) implements NullableMessageBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class NullableMessage extends JsonSchema implements NullSchemaValidator, StringSchemaValidator { + public static class NullableMessage extends JsonSchema implements NullSchemaValidator, StringSchemaValidator { private static @Nullable NullableMessage instance = null; protected NullableMessage() { @@ -125,6 +117,16 @@ public NullableMessageBoxedVoid validateAndBox(Void arg, SchemaConfiguration con public NullableMessageBoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new NullableMessageBoxedString(validate(arg, configuration)); } + @Override + public NullableMessageBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class HealthCheckResultMap extends FrozenMap<@Nullable Object> { @@ -199,23 +201,19 @@ public HealthCheckResultMapBuilder getBuilderAfterAdditionalProperty(Map { + public static class HealthCheckResult1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -253,11 +251,11 @@ public HealthCheckResultMap getNewInstance(Map arg, List pathToIte List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -294,6 +292,13 @@ public HealthCheckResultMap validate(Map arg, SchemaConfiguration configur public HealthCheckResult1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new HealthCheckResult1BoxedMap(validate(arg, configuration)); } + @Override + public HealthCheckResult1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/IntegerEnum.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/IntegerEnum.java index a9da619526d..b20ad0b018a 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/IntegerEnum.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/IntegerEnum.java @@ -85,24 +85,20 @@ public double value() { } - public static abstract sealed class IntegerEnum1Boxed permits IntegerEnum1BoxedNumber { - public abstract @Nullable Object data(); + public sealed interface IntegerEnum1Boxed permits IntegerEnum1BoxedNumber { + @Nullable Object getData(); } - public static final class IntegerEnum1BoxedNumber extends IntegerEnum1Boxed { - public final Number data; - private IntegerEnum1BoxedNumber(Number data) { - this.data = data; - } + public record IntegerEnum1BoxedNumber(Number data) implements IntegerEnum1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class IntegerEnum1 extends JsonSchema implements IntegerEnumValidator, LongEnumValidator, FloatEnumValidator, DoubleEnumValidator, NumberSchemaValidator { + public static class IntegerEnum1 extends JsonSchema implements IntegerEnumValidator, LongEnumValidator, FloatEnumValidator, DoubleEnumValidator, NumberSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -200,5 +196,12 @@ public double validate(DoubleIntegerEnumEnums arg,SchemaConfiguration configurat public IntegerEnum1BoxedNumber validateAndBox(Number arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new IntegerEnum1BoxedNumber(validate(arg, configuration)); } + @Override + public IntegerEnum1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/IntegerEnumBig.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/IntegerEnumBig.java index 0d63312cba1..74085a9268a 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/IntegerEnumBig.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/IntegerEnumBig.java @@ -85,24 +85,20 @@ public double value() { } - public static abstract sealed class IntegerEnumBig1Boxed permits IntegerEnumBig1BoxedNumber { - public abstract @Nullable Object data(); + public sealed interface IntegerEnumBig1Boxed permits IntegerEnumBig1BoxedNumber { + @Nullable Object getData(); } - public static final class IntegerEnumBig1BoxedNumber extends IntegerEnumBig1Boxed { - public final Number data; - private IntegerEnumBig1BoxedNumber(Number data) { - this.data = data; - } + public record IntegerEnumBig1BoxedNumber(Number data) implements IntegerEnumBig1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class IntegerEnumBig1 extends JsonSchema implements IntegerEnumValidator, LongEnumValidator, FloatEnumValidator, DoubleEnumValidator, NumberSchemaValidator { + public static class IntegerEnumBig1 extends JsonSchema implements IntegerEnumValidator, LongEnumValidator, FloatEnumValidator, DoubleEnumValidator, NumberSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -200,5 +196,12 @@ public double validate(DoubleIntegerEnumBigEnums arg,SchemaConfiguration configu public IntegerEnumBig1BoxedNumber validateAndBox(Number arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new IntegerEnumBig1BoxedNumber(validate(arg, configuration)); } + @Override + public IntegerEnumBig1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/IntegerEnumOneValue.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/IntegerEnumOneValue.java index 921f9caddc6..3157279dfbf 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/IntegerEnumOneValue.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/IntegerEnumOneValue.java @@ -77,24 +77,20 @@ public double value() { } - public static abstract sealed class IntegerEnumOneValue1Boxed permits IntegerEnumOneValue1BoxedNumber { - public abstract @Nullable Object data(); + public sealed interface IntegerEnumOneValue1Boxed permits IntegerEnumOneValue1BoxedNumber { + @Nullable Object getData(); } - public static final class IntegerEnumOneValue1BoxedNumber extends IntegerEnumOneValue1Boxed { - public final Number data; - private IntegerEnumOneValue1BoxedNumber(Number data) { - this.data = data; - } + public record IntegerEnumOneValue1BoxedNumber(Number data) implements IntegerEnumOneValue1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class IntegerEnumOneValue1 extends JsonSchema implements IntegerEnumValidator, LongEnumValidator, FloatEnumValidator, DoubleEnumValidator, NumberSchemaValidator { + public static class IntegerEnumOneValue1 extends JsonSchema implements IntegerEnumValidator, LongEnumValidator, FloatEnumValidator, DoubleEnumValidator, NumberSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -190,5 +186,12 @@ public double validate(DoubleIntegerEnumOneValueEnums arg,SchemaConfiguration co public IntegerEnumOneValue1BoxedNumber validateAndBox(Number arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new IntegerEnumOneValue1BoxedNumber(validate(arg, configuration)); } + @Override + public IntegerEnumOneValue1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/IntegerEnumWithDefaultValue.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/IntegerEnumWithDefaultValue.java index b6476996ef5..a4afc589221 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/IntegerEnumWithDefaultValue.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/IntegerEnumWithDefaultValue.java @@ -86,24 +86,20 @@ public double value() { } - public static abstract sealed class IntegerEnumWithDefaultValue1Boxed permits IntegerEnumWithDefaultValue1BoxedNumber { - public abstract @Nullable Object data(); + public sealed interface IntegerEnumWithDefaultValue1Boxed permits IntegerEnumWithDefaultValue1BoxedNumber { + @Nullable Object getData(); } - public static final class IntegerEnumWithDefaultValue1BoxedNumber extends IntegerEnumWithDefaultValue1Boxed { - public final Number data; - private IntegerEnumWithDefaultValue1BoxedNumber(Number data) { - this.data = data; - } + public record IntegerEnumWithDefaultValue1BoxedNumber(Number data) implements IntegerEnumWithDefaultValue1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class IntegerEnumWithDefaultValue1 extends JsonSchema implements IntegerEnumValidator, LongEnumValidator, FloatEnumValidator, DoubleEnumValidator, NumberSchemaValidator { + public static class IntegerEnumWithDefaultValue1 extends JsonSchema implements IntegerEnumValidator, LongEnumValidator, FloatEnumValidator, DoubleEnumValidator, NumberSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -202,5 +198,12 @@ public double validate(DoubleIntegerEnumWithDefaultValueEnums arg,SchemaConfigur public IntegerEnumWithDefaultValue1BoxedNumber validateAndBox(Number arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new IntegerEnumWithDefaultValue1BoxedNumber(validate(arg, configuration)); } + @Override + public IntegerEnumWithDefaultValue1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/IntegerMax10.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/IntegerMax10.java index 8da93b9a6c7..aca58126d3d 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/IntegerMax10.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/IntegerMax10.java @@ -19,24 +19,20 @@ public class IntegerMax10 { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class IntegerMax101Boxed permits IntegerMax101BoxedNumber { - public abstract @Nullable Object data(); + public sealed interface IntegerMax101Boxed permits IntegerMax101BoxedNumber { + @Nullable Object getData(); } - public static final class IntegerMax101BoxedNumber extends IntegerMax101Boxed { - public final Number data; - private IntegerMax101BoxedNumber(Number data) { - this.data = data; - } + public record IntegerMax101BoxedNumber(Number data) implements IntegerMax101Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class IntegerMax101 extends JsonSchema implements NumberSchemaValidator { + public static class IntegerMax101 extends JsonSchema implements NumberSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -110,5 +106,12 @@ public double validate(double arg, SchemaConfiguration configuration) throws Val public IntegerMax101BoxedNumber validateAndBox(Number arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new IntegerMax101BoxedNumber(validate(arg, configuration)); } + @Override + public IntegerMax101Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/IntegerMin15.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/IntegerMin15.java index 2e6b19713f9..40f8b80b761 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/IntegerMin15.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/IntegerMin15.java @@ -19,24 +19,20 @@ public class IntegerMin15 { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class IntegerMin151Boxed permits IntegerMin151BoxedNumber { - public abstract @Nullable Object data(); + public sealed interface IntegerMin151Boxed permits IntegerMin151BoxedNumber { + @Nullable Object getData(); } - public static final class IntegerMin151BoxedNumber extends IntegerMin151Boxed { - public final Number data; - private IntegerMin151BoxedNumber(Number data) { - this.data = data; - } + public record IntegerMin151BoxedNumber(Number data) implements IntegerMin151Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class IntegerMin151 extends JsonSchema implements NumberSchemaValidator { + public static class IntegerMin151 extends JsonSchema implements NumberSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -110,5 +106,12 @@ public double validate(double arg, SchemaConfiguration configuration) throws Val public IntegerMin151BoxedNumber validateAndBox(Number arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new IntegerMin151BoxedNumber(validate(arg, configuration)); } + @Override + public IntegerMin151Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/IsoscelesTriangle.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/IsoscelesTriangle.java index 3b4db491554..57a6f72619c 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/IsoscelesTriangle.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/IsoscelesTriangle.java @@ -52,24 +52,20 @@ public String value() { } - public static abstract sealed class TriangleTypeBoxed permits TriangleTypeBoxedString { - public abstract @Nullable Object data(); + public sealed interface TriangleTypeBoxed permits TriangleTypeBoxedString { + @Nullable Object getData(); } - public static final class TriangleTypeBoxedString extends TriangleTypeBoxed { - public final String data; - private TriangleTypeBoxedString(String data) { - this.data = data; - } + public record TriangleTypeBoxedString(String data) implements TriangleTypeBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class TriangleType extends JsonSchema implements StringSchemaValidator, StringEnumValidator { + public static class TriangleType extends JsonSchema implements StringSchemaValidator, StringEnumValidator { private static @Nullable TriangleType instance = null; protected TriangleType() { @@ -124,6 +120,13 @@ public String validate(StringTriangleTypeEnums arg,SchemaConfiguration configura public TriangleTypeBoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new TriangleTypeBoxedString(validate(arg, configuration)); } + @Override + public TriangleTypeBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class Schema1Map extends FrozenMap<@Nullable Object> { @@ -198,23 +201,19 @@ public Schema1MapBuilder getBuilderAfterAdditionalProperty(Map { + public static class Schema1 extends JsonSchema implements MapSchemaValidator { private static @Nullable Schema1 instance = null; protected Schema1() { @@ -244,11 +243,11 @@ public Schema1Map getNewInstance(Map arg, List pathToItem, PathToS List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -285,81 +284,64 @@ public Schema1Map validate(Map arg, SchemaConfiguration configuration) thr public Schema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema1BoxedMap(validate(arg, configuration)); } + @Override + public Schema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class IsoscelesTriangle1Boxed permits IsoscelesTriangle1BoxedVoid, IsoscelesTriangle1BoxedBoolean, IsoscelesTriangle1BoxedNumber, IsoscelesTriangle1BoxedString, IsoscelesTriangle1BoxedList, IsoscelesTriangle1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface IsoscelesTriangle1Boxed permits IsoscelesTriangle1BoxedVoid, IsoscelesTriangle1BoxedBoolean, IsoscelesTriangle1BoxedNumber, IsoscelesTriangle1BoxedString, IsoscelesTriangle1BoxedList, IsoscelesTriangle1BoxedMap { + @Nullable Object getData(); } - public static final class IsoscelesTriangle1BoxedVoid extends IsoscelesTriangle1Boxed { - public final Void data; - private IsoscelesTriangle1BoxedVoid(Void data) { - this.data = data; - } + public record IsoscelesTriangle1BoxedVoid(Void data) implements IsoscelesTriangle1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IsoscelesTriangle1BoxedBoolean extends IsoscelesTriangle1Boxed { - public final boolean data; - private IsoscelesTriangle1BoxedBoolean(boolean data) { - this.data = data; - } + public record IsoscelesTriangle1BoxedBoolean(boolean data) implements IsoscelesTriangle1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IsoscelesTriangle1BoxedNumber extends IsoscelesTriangle1Boxed { - public final Number data; - private IsoscelesTriangle1BoxedNumber(Number data) { - this.data = data; - } + public record IsoscelesTriangle1BoxedNumber(Number data) implements IsoscelesTriangle1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IsoscelesTriangle1BoxedString extends IsoscelesTriangle1Boxed { - public final String data; - private IsoscelesTriangle1BoxedString(String data) { - this.data = data; - } + public record IsoscelesTriangle1BoxedString(String data) implements IsoscelesTriangle1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IsoscelesTriangle1BoxedList extends IsoscelesTriangle1Boxed { - public final FrozenList<@Nullable Object> data; - private IsoscelesTriangle1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record IsoscelesTriangle1BoxedList(FrozenList<@Nullable Object> data) implements IsoscelesTriangle1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IsoscelesTriangle1BoxedMap extends IsoscelesTriangle1Boxed { - public final FrozenMap<@Nullable Object> data; - private IsoscelesTriangle1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record IsoscelesTriangle1BoxedMap(FrozenMap<@Nullable Object> data) implements IsoscelesTriangle1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class IsoscelesTriangle1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, IsoscelesTriangle1BoxedList>, MapSchemaValidator, IsoscelesTriangle1BoxedMap> { + public static class IsoscelesTriangle1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, IsoscelesTriangle1BoxedList>, MapSchemaValidator, IsoscelesTriangle1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -467,11 +449,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -502,11 +484,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -585,5 +567,24 @@ public IsoscelesTriangle1BoxedList validateAndBox(List arg, SchemaConfigurati public IsoscelesTriangle1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new IsoscelesTriangle1BoxedMap(validate(arg, configuration)); } + @Override + public IsoscelesTriangle1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Items.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Items.java index 524bdbba8cd..594b1fe65bc 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Items.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Items.java @@ -68,24 +68,20 @@ public ItemsListBuilder add(Map item) { } - public static abstract sealed class Items1Boxed permits Items1BoxedList { - public abstract @Nullable Object data(); + public sealed interface Items1Boxed permits Items1BoxedList { + @Nullable Object getData(); } - public static final class Items1BoxedList extends Items1Boxed { - public final ItemsList data; - private Items1BoxedList(ItemsList data) { - this.data = data; - } + public record Items1BoxedList(ItemsList data) implements Items1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Items1 extends JsonSchema implements ListSchemaValidator { + public static class Items1 extends JsonSchema implements ListSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -117,11 +113,11 @@ public ItemsList getNewInstance(List arg, List pathToItem, PathToSche for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof FrozenMap)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -161,5 +157,12 @@ public ItemsList validate(List arg, SchemaConfiguration configuration) throws public Items1BoxedList validateAndBox(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Items1BoxedList(validate(arg, configuration)); } + @Override + public Items1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/JSONPatchRequest.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/JSONPatchRequest.java index 23f30649b8a..6d33dabcc9a 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/JSONPatchRequest.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/JSONPatchRequest.java @@ -35,78 +35,54 @@ public class JSONPatchRequest { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class ItemsBoxed permits ItemsBoxedVoid, ItemsBoxedBoolean, ItemsBoxedNumber, ItemsBoxedString, ItemsBoxedList, ItemsBoxedMap { - public abstract @Nullable Object data(); + public sealed interface ItemsBoxed permits ItemsBoxedVoid, ItemsBoxedBoolean, ItemsBoxedNumber, ItemsBoxedString, ItemsBoxedList, ItemsBoxedMap { + @Nullable Object getData(); } - public static final class ItemsBoxedVoid extends ItemsBoxed { - public final Void data; - private ItemsBoxedVoid(Void data) { - this.data = data; - } + public record ItemsBoxedVoid(Void data) implements ItemsBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ItemsBoxedBoolean extends ItemsBoxed { - public final boolean data; - private ItemsBoxedBoolean(boolean data) { - this.data = data; - } + public record ItemsBoxedBoolean(boolean data) implements ItemsBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ItemsBoxedNumber extends ItemsBoxed { - public final Number data; - private ItemsBoxedNumber(Number data) { - this.data = data; - } + public record ItemsBoxedNumber(Number data) implements ItemsBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ItemsBoxedString extends ItemsBoxed { - public final String data; - private ItemsBoxedString(String data) { - this.data = data; - } + public record ItemsBoxedString(String data) implements ItemsBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ItemsBoxedList extends ItemsBoxed { - public final FrozenList<@Nullable Object> data; - private ItemsBoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record ItemsBoxedList(FrozenList<@Nullable Object> data) implements ItemsBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ItemsBoxedMap extends ItemsBoxed { - public final FrozenMap<@Nullable Object> data; - private ItemsBoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record ItemsBoxedMap(FrozenMap<@Nullable Object> data) implements ItemsBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Items extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ItemsBoxedList>, MapSchemaValidator, ItemsBoxedMap> { + public static class Items extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ItemsBoxedList>, MapSchemaValidator, ItemsBoxedMap> { private static @Nullable Items instance = null; protected Items() { @@ -209,11 +185,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -244,11 +220,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -327,6 +303,25 @@ public ItemsBoxedList validateAndBox(List arg, SchemaConfiguration configurat public ItemsBoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ItemsBoxedMap(validate(arg, configuration)); } + @Override + public ItemsBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class JSONPatchRequestList extends FrozenList<@Nullable Object> { @@ -401,24 +396,20 @@ public JSONPatchRequestListBuilder add(Map item) { } - public static abstract sealed class JSONPatchRequest1Boxed permits JSONPatchRequest1BoxedList { - public abstract @Nullable Object data(); + public sealed interface JSONPatchRequest1Boxed permits JSONPatchRequest1BoxedList { + @Nullable Object getData(); } - public static final class JSONPatchRequest1BoxedList extends JSONPatchRequest1Boxed { - public final JSONPatchRequestList data; - private JSONPatchRequest1BoxedList(JSONPatchRequestList data) { - this.data = data; - } + public record JSONPatchRequest1BoxedList(JSONPatchRequestList data) implements JSONPatchRequest1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class JSONPatchRequest1 extends JsonSchema implements ListSchemaValidator { + public static class JSONPatchRequest1 extends JsonSchema implements ListSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -448,11 +439,11 @@ public JSONPatchRequestList getNewInstance(List arg, List pathToItem, for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -489,5 +480,12 @@ public JSONPatchRequestList validate(List arg, SchemaConfiguration configurat public JSONPatchRequest1BoxedList validateAndBox(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new JSONPatchRequest1BoxedList(validate(arg, configuration)); } + @Override + public JSONPatchRequest1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/JSONPatchRequestAddReplaceTest.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/JSONPatchRequestAddReplaceTest.java index 76983d02e22..208f6dbb772 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/JSONPatchRequestAddReplaceTest.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/JSONPatchRequestAddReplaceTest.java @@ -82,24 +82,20 @@ public String value() { } - public static abstract sealed class OpBoxed permits OpBoxedString { - public abstract @Nullable Object data(); + public sealed interface OpBoxed permits OpBoxedString { + @Nullable Object getData(); } - public static final class OpBoxedString extends OpBoxed { - public final String data; - private OpBoxedString(String data) { - this.data = data; - } + public record OpBoxedString(String data) implements OpBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Op extends JsonSchema implements StringSchemaValidator, StringEnumValidator { + public static class Op extends JsonSchema implements StringSchemaValidator, StringEnumValidator { private static @Nullable Op instance = null; protected Op() { @@ -156,6 +152,13 @@ public String validate(StringOpEnums arg,SchemaConfiguration configuration) thro public OpBoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new OpBoxedString(validate(arg, configuration)); } + @Override + public OpBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class JSONPatchRequestAddReplaceTestMap extends FrozenMap<@Nullable Object> { @@ -405,23 +408,19 @@ public JSONPatchRequestAddReplaceTestMap110Builder getBuilderAfterValue(Map { + public static class JSONPatchRequestAddReplaceTest1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -465,11 +464,11 @@ public JSONPatchRequestAddReplaceTestMap getNewInstance(Map arg, List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -506,6 +505,13 @@ public JSONPatchRequestAddReplaceTestMap validate(Map arg, SchemaConfigura public JSONPatchRequestAddReplaceTest1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new JSONPatchRequestAddReplaceTest1BoxedMap(validate(arg, configuration)); } + @Override + public JSONPatchRequestAddReplaceTest1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/JSONPatchRequestMoveCopy.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/JSONPatchRequestMoveCopy.java index 9596af1cd46..756770311c5 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/JSONPatchRequestMoveCopy.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/JSONPatchRequestMoveCopy.java @@ -81,24 +81,20 @@ public String value() { } - public static abstract sealed class OpBoxed permits OpBoxedString { - public abstract @Nullable Object data(); + public sealed interface OpBoxed permits OpBoxedString { + @Nullable Object getData(); } - public static final class OpBoxedString extends OpBoxed { - public final String data; - private OpBoxedString(String data) { - this.data = data; - } + public record OpBoxedString(String data) implements OpBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Op extends JsonSchema implements StringSchemaValidator, StringEnumValidator { + public static class Op extends JsonSchema implements StringSchemaValidator, StringEnumValidator { private static @Nullable Op instance = null; protected Op() { @@ -154,6 +150,13 @@ public String validate(StringOpEnums arg,SchemaConfiguration configuration) thro public OpBoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new OpBoxedString(validate(arg, configuration)); } + @Override + public OpBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class JSONPatchRequestMoveCopyMap extends FrozenMap { @@ -351,23 +354,19 @@ public JSONPatchRequestMoveCopyMap110Builder getBuilderAfterPath(Map { + public static class JSONPatchRequestMoveCopy1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -411,11 +410,11 @@ public JSONPatchRequestMoveCopyMap getNewInstance(Map arg, List pa List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof String)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -455,6 +454,13 @@ public JSONPatchRequestMoveCopyMap validate(Map arg, SchemaConfiguration c public JSONPatchRequestMoveCopy1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new JSONPatchRequestMoveCopy1BoxedMap(validate(arg, configuration)); } + @Override + public JSONPatchRequestMoveCopy1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/JSONPatchRequestRemove.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/JSONPatchRequestRemove.java index 55580258ce1..e358e5e96d5 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/JSONPatchRequestRemove.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/JSONPatchRequestRemove.java @@ -69,24 +69,20 @@ public String value() { } - public static abstract sealed class OpBoxed permits OpBoxedString { - public abstract @Nullable Object data(); + public sealed interface OpBoxed permits OpBoxedString { + @Nullable Object getData(); } - public static final class OpBoxedString extends OpBoxed { - public final String data; - private OpBoxedString(String data) { - this.data = data; - } + public record OpBoxedString(String data) implements OpBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Op extends JsonSchema implements StringSchemaValidator, StringEnumValidator { + public static class Op extends JsonSchema implements StringSchemaValidator, StringEnumValidator { private static @Nullable Op instance = null; protected Op() { @@ -141,6 +137,13 @@ public String validate(StringOpEnums arg,SchemaConfiguration configuration) thro public OpBoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new OpBoxedString(validate(arg, configuration)); } + @Override + public OpBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class JSONPatchRequestRemoveMap extends FrozenMap { @@ -257,23 +260,19 @@ public JSONPatchRequestRemoveMap10Builder getBuilderAfterPath(Map { + public static class JSONPatchRequestRemove1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -315,11 +314,11 @@ public JSONPatchRequestRemoveMap getNewInstance(Map arg, List path List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof String)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -359,6 +358,13 @@ public JSONPatchRequestRemoveMap validate(Map arg, SchemaConfiguration con public JSONPatchRequestRemove1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new JSONPatchRequestRemove1BoxedMap(validate(arg, configuration)); } + @Override + public JSONPatchRequestRemove1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Mammal.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Mammal.java index 08c0e8dfd2f..4cd47033fbd 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Mammal.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Mammal.java @@ -35,78 +35,54 @@ public class Mammal { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class Mammal1Boxed permits Mammal1BoxedVoid, Mammal1BoxedBoolean, Mammal1BoxedNumber, Mammal1BoxedString, Mammal1BoxedList, Mammal1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Mammal1Boxed permits Mammal1BoxedVoid, Mammal1BoxedBoolean, Mammal1BoxedNumber, Mammal1BoxedString, Mammal1BoxedList, Mammal1BoxedMap { + @Nullable Object getData(); } - public static final class Mammal1BoxedVoid extends Mammal1Boxed { - public final Void data; - private Mammal1BoxedVoid(Void data) { - this.data = data; - } + public record Mammal1BoxedVoid(Void data) implements Mammal1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Mammal1BoxedBoolean extends Mammal1Boxed { - public final boolean data; - private Mammal1BoxedBoolean(boolean data) { - this.data = data; - } + public record Mammal1BoxedBoolean(boolean data) implements Mammal1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Mammal1BoxedNumber extends Mammal1Boxed { - public final Number data; - private Mammal1BoxedNumber(Number data) { - this.data = data; - } + public record Mammal1BoxedNumber(Number data) implements Mammal1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Mammal1BoxedString extends Mammal1Boxed { - public final String data; - private Mammal1BoxedString(String data) { - this.data = data; - } + public record Mammal1BoxedString(String data) implements Mammal1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Mammal1BoxedList extends Mammal1Boxed { - public final FrozenList<@Nullable Object> data; - private Mammal1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Mammal1BoxedList(FrozenList<@Nullable Object> data) implements Mammal1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Mammal1BoxedMap extends Mammal1Boxed { - public final FrozenMap<@Nullable Object> data; - private Mammal1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record Mammal1BoxedMap(FrozenMap<@Nullable Object> data) implements Mammal1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Mammal1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Mammal1BoxedList>, MapSchemaValidator, Mammal1BoxedMap> { + public static class Mammal1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Mammal1BoxedList>, MapSchemaValidator, Mammal1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -215,11 +191,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -250,11 +226,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -333,5 +309,24 @@ public Mammal1BoxedList validateAndBox(List arg, SchemaConfiguration configur public Mammal1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Mammal1BoxedMap(validate(arg, configuration)); } + @Override + public Mammal1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/MapTest.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/MapTest.java index 888642db4bb..b0e6e922553 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/MapTest.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/MapTest.java @@ -95,23 +95,19 @@ public AdditionalPropertiesMapBuilder1 getBuilderAfterAdditionalProperty(Map { + public static class AdditionalProperties extends JsonSchema implements MapSchemaValidator { private static @Nullable AdditionalProperties instance = null; protected AdditionalProperties() { @@ -139,11 +135,11 @@ public AdditionalPropertiesMap getNewInstance(Map arg, List pathTo List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof String)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -183,6 +179,13 @@ public AdditionalPropertiesMap validate(Map arg, SchemaConfiguration confi public AdditionalPropertiesBoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new AdditionalPropertiesBoxedMap(validate(arg, configuration)); } + @Override + public AdditionalPropertiesBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } @@ -235,23 +238,19 @@ public MapMapOfStringMapBuilder getBuilderAfterAdditionalProperty(Map { + public static class MapMapOfString extends JsonSchema implements MapSchemaValidator { private static @Nullable MapMapOfString instance = null; protected MapMapOfString() { @@ -279,11 +278,11 @@ public MapMapOfStringMap getNewInstance(Map arg, List pathToItem, List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof AdditionalPropertiesMap)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -323,6 +322,13 @@ public MapMapOfStringMap validate(Map arg, SchemaConfiguration configurati public MapMapOfStringBoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new MapMapOfStringBoxedMap(validate(arg, configuration)); } + @Override + public MapMapOfStringBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public enum StringAdditionalPropertiesEnums implements StringValueMethod { @@ -339,24 +345,20 @@ public String value() { } - public static abstract sealed class AdditionalProperties2Boxed permits AdditionalProperties2BoxedString { - public abstract @Nullable Object data(); + public sealed interface AdditionalProperties2Boxed permits AdditionalProperties2BoxedString { + @Nullable Object getData(); } - public static final class AdditionalProperties2BoxedString extends AdditionalProperties2Boxed { - public final String data; - private AdditionalProperties2BoxedString(String data) { - this.data = data; - } + public record AdditionalProperties2BoxedString(String data) implements AdditionalProperties2Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class AdditionalProperties2 extends JsonSchema implements StringSchemaValidator, StringEnumValidator { + public static class AdditionalProperties2 extends JsonSchema implements StringSchemaValidator, StringEnumValidator { private static @Nullable AdditionalProperties2 instance = null; protected AdditionalProperties2() { @@ -412,6 +414,13 @@ public String validate(StringAdditionalPropertiesEnums arg,SchemaConfiguration c public AdditionalProperties2BoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new AdditionalProperties2BoxedString(validate(arg, configuration)); } + @Override + public AdditionalProperties2Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class MapOfEnumStringMap extends FrozenMap { @@ -470,23 +479,19 @@ public MapOfEnumStringMapBuilder getBuilderAfterAdditionalProperty(Map { + public static class MapOfEnumString extends JsonSchema implements MapSchemaValidator { private static @Nullable MapOfEnumString instance = null; protected MapOfEnumString() { @@ -514,11 +519,11 @@ public MapOfEnumStringMap getNewInstance(Map arg, List pathToItem, List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof String)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -558,6 +563,13 @@ public MapOfEnumStringMap validate(Map arg, SchemaConfiguration configurat public MapOfEnumStringBoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new MapOfEnumStringBoxedMap(validate(arg, configuration)); } + @Override + public MapOfEnumStringBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } @@ -626,23 +638,19 @@ public DirectMapMapBuilder getBuilderAfterAdditionalProperty(Map { + public static class DirectMap extends JsonSchema implements MapSchemaValidator { private static @Nullable DirectMap instance = null; protected DirectMap() { @@ -670,11 +678,11 @@ public DirectMapMap getNewInstance(Map arg, List pathToItem, PathT List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Boolean)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -714,6 +722,13 @@ public DirectMapMap validate(Map arg, SchemaConfiguration configuration) t public DirectMapBoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new DirectMapBoxedMap(validate(arg, configuration)); } + @Override + public DirectMapBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } @@ -861,23 +876,19 @@ public MapTestMapBuilder getBuilderAfterAdditionalProperty(Map { + public static class MapTest1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -916,11 +927,11 @@ public MapTestMap getNewInstance(Map arg, List pathToItem, PathToS List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -957,6 +968,13 @@ public MapTestMap validate(Map arg, SchemaConfiguration configuration) thr public MapTest1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new MapTest1BoxedMap(validate(arg, configuration)); } + @Override + public MapTest1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/MixedPropertiesAndAdditionalPropertiesClass.java index 9a7528995ac..60737d39485 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/MixedPropertiesAndAdditionalPropertiesClass.java @@ -102,23 +102,19 @@ public MapMapBuilder getBuilderAfterAdditionalProperty(Map { + public static class MapSchema extends JsonSchema implements MapSchemaValidator { private static @Nullable MapSchema instance = null; protected MapSchema() { @@ -146,11 +142,11 @@ public MapMap getNewInstance(Map arg, List pathToItem, PathToSchem List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Animal.AnimalMap)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -190,6 +186,13 @@ public MapMap validate(Map arg, SchemaConfiguration configuration) throws public MapSchemaBoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new MapSchemaBoxedMap(validate(arg, configuration)); } + @Override + public MapSchemaBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } @@ -291,23 +294,19 @@ public MixedPropertiesAndAdditionalPropertiesClassMapBuilder getBuilderAfterAddi } - public static abstract sealed class MixedPropertiesAndAdditionalPropertiesClass1Boxed permits MixedPropertiesAndAdditionalPropertiesClass1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface MixedPropertiesAndAdditionalPropertiesClass1Boxed permits MixedPropertiesAndAdditionalPropertiesClass1BoxedMap { + @Nullable Object getData(); } - public static final class MixedPropertiesAndAdditionalPropertiesClass1BoxedMap extends MixedPropertiesAndAdditionalPropertiesClass1Boxed { - public final MixedPropertiesAndAdditionalPropertiesClassMap data; - private MixedPropertiesAndAdditionalPropertiesClass1BoxedMap(MixedPropertiesAndAdditionalPropertiesClassMap data) { - this.data = data; - } + public record MixedPropertiesAndAdditionalPropertiesClass1BoxedMap(MixedPropertiesAndAdditionalPropertiesClassMap data) implements MixedPropertiesAndAdditionalPropertiesClass1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class MixedPropertiesAndAdditionalPropertiesClass1 extends JsonSchema implements MapSchemaValidator { + public static class MixedPropertiesAndAdditionalPropertiesClass1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -345,11 +344,11 @@ public MixedPropertiesAndAdditionalPropertiesClassMap getNewInstance(Map a List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -386,6 +385,13 @@ public MixedPropertiesAndAdditionalPropertiesClassMap validate(Map arg, Sc public MixedPropertiesAndAdditionalPropertiesClass1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new MixedPropertiesAndAdditionalPropertiesClass1BoxedMap(validate(arg, configuration)); } + @Override + public MixedPropertiesAndAdditionalPropertiesClass1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Money.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Money.java index e6397a1e50c..646f92ae740 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Money.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Money.java @@ -171,23 +171,19 @@ public MoneyMap10Builder getBuilderAfterCurrency(Map i } - public static abstract sealed class Money1Boxed permits Money1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Money1Boxed permits Money1BoxedMap { + @Nullable Object getData(); } - public static final class Money1BoxedMap extends Money1Boxed { - public final MoneyMap data; - private Money1BoxedMap(MoneyMap data) { - this.data = data; - } + public record Money1BoxedMap(MoneyMap data) implements Money1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Money1 extends JsonSchema implements MapSchemaValidator { + public static class Money1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -229,11 +225,11 @@ public MoneyMap getNewInstance(Map arg, List pathToItem, PathToSch List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -270,6 +266,13 @@ public MoneyMap validate(Map arg, SchemaConfiguration configuration) throw public Money1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Money1BoxedMap(validate(arg, configuration)); } + @Override + public Money1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/MyObjectDto.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/MyObjectDto.java index 5ba3d1e3e41..b985e9350ac 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/MyObjectDto.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/MyObjectDto.java @@ -104,23 +104,19 @@ public MyObjectDtoMapBuilder getBuilderAfterId(Map instance) { } - public static abstract sealed class MyObjectDto1Boxed permits MyObjectDto1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface MyObjectDto1Boxed permits MyObjectDto1BoxedMap { + @Nullable Object getData(); } - public static final class MyObjectDto1BoxedMap extends MyObjectDto1Boxed { - public final MyObjectDtoMap data; - private MyObjectDto1BoxedMap(MyObjectDtoMap data) { - this.data = data; - } + public record MyObjectDto1BoxedMap(MyObjectDtoMap data) implements MyObjectDto1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class MyObjectDto1 extends JsonSchema implements MapSchemaValidator { + public static class MyObjectDto1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -157,11 +153,11 @@ public MyObjectDtoMap getNewInstance(Map arg, List pathToItem, Pat List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof String)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -201,6 +197,13 @@ public MyObjectDtoMap validate(Map arg, SchemaConfiguration configuration) public MyObjectDto1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new MyObjectDto1BoxedMap(validate(arg, configuration)); } + @Override + public MyObjectDto1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Name.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Name.java index 98a6d9148f8..081f87d53d9 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Name.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Name.java @@ -211,78 +211,54 @@ public NameMap0Builder getBuilderAfterName2(Map instan } - public static abstract sealed class Name1Boxed permits Name1BoxedVoid, Name1BoxedBoolean, Name1BoxedNumber, Name1BoxedString, Name1BoxedList, Name1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Name1Boxed permits Name1BoxedVoid, Name1BoxedBoolean, Name1BoxedNumber, Name1BoxedString, Name1BoxedList, Name1BoxedMap { + @Nullable Object getData(); } - public static final class Name1BoxedVoid extends Name1Boxed { - public final Void data; - private Name1BoxedVoid(Void data) { - this.data = data; - } + public record Name1BoxedVoid(Void data) implements Name1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Name1BoxedBoolean extends Name1Boxed { - public final boolean data; - private Name1BoxedBoolean(boolean data) { - this.data = data; - } + public record Name1BoxedBoolean(boolean data) implements Name1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Name1BoxedNumber extends Name1Boxed { - public final Number data; - private Name1BoxedNumber(Number data) { - this.data = data; - } + public record Name1BoxedNumber(Number data) implements Name1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Name1BoxedString extends Name1Boxed { - public final String data; - private Name1BoxedString(String data) { - this.data = data; - } + public record Name1BoxedString(String data) implements Name1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Name1BoxedList extends Name1Boxed { - public final FrozenList<@Nullable Object> data; - private Name1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Name1BoxedList(FrozenList<@Nullable Object> data) implements Name1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Name1BoxedMap extends Name1Boxed { - public final NameMap data; - private Name1BoxedMap(NameMap data) { - this.data = data; - } + public record Name1BoxedMap(NameMap data) implements Name1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Name1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Name1BoxedList>, MapSchemaValidator { + public static class Name1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Name1BoxedList>, MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -396,11 +372,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -431,11 +407,11 @@ public NameMap getNewInstance(Map arg, List pathToItem, PathToSche List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -514,5 +490,24 @@ public Name1BoxedList validateAndBox(List arg, SchemaConfiguration configurat public Name1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Name1BoxedMap(validate(arg, configuration)); } + @Override + public Name1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/NoAdditionalProperties.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/NoAdditionalProperties.java index 2fb470947dc..dec315f92ed 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/NoAdditionalProperties.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/NoAdditionalProperties.java @@ -182,23 +182,19 @@ public NoAdditionalPropertiesMap0Builder getBuilderAfterId(Map i } - public static abstract sealed class NoAdditionalProperties1Boxed permits NoAdditionalProperties1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface NoAdditionalProperties1Boxed permits NoAdditionalProperties1BoxedMap { + @Nullable Object getData(); } - public static final class NoAdditionalProperties1BoxedMap extends NoAdditionalProperties1Boxed { - public final NoAdditionalPropertiesMap data; - private NoAdditionalProperties1BoxedMap(NoAdditionalPropertiesMap data) { - this.data = data; - } + public record NoAdditionalProperties1BoxedMap(NoAdditionalPropertiesMap data) implements NoAdditionalProperties1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class NoAdditionalProperties1 extends JsonSchema implements MapSchemaValidator { + public static class NoAdditionalProperties1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -239,11 +235,11 @@ public NoAdditionalPropertiesMap getNewInstance(Map arg, List path List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Number)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -283,6 +279,13 @@ public NoAdditionalPropertiesMap validate(Map arg, SchemaConfiguration con public NoAdditionalProperties1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new NoAdditionalProperties1BoxedMap(validate(arg, configuration)); } + @Override + public NoAdditionalProperties1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/NullableClass.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/NullableClass.java index bf6bad667f4..d412dae60ee 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/NullableClass.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/NullableClass.java @@ -38,34 +38,26 @@ public class NullableClass { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class AdditionalProperties3Boxed permits AdditionalProperties3BoxedVoid, AdditionalProperties3BoxedMap { - public abstract @Nullable Object data(); + public sealed interface AdditionalProperties3Boxed permits AdditionalProperties3BoxedVoid, AdditionalProperties3BoxedMap { + @Nullable Object getData(); } - public static final class AdditionalProperties3BoxedVoid extends AdditionalProperties3Boxed { - public final Void data; - private AdditionalProperties3BoxedVoid(Void data) { - this.data = data; - } + public record AdditionalProperties3BoxedVoid(Void data) implements AdditionalProperties3Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AdditionalProperties3BoxedMap extends AdditionalProperties3Boxed { - public final FrozenMap<@Nullable Object> data; - private AdditionalProperties3BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record AdditionalProperties3BoxedMap(FrozenMap<@Nullable Object> data) implements AdditionalProperties3Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class AdditionalProperties3 extends JsonSchema implements NullSchemaValidator, MapSchemaValidator, AdditionalProperties3BoxedMap> { + public static class AdditionalProperties3 extends JsonSchema implements NullSchemaValidator, MapSchemaValidator, AdditionalProperties3BoxedMap> { private static @Nullable AdditionalProperties3 instance = null; protected AdditionalProperties3() { @@ -106,11 +98,11 @@ public Void validate(Void arg, SchemaConfiguration configuration) throws Validat List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -155,37 +147,39 @@ public AdditionalProperties3BoxedVoid validateAndBox(Void arg, SchemaConfigurati public AdditionalProperties3BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new AdditionalProperties3BoxedMap(validate(arg, configuration)); } + @Override + public AdditionalProperties3Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class IntegerPropBoxed permits IntegerPropBoxedVoid, IntegerPropBoxedNumber { - public abstract @Nullable Object data(); + public sealed interface IntegerPropBoxed permits IntegerPropBoxedVoid, IntegerPropBoxedNumber { + @Nullable Object getData(); } - public static final class IntegerPropBoxedVoid extends IntegerPropBoxed { - public final Void data; - private IntegerPropBoxedVoid(Void data) { - this.data = data; - } + public record IntegerPropBoxedVoid(Void data) implements IntegerPropBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class IntegerPropBoxedNumber extends IntegerPropBoxed { - public final Number data; - private IntegerPropBoxedNumber(Number data) { - this.data = data; - } + public record IntegerPropBoxedNumber(Number data) implements IntegerPropBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class IntegerProp extends JsonSchema implements NullSchemaValidator, NumberSchemaValidator { + public static class IntegerProp extends JsonSchema implements NullSchemaValidator, NumberSchemaValidator { private static @Nullable IntegerProp instance = null; protected IntegerProp() { @@ -272,37 +266,39 @@ public IntegerPropBoxedVoid validateAndBox(Void arg, SchemaConfiguration configu public IntegerPropBoxedNumber validateAndBox(Number arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new IntegerPropBoxedNumber(validate(arg, configuration)); } + @Override + public IntegerPropBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class NumberPropBoxed permits NumberPropBoxedVoid, NumberPropBoxedNumber { - public abstract @Nullable Object data(); + public sealed interface NumberPropBoxed permits NumberPropBoxedVoid, NumberPropBoxedNumber { + @Nullable Object getData(); } - public static final class NumberPropBoxedVoid extends NumberPropBoxed { - public final Void data; - private NumberPropBoxedVoid(Void data) { - this.data = data; - } + public record NumberPropBoxedVoid(Void data) implements NumberPropBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NumberPropBoxedNumber extends NumberPropBoxed { - public final Number data; - private NumberPropBoxedNumber(Number data) { - this.data = data; - } + public record NumberPropBoxedNumber(Number data) implements NumberPropBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class NumberProp extends JsonSchema implements NullSchemaValidator, NumberSchemaValidator { + public static class NumberProp extends JsonSchema implements NullSchemaValidator, NumberSchemaValidator { private static @Nullable NumberProp instance = null; protected NumberProp() { @@ -388,37 +384,39 @@ public NumberPropBoxedVoid validateAndBox(Void arg, SchemaConfiguration configur public NumberPropBoxedNumber validateAndBox(Number arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new NumberPropBoxedNumber(validate(arg, configuration)); } + @Override + public NumberPropBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class BooleanPropBoxed permits BooleanPropBoxedVoid, BooleanPropBoxedBoolean { - public abstract @Nullable Object data(); + public sealed interface BooleanPropBoxed permits BooleanPropBoxedVoid, BooleanPropBoxedBoolean { + @Nullable Object getData(); } - public static final class BooleanPropBoxedVoid extends BooleanPropBoxed { - public final Void data; - private BooleanPropBoxedVoid(Void data) { - this.data = data; - } + public record BooleanPropBoxedVoid(Void data) implements BooleanPropBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class BooleanPropBoxedBoolean extends BooleanPropBoxed { - public final boolean data; - private BooleanPropBoxedBoolean(boolean data) { - this.data = data; - } + public record BooleanPropBoxedBoolean(boolean data) implements BooleanPropBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class BooleanProp extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator { + public static class BooleanProp extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator { private static @Nullable BooleanProp instance = null; protected BooleanProp() { @@ -487,37 +485,40 @@ public BooleanPropBoxedVoid validateAndBox(Void arg, SchemaConfiguration configu public BooleanPropBoxedBoolean validateAndBox(boolean arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new BooleanPropBoxedBoolean(validate(arg, configuration)); } + @Override + public BooleanPropBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class StringPropBoxed permits StringPropBoxedVoid, StringPropBoxedString { - public abstract @Nullable Object data(); + public sealed interface StringPropBoxed permits StringPropBoxedVoid, StringPropBoxedString { + @Nullable Object getData(); } - public static final class StringPropBoxedVoid extends StringPropBoxed { - public final Void data; - private StringPropBoxedVoid(Void data) { - this.data = data; - } + public record StringPropBoxedVoid(Void data) implements StringPropBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class StringPropBoxedString extends StringPropBoxed { - public final String data; - private StringPropBoxedString(String data) { - this.data = data; - } + public record StringPropBoxedString(String data) implements StringPropBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class StringProp extends JsonSchema implements NullSchemaValidator, StringSchemaValidator { + public static class StringProp extends JsonSchema implements NullSchemaValidator, StringSchemaValidator { private static @Nullable StringProp instance = null; protected StringProp() { @@ -584,37 +585,39 @@ public StringPropBoxedVoid validateAndBox(Void arg, SchemaConfiguration configur public StringPropBoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new StringPropBoxedString(validate(arg, configuration)); } + @Override + public StringPropBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class DatePropBoxed permits DatePropBoxedVoid, DatePropBoxedString { - public abstract @Nullable Object data(); + public sealed interface DatePropBoxed permits DatePropBoxedVoid, DatePropBoxedString { + @Nullable Object getData(); } - public static final class DatePropBoxedVoid extends DatePropBoxed { - public final Void data; - private DatePropBoxedVoid(Void data) { - this.data = data; - } + public record DatePropBoxedVoid(Void data) implements DatePropBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class DatePropBoxedString extends DatePropBoxed { - public final String data; - private DatePropBoxedString(String data) { - this.data = data; - } + public record DatePropBoxedString(String data) implements DatePropBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class DateProp extends JsonSchema implements NullSchemaValidator, StringSchemaValidator { + public static class DateProp extends JsonSchema implements NullSchemaValidator, StringSchemaValidator { private static @Nullable DateProp instance = null; protected DateProp() { @@ -682,37 +685,39 @@ public DatePropBoxedVoid validateAndBox(Void arg, SchemaConfiguration configurat public DatePropBoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new DatePropBoxedString(validate(arg, configuration)); } + @Override + public DatePropBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class DatetimePropBoxed permits DatetimePropBoxedVoid, DatetimePropBoxedString { - public abstract @Nullable Object data(); + public sealed interface DatetimePropBoxed permits DatetimePropBoxedVoid, DatetimePropBoxedString { + @Nullable Object getData(); } - public static final class DatetimePropBoxedVoid extends DatetimePropBoxed { - public final Void data; - private DatetimePropBoxedVoid(Void data) { - this.data = data; - } + public record DatetimePropBoxedVoid(Void data) implements DatetimePropBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class DatetimePropBoxedString extends DatetimePropBoxed { - public final String data; - private DatetimePropBoxedString(String data) { - this.data = data; - } + public record DatetimePropBoxedString(String data) implements DatetimePropBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class DatetimeProp extends JsonSchema implements NullSchemaValidator, StringSchemaValidator { + public static class DatetimeProp extends JsonSchema implements NullSchemaValidator, StringSchemaValidator { private static @Nullable DatetimeProp instance = null; protected DatetimeProp() { @@ -780,6 +785,16 @@ public DatetimePropBoxedVoid validateAndBox(Void arg, SchemaConfiguration config public DatetimePropBoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new DatetimePropBoxedString(validate(arg, configuration)); } + @Override + public DatetimePropBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class Items extends MapJsonSchema.MapJsonSchema1 { @@ -825,35 +840,27 @@ public ArrayNullablePropListBuilder add(Map item) { } - public static abstract sealed class ArrayNullablePropBoxed permits ArrayNullablePropBoxedVoid, ArrayNullablePropBoxedList { - public abstract @Nullable Object data(); + public sealed interface ArrayNullablePropBoxed permits ArrayNullablePropBoxedVoid, ArrayNullablePropBoxedList { + @Nullable Object getData(); } - public static final class ArrayNullablePropBoxedVoid extends ArrayNullablePropBoxed { - public final Void data; - private ArrayNullablePropBoxedVoid(Void data) { - this.data = data; - } + public record ArrayNullablePropBoxedVoid(Void data) implements ArrayNullablePropBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ArrayNullablePropBoxedList extends ArrayNullablePropBoxed { - public final ArrayNullablePropList data; - private ArrayNullablePropBoxedList(ArrayNullablePropList data) { - this.data = data; - } + public record ArrayNullablePropBoxedList(ArrayNullablePropList data) implements ArrayNullablePropBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ArrayNullableProp extends JsonSchema implements NullSchemaValidator, ListSchemaValidator { + public static class ArrayNullableProp extends JsonSchema implements NullSchemaValidator, ListSchemaValidator { private static @Nullable ArrayNullableProp instance = null; protected ArrayNullableProp() { @@ -891,11 +898,11 @@ public ArrayNullablePropList getNewInstance(List arg, List pathToItem for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof FrozenMap)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -943,36 +950,38 @@ public ArrayNullablePropBoxedVoid validateAndBox(Void arg, SchemaConfiguration c public ArrayNullablePropBoxedList validateAndBox(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ArrayNullablePropBoxedList(validate(arg, configuration)); } + @Override + public ArrayNullablePropBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class Items1Boxed permits Items1BoxedVoid, Items1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Items1Boxed permits Items1BoxedVoid, Items1BoxedMap { + @Nullable Object getData(); } - public static final class Items1BoxedVoid extends Items1Boxed { - public final Void data; - private Items1BoxedVoid(Void data) { - this.data = data; - } + public record Items1BoxedVoid(Void data) implements Items1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Items1BoxedMap extends Items1Boxed { - public final FrozenMap<@Nullable Object> data; - private Items1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record Items1BoxedMap(FrozenMap<@Nullable Object> data) implements Items1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Items1 extends JsonSchema implements NullSchemaValidator, MapSchemaValidator, Items1BoxedMap> { + public static class Items1 extends JsonSchema implements NullSchemaValidator, MapSchemaValidator, Items1BoxedMap> { private static @Nullable Items1 instance = null; protected Items1() { @@ -1013,11 +1022,11 @@ public Void validate(Void arg, SchemaConfiguration configuration) throws Validat List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -1062,6 +1071,16 @@ public Items1BoxedVoid validateAndBox(Void arg, SchemaConfiguration configuratio public Items1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Items1BoxedMap(validate(arg, configuration)); } + @Override + public Items1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class ArrayAndItemsNullablePropList extends FrozenList<@Nullable FrozenMap> { @@ -1101,35 +1120,27 @@ public ArrayAndItemsNullablePropListBuilder add(Map it } - public static abstract sealed class ArrayAndItemsNullablePropBoxed permits ArrayAndItemsNullablePropBoxedVoid, ArrayAndItemsNullablePropBoxedList { - public abstract @Nullable Object data(); + public sealed interface ArrayAndItemsNullablePropBoxed permits ArrayAndItemsNullablePropBoxedVoid, ArrayAndItemsNullablePropBoxedList { + @Nullable Object getData(); } - public static final class ArrayAndItemsNullablePropBoxedVoid extends ArrayAndItemsNullablePropBoxed { - public final Void data; - private ArrayAndItemsNullablePropBoxedVoid(Void data) { - this.data = data; - } + public record ArrayAndItemsNullablePropBoxedVoid(Void data) implements ArrayAndItemsNullablePropBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ArrayAndItemsNullablePropBoxedList extends ArrayAndItemsNullablePropBoxed { - public final ArrayAndItemsNullablePropList data; - private ArrayAndItemsNullablePropBoxedList(ArrayAndItemsNullablePropList data) { - this.data = data; - } + public record ArrayAndItemsNullablePropBoxedList(ArrayAndItemsNullablePropList data) implements ArrayAndItemsNullablePropBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ArrayAndItemsNullableProp extends JsonSchema implements NullSchemaValidator, ListSchemaValidator { + public static class ArrayAndItemsNullableProp extends JsonSchema implements NullSchemaValidator, ListSchemaValidator { private static @Nullable ArrayAndItemsNullableProp instance = null; protected ArrayAndItemsNullableProp() { @@ -1167,11 +1178,11 @@ public ArrayAndItemsNullablePropList getNewInstance(List arg, List pa for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance == null || itemInstance instanceof FrozenMap)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -1219,36 +1230,38 @@ public ArrayAndItemsNullablePropBoxedVoid validateAndBox(Void arg, SchemaConfigu public ArrayAndItemsNullablePropBoxedList validateAndBox(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ArrayAndItemsNullablePropBoxedList(validate(arg, configuration)); } + @Override + public ArrayAndItemsNullablePropBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class Items2Boxed permits Items2BoxedVoid, Items2BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Items2Boxed permits Items2BoxedVoid, Items2BoxedMap { + @Nullable Object getData(); } - public static final class Items2BoxedVoid extends Items2Boxed { - public final Void data; - private Items2BoxedVoid(Void data) { - this.data = data; - } + public record Items2BoxedVoid(Void data) implements Items2Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Items2BoxedMap extends Items2Boxed { - public final FrozenMap<@Nullable Object> data; - private Items2BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record Items2BoxedMap(FrozenMap<@Nullable Object> data) implements Items2Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Items2 extends JsonSchema implements NullSchemaValidator, MapSchemaValidator, Items2BoxedMap> { + public static class Items2 extends JsonSchema implements NullSchemaValidator, MapSchemaValidator, Items2BoxedMap> { private static @Nullable Items2 instance = null; protected Items2() { @@ -1289,11 +1302,11 @@ public Void validate(Void arg, SchemaConfiguration configuration) throws Validat List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -1338,6 +1351,16 @@ public Items2BoxedVoid validateAndBox(Void arg, SchemaConfiguration configuratio public Items2BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Items2BoxedMap(validate(arg, configuration)); } + @Override + public Items2Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class ArrayItemsNullableList extends FrozenList<@Nullable FrozenMap> { @@ -1377,24 +1400,20 @@ public ArrayItemsNullableListBuilder add(Map item) { } - public static abstract sealed class ArrayItemsNullableBoxed permits ArrayItemsNullableBoxedList { - public abstract @Nullable Object data(); + public sealed interface ArrayItemsNullableBoxed permits ArrayItemsNullableBoxedList { + @Nullable Object getData(); } - public static final class ArrayItemsNullableBoxedList extends ArrayItemsNullableBoxed { - public final ArrayItemsNullableList data; - private ArrayItemsNullableBoxedList(ArrayItemsNullableList data) { - this.data = data; - } + public record ArrayItemsNullableBoxedList(ArrayItemsNullableList data) implements ArrayItemsNullableBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ArrayItemsNullable extends JsonSchema implements ListSchemaValidator { + public static class ArrayItemsNullable extends JsonSchema implements ListSchemaValidator { private static @Nullable ArrayItemsNullable instance = null; protected ArrayItemsNullable() { @@ -1418,11 +1437,11 @@ public ArrayItemsNullableList getNewInstance(List arg, List pathToIte for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance == null || itemInstance instanceof FrozenMap)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -1462,6 +1481,13 @@ public ArrayItemsNullableList validate(List arg, SchemaConfiguration configur public ArrayItemsNullableBoxedList validateAndBox(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ArrayItemsNullableBoxedList(validate(arg, configuration)); } + @Override + public ArrayItemsNullableBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class AdditionalProperties extends MapJsonSchema.MapJsonSchema1 { @@ -1524,34 +1550,26 @@ public ObjectNullablePropMapBuilder getBuilderAfterAdditionalProperty(Map, MapSchemaValidator { + public static class ObjectNullableProp extends JsonSchema implements NullSchemaValidator, MapSchemaValidator { private static @Nullable ObjectNullableProp instance = null; protected ObjectNullableProp() { @@ -1593,11 +1611,11 @@ public ObjectNullablePropMap getNewInstance(Map arg, List pathToIt List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof FrozenMap)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -1645,36 +1663,38 @@ public ObjectNullablePropBoxedVoid validateAndBox(Void arg, SchemaConfiguration public ObjectNullablePropBoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ObjectNullablePropBoxedMap(validate(arg, configuration)); } + @Override + public ObjectNullablePropBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class AdditionalProperties1Boxed permits AdditionalProperties1BoxedVoid, AdditionalProperties1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface AdditionalProperties1Boxed permits AdditionalProperties1BoxedVoid, AdditionalProperties1BoxedMap { + @Nullable Object getData(); } - public static final class AdditionalProperties1BoxedVoid extends AdditionalProperties1Boxed { - public final Void data; - private AdditionalProperties1BoxedVoid(Void data) { - this.data = data; - } + public record AdditionalProperties1BoxedVoid(Void data) implements AdditionalProperties1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AdditionalProperties1BoxedMap extends AdditionalProperties1Boxed { - public final FrozenMap<@Nullable Object> data; - private AdditionalProperties1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record AdditionalProperties1BoxedMap(FrozenMap<@Nullable Object> data) implements AdditionalProperties1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class AdditionalProperties1 extends JsonSchema implements NullSchemaValidator, MapSchemaValidator, AdditionalProperties1BoxedMap> { + public static class AdditionalProperties1 extends JsonSchema implements NullSchemaValidator, MapSchemaValidator, AdditionalProperties1BoxedMap> { private static @Nullable AdditionalProperties1 instance = null; protected AdditionalProperties1() { @@ -1715,11 +1735,11 @@ public Void validate(Void arg, SchemaConfiguration configuration) throws Validat List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -1764,6 +1784,16 @@ public AdditionalProperties1BoxedVoid validateAndBox(Void arg, SchemaConfigurati public AdditionalProperties1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new AdditionalProperties1BoxedMap(validate(arg, configuration)); } + @Override + public AdditionalProperties1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class ObjectAndItemsNullablePropMap extends FrozenMap<@Nullable FrozenMap> { @@ -1822,34 +1852,26 @@ public ObjectAndItemsNullablePropMapBuilder getBuilderAfterAdditionalProperty(Ma } - public static abstract sealed class ObjectAndItemsNullablePropBoxed permits ObjectAndItemsNullablePropBoxedVoid, ObjectAndItemsNullablePropBoxedMap { - public abstract @Nullable Object data(); + public sealed interface ObjectAndItemsNullablePropBoxed permits ObjectAndItemsNullablePropBoxedVoid, ObjectAndItemsNullablePropBoxedMap { + @Nullable Object getData(); } - public static final class ObjectAndItemsNullablePropBoxedVoid extends ObjectAndItemsNullablePropBoxed { - public final Void data; - private ObjectAndItemsNullablePropBoxedVoid(Void data) { - this.data = data; - } + public record ObjectAndItemsNullablePropBoxedVoid(Void data) implements ObjectAndItemsNullablePropBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ObjectAndItemsNullablePropBoxedMap extends ObjectAndItemsNullablePropBoxed { - public final ObjectAndItemsNullablePropMap data; - private ObjectAndItemsNullablePropBoxedMap(ObjectAndItemsNullablePropMap data) { - this.data = data; - } + public record ObjectAndItemsNullablePropBoxedMap(ObjectAndItemsNullablePropMap data) implements ObjectAndItemsNullablePropBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ObjectAndItemsNullableProp extends JsonSchema implements NullSchemaValidator, MapSchemaValidator { + public static class ObjectAndItemsNullableProp extends JsonSchema implements NullSchemaValidator, MapSchemaValidator { private static @Nullable ObjectAndItemsNullableProp instance = null; protected ObjectAndItemsNullableProp() { @@ -1891,11 +1913,11 @@ public ObjectAndItemsNullablePropMap getNewInstance(Map arg, List List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance == null || propertyInstance instanceof FrozenMap)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -1943,36 +1965,38 @@ public ObjectAndItemsNullablePropBoxedVoid validateAndBox(Void arg, SchemaConfig public ObjectAndItemsNullablePropBoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ObjectAndItemsNullablePropBoxedMap(validate(arg, configuration)); } + @Override + public ObjectAndItemsNullablePropBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class AdditionalProperties2Boxed permits AdditionalProperties2BoxedVoid, AdditionalProperties2BoxedMap { - public abstract @Nullable Object data(); + public sealed interface AdditionalProperties2Boxed permits AdditionalProperties2BoxedVoid, AdditionalProperties2BoxedMap { + @Nullable Object getData(); } - public static final class AdditionalProperties2BoxedVoid extends AdditionalProperties2Boxed { - public final Void data; - private AdditionalProperties2BoxedVoid(Void data) { - this.data = data; - } + public record AdditionalProperties2BoxedVoid(Void data) implements AdditionalProperties2Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AdditionalProperties2BoxedMap extends AdditionalProperties2Boxed { - public final FrozenMap<@Nullable Object> data; - private AdditionalProperties2BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record AdditionalProperties2BoxedMap(FrozenMap<@Nullable Object> data) implements AdditionalProperties2Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class AdditionalProperties2 extends JsonSchema implements NullSchemaValidator, MapSchemaValidator, AdditionalProperties2BoxedMap> { + public static class AdditionalProperties2 extends JsonSchema implements NullSchemaValidator, MapSchemaValidator, AdditionalProperties2BoxedMap> { private static @Nullable AdditionalProperties2 instance = null; protected AdditionalProperties2() { @@ -2013,11 +2037,11 @@ public Void validate(Void arg, SchemaConfiguration configuration) throws Validat List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -2062,6 +2086,16 @@ public AdditionalProperties2BoxedVoid validateAndBox(Void arg, SchemaConfigurati public AdditionalProperties2BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new AdditionalProperties2BoxedMap(validate(arg, configuration)); } + @Override + public AdditionalProperties2Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class ObjectItemsNullableMap extends FrozenMap<@Nullable FrozenMap> { @@ -2120,23 +2154,19 @@ public ObjectItemsNullableMapBuilder getBuilderAfterAdditionalProperty(Map { + public static class ObjectItemsNullable extends JsonSchema implements MapSchemaValidator { private static @Nullable ObjectItemsNullable instance = null; protected ObjectItemsNullable() { @@ -2164,11 +2194,11 @@ public ObjectItemsNullableMap getNewInstance(Map arg, List pathToI List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance == null || propertyInstance instanceof FrozenMap)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -2208,6 +2238,13 @@ public ObjectItemsNullableMap validate(Map arg, SchemaConfiguration config public ObjectItemsNullableBoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ObjectItemsNullableBoxedMap(validate(arg, configuration)); } + @Override + public ObjectItemsNullableBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } @@ -2682,23 +2719,19 @@ public NullableClassMapBuilder getBuilderAfterAdditionalProperty(Map { + public static class NullableClass1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -2746,11 +2779,11 @@ public NullableClassMap getNewInstance(Map arg, List pathToItem, P List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance == null || propertyInstance instanceof Object)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -2790,6 +2823,13 @@ public NullableClassMap validate(Map arg, SchemaConfiguration configuratio public NullableClass1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new NullableClass1BoxedMap(validate(arg, configuration)); } + @Override + public NullableClass1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/NullableShape.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/NullableShape.java index 44aeb7ad4a8..4a127d0c38e 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/NullableShape.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/NullableShape.java @@ -47,78 +47,54 @@ public static Schema2 getInstance() { } - public static abstract sealed class NullableShape1Boxed permits NullableShape1BoxedVoid, NullableShape1BoxedBoolean, NullableShape1BoxedNumber, NullableShape1BoxedString, NullableShape1BoxedList, NullableShape1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface NullableShape1Boxed permits NullableShape1BoxedVoid, NullableShape1BoxedBoolean, NullableShape1BoxedNumber, NullableShape1BoxedString, NullableShape1BoxedList, NullableShape1BoxedMap { + @Nullable Object getData(); } - public static final class NullableShape1BoxedVoid extends NullableShape1Boxed { - public final Void data; - private NullableShape1BoxedVoid(Void data) { - this.data = data; - } + public record NullableShape1BoxedVoid(Void data) implements NullableShape1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NullableShape1BoxedBoolean extends NullableShape1Boxed { - public final boolean data; - private NullableShape1BoxedBoolean(boolean data) { - this.data = data; - } + public record NullableShape1BoxedBoolean(boolean data) implements NullableShape1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NullableShape1BoxedNumber extends NullableShape1Boxed { - public final Number data; - private NullableShape1BoxedNumber(Number data) { - this.data = data; - } + public record NullableShape1BoxedNumber(Number data) implements NullableShape1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NullableShape1BoxedString extends NullableShape1Boxed { - public final String data; - private NullableShape1BoxedString(String data) { - this.data = data; - } + public record NullableShape1BoxedString(String data) implements NullableShape1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NullableShape1BoxedList extends NullableShape1Boxed { - public final FrozenList<@Nullable Object> data; - private NullableShape1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record NullableShape1BoxedList(FrozenList<@Nullable Object> data) implements NullableShape1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NullableShape1BoxedMap extends NullableShape1Boxed { - public final FrozenMap<@Nullable Object> data; - private NullableShape1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record NullableShape1BoxedMap(FrozenMap<@Nullable Object> data) implements NullableShape1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class NullableShape1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, NullableShape1BoxedList>, MapSchemaValidator, NullableShape1BoxedMap> { + public static class NullableShape1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, NullableShape1BoxedList>, MapSchemaValidator, NullableShape1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -229,11 +205,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -264,11 +240,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -347,5 +323,24 @@ public NullableShape1BoxedList validateAndBox(List arg, SchemaConfiguration c public NullableShape1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new NullableShape1BoxedMap(validate(arg, configuration)); } + @Override + public NullableShape1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/NullableString.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/NullableString.java index 5dceb5f7446..d52f8c2d9bb 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/NullableString.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/NullableString.java @@ -21,35 +21,27 @@ public class NullableString { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class NullableString1Boxed permits NullableString1BoxedVoid, NullableString1BoxedString { - public abstract @Nullable Object data(); + public sealed interface NullableString1Boxed permits NullableString1BoxedVoid, NullableString1BoxedString { + @Nullable Object getData(); } - public static final class NullableString1BoxedVoid extends NullableString1Boxed { - public final Void data; - private NullableString1BoxedVoid(Void data) { - this.data = data; - } + public record NullableString1BoxedVoid(Void data) implements NullableString1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NullableString1BoxedString extends NullableString1Boxed { - public final String data; - private NullableString1BoxedString(String data) { - this.data = data; - } + public record NullableString1BoxedString(String data) implements NullableString1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class NullableString1 extends JsonSchema implements NullSchemaValidator, StringSchemaValidator { + public static class NullableString1 extends JsonSchema implements NullSchemaValidator, StringSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -122,5 +114,15 @@ public NullableString1BoxedVoid validateAndBox(Void arg, SchemaConfiguration con public NullableString1BoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new NullableString1BoxedString(validate(arg, configuration)); } + @Override + public NullableString1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/NumberOnly.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/NumberOnly.java index 82f4bef89b1..2aec9f86eb4 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/NumberOnly.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/NumberOnly.java @@ -124,23 +124,19 @@ public NumberOnlyMapBuilder getBuilderAfterAdditionalProperty(Map { + public static class NumberOnly1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -176,11 +172,11 @@ public NumberOnlyMap getNewInstance(Map arg, List pathToItem, Path List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -217,6 +213,13 @@ public NumberOnlyMap validate(Map arg, SchemaConfiguration configuration) public NumberOnly1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new NumberOnly1BoxedMap(validate(arg, configuration)); } + @Override + public NumberOnly1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/NumberWithExclusiveMinMax.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/NumberWithExclusiveMinMax.java index 4a60649f087..d839b2752c8 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/NumberWithExclusiveMinMax.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/NumberWithExclusiveMinMax.java @@ -19,24 +19,20 @@ public class NumberWithExclusiveMinMax { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class NumberWithExclusiveMinMax1Boxed permits NumberWithExclusiveMinMax1BoxedNumber { - public abstract @Nullable Object data(); + public sealed interface NumberWithExclusiveMinMax1Boxed permits NumberWithExclusiveMinMax1BoxedNumber { + @Nullable Object getData(); } - public static final class NumberWithExclusiveMinMax1BoxedNumber extends NumberWithExclusiveMinMax1Boxed { - public final Number data; - private NumberWithExclusiveMinMax1BoxedNumber(Number data) { - this.data = data; - } + public record NumberWithExclusiveMinMax1BoxedNumber(Number data) implements NumberWithExclusiveMinMax1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class NumberWithExclusiveMinMax1 extends JsonSchema implements NumberSchemaValidator { + public static class NumberWithExclusiveMinMax1 extends JsonSchema implements NumberSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -110,5 +106,12 @@ public double validate(double arg, SchemaConfiguration configuration) throws Val public NumberWithExclusiveMinMax1BoxedNumber validateAndBox(Number arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new NumberWithExclusiveMinMax1BoxedNumber(validate(arg, configuration)); } + @Override + public NumberWithExclusiveMinMax1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/NumberWithValidations.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/NumberWithValidations.java index ca34e1ca3ed..b859f61f42c 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/NumberWithValidations.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/NumberWithValidations.java @@ -19,24 +19,20 @@ public class NumberWithValidations { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class NumberWithValidations1Boxed permits NumberWithValidations1BoxedNumber { - public abstract @Nullable Object data(); + public sealed interface NumberWithValidations1Boxed permits NumberWithValidations1BoxedNumber { + @Nullable Object getData(); } - public static final class NumberWithValidations1BoxedNumber extends NumberWithValidations1Boxed { - public final Number data; - private NumberWithValidations1BoxedNumber(Number data) { - this.data = data; - } + public record NumberWithValidations1BoxedNumber(Number data) implements NumberWithValidations1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class NumberWithValidations1 extends JsonSchema implements NumberSchemaValidator { + public static class NumberWithValidations1 extends JsonSchema implements NumberSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -110,5 +106,12 @@ public double validate(double arg, SchemaConfiguration configuration) throws Val public NumberWithValidations1BoxedNumber validateAndBox(Number arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new NumberWithValidations1BoxedNumber(validate(arg, configuration)); } + @Override + public NumberWithValidations1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjWithRequiredProps.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjWithRequiredProps.java index 8c9c8371f1a..7440322d228 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjWithRequiredProps.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjWithRequiredProps.java @@ -114,23 +114,19 @@ public ObjWithRequiredPropsMap0Builder getBuilderAfterA(Map { + public static class ObjWithRequiredProps1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -172,11 +168,11 @@ public ObjWithRequiredPropsMap getNewInstance(Map arg, List pathTo List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -213,6 +209,13 @@ public ObjWithRequiredPropsMap validate(Map arg, SchemaConfiguration confi public ObjWithRequiredProps1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ObjWithRequiredProps1BoxedMap(validate(arg, configuration)); } + @Override + public ObjWithRequiredProps1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjWithRequiredPropsBase.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjWithRequiredPropsBase.java index d66f87b13bf..8d1712ddba9 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjWithRequiredPropsBase.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjWithRequiredPropsBase.java @@ -114,23 +114,19 @@ public ObjWithRequiredPropsBaseMap0Builder getBuilderAfterB(Map { + public static class ObjWithRequiredPropsBase1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -169,11 +165,11 @@ public ObjWithRequiredPropsBaseMap getNewInstance(Map arg, List pa List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -210,6 +206,13 @@ public ObjWithRequiredPropsBaseMap validate(Map arg, SchemaConfiguration c public ObjWithRequiredPropsBase1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ObjWithRequiredPropsBase1BoxedMap(validate(arg, configuration)); } + @Override + public ObjWithRequiredPropsBase1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectModelWithArgAndArgsProperties.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectModelWithArgAndArgsProperties.java index a4d91d97242..2b92bc15f29 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectModelWithArgAndArgsProperties.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectModelWithArgAndArgsProperties.java @@ -175,23 +175,19 @@ public ObjectModelWithArgAndArgsPropertiesMap10Builder getBuilderAfterArgs(Map { + public static class ObjectModelWithArgAndArgsProperties1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -232,11 +228,11 @@ public ObjectModelWithArgAndArgsPropertiesMap getNewInstance(Map arg, List List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -273,6 +269,13 @@ public ObjectModelWithArgAndArgsPropertiesMap validate(Map arg, SchemaConf public ObjectModelWithArgAndArgsProperties1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ObjectModelWithArgAndArgsProperties1BoxedMap(validate(arg, configuration)); } + @Override + public ObjectModelWithArgAndArgsProperties1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectModelWithRefProps.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectModelWithRefProps.java index 460fb518c51..46d4dd148c3 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectModelWithRefProps.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectModelWithRefProps.java @@ -164,23 +164,19 @@ public ObjectModelWithRefPropsMapBuilder getBuilderAfterAdditionalProperty(Map { + public static class ObjectModelWithRefProps1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -220,11 +216,11 @@ public ObjectModelWithRefPropsMap getNewInstance(Map arg, List pat List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -261,6 +257,13 @@ public ObjectModelWithRefPropsMap validate(Map arg, SchemaConfiguration co public ObjectModelWithRefProps1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ObjectModelWithRefProps1BoxedMap(validate(arg, configuration)); } + @Override + public ObjectModelWithRefProps1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectWithAllOfWithReqTestPropFromUnsetAddProp.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectWithAllOfWithReqTestPropFromUnsetAddProp.java index 15b8a382313..83ae5af726f 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectWithAllOfWithReqTestPropFromUnsetAddProp.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectWithAllOfWithReqTestPropFromUnsetAddProp.java @@ -194,23 +194,19 @@ public Schema1Map0Builder getBuilderAfterTest(Map inst } - public static abstract sealed class Schema1Boxed permits Schema1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Schema1Boxed permits Schema1BoxedMap { + @Nullable Object getData(); } - public static final class Schema1BoxedMap extends Schema1Boxed { - public final Schema1Map data; - private Schema1BoxedMap(Schema1Map data) { - this.data = data; - } + public record Schema1BoxedMap(Schema1Map data) implements Schema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema1 extends JsonSchema implements MapSchemaValidator { + public static class Schema1 extends JsonSchema implements MapSchemaValidator { private static @Nullable Schema1 instance = null; protected Schema1() { @@ -243,11 +239,11 @@ public Schema1Map getNewInstance(Map arg, List pathToItem, PathToS List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -284,81 +280,64 @@ public Schema1Map validate(Map arg, SchemaConfiguration configuration) thr public Schema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema1BoxedMap(validate(arg, configuration)); } + @Override + public Schema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class ObjectWithAllOfWithReqTestPropFromUnsetAddProp1Boxed permits ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedVoid, ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedBoolean, ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedNumber, ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedString, ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedList, ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface ObjectWithAllOfWithReqTestPropFromUnsetAddProp1Boxed permits ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedVoid, ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedBoolean, ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedNumber, ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedString, ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedList, ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedMap { + @Nullable Object getData(); } - public static final class ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedVoid extends ObjectWithAllOfWithReqTestPropFromUnsetAddProp1Boxed { - public final Void data; - private ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedVoid(Void data) { - this.data = data; - } + public record ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedVoid(Void data) implements ObjectWithAllOfWithReqTestPropFromUnsetAddProp1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedBoolean extends ObjectWithAllOfWithReqTestPropFromUnsetAddProp1Boxed { - public final boolean data; - private ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedBoolean(boolean data) { - this.data = data; - } + public record ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedBoolean(boolean data) implements ObjectWithAllOfWithReqTestPropFromUnsetAddProp1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedNumber extends ObjectWithAllOfWithReqTestPropFromUnsetAddProp1Boxed { - public final Number data; - private ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedNumber(Number data) { - this.data = data; - } + public record ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedNumber(Number data) implements ObjectWithAllOfWithReqTestPropFromUnsetAddProp1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedString extends ObjectWithAllOfWithReqTestPropFromUnsetAddProp1Boxed { - public final String data; - private ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedString(String data) { - this.data = data; - } + public record ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedString(String data) implements ObjectWithAllOfWithReqTestPropFromUnsetAddProp1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedList extends ObjectWithAllOfWithReqTestPropFromUnsetAddProp1Boxed { - public final FrozenList<@Nullable Object> data; - private ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedList(FrozenList<@Nullable Object> data) implements ObjectWithAllOfWithReqTestPropFromUnsetAddProp1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedMap extends ObjectWithAllOfWithReqTestPropFromUnsetAddProp1Boxed { - public final FrozenMap<@Nullable Object> data; - private ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedMap(FrozenMap<@Nullable Object> data) implements ObjectWithAllOfWithReqTestPropFromUnsetAddProp1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ObjectWithAllOfWithReqTestPropFromUnsetAddProp1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedList>, MapSchemaValidator, ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedMap> { + public static class ObjectWithAllOfWithReqTestPropFromUnsetAddProp1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedList>, MapSchemaValidator, ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -466,11 +445,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -501,11 +480,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -584,5 +563,24 @@ public ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedList validateAndBox(L public ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ObjectWithAllOfWithReqTestPropFromUnsetAddProp1BoxedMap(validate(arg, configuration)); } + @Override + public ObjectWithAllOfWithReqTestPropFromUnsetAddProp1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectWithCollidingProperties.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectWithCollidingProperties.java index e35a9b4dc0d..0b16a14b9db 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectWithCollidingProperties.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectWithCollidingProperties.java @@ -143,23 +143,19 @@ public ObjectWithCollidingPropertiesMapBuilder getBuilderAfterAdditionalProperty } - public static abstract sealed class ObjectWithCollidingProperties1Boxed permits ObjectWithCollidingProperties1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface ObjectWithCollidingProperties1Boxed permits ObjectWithCollidingProperties1BoxedMap { + @Nullable Object getData(); } - public static final class ObjectWithCollidingProperties1BoxedMap extends ObjectWithCollidingProperties1Boxed { - public final ObjectWithCollidingPropertiesMap data; - private ObjectWithCollidingProperties1BoxedMap(ObjectWithCollidingPropertiesMap data) { - this.data = data; - } + public record ObjectWithCollidingProperties1BoxedMap(ObjectWithCollidingPropertiesMap data) implements ObjectWithCollidingProperties1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ObjectWithCollidingProperties1 extends JsonSchema implements MapSchemaValidator { + public static class ObjectWithCollidingProperties1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -198,11 +194,11 @@ public ObjectWithCollidingPropertiesMap getNewInstance(Map arg, List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -239,6 +235,13 @@ public ObjectWithCollidingPropertiesMap validate(Map arg, SchemaConfigurat public ObjectWithCollidingProperties1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ObjectWithCollidingProperties1BoxedMap(validate(arg, configuration)); } + @Override + public ObjectWithCollidingProperties1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectWithDecimalProperties.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectWithDecimalProperties.java index 08c18cd57af..fe684c55bfe 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectWithDecimalProperties.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectWithDecimalProperties.java @@ -158,23 +158,19 @@ public ObjectWithDecimalPropertiesMapBuilder getBuilderAfterAdditionalProperty(M } - public static abstract sealed class ObjectWithDecimalProperties1Boxed permits ObjectWithDecimalProperties1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface ObjectWithDecimalProperties1Boxed permits ObjectWithDecimalProperties1BoxedMap { + @Nullable Object getData(); } - public static final class ObjectWithDecimalProperties1BoxedMap extends ObjectWithDecimalProperties1Boxed { - public final ObjectWithDecimalPropertiesMap data; - private ObjectWithDecimalProperties1BoxedMap(ObjectWithDecimalPropertiesMap data) { - this.data = data; - } + public record ObjectWithDecimalProperties1BoxedMap(ObjectWithDecimalPropertiesMap data) implements ObjectWithDecimalProperties1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ObjectWithDecimalProperties1 extends JsonSchema implements MapSchemaValidator { + public static class ObjectWithDecimalProperties1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -212,11 +208,11 @@ public ObjectWithDecimalPropertiesMap getNewInstance(Map arg, List List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -253,6 +249,13 @@ public ObjectWithDecimalPropertiesMap validate(Map arg, SchemaConfiguratio public ObjectWithDecimalProperties1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ObjectWithDecimalProperties1BoxedMap(validate(arg, configuration)); } + @Override + public ObjectWithDecimalProperties1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectWithDifficultlyNamedProps.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectWithDifficultlyNamedProps.java index fc43bb14709..2d7d1e7104f 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectWithDifficultlyNamedProps.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectWithDifficultlyNamedProps.java @@ -199,23 +199,19 @@ public ObjectWithDifficultlyNamedPropsMap0Builder getBuilderAfterSchema123list(M } - public static abstract sealed class ObjectWithDifficultlyNamedProps1Boxed permits ObjectWithDifficultlyNamedProps1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface ObjectWithDifficultlyNamedProps1Boxed permits ObjectWithDifficultlyNamedProps1BoxedMap { + @Nullable Object getData(); } - public static final class ObjectWithDifficultlyNamedProps1BoxedMap extends ObjectWithDifficultlyNamedProps1Boxed { - public final ObjectWithDifficultlyNamedPropsMap data; - private ObjectWithDifficultlyNamedProps1BoxedMap(ObjectWithDifficultlyNamedPropsMap data) { - this.data = data; - } + public record ObjectWithDifficultlyNamedProps1BoxedMap(ObjectWithDifficultlyNamedPropsMap data) implements ObjectWithDifficultlyNamedProps1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ObjectWithDifficultlyNamedProps1 extends JsonSchema implements MapSchemaValidator { + public static class ObjectWithDifficultlyNamedProps1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -258,11 +254,11 @@ public ObjectWithDifficultlyNamedPropsMap getNewInstance(Map arg, List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -299,6 +295,13 @@ public ObjectWithDifficultlyNamedPropsMap validate(Map arg, SchemaConfigur public ObjectWithDifficultlyNamedProps1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ObjectWithDifficultlyNamedProps1BoxedMap(validate(arg, configuration)); } + @Override + public ObjectWithDifficultlyNamedProps1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectWithInlineCompositionProperty.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectWithInlineCompositionProperty.java index f54b69750b9..e5dd13be7c0 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectWithInlineCompositionProperty.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectWithInlineCompositionProperty.java @@ -37,24 +37,20 @@ public class ObjectWithInlineCompositionProperty { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class Schema0Boxed permits Schema0BoxedString { - public abstract @Nullable Object data(); + public sealed interface Schema0Boxed permits Schema0BoxedString { + @Nullable Object getData(); } - public static final class Schema0BoxedString extends Schema0Boxed { - public final String data; - private Schema0BoxedString(String data) { - this.data = data; - } + public record Schema0BoxedString(String data) implements Schema0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema0 extends JsonSchema implements StringSchemaValidator { + public static class Schema0 extends JsonSchema implements StringSchemaValidator { private static @Nullable Schema0 instance = null; protected Schema0() { @@ -102,80 +98,63 @@ public String validate(String arg, SchemaConfiguration configuration) throws Val public Schema0BoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema0BoxedString(validate(arg, configuration)); } + @Override + public Schema0Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class SomePropBoxed permits SomePropBoxedVoid, SomePropBoxedBoolean, SomePropBoxedNumber, SomePropBoxedString, SomePropBoxedList, SomePropBoxedMap { - public abstract @Nullable Object data(); + public sealed interface SomePropBoxed permits SomePropBoxedVoid, SomePropBoxedBoolean, SomePropBoxedNumber, SomePropBoxedString, SomePropBoxedList, SomePropBoxedMap { + @Nullable Object getData(); } - public static final class SomePropBoxedVoid extends SomePropBoxed { - public final Void data; - private SomePropBoxedVoid(Void data) { - this.data = data; - } + public record SomePropBoxedVoid(Void data) implements SomePropBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class SomePropBoxedBoolean extends SomePropBoxed { - public final boolean data; - private SomePropBoxedBoolean(boolean data) { - this.data = data; - } + public record SomePropBoxedBoolean(boolean data) implements SomePropBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class SomePropBoxedNumber extends SomePropBoxed { - public final Number data; - private SomePropBoxedNumber(Number data) { - this.data = data; - } + public record SomePropBoxedNumber(Number data) implements SomePropBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class SomePropBoxedString extends SomePropBoxed { - public final String data; - private SomePropBoxedString(String data) { - this.data = data; - } + public record SomePropBoxedString(String data) implements SomePropBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class SomePropBoxedList extends SomePropBoxed { - public final FrozenList<@Nullable Object> data; - private SomePropBoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record SomePropBoxedList(FrozenList<@Nullable Object> data) implements SomePropBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class SomePropBoxedMap extends SomePropBoxed { - public final FrozenMap<@Nullable Object> data; - private SomePropBoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record SomePropBoxedMap(FrozenMap<@Nullable Object> data) implements SomePropBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class SomeProp extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, SomePropBoxedList>, MapSchemaValidator, SomePropBoxedMap> { + public static class SomeProp extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, SomePropBoxedList>, MapSchemaValidator, SomePropBoxedMap> { private static @Nullable SomeProp instance = null; protected SomeProp() { @@ -276,11 +255,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -311,11 +290,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -394,6 +373,25 @@ public SomePropBoxedList validateAndBox(List arg, SchemaConfiguration configu public SomePropBoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new SomePropBoxedMap(validate(arg, configuration)); } + @Override + public SomePropBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class ObjectWithInlineCompositionPropertyMap extends FrozenMap<@Nullable Object> { @@ -504,23 +502,19 @@ public ObjectWithInlineCompositionPropertyMapBuilder getBuilderAfterAdditionalPr } - public static abstract sealed class ObjectWithInlineCompositionProperty1Boxed permits ObjectWithInlineCompositionProperty1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface ObjectWithInlineCompositionProperty1Boxed permits ObjectWithInlineCompositionProperty1BoxedMap { + @Nullable Object getData(); } - public static final class ObjectWithInlineCompositionProperty1BoxedMap extends ObjectWithInlineCompositionProperty1Boxed { - public final ObjectWithInlineCompositionPropertyMap data; - private ObjectWithInlineCompositionProperty1BoxedMap(ObjectWithInlineCompositionPropertyMap data) { - this.data = data; - } + public record ObjectWithInlineCompositionProperty1BoxedMap(ObjectWithInlineCompositionPropertyMap data) implements ObjectWithInlineCompositionProperty1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ObjectWithInlineCompositionProperty1 extends JsonSchema implements MapSchemaValidator { + public static class ObjectWithInlineCompositionProperty1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -556,11 +550,11 @@ public ObjectWithInlineCompositionPropertyMap getNewInstance(Map arg, List List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -597,6 +591,13 @@ public ObjectWithInlineCompositionPropertyMap validate(Map arg, SchemaConf public ObjectWithInlineCompositionProperty1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ObjectWithInlineCompositionProperty1BoxedMap(validate(arg, configuration)); } + @Override + public ObjectWithInlineCompositionProperty1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectWithInvalidNamedRefedProperties.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectWithInvalidNamedRefedProperties.java index 94c2e93a413..52c1ba51fbe 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectWithInvalidNamedRefedProperties.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectWithInvalidNamedRefedProperties.java @@ -144,23 +144,19 @@ public ObjectWithInvalidNamedRefedPropertiesMap10Builder getBuilderAfterFrom(Map } - public static abstract sealed class ObjectWithInvalidNamedRefedProperties1Boxed permits ObjectWithInvalidNamedRefedProperties1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface ObjectWithInvalidNamedRefedProperties1Boxed permits ObjectWithInvalidNamedRefedProperties1BoxedMap { + @Nullable Object getData(); } - public static final class ObjectWithInvalidNamedRefedProperties1BoxedMap extends ObjectWithInvalidNamedRefedProperties1Boxed { - public final ObjectWithInvalidNamedRefedPropertiesMap data; - private ObjectWithInvalidNamedRefedProperties1BoxedMap(ObjectWithInvalidNamedRefedPropertiesMap data) { - this.data = data; - } + public record ObjectWithInvalidNamedRefedProperties1BoxedMap(ObjectWithInvalidNamedRefedPropertiesMap data) implements ObjectWithInvalidNamedRefedProperties1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ObjectWithInvalidNamedRefedProperties1 extends JsonSchema implements MapSchemaValidator { + public static class ObjectWithInvalidNamedRefedProperties1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -201,11 +197,11 @@ public ObjectWithInvalidNamedRefedPropertiesMap getNewInstance(Map arg, Li List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -242,6 +238,13 @@ public ObjectWithInvalidNamedRefedPropertiesMap validate(Map arg, SchemaCo public ObjectWithInvalidNamedRefedProperties1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ObjectWithInvalidNamedRefedProperties1BoxedMap(validate(arg, configuration)); } + @Override + public ObjectWithInvalidNamedRefedProperties1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectWithNonIntersectingValues.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectWithNonIntersectingValues.java index 166d27b485d..c27d1e36619 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectWithNonIntersectingValues.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectWithNonIntersectingValues.java @@ -152,23 +152,19 @@ public ObjectWithNonIntersectingValuesMapBuilder getBuilderAfterAdditionalProper } - public static abstract sealed class ObjectWithNonIntersectingValues1Boxed permits ObjectWithNonIntersectingValues1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface ObjectWithNonIntersectingValues1Boxed permits ObjectWithNonIntersectingValues1BoxedMap { + @Nullable Object getData(); } - public static final class ObjectWithNonIntersectingValues1BoxedMap extends ObjectWithNonIntersectingValues1Boxed { - public final ObjectWithNonIntersectingValuesMap data; - private ObjectWithNonIntersectingValues1BoxedMap(ObjectWithNonIntersectingValuesMap data) { - this.data = data; - } + public record ObjectWithNonIntersectingValues1BoxedMap(ObjectWithNonIntersectingValuesMap data) implements ObjectWithNonIntersectingValues1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ObjectWithNonIntersectingValues1 extends JsonSchema implements MapSchemaValidator { + public static class ObjectWithNonIntersectingValues1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -205,11 +201,11 @@ public ObjectWithNonIntersectingValuesMap getNewInstance(Map arg, List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -249,6 +245,13 @@ public ObjectWithNonIntersectingValuesMap validate(Map arg, SchemaConfigur public ObjectWithNonIntersectingValues1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ObjectWithNonIntersectingValues1BoxedMap(validate(arg, configuration)); } + @Override + public ObjectWithNonIntersectingValues1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectWithOnlyOptionalProps.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectWithOnlyOptionalProps.java index dfe7aef987f..5f76e1a3b33 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectWithOnlyOptionalProps.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectWithOnlyOptionalProps.java @@ -166,23 +166,19 @@ public ObjectWithOnlyOptionalPropsMapBuilder getBuilderAfterB(Map { + public static class ObjectWithOnlyOptionalProps1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -220,11 +216,11 @@ public ObjectWithOnlyOptionalPropsMap getNewInstance(Map arg, List List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -264,6 +260,13 @@ public ObjectWithOnlyOptionalPropsMap validate(Map arg, SchemaConfiguratio public ObjectWithOnlyOptionalProps1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ObjectWithOnlyOptionalProps1BoxedMap(validate(arg, configuration)); } + @Override + public ObjectWithOnlyOptionalProps1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectWithOptionalTestProp.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectWithOptionalTestProp.java index d1aae084f3b..224aad5414a 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectWithOptionalTestProp.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectWithOptionalTestProp.java @@ -106,23 +106,19 @@ public ObjectWithOptionalTestPropMapBuilder getBuilderAfterAdditionalProperty(Ma } - public static abstract sealed class ObjectWithOptionalTestProp1Boxed permits ObjectWithOptionalTestProp1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface ObjectWithOptionalTestProp1Boxed permits ObjectWithOptionalTestProp1BoxedMap { + @Nullable Object getData(); } - public static final class ObjectWithOptionalTestProp1BoxedMap extends ObjectWithOptionalTestProp1Boxed { - public final ObjectWithOptionalTestPropMap data; - private ObjectWithOptionalTestProp1BoxedMap(ObjectWithOptionalTestPropMap data) { - this.data = data; - } + public record ObjectWithOptionalTestProp1BoxedMap(ObjectWithOptionalTestPropMap data) implements ObjectWithOptionalTestProp1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ObjectWithOptionalTestProp1 extends JsonSchema implements MapSchemaValidator { + public static class ObjectWithOptionalTestProp1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -158,11 +154,11 @@ public ObjectWithOptionalTestPropMap getNewInstance(Map arg, List List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -199,6 +195,13 @@ public ObjectWithOptionalTestPropMap validate(Map arg, SchemaConfiguration public ObjectWithOptionalTestProp1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ObjectWithOptionalTestProp1BoxedMap(validate(arg, configuration)); } + @Override + public ObjectWithOptionalTestProp1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectWithValidations.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectWithValidations.java index 0d20a88969c..55808b655b4 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectWithValidations.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ObjectWithValidations.java @@ -26,23 +26,19 @@ public class ObjectWithValidations { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class ObjectWithValidations1Boxed permits ObjectWithValidations1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface ObjectWithValidations1Boxed permits ObjectWithValidations1BoxedMap { + @Nullable Object getData(); } - public static final class ObjectWithValidations1BoxedMap extends ObjectWithValidations1Boxed { - public final FrozenMap<@Nullable Object> data; - private ObjectWithValidations1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record ObjectWithValidations1BoxedMap(FrozenMap<@Nullable Object> data) implements ObjectWithValidations1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ObjectWithValidations1 extends JsonSchema implements MapSchemaValidator, ObjectWithValidations1BoxedMap> { + public static class ObjectWithValidations1 extends JsonSchema implements MapSchemaValidator, ObjectWithValidations1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -76,11 +72,11 @@ public static ObjectWithValidations1 getInstance() { List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -117,6 +113,13 @@ public static ObjectWithValidations1 getInstance() { public ObjectWithValidations1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ObjectWithValidations1BoxedMap(validate(arg, configuration)); } + @Override + public ObjectWithValidations1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Order.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Order.java index 461c00cc8ed..de3df444595 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Order.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Order.java @@ -94,24 +94,20 @@ public String value() { } - public static abstract sealed class StatusBoxed permits StatusBoxedString { - public abstract @Nullable Object data(); + public sealed interface StatusBoxed permits StatusBoxedString { + @Nullable Object getData(); } - public static final class StatusBoxedString extends StatusBoxed { - public final String data; - private StatusBoxedString(String data) { - this.data = data; - } + public record StatusBoxedString(String data) implements StatusBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Status extends JsonSchema implements StringSchemaValidator, StringEnumValidator { + public static class Status extends JsonSchema implements StringSchemaValidator, StringEnumValidator { private static @Nullable Status instance = null; protected Status() { @@ -168,6 +164,13 @@ public String validate(StringStatusEnums arg,SchemaConfiguration configuration) public StatusBoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new StatusBoxedString(validate(arg, configuration)); } + @Override + public StatusBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class Complete extends BooleanJsonSchema.BooleanJsonSchema1 { @@ -425,23 +428,19 @@ public OrderMapBuilder getBuilderAfterAdditionalProperty(Map { + public static class Order1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -482,11 +481,11 @@ public OrderMap getNewInstance(Map arg, List pathToItem, PathToSch List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -523,6 +522,13 @@ public OrderMap validate(Map arg, SchemaConfiguration configuration) throw public Order1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Order1BoxedMap(validate(arg, configuration)); } + @Override + public Order1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/PaginatedResultMyObjectDto.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/PaginatedResultMyObjectDto.java index 333552e9483..7341ce01c3f 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/PaginatedResultMyObjectDto.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/PaginatedResultMyObjectDto.java @@ -87,24 +87,20 @@ public List> build() { } - public static abstract sealed class ResultsBoxed permits ResultsBoxedList { - public abstract @Nullable Object data(); + public sealed interface ResultsBoxed permits ResultsBoxedList { + @Nullable Object getData(); } - public static final class ResultsBoxedList extends ResultsBoxed { - public final ResultsList data; - private ResultsBoxedList(ResultsList data) { - this.data = data; - } + public record ResultsBoxedList(ResultsList data) implements ResultsBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Results extends JsonSchema implements ListSchemaValidator { + public static class Results extends JsonSchema implements ListSchemaValidator { private static @Nullable Results instance = null; protected Results() { @@ -128,11 +124,11 @@ public ResultsList getNewInstance(List arg, List pathToItem, PathToSc for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof MyObjectDto.MyObjectDtoMap)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -172,6 +168,13 @@ public ResultsList validate(List arg, SchemaConfiguration configuration) thro public ResultsBoxedList validateAndBox(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ResultsBoxedList(validate(arg, configuration)); } + @Override + public ResultsBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class PaginatedResultMyObjectDtoMap extends FrozenMap { @@ -304,23 +307,19 @@ public PaginatedResultMyObjectDtoMap10Builder getBuilderAfterResults(Map { + public static class PaginatedResultMyObjectDto1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -362,11 +361,11 @@ public PaginatedResultMyObjectDtoMap getNewInstance(Map arg, List List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -406,6 +405,13 @@ public PaginatedResultMyObjectDtoMap validate(Map arg, SchemaConfiguration public PaginatedResultMyObjectDto1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new PaginatedResultMyObjectDto1BoxedMap(validate(arg, configuration)); } + @Override + public PaginatedResultMyObjectDto1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ParentPet.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ParentPet.java index bcb1c3fd16a..d9acac7bd8a 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ParentPet.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ParentPet.java @@ -26,23 +26,19 @@ public class ParentPet { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class ParentPet1Boxed permits ParentPet1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface ParentPet1Boxed permits ParentPet1BoxedMap { + @Nullable Object getData(); } - public static final class ParentPet1BoxedMap extends ParentPet1Boxed { - public final FrozenMap<@Nullable Object> data; - private ParentPet1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record ParentPet1BoxedMap(FrozenMap<@Nullable Object> data) implements ParentPet1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ParentPet1 extends JsonSchema implements MapSchemaValidator, ParentPet1BoxedMap> { + public static class ParentPet1 extends JsonSchema implements MapSchemaValidator, ParentPet1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -78,11 +74,11 @@ public static ParentPet1 getInstance() { List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -119,6 +115,13 @@ public static ParentPet1 getInstance() { public ParentPet1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ParentPet1BoxedMap(validate(arg, configuration)); } + @Override + public ParentPet1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Pet.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Pet.java index a1e78cd8592..22e72fa1bb5 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Pet.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Pet.java @@ -101,24 +101,20 @@ public List build() { } - public static abstract sealed class PhotoUrlsBoxed permits PhotoUrlsBoxedList { - public abstract @Nullable Object data(); + public sealed interface PhotoUrlsBoxed permits PhotoUrlsBoxedList { + @Nullable Object getData(); } - public static final class PhotoUrlsBoxedList extends PhotoUrlsBoxed { - public final PhotoUrlsList data; - private PhotoUrlsBoxedList(PhotoUrlsList data) { - this.data = data; - } + public record PhotoUrlsBoxedList(PhotoUrlsList data) implements PhotoUrlsBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class PhotoUrls extends JsonSchema implements ListSchemaValidator { + public static class PhotoUrls extends JsonSchema implements ListSchemaValidator { private static @Nullable PhotoUrls instance = null; protected PhotoUrls() { @@ -142,11 +138,11 @@ public PhotoUrlsList getNewInstance(List arg, List pathToItem, PathTo for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof String)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -186,6 +182,13 @@ public PhotoUrlsList validate(List arg, SchemaConfiguration configuration) th public PhotoUrlsBoxedList validateAndBox(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new PhotoUrlsBoxedList(validate(arg, configuration)); } + @Override + public PhotoUrlsBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public enum StringStatusEnums implements StringValueMethod { AVAILABLE("available"), @@ -202,24 +205,20 @@ public String value() { } - public static abstract sealed class StatusBoxed permits StatusBoxedString { - public abstract @Nullable Object data(); + public sealed interface StatusBoxed permits StatusBoxedString { + @Nullable Object getData(); } - public static final class StatusBoxedString extends StatusBoxed { - public final String data; - private StatusBoxedString(String data) { - this.data = data; - } + public record StatusBoxedString(String data) implements StatusBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Status extends JsonSchema implements StringSchemaValidator, StringEnumValidator { + public static class Status extends JsonSchema implements StringSchemaValidator, StringEnumValidator { private static @Nullable Status instance = null; protected Status() { @@ -276,6 +275,13 @@ public String validate(StringStatusEnums arg,SchemaConfiguration configuration) public StatusBoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new StatusBoxedString(validate(arg, configuration)); } + @Override + public StatusBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class TagsList extends FrozenList { @@ -310,24 +316,20 @@ public TagsListBuilder add(Map item) { } - public static abstract sealed class TagsBoxed permits TagsBoxedList { - public abstract @Nullable Object data(); + public sealed interface TagsBoxed permits TagsBoxedList { + @Nullable Object getData(); } - public static final class TagsBoxedList extends TagsBoxed { - public final TagsList data; - private TagsBoxedList(TagsList data) { - this.data = data; - } + public record TagsBoxedList(TagsList data) implements TagsBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Tags extends JsonSchema implements ListSchemaValidator { + public static class Tags extends JsonSchema implements ListSchemaValidator { private static @Nullable Tags instance = null; protected Tags() { @@ -351,11 +353,11 @@ public TagsList getNewInstance(List arg, List pathToItem, PathToSchem for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof Tag.TagMap)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -395,6 +397,13 @@ public TagsList validate(List arg, SchemaConfiguration configuration) throws public TagsBoxedList validateAndBox(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new TagsBoxedList(validate(arg, configuration)); } + @Override + public TagsBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class PetMap extends FrozenMap<@Nullable Object> { @@ -650,23 +659,19 @@ public PetMap10Builder getBuilderAfterPhotoUrls(Map in } - public static abstract sealed class Pet1Boxed permits Pet1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Pet1Boxed permits Pet1BoxedMap { + @Nullable Object getData(); } - public static final class Pet1BoxedMap extends Pet1Boxed { - public final PetMap data; - private Pet1BoxedMap(PetMap data) { - this.data = data; - } + public record Pet1BoxedMap(PetMap data) implements Pet1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Pet1 extends JsonSchema implements MapSchemaValidator { + public static class Pet1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -713,11 +718,11 @@ public PetMap getNewInstance(Map arg, List pathToItem, PathToSchem List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -754,6 +759,13 @@ public PetMap validate(Map arg, SchemaConfiguration configuration) throws public Pet1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Pet1BoxedMap(validate(arg, configuration)); } + @Override + public Pet1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Pig.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Pig.java index d44f79ca023..9a385a57d58 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Pig.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Pig.java @@ -35,78 +35,54 @@ public class Pig { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class Pig1Boxed permits Pig1BoxedVoid, Pig1BoxedBoolean, Pig1BoxedNumber, Pig1BoxedString, Pig1BoxedList, Pig1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Pig1Boxed permits Pig1BoxedVoid, Pig1BoxedBoolean, Pig1BoxedNumber, Pig1BoxedString, Pig1BoxedList, Pig1BoxedMap { + @Nullable Object getData(); } - public static final class Pig1BoxedVoid extends Pig1Boxed { - public final Void data; - private Pig1BoxedVoid(Void data) { - this.data = data; - } + public record Pig1BoxedVoid(Void data) implements Pig1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Pig1BoxedBoolean extends Pig1Boxed { - public final boolean data; - private Pig1BoxedBoolean(boolean data) { - this.data = data; - } + public record Pig1BoxedBoolean(boolean data) implements Pig1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Pig1BoxedNumber extends Pig1Boxed { - public final Number data; - private Pig1BoxedNumber(Number data) { - this.data = data; - } + public record Pig1BoxedNumber(Number data) implements Pig1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Pig1BoxedString extends Pig1Boxed { - public final String data; - private Pig1BoxedString(String data) { - this.data = data; - } + public record Pig1BoxedString(String data) implements Pig1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Pig1BoxedList extends Pig1Boxed { - public final FrozenList<@Nullable Object> data; - private Pig1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Pig1BoxedList(FrozenList<@Nullable Object> data) implements Pig1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Pig1BoxedMap extends Pig1Boxed { - public final FrozenMap<@Nullable Object> data; - private Pig1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record Pig1BoxedMap(FrozenMap<@Nullable Object> data) implements Pig1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Pig1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Pig1BoxedList>, MapSchemaValidator, Pig1BoxedMap> { + public static class Pig1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Pig1BoxedList>, MapSchemaValidator, Pig1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -214,11 +190,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -249,11 +225,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -332,5 +308,24 @@ public Pig1BoxedList validateAndBox(List arg, SchemaConfiguration configurati public Pig1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Pig1BoxedMap(validate(arg, configuration)); } + @Override + public Pig1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Player.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Player.java index b4c7b3c9ee9..e0555909702 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Player.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Player.java @@ -132,23 +132,19 @@ public PlayerMapBuilder getBuilderAfterAdditionalProperty(Map { + public static class Player1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -187,11 +183,11 @@ public PlayerMap getNewInstance(Map arg, List pathToItem, PathToSc List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -228,6 +224,13 @@ public PlayerMap validate(Map arg, SchemaConfiguration configuration) thro public Player1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Player1BoxedMap(validate(arg, configuration)); } + @Override + public Player1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/PublicKey.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/PublicKey.java index 11a9fc13536..6e03a2081a6 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/PublicKey.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/PublicKey.java @@ -106,23 +106,19 @@ public PublicKeyMapBuilder getBuilderAfterAdditionalProperty(Map { + public static class PublicKey1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -160,11 +156,11 @@ public PublicKeyMap getNewInstance(Map arg, List pathToItem, PathT List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -201,6 +197,13 @@ public PublicKeyMap validate(Map arg, SchemaConfiguration configuration) t public PublicKey1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new PublicKey1BoxedMap(validate(arg, configuration)); } + @Override + public PublicKey1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Quadrilateral.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Quadrilateral.java index 6d50a1c3572..eb0913bb7b3 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Quadrilateral.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Quadrilateral.java @@ -35,78 +35,54 @@ public class Quadrilateral { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class Quadrilateral1Boxed permits Quadrilateral1BoxedVoid, Quadrilateral1BoxedBoolean, Quadrilateral1BoxedNumber, Quadrilateral1BoxedString, Quadrilateral1BoxedList, Quadrilateral1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Quadrilateral1Boxed permits Quadrilateral1BoxedVoid, Quadrilateral1BoxedBoolean, Quadrilateral1BoxedNumber, Quadrilateral1BoxedString, Quadrilateral1BoxedList, Quadrilateral1BoxedMap { + @Nullable Object getData(); } - public static final class Quadrilateral1BoxedVoid extends Quadrilateral1Boxed { - public final Void data; - private Quadrilateral1BoxedVoid(Void data) { - this.data = data; - } + public record Quadrilateral1BoxedVoid(Void data) implements Quadrilateral1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Quadrilateral1BoxedBoolean extends Quadrilateral1Boxed { - public final boolean data; - private Quadrilateral1BoxedBoolean(boolean data) { - this.data = data; - } + public record Quadrilateral1BoxedBoolean(boolean data) implements Quadrilateral1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Quadrilateral1BoxedNumber extends Quadrilateral1Boxed { - public final Number data; - private Quadrilateral1BoxedNumber(Number data) { - this.data = data; - } + public record Quadrilateral1BoxedNumber(Number data) implements Quadrilateral1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Quadrilateral1BoxedString extends Quadrilateral1Boxed { - public final String data; - private Quadrilateral1BoxedString(String data) { - this.data = data; - } + public record Quadrilateral1BoxedString(String data) implements Quadrilateral1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Quadrilateral1BoxedList extends Quadrilateral1Boxed { - public final FrozenList<@Nullable Object> data; - private Quadrilateral1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Quadrilateral1BoxedList(FrozenList<@Nullable Object> data) implements Quadrilateral1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Quadrilateral1BoxedMap extends Quadrilateral1Boxed { - public final FrozenMap<@Nullable Object> data; - private Quadrilateral1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record Quadrilateral1BoxedMap(FrozenMap<@Nullable Object> data) implements Quadrilateral1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Quadrilateral1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Quadrilateral1BoxedList>, MapSchemaValidator, Quadrilateral1BoxedMap> { + public static class Quadrilateral1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Quadrilateral1BoxedList>, MapSchemaValidator, Quadrilateral1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -214,11 +190,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -249,11 +225,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -332,5 +308,24 @@ public Quadrilateral1BoxedList validateAndBox(List arg, SchemaConfiguration c public Quadrilateral1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Quadrilateral1BoxedMap(validate(arg, configuration)); } + @Override + public Quadrilateral1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/QuadrilateralInterface.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/QuadrilateralInterface.java index 04ce14b728a..a78c73750d0 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/QuadrilateralInterface.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/QuadrilateralInterface.java @@ -53,24 +53,20 @@ public String value() { } - public static abstract sealed class ShapeTypeBoxed permits ShapeTypeBoxedString { - public abstract @Nullable Object data(); + public sealed interface ShapeTypeBoxed permits ShapeTypeBoxedString { + @Nullable Object getData(); } - public static final class ShapeTypeBoxedString extends ShapeTypeBoxed { - public final String data; - private ShapeTypeBoxedString(String data) { - this.data = data; - } + public record ShapeTypeBoxedString(String data) implements ShapeTypeBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ShapeType extends JsonSchema implements StringSchemaValidator, StringEnumValidator { + public static class ShapeType extends JsonSchema implements StringSchemaValidator, StringEnumValidator { private static @Nullable ShapeType instance = null; protected ShapeType() { @@ -125,6 +121,13 @@ public String validate(StringShapeTypeEnums arg,SchemaConfiguration configuratio public ShapeTypeBoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ShapeTypeBoxedString(validate(arg, configuration)); } + @Override + public ShapeTypeBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class QuadrilateralType extends StringJsonSchema.StringJsonSchema1 { @@ -268,78 +271,54 @@ public QuadrilateralInterfaceMap10Builder getBuilderAfterShapeType(Map data; - private QuadrilateralInterface1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record QuadrilateralInterface1BoxedList(FrozenList<@Nullable Object> data) implements QuadrilateralInterface1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class QuadrilateralInterface1BoxedMap extends QuadrilateralInterface1Boxed { - public final QuadrilateralInterfaceMap data; - private QuadrilateralInterface1BoxedMap(QuadrilateralInterfaceMap data) { - this.data = data; - } + public record QuadrilateralInterface1BoxedMap(QuadrilateralInterfaceMap data) implements QuadrilateralInterface1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class QuadrilateralInterface1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, QuadrilateralInterface1BoxedList>, MapSchemaValidator { + public static class QuadrilateralInterface1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, QuadrilateralInterface1BoxedList>, MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -451,11 +430,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -486,11 +465,11 @@ public QuadrilateralInterfaceMap getNewInstance(Map arg, List path List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -569,5 +548,24 @@ public QuadrilateralInterface1BoxedList validateAndBox(List arg, SchemaConfig public QuadrilateralInterface1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new QuadrilateralInterface1BoxedMap(validate(arg, configuration)); } + @Override + public QuadrilateralInterface1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ReadOnlyFirst.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ReadOnlyFirst.java index 60a3869dd42..68e6ae7401f 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ReadOnlyFirst.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ReadOnlyFirst.java @@ -143,23 +143,19 @@ public ReadOnlyFirstMapBuilder getBuilderAfterAdditionalProperty(Map { + public static class ReadOnlyFirst1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -196,11 +192,11 @@ public ReadOnlyFirstMap getNewInstance(Map arg, List pathToItem, P List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -237,6 +233,13 @@ public ReadOnlyFirstMap validate(Map arg, SchemaConfiguration configuratio public ReadOnlyFirst1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ReadOnlyFirst1BoxedMap(validate(arg, configuration)); } + @Override + public ReadOnlyFirst1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ReqPropsFromExplicitAddProps.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ReqPropsFromExplicitAddProps.java index ff65ee4e9b5..6daa60214b9 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ReqPropsFromExplicitAddProps.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ReqPropsFromExplicitAddProps.java @@ -163,23 +163,19 @@ public ReqPropsFromExplicitAddPropsMap10Builder getBuilderAfterValidName(Map { + public static class ReqPropsFromExplicitAddProps1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -217,11 +213,11 @@ public ReqPropsFromExplicitAddPropsMap getNewInstance(Map arg, List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof String)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -261,6 +257,13 @@ public ReqPropsFromExplicitAddPropsMap validate(Map arg, SchemaConfigurati public ReqPropsFromExplicitAddProps1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ReqPropsFromExplicitAddProps1BoxedMap(validate(arg, configuration)); } + @Override + public ReqPropsFromExplicitAddProps1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ReqPropsFromTrueAddProps.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ReqPropsFromTrueAddProps.java index 764ac94039f..4c881bceaf6 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ReqPropsFromTrueAddProps.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ReqPropsFromTrueAddProps.java @@ -315,23 +315,19 @@ public ReqPropsFromTrueAddPropsMap10Builder getBuilderAfterValidName(Map { + public static class ReqPropsFromTrueAddProps1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -369,11 +365,11 @@ public ReqPropsFromTrueAddPropsMap getNewInstance(Map arg, List pa List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -410,6 +406,13 @@ public ReqPropsFromTrueAddPropsMap validate(Map arg, SchemaConfiguration c public ReqPropsFromTrueAddProps1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ReqPropsFromTrueAddProps1BoxedMap(validate(arg, configuration)); } + @Override + public ReqPropsFromTrueAddProps1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ReqPropsFromUnsetAddProps.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ReqPropsFromUnsetAddProps.java index 5c04ac72ab5..4d680f215bc 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ReqPropsFromUnsetAddProps.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ReqPropsFromUnsetAddProps.java @@ -235,23 +235,19 @@ public ReqPropsFromUnsetAddPropsMap10Builder getBuilderAfterValidName(Map { + public static class ReqPropsFromUnsetAddProps1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -288,11 +284,11 @@ public ReqPropsFromUnsetAddPropsMap getNewInstance(Map arg, List p List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -329,6 +325,13 @@ public ReqPropsFromUnsetAddPropsMap validate(Map arg, SchemaConfiguration public ReqPropsFromUnsetAddProps1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ReqPropsFromUnsetAddProps1BoxedMap(validate(arg, configuration)); } + @Override + public ReqPropsFromUnsetAddProps1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ReturnSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ReturnSchema.java index c96a28b79c2..cde9348b342 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ReturnSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ReturnSchema.java @@ -111,78 +111,54 @@ public ReturnMapBuilder1 getBuilderAfterAdditionalProperty(Map data; - private ReturnSchema1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record ReturnSchema1BoxedList(FrozenList<@Nullable Object> data) implements ReturnSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ReturnSchema1BoxedMap extends ReturnSchema1Boxed { - public final ReturnMap data; - private ReturnSchema1BoxedMap(ReturnMap data) { - this.data = data; - } + public record ReturnSchema1BoxedMap(ReturnMap data) implements ReturnSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ReturnSchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ReturnSchema1BoxedList>, MapSchemaValidator { + public static class ReturnSchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ReturnSchema1BoxedList>, MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -291,11 +267,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -326,11 +302,11 @@ public ReturnMap getNewInstance(Map arg, List pathToItem, PathToSc List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -409,5 +385,24 @@ public ReturnSchema1BoxedList validateAndBox(List arg, SchemaConfiguration co public ReturnSchema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ReturnSchema1BoxedMap(validate(arg, configuration)); } + @Override + public ReturnSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ScaleneTriangle.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ScaleneTriangle.java index 111d8cc20a8..a3a51048188 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ScaleneTriangle.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ScaleneTriangle.java @@ -52,24 +52,20 @@ public String value() { } - public static abstract sealed class TriangleTypeBoxed permits TriangleTypeBoxedString { - public abstract @Nullable Object data(); + public sealed interface TriangleTypeBoxed permits TriangleTypeBoxedString { + @Nullable Object getData(); } - public static final class TriangleTypeBoxedString extends TriangleTypeBoxed { - public final String data; - private TriangleTypeBoxedString(String data) { - this.data = data; - } + public record TriangleTypeBoxedString(String data) implements TriangleTypeBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class TriangleType extends JsonSchema implements StringSchemaValidator, StringEnumValidator { + public static class TriangleType extends JsonSchema implements StringSchemaValidator, StringEnumValidator { private static @Nullable TriangleType instance = null; protected TriangleType() { @@ -124,6 +120,13 @@ public String validate(StringTriangleTypeEnums arg,SchemaConfiguration configura public TriangleTypeBoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new TriangleTypeBoxedString(validate(arg, configuration)); } + @Override + public TriangleTypeBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class Schema1Map extends FrozenMap<@Nullable Object> { @@ -198,23 +201,19 @@ public Schema1MapBuilder getBuilderAfterAdditionalProperty(Map { + public static class Schema1 extends JsonSchema implements MapSchemaValidator { private static @Nullable Schema1 instance = null; protected Schema1() { @@ -244,11 +243,11 @@ public Schema1Map getNewInstance(Map arg, List pathToItem, PathToS List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -285,81 +284,64 @@ public Schema1Map validate(Map arg, SchemaConfiguration configuration) thr public Schema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema1BoxedMap(validate(arg, configuration)); } + @Override + public Schema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class ScaleneTriangle1Boxed permits ScaleneTriangle1BoxedVoid, ScaleneTriangle1BoxedBoolean, ScaleneTriangle1BoxedNumber, ScaleneTriangle1BoxedString, ScaleneTriangle1BoxedList, ScaleneTriangle1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface ScaleneTriangle1Boxed permits ScaleneTriangle1BoxedVoid, ScaleneTriangle1BoxedBoolean, ScaleneTriangle1BoxedNumber, ScaleneTriangle1BoxedString, ScaleneTriangle1BoxedList, ScaleneTriangle1BoxedMap { + @Nullable Object getData(); } - public static final class ScaleneTriangle1BoxedVoid extends ScaleneTriangle1Boxed { - public final Void data; - private ScaleneTriangle1BoxedVoid(Void data) { - this.data = data; - } + public record ScaleneTriangle1BoxedVoid(Void data) implements ScaleneTriangle1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ScaleneTriangle1BoxedBoolean extends ScaleneTriangle1Boxed { - public final boolean data; - private ScaleneTriangle1BoxedBoolean(boolean data) { - this.data = data; - } + public record ScaleneTriangle1BoxedBoolean(boolean data) implements ScaleneTriangle1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ScaleneTriangle1BoxedNumber extends ScaleneTriangle1Boxed { - public final Number data; - private ScaleneTriangle1BoxedNumber(Number data) { - this.data = data; - } + public record ScaleneTriangle1BoxedNumber(Number data) implements ScaleneTriangle1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ScaleneTriangle1BoxedString extends ScaleneTriangle1Boxed { - public final String data; - private ScaleneTriangle1BoxedString(String data) { - this.data = data; - } + public record ScaleneTriangle1BoxedString(String data) implements ScaleneTriangle1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ScaleneTriangle1BoxedList extends ScaleneTriangle1Boxed { - public final FrozenList<@Nullable Object> data; - private ScaleneTriangle1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record ScaleneTriangle1BoxedList(FrozenList<@Nullable Object> data) implements ScaleneTriangle1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ScaleneTriangle1BoxedMap extends ScaleneTriangle1Boxed { - public final FrozenMap<@Nullable Object> data; - private ScaleneTriangle1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record ScaleneTriangle1BoxedMap(FrozenMap<@Nullable Object> data) implements ScaleneTriangle1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ScaleneTriangle1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ScaleneTriangle1BoxedList>, MapSchemaValidator, ScaleneTriangle1BoxedMap> { + public static class ScaleneTriangle1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ScaleneTriangle1BoxedList>, MapSchemaValidator, ScaleneTriangle1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -467,11 +449,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -502,11 +484,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -585,5 +567,24 @@ public ScaleneTriangle1BoxedList validateAndBox(List arg, SchemaConfiguration public ScaleneTriangle1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ScaleneTriangle1BoxedMap(validate(arg, configuration)); } + @Override + public ScaleneTriangle1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Schema200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Schema200Response.java index cb8685207bf..4ef90595cef 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Schema200Response.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Schema200Response.java @@ -149,78 +149,54 @@ public Schema200ResponseMapBuilder getBuilderAfterAdditionalProperty(Map data; - private Schema200Response1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Schema200Response1BoxedList(FrozenList<@Nullable Object> data) implements Schema200Response1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema200Response1BoxedMap extends Schema200Response1Boxed { - public final Schema200ResponseMap data; - private Schema200Response1BoxedMap(Schema200ResponseMap data) { - this.data = data; - } + public record Schema200Response1BoxedMap(Schema200ResponseMap data) implements Schema200Response1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema200Response1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema200Response1BoxedList>, MapSchemaValidator { + public static class Schema200Response1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema200Response1BoxedList>, MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -330,11 +306,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -365,11 +341,11 @@ public Schema200ResponseMap getNewInstance(Map arg, List pathToIte List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -448,5 +424,24 @@ public Schema200Response1BoxedList validateAndBox(List arg, SchemaConfigurati public Schema200Response1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema200Response1BoxedMap(validate(arg, configuration)); } + @Override + public Schema200Response1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/SelfReferencingArrayModel.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/SelfReferencingArrayModel.java index 5f258da7002..391c432945d 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/SelfReferencingArrayModel.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/SelfReferencingArrayModel.java @@ -55,24 +55,20 @@ public List> build() { } - public static abstract sealed class SelfReferencingArrayModel1Boxed permits SelfReferencingArrayModel1BoxedList { - public abstract @Nullable Object data(); + public sealed interface SelfReferencingArrayModel1Boxed permits SelfReferencingArrayModel1BoxedList { + @Nullable Object getData(); } - public static final class SelfReferencingArrayModel1BoxedList extends SelfReferencingArrayModel1Boxed { - public final SelfReferencingArrayModelList data; - private SelfReferencingArrayModel1BoxedList(SelfReferencingArrayModelList data) { - this.data = data; - } + public record SelfReferencingArrayModel1BoxedList(SelfReferencingArrayModelList data) implements SelfReferencingArrayModel1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class SelfReferencingArrayModel1 extends JsonSchema implements ListSchemaValidator { + public static class SelfReferencingArrayModel1 extends JsonSchema implements ListSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -102,11 +98,11 @@ public SelfReferencingArrayModelList getNewInstance(List arg, List pa for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof SelfReferencingArrayModelList)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -146,5 +142,12 @@ public SelfReferencingArrayModelList validate(List arg, SchemaConfiguration c public SelfReferencingArrayModel1BoxedList validateAndBox(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new SelfReferencingArrayModel1BoxedList(validate(arg, configuration)); } + @Override + public SelfReferencingArrayModel1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/SelfReferencingObjectModel.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/SelfReferencingObjectModel.java index 32af112a2b5..06512cff6c2 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/SelfReferencingObjectModel.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/SelfReferencingObjectModel.java @@ -110,23 +110,19 @@ public SelfReferencingObjectModelMapBuilder getBuilderAfterAdditionalProperty(Ma } - public static abstract sealed class SelfReferencingObjectModel1Boxed permits SelfReferencingObjectModel1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface SelfReferencingObjectModel1Boxed permits SelfReferencingObjectModel1BoxedMap { + @Nullable Object getData(); } - public static final class SelfReferencingObjectModel1BoxedMap extends SelfReferencingObjectModel1Boxed { - public final SelfReferencingObjectModelMap data; - private SelfReferencingObjectModel1BoxedMap(SelfReferencingObjectModelMap data) { - this.data = data; - } + public record SelfReferencingObjectModel1BoxedMap(SelfReferencingObjectModelMap data) implements SelfReferencingObjectModel1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class SelfReferencingObjectModel1 extends JsonSchema implements MapSchemaValidator { + public static class SelfReferencingObjectModel1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -163,11 +159,11 @@ public SelfReferencingObjectModelMap getNewInstance(Map arg, List List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -204,6 +200,13 @@ public SelfReferencingObjectModelMap validate(Map arg, SchemaConfiguration public SelfReferencingObjectModel1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new SelfReferencingObjectModel1BoxedMap(validate(arg, configuration)); } + @Override + public SelfReferencingObjectModel1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Shape.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Shape.java index 71c071879e5..42a01a295f5 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Shape.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Shape.java @@ -35,78 +35,54 @@ public class Shape { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class Shape1Boxed permits Shape1BoxedVoid, Shape1BoxedBoolean, Shape1BoxedNumber, Shape1BoxedString, Shape1BoxedList, Shape1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Shape1Boxed permits Shape1BoxedVoid, Shape1BoxedBoolean, Shape1BoxedNumber, Shape1BoxedString, Shape1BoxedList, Shape1BoxedMap { + @Nullable Object getData(); } - public static final class Shape1BoxedVoid extends Shape1Boxed { - public final Void data; - private Shape1BoxedVoid(Void data) { - this.data = data; - } + public record Shape1BoxedVoid(Void data) implements Shape1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Shape1BoxedBoolean extends Shape1Boxed { - public final boolean data; - private Shape1BoxedBoolean(boolean data) { - this.data = data; - } + public record Shape1BoxedBoolean(boolean data) implements Shape1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Shape1BoxedNumber extends Shape1Boxed { - public final Number data; - private Shape1BoxedNumber(Number data) { - this.data = data; - } + public record Shape1BoxedNumber(Number data) implements Shape1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Shape1BoxedString extends Shape1Boxed { - public final String data; - private Shape1BoxedString(String data) { - this.data = data; - } + public record Shape1BoxedString(String data) implements Shape1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Shape1BoxedList extends Shape1Boxed { - public final FrozenList<@Nullable Object> data; - private Shape1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Shape1BoxedList(FrozenList<@Nullable Object> data) implements Shape1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Shape1BoxedMap extends Shape1Boxed { - public final FrozenMap<@Nullable Object> data; - private Shape1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record Shape1BoxedMap(FrozenMap<@Nullable Object> data) implements Shape1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Shape1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Shape1BoxedList>, MapSchemaValidator, Shape1BoxedMap> { + public static class Shape1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Shape1BoxedList>, MapSchemaValidator, Shape1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -214,11 +190,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -249,11 +225,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -332,5 +308,24 @@ public Shape1BoxedList validateAndBox(List arg, SchemaConfiguration configura public Shape1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Shape1BoxedMap(validate(arg, configuration)); } + @Override + public Shape1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ShapeOrNull.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ShapeOrNull.java index 6e7843466f3..f2ee34e6eee 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ShapeOrNull.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/ShapeOrNull.java @@ -47,78 +47,54 @@ public static Schema0 getInstance() { } - public static abstract sealed class ShapeOrNull1Boxed permits ShapeOrNull1BoxedVoid, ShapeOrNull1BoxedBoolean, ShapeOrNull1BoxedNumber, ShapeOrNull1BoxedString, ShapeOrNull1BoxedList, ShapeOrNull1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface ShapeOrNull1Boxed permits ShapeOrNull1BoxedVoid, ShapeOrNull1BoxedBoolean, ShapeOrNull1BoxedNumber, ShapeOrNull1BoxedString, ShapeOrNull1BoxedList, ShapeOrNull1BoxedMap { + @Nullable Object getData(); } - public static final class ShapeOrNull1BoxedVoid extends ShapeOrNull1Boxed { - public final Void data; - private ShapeOrNull1BoxedVoid(Void data) { - this.data = data; - } + public record ShapeOrNull1BoxedVoid(Void data) implements ShapeOrNull1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ShapeOrNull1BoxedBoolean extends ShapeOrNull1Boxed { - public final boolean data; - private ShapeOrNull1BoxedBoolean(boolean data) { - this.data = data; - } + public record ShapeOrNull1BoxedBoolean(boolean data) implements ShapeOrNull1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ShapeOrNull1BoxedNumber extends ShapeOrNull1Boxed { - public final Number data; - private ShapeOrNull1BoxedNumber(Number data) { - this.data = data; - } + public record ShapeOrNull1BoxedNumber(Number data) implements ShapeOrNull1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ShapeOrNull1BoxedString extends ShapeOrNull1Boxed { - public final String data; - private ShapeOrNull1BoxedString(String data) { - this.data = data; - } + public record ShapeOrNull1BoxedString(String data) implements ShapeOrNull1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ShapeOrNull1BoxedList extends ShapeOrNull1Boxed { - public final FrozenList<@Nullable Object> data; - private ShapeOrNull1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record ShapeOrNull1BoxedList(FrozenList<@Nullable Object> data) implements ShapeOrNull1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ShapeOrNull1BoxedMap extends ShapeOrNull1Boxed { - public final FrozenMap<@Nullable Object> data; - private ShapeOrNull1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record ShapeOrNull1BoxedMap(FrozenMap<@Nullable Object> data) implements ShapeOrNull1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ShapeOrNull1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ShapeOrNull1BoxedList>, MapSchemaValidator, ShapeOrNull1BoxedMap> { + public static class ShapeOrNull1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ShapeOrNull1BoxedList>, MapSchemaValidator, ShapeOrNull1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -229,11 +205,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -264,11 +240,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -347,5 +323,24 @@ public ShapeOrNull1BoxedList validateAndBox(List arg, SchemaConfiguration con public ShapeOrNull1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ShapeOrNull1BoxedMap(validate(arg, configuration)); } + @Override + public ShapeOrNull1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/SimpleQuadrilateral.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/SimpleQuadrilateral.java index 1ba98c8b9d1..e003d011a1f 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/SimpleQuadrilateral.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/SimpleQuadrilateral.java @@ -52,24 +52,20 @@ public String value() { } - public static abstract sealed class QuadrilateralTypeBoxed permits QuadrilateralTypeBoxedString { - public abstract @Nullable Object data(); + public sealed interface QuadrilateralTypeBoxed permits QuadrilateralTypeBoxedString { + @Nullable Object getData(); } - public static final class QuadrilateralTypeBoxedString extends QuadrilateralTypeBoxed { - public final String data; - private QuadrilateralTypeBoxedString(String data) { - this.data = data; - } + public record QuadrilateralTypeBoxedString(String data) implements QuadrilateralTypeBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class QuadrilateralType extends JsonSchema implements StringSchemaValidator, StringEnumValidator { + public static class QuadrilateralType extends JsonSchema implements StringSchemaValidator, StringEnumValidator { private static @Nullable QuadrilateralType instance = null; protected QuadrilateralType() { @@ -124,6 +120,13 @@ public String validate(StringQuadrilateralTypeEnums arg,SchemaConfiguration conf public QuadrilateralTypeBoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new QuadrilateralTypeBoxedString(validate(arg, configuration)); } + @Override + public QuadrilateralTypeBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class Schema1Map extends FrozenMap<@Nullable Object> { @@ -198,23 +201,19 @@ public Schema1MapBuilder getBuilderAfterAdditionalProperty(Map { + public static class Schema1 extends JsonSchema implements MapSchemaValidator { private static @Nullable Schema1 instance = null; protected Schema1() { @@ -244,11 +243,11 @@ public Schema1Map getNewInstance(Map arg, List pathToItem, PathToS List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -285,81 +284,64 @@ public Schema1Map validate(Map arg, SchemaConfiguration configuration) thr public Schema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema1BoxedMap(validate(arg, configuration)); } + @Override + public Schema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class SimpleQuadrilateral1Boxed permits SimpleQuadrilateral1BoxedVoid, SimpleQuadrilateral1BoxedBoolean, SimpleQuadrilateral1BoxedNumber, SimpleQuadrilateral1BoxedString, SimpleQuadrilateral1BoxedList, SimpleQuadrilateral1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface SimpleQuadrilateral1Boxed permits SimpleQuadrilateral1BoxedVoid, SimpleQuadrilateral1BoxedBoolean, SimpleQuadrilateral1BoxedNumber, SimpleQuadrilateral1BoxedString, SimpleQuadrilateral1BoxedList, SimpleQuadrilateral1BoxedMap { + @Nullable Object getData(); } - public static final class SimpleQuadrilateral1BoxedVoid extends SimpleQuadrilateral1Boxed { - public final Void data; - private SimpleQuadrilateral1BoxedVoid(Void data) { - this.data = data; - } + public record SimpleQuadrilateral1BoxedVoid(Void data) implements SimpleQuadrilateral1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class SimpleQuadrilateral1BoxedBoolean extends SimpleQuadrilateral1Boxed { - public final boolean data; - private SimpleQuadrilateral1BoxedBoolean(boolean data) { - this.data = data; - } + public record SimpleQuadrilateral1BoxedBoolean(boolean data) implements SimpleQuadrilateral1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class SimpleQuadrilateral1BoxedNumber extends SimpleQuadrilateral1Boxed { - public final Number data; - private SimpleQuadrilateral1BoxedNumber(Number data) { - this.data = data; - } + public record SimpleQuadrilateral1BoxedNumber(Number data) implements SimpleQuadrilateral1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class SimpleQuadrilateral1BoxedString extends SimpleQuadrilateral1Boxed { - public final String data; - private SimpleQuadrilateral1BoxedString(String data) { - this.data = data; - } + public record SimpleQuadrilateral1BoxedString(String data) implements SimpleQuadrilateral1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class SimpleQuadrilateral1BoxedList extends SimpleQuadrilateral1Boxed { - public final FrozenList<@Nullable Object> data; - private SimpleQuadrilateral1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record SimpleQuadrilateral1BoxedList(FrozenList<@Nullable Object> data) implements SimpleQuadrilateral1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class SimpleQuadrilateral1BoxedMap extends SimpleQuadrilateral1Boxed { - public final FrozenMap<@Nullable Object> data; - private SimpleQuadrilateral1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record SimpleQuadrilateral1BoxedMap(FrozenMap<@Nullable Object> data) implements SimpleQuadrilateral1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class SimpleQuadrilateral1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, SimpleQuadrilateral1BoxedList>, MapSchemaValidator, SimpleQuadrilateral1BoxedMap> { + public static class SimpleQuadrilateral1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, SimpleQuadrilateral1BoxedList>, MapSchemaValidator, SimpleQuadrilateral1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -467,11 +449,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -502,11 +484,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -585,5 +567,24 @@ public SimpleQuadrilateral1BoxedList validateAndBox(List arg, SchemaConfigura public SimpleQuadrilateral1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new SimpleQuadrilateral1BoxedMap(validate(arg, configuration)); } + @Override + public SimpleQuadrilateral1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/SomeObject.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/SomeObject.java index a4cd76c800c..f2be945112a 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/SomeObject.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/SomeObject.java @@ -35,78 +35,54 @@ public class SomeObject { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class SomeObject1Boxed permits SomeObject1BoxedVoid, SomeObject1BoxedBoolean, SomeObject1BoxedNumber, SomeObject1BoxedString, SomeObject1BoxedList, SomeObject1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface SomeObject1Boxed permits SomeObject1BoxedVoid, SomeObject1BoxedBoolean, SomeObject1BoxedNumber, SomeObject1BoxedString, SomeObject1BoxedList, SomeObject1BoxedMap { + @Nullable Object getData(); } - public static final class SomeObject1BoxedVoid extends SomeObject1Boxed { - public final Void data; - private SomeObject1BoxedVoid(Void data) { - this.data = data; - } + public record SomeObject1BoxedVoid(Void data) implements SomeObject1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class SomeObject1BoxedBoolean extends SomeObject1Boxed { - public final boolean data; - private SomeObject1BoxedBoolean(boolean data) { - this.data = data; - } + public record SomeObject1BoxedBoolean(boolean data) implements SomeObject1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class SomeObject1BoxedNumber extends SomeObject1Boxed { - public final Number data; - private SomeObject1BoxedNumber(Number data) { - this.data = data; - } + public record SomeObject1BoxedNumber(Number data) implements SomeObject1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class SomeObject1BoxedString extends SomeObject1Boxed { - public final String data; - private SomeObject1BoxedString(String data) { - this.data = data; - } + public record SomeObject1BoxedString(String data) implements SomeObject1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class SomeObject1BoxedList extends SomeObject1Boxed { - public final FrozenList<@Nullable Object> data; - private SomeObject1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record SomeObject1BoxedList(FrozenList<@Nullable Object> data) implements SomeObject1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class SomeObject1BoxedMap extends SomeObject1Boxed { - public final FrozenMap<@Nullable Object> data; - private SomeObject1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record SomeObject1BoxedMap(FrozenMap<@Nullable Object> data) implements SomeObject1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class SomeObject1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, SomeObject1BoxedList>, MapSchemaValidator, SomeObject1BoxedMap> { + public static class SomeObject1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, SomeObject1BoxedList>, MapSchemaValidator, SomeObject1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -213,11 +189,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -248,11 +224,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -331,5 +307,24 @@ public SomeObject1BoxedList validateAndBox(List arg, SchemaConfiguration conf public SomeObject1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new SomeObject1BoxedMap(validate(arg, configuration)); } + @Override + public SomeObject1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/SpecialModelname.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/SpecialModelname.java index 5aebdd2fc81..ded331f552f 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/SpecialModelname.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/SpecialModelname.java @@ -106,23 +106,19 @@ public SpecialModelnameMapBuilder getBuilderAfterAdditionalProperty(Map { + public static class SpecialModelname1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -160,11 +156,11 @@ public SpecialModelnameMap getNewInstance(Map arg, List pathToItem List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -201,6 +197,13 @@ public SpecialModelnameMap validate(Map arg, SchemaConfiguration configura public SpecialModelname1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new SpecialModelname1BoxedMap(validate(arg, configuration)); } + @Override + public SpecialModelname1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/StringBooleanMap.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/StringBooleanMap.java index d4daa6b182b..a68c7c2ef85 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/StringBooleanMap.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/StringBooleanMap.java @@ -93,23 +93,19 @@ public StringBooleanMapMapBuilder getBuilderAfterAdditionalProperty(Map { + public static class StringBooleanMap1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -143,11 +139,11 @@ public StringBooleanMapMap getNewInstance(Map arg, List pathToItem List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Boolean)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -187,6 +183,13 @@ public StringBooleanMapMap validate(Map arg, SchemaConfiguration configura public StringBooleanMap1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new StringBooleanMap1BoxedMap(validate(arg, configuration)); } + @Override + public StringBooleanMap1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/StringEnum.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/StringEnum.java index c0bf3a2404e..2be475bc0f4 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/StringEnum.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/StringEnum.java @@ -55,35 +55,27 @@ public Void value() { } - public static abstract sealed class StringEnum1Boxed permits StringEnum1BoxedVoid, StringEnum1BoxedString { - public abstract @Nullable Object data(); + public sealed interface StringEnum1Boxed permits StringEnum1BoxedVoid, StringEnum1BoxedString { + @Nullable Object getData(); } - public static final class StringEnum1BoxedVoid extends StringEnum1Boxed { - public final Void data; - private StringEnum1BoxedVoid(Void data) { - this.data = data; - } + public record StringEnum1BoxedVoid(Void data) implements StringEnum1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class StringEnum1BoxedString extends StringEnum1Boxed { - public final String data; - private StringEnum1BoxedString(String data) { - this.data = data; - } + public record StringEnum1BoxedString(String data) implements StringEnum1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class StringEnum1 extends JsonSchema implements NullEnumValidator, StringEnumValidator, NullSchemaValidator, StringSchemaValidator { + public static class StringEnum1 extends JsonSchema implements NullEnumValidator, StringEnumValidator, NullSchemaValidator, StringSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -175,5 +167,15 @@ public StringEnum1BoxedVoid validateAndBox(Void arg, SchemaConfiguration configu public StringEnum1BoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new StringEnum1BoxedString(validate(arg, configuration)); } + @Override + public StringEnum1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/StringEnumWithDefaultValue.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/StringEnumWithDefaultValue.java index d3b2eb76c71..ea6617a8b7a 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/StringEnumWithDefaultValue.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/StringEnumWithDefaultValue.java @@ -37,24 +37,20 @@ public String value() { } - public static abstract sealed class StringEnumWithDefaultValue1Boxed permits StringEnumWithDefaultValue1BoxedString { - public abstract @Nullable Object data(); + public sealed interface StringEnumWithDefaultValue1Boxed permits StringEnumWithDefaultValue1BoxedString { + @Nullable Object getData(); } - public static final class StringEnumWithDefaultValue1BoxedString extends StringEnumWithDefaultValue1Boxed { - public final String data; - private StringEnumWithDefaultValue1BoxedString(String data) { - this.data = data; - } + public record StringEnumWithDefaultValue1BoxedString(String data) implements StringEnumWithDefaultValue1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class StringEnumWithDefaultValue1 extends JsonSchema implements StringSchemaValidator, StringEnumValidator, DefaultValueMethod { + public static class StringEnumWithDefaultValue1 extends JsonSchema implements StringSchemaValidator, StringEnumValidator, DefaultValueMethod { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -124,5 +120,12 @@ public String defaultValue() { public StringEnumWithDefaultValue1BoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new StringEnumWithDefaultValue1BoxedString(validate(arg, configuration)); } + @Override + public StringEnumWithDefaultValue1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/StringWithValidation.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/StringWithValidation.java index 995db3b84d9..c618fe0a225 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/StringWithValidation.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/StringWithValidation.java @@ -19,24 +19,20 @@ public class StringWithValidation { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class StringWithValidation1Boxed permits StringWithValidation1BoxedString { - public abstract @Nullable Object data(); + public sealed interface StringWithValidation1Boxed permits StringWithValidation1BoxedString { + @Nullable Object getData(); } - public static final class StringWithValidation1BoxedString extends StringWithValidation1Boxed { - public final String data; - private StringWithValidation1BoxedString(String data) { - this.data = data; - } + public record StringWithValidation1BoxedString(String data) implements StringWithValidation1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class StringWithValidation1 extends JsonSchema implements StringSchemaValidator { + public static class StringWithValidation1 extends JsonSchema implements StringSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -90,5 +86,12 @@ public String validate(String arg, SchemaConfiguration configuration) throws Val public StringWithValidation1BoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new StringWithValidation1BoxedString(validate(arg, configuration)); } + @Override + public StringWithValidation1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Tag.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Tag.java index 3e4141e3336..bb7cc4c9bf1 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Tag.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Tag.java @@ -162,23 +162,19 @@ public TagMapBuilder getBuilderAfterAdditionalProperty(Map { + public static class Tag1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -215,11 +211,11 @@ public TagMap getNewInstance(Map arg, List pathToItem, PathToSchem List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -256,6 +252,13 @@ public TagMap validate(Map arg, SchemaConfiguration configuration) throws public Tag1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Tag1BoxedMap(validate(arg, configuration)); } + @Override + public Tag1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Triangle.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Triangle.java index 87b7ed7ba4a..9a6a0546bd6 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Triangle.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Triangle.java @@ -35,78 +35,54 @@ public class Triangle { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class Triangle1Boxed permits Triangle1BoxedVoid, Triangle1BoxedBoolean, Triangle1BoxedNumber, Triangle1BoxedString, Triangle1BoxedList, Triangle1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Triangle1Boxed permits Triangle1BoxedVoid, Triangle1BoxedBoolean, Triangle1BoxedNumber, Triangle1BoxedString, Triangle1BoxedList, Triangle1BoxedMap { + @Nullable Object getData(); } - public static final class Triangle1BoxedVoid extends Triangle1Boxed { - public final Void data; - private Triangle1BoxedVoid(Void data) { - this.data = data; - } + public record Triangle1BoxedVoid(Void data) implements Triangle1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Triangle1BoxedBoolean extends Triangle1Boxed { - public final boolean data; - private Triangle1BoxedBoolean(boolean data) { - this.data = data; - } + public record Triangle1BoxedBoolean(boolean data) implements Triangle1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Triangle1BoxedNumber extends Triangle1Boxed { - public final Number data; - private Triangle1BoxedNumber(Number data) { - this.data = data; - } + public record Triangle1BoxedNumber(Number data) implements Triangle1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Triangle1BoxedString extends Triangle1Boxed { - public final String data; - private Triangle1BoxedString(String data) { - this.data = data; - } + public record Triangle1BoxedString(String data) implements Triangle1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Triangle1BoxedList extends Triangle1Boxed { - public final FrozenList<@Nullable Object> data; - private Triangle1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Triangle1BoxedList(FrozenList<@Nullable Object> data) implements Triangle1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Triangle1BoxedMap extends Triangle1Boxed { - public final FrozenMap<@Nullable Object> data; - private Triangle1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record Triangle1BoxedMap(FrozenMap<@Nullable Object> data) implements Triangle1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Triangle1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Triangle1BoxedList>, MapSchemaValidator, Triangle1BoxedMap> { + public static class Triangle1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Triangle1BoxedList>, MapSchemaValidator, Triangle1BoxedMap> { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -215,11 +191,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -250,11 +226,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -333,5 +309,24 @@ public Triangle1BoxedList validateAndBox(List arg, SchemaConfiguration config public Triangle1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Triangle1BoxedMap(validate(arg, configuration)); } + @Override + public Triangle1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/TriangleInterface.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/TriangleInterface.java index 905f0382b89..8e0505b9eb8 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/TriangleInterface.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/TriangleInterface.java @@ -53,24 +53,20 @@ public String value() { } - public static abstract sealed class ShapeTypeBoxed permits ShapeTypeBoxedString { - public abstract @Nullable Object data(); + public sealed interface ShapeTypeBoxed permits ShapeTypeBoxedString { + @Nullable Object getData(); } - public static final class ShapeTypeBoxedString extends ShapeTypeBoxed { - public final String data; - private ShapeTypeBoxedString(String data) { - this.data = data; - } + public record ShapeTypeBoxedString(String data) implements ShapeTypeBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ShapeType extends JsonSchema implements StringSchemaValidator, StringEnumValidator { + public static class ShapeType extends JsonSchema implements StringSchemaValidator, StringEnumValidator { private static @Nullable ShapeType instance = null; protected ShapeType() { @@ -125,6 +121,13 @@ public String validate(StringShapeTypeEnums arg,SchemaConfiguration configuratio public ShapeTypeBoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ShapeTypeBoxedString(validate(arg, configuration)); } + @Override + public ShapeTypeBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class TriangleType extends StringJsonSchema.StringJsonSchema1 { @@ -268,78 +271,54 @@ public TriangleInterfaceMap10Builder getBuilderAfterTriangleType(Map data; - private TriangleInterface1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record TriangleInterface1BoxedList(FrozenList<@Nullable Object> data) implements TriangleInterface1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class TriangleInterface1BoxedMap extends TriangleInterface1Boxed { - public final TriangleInterfaceMap data; - private TriangleInterface1BoxedMap(TriangleInterfaceMap data) { - this.data = data; - } + public record TriangleInterface1BoxedMap(TriangleInterfaceMap data) implements TriangleInterface1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class TriangleInterface1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, TriangleInterface1BoxedList>, MapSchemaValidator { + public static class TriangleInterface1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, TriangleInterface1BoxedList>, MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -451,11 +430,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -486,11 +465,11 @@ public TriangleInterfaceMap getNewInstance(Map arg, List pathToIte List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -569,5 +548,24 @@ public TriangleInterface1BoxedList validateAndBox(List arg, SchemaConfigurati public TriangleInterface1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new TriangleInterface1BoxedMap(validate(arg, configuration)); } + @Override + public TriangleInterface1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/UUIDString.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/UUIDString.java index cb841238b1b..3f8a3975eb4 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/UUIDString.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/UUIDString.java @@ -20,24 +20,20 @@ public class UUIDString { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class UUIDString1Boxed permits UUIDString1BoxedString { - public abstract @Nullable Object data(); + public sealed interface UUIDString1Boxed permits UUIDString1BoxedString { + @Nullable Object getData(); } - public static final class UUIDString1BoxedString extends UUIDString1Boxed { - public final String data; - private UUIDString1BoxedString(String data) { - this.data = data; - } + public record UUIDString1BoxedString(String data) implements UUIDString1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class UUIDString1 extends JsonSchema implements StringSchemaValidator { + public static class UUIDString1 extends JsonSchema implements StringSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -92,5 +88,12 @@ public String validate(String arg, SchemaConfiguration configuration) throws Val public UUIDString1BoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new UUIDString1BoxedString(validate(arg, configuration)); } + @Override + public UUIDString1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/User.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/User.java index f787a2be117..feca1011e62 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/User.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/User.java @@ -142,34 +142,26 @@ public static ObjectWithNoDeclaredProps getInstance() { } - public static abstract sealed class ObjectWithNoDeclaredPropsNullableBoxed permits ObjectWithNoDeclaredPropsNullableBoxedVoid, ObjectWithNoDeclaredPropsNullableBoxedMap { - public abstract @Nullable Object data(); + public sealed interface ObjectWithNoDeclaredPropsNullableBoxed permits ObjectWithNoDeclaredPropsNullableBoxedVoid, ObjectWithNoDeclaredPropsNullableBoxedMap { + @Nullable Object getData(); } - public static final class ObjectWithNoDeclaredPropsNullableBoxedVoid extends ObjectWithNoDeclaredPropsNullableBoxed { - public final Void data; - private ObjectWithNoDeclaredPropsNullableBoxedVoid(Void data) { - this.data = data; - } + public record ObjectWithNoDeclaredPropsNullableBoxedVoid(Void data) implements ObjectWithNoDeclaredPropsNullableBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ObjectWithNoDeclaredPropsNullableBoxedMap extends ObjectWithNoDeclaredPropsNullableBoxed { - public final FrozenMap<@Nullable Object> data; - private ObjectWithNoDeclaredPropsNullableBoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record ObjectWithNoDeclaredPropsNullableBoxedMap(FrozenMap<@Nullable Object> data) implements ObjectWithNoDeclaredPropsNullableBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ObjectWithNoDeclaredPropsNullable extends JsonSchema implements NullSchemaValidator, MapSchemaValidator, ObjectWithNoDeclaredPropsNullableBoxedMap> { + public static class ObjectWithNoDeclaredPropsNullable extends JsonSchema implements NullSchemaValidator, MapSchemaValidator, ObjectWithNoDeclaredPropsNullableBoxedMap> { private static @Nullable ObjectWithNoDeclaredPropsNullable instance = null; protected ObjectWithNoDeclaredPropsNullable() { @@ -210,11 +202,11 @@ public Void validate(Void arg, SchemaConfiguration configuration) throws Validat List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -259,6 +251,16 @@ public ObjectWithNoDeclaredPropsNullableBoxedVoid validateAndBox(Void arg, Schem public ObjectWithNoDeclaredPropsNullableBoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ObjectWithNoDeclaredPropsNullableBoxedMap(validate(arg, configuration)); } + @Override + public ObjectWithNoDeclaredPropsNullableBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class AnyTypeProp extends AnyTypeJsonSchema.AnyTypeJsonSchema1 { @@ -283,78 +285,54 @@ public static Not getInstance() { } - public static abstract sealed class AnyTypeExceptNullPropBoxed permits AnyTypeExceptNullPropBoxedVoid, AnyTypeExceptNullPropBoxedBoolean, AnyTypeExceptNullPropBoxedNumber, AnyTypeExceptNullPropBoxedString, AnyTypeExceptNullPropBoxedList, AnyTypeExceptNullPropBoxedMap { - public abstract @Nullable Object data(); + public sealed interface AnyTypeExceptNullPropBoxed permits AnyTypeExceptNullPropBoxedVoid, AnyTypeExceptNullPropBoxedBoolean, AnyTypeExceptNullPropBoxedNumber, AnyTypeExceptNullPropBoxedString, AnyTypeExceptNullPropBoxedList, AnyTypeExceptNullPropBoxedMap { + @Nullable Object getData(); } - public static final class AnyTypeExceptNullPropBoxedVoid extends AnyTypeExceptNullPropBoxed { - public final Void data; - private AnyTypeExceptNullPropBoxedVoid(Void data) { - this.data = data; - } + public record AnyTypeExceptNullPropBoxedVoid(Void data) implements AnyTypeExceptNullPropBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AnyTypeExceptNullPropBoxedBoolean extends AnyTypeExceptNullPropBoxed { - public final boolean data; - private AnyTypeExceptNullPropBoxedBoolean(boolean data) { - this.data = data; - } + public record AnyTypeExceptNullPropBoxedBoolean(boolean data) implements AnyTypeExceptNullPropBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AnyTypeExceptNullPropBoxedNumber extends AnyTypeExceptNullPropBoxed { - public final Number data; - private AnyTypeExceptNullPropBoxedNumber(Number data) { - this.data = data; - } + public record AnyTypeExceptNullPropBoxedNumber(Number data) implements AnyTypeExceptNullPropBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AnyTypeExceptNullPropBoxedString extends AnyTypeExceptNullPropBoxed { - public final String data; - private AnyTypeExceptNullPropBoxedString(String data) { - this.data = data; - } + public record AnyTypeExceptNullPropBoxedString(String data) implements AnyTypeExceptNullPropBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AnyTypeExceptNullPropBoxedList extends AnyTypeExceptNullPropBoxed { - public final FrozenList<@Nullable Object> data; - private AnyTypeExceptNullPropBoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record AnyTypeExceptNullPropBoxedList(FrozenList<@Nullable Object> data) implements AnyTypeExceptNullPropBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AnyTypeExceptNullPropBoxedMap extends AnyTypeExceptNullPropBoxed { - public final FrozenMap<@Nullable Object> data; - private AnyTypeExceptNullPropBoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record AnyTypeExceptNullPropBoxedMap(FrozenMap<@Nullable Object> data) implements AnyTypeExceptNullPropBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class AnyTypeExceptNullProp extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, AnyTypeExceptNullPropBoxedList>, MapSchemaValidator, AnyTypeExceptNullPropBoxedMap> { + public static class AnyTypeExceptNullProp extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, AnyTypeExceptNullPropBoxedList>, MapSchemaValidator, AnyTypeExceptNullPropBoxedMap> { private static @Nullable AnyTypeExceptNullProp instance = null; protected AnyTypeExceptNullProp() { @@ -453,11 +431,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -488,11 +466,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -571,6 +549,25 @@ public AnyTypeExceptNullPropBoxedList validateAndBox(List arg, SchemaConfigur public AnyTypeExceptNullPropBoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new AnyTypeExceptNullPropBoxedMap(validate(arg, configuration)); } + @Override + public AnyTypeExceptNullPropBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class AnyTypePropNullable extends AnyTypeJsonSchema.AnyTypeJsonSchema1 { @@ -1118,23 +1115,19 @@ public UserMapBuilder getBuilderAfterAdditionalProperty(Map { + public static class User1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -1182,11 +1175,11 @@ public UserMap getNewInstance(Map arg, List pathToItem, PathToSche List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -1223,6 +1216,13 @@ public UserMap validate(Map arg, SchemaConfiguration configuration) throws public User1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new User1BoxedMap(validate(arg, configuration)); } + @Override + public User1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Whale.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Whale.java index 28e2ad98225..ae2e8a60d52 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Whale.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Whale.java @@ -67,24 +67,20 @@ public String value() { } - public static abstract sealed class ClassNameBoxed permits ClassNameBoxedString { - public abstract @Nullable Object data(); + public sealed interface ClassNameBoxed permits ClassNameBoxedString { + @Nullable Object getData(); } - public static final class ClassNameBoxedString extends ClassNameBoxed { - public final String data; - private ClassNameBoxedString(String data) { - this.data = data; - } + public record ClassNameBoxedString(String data) implements ClassNameBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ClassName extends JsonSchema implements StringSchemaValidator, StringEnumValidator { + public static class ClassName extends JsonSchema implements StringSchemaValidator, StringEnumValidator { private static @Nullable ClassName instance = null; protected ClassName() { @@ -139,6 +135,13 @@ public String validate(StringClassNameEnums arg,SchemaConfiguration configuratio public ClassNameBoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ClassNameBoxedString(validate(arg, configuration)); } + @Override + public ClassNameBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class WhaleMap extends FrozenMap<@Nullable Object> { @@ -274,23 +277,19 @@ public WhaleMap0Builder getBuilderAfterClassName(Map i } - public static abstract sealed class Whale1Boxed permits Whale1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Whale1Boxed permits Whale1BoxedMap { + @Nullable Object getData(); } - public static final class Whale1BoxedMap extends Whale1Boxed { - public final WhaleMap data; - private Whale1BoxedMap(WhaleMap data) { - this.data = data; - } + public record Whale1BoxedMap(WhaleMap data) implements Whale1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Whale1 extends JsonSchema implements MapSchemaValidator { + public static class Whale1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -331,11 +330,11 @@ public WhaleMap getNewInstance(Map arg, List pathToItem, PathToSch List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -372,6 +371,13 @@ public WhaleMap validate(Map arg, SchemaConfiguration configuration) throw public Whale1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Whale1BoxedMap(validate(arg, configuration)); } + @Override + public Whale1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Zebra.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Zebra.java index 4782de8affe..168d9e099dd 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Zebra.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/components/schemas/Zebra.java @@ -58,24 +58,20 @@ public String value() { } - public static abstract sealed class TypeBoxed permits TypeBoxedString { - public abstract @Nullable Object data(); + public sealed interface TypeBoxed permits TypeBoxedString { + @Nullable Object getData(); } - public static final class TypeBoxedString extends TypeBoxed { - public final String data; - private TypeBoxedString(String data) { - this.data = data; - } + public record TypeBoxedString(String data) implements TypeBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Type extends JsonSchema implements StringSchemaValidator, StringEnumValidator { + public static class Type extends JsonSchema implements StringSchemaValidator, StringEnumValidator { private static @Nullable Type instance = null; protected Type() { @@ -132,6 +128,13 @@ public String validate(StringTypeEnums arg,SchemaConfiguration configuration) th public TypeBoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new TypeBoxedString(validate(arg, configuration)); } + @Override + public TypeBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public enum StringClassNameEnums implements StringValueMethod { ZEBRA("zebra"); @@ -146,24 +149,20 @@ public String value() { } - public static abstract sealed class ClassNameBoxed permits ClassNameBoxedString { - public abstract @Nullable Object data(); + public sealed interface ClassNameBoxed permits ClassNameBoxedString { + @Nullable Object getData(); } - public static final class ClassNameBoxedString extends ClassNameBoxed { - public final String data; - private ClassNameBoxedString(String data) { - this.data = data; - } + public record ClassNameBoxedString(String data) implements ClassNameBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ClassName extends JsonSchema implements StringSchemaValidator, StringEnumValidator { + public static class ClassName extends JsonSchema implements StringSchemaValidator, StringEnumValidator { private static @Nullable ClassName instance = null; protected ClassName() { @@ -218,6 +217,13 @@ public String validate(StringClassNameEnums arg,SchemaConfiguration configuratio public ClassNameBoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ClassNameBoxedString(validate(arg, configuration)); } + @Override + public ClassNameBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class ZebraMap extends FrozenMap<@Nullable Object> { @@ -401,23 +407,19 @@ public ZebraMap0Builder getBuilderAfterClassName(Map i } - public static abstract sealed class Zebra1Boxed permits Zebra1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Zebra1Boxed permits Zebra1BoxedMap { + @Nullable Object getData(); } - public static final class Zebra1BoxedMap extends Zebra1Boxed { - public final ZebraMap data; - private Zebra1BoxedMap(ZebraMap data) { - this.data = data; - } + public record Zebra1BoxedMap(ZebraMap data) implements Zebra1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Zebra1 extends JsonSchema implements MapSchemaValidator { + public static class Zebra1 extends JsonSchema implements MapSchemaValidator { /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator @@ -458,11 +460,11 @@ public ZebraMap getNewInstance(Map arg, List pathToItem, PathToSch List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -499,6 +501,13 @@ public ZebraMap validate(Map arg, SchemaConfiguration configuration) throw public Zebra1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Zebra1BoxedMap(validate(arg, configuration)); } + @Override + public Zebra1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/mediatype/MediaType.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/mediatype/MediaType.java index 7e55f79c911..e8392d15eda 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/mediatype/MediaType.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/mediatype/MediaType.java @@ -1,11 +1,8 @@ package org.openapijsonschematools.client.mediatype; import org.openapijsonschematools.client.schemas.validation.JsonSchema; -import org.checkerframework.checker.nullness.qual.Nullable; -import java.util.Map; - -public class MediaType { +public interface MediaType, U> { /* * Used to store request and response body schema information * encoding: @@ -14,16 +11,6 @@ public class MediaType { * The encoding object SHALL only apply to requestBody objects when the media type is * multipart or application/x-www-form-urlencoded. */ - public final T schema; - public final @Nullable Map encoding; - - public MediaType(T schema, @Nullable Map encoding) { - this.schema = schema; - this.encoding = encoding; - } - - public MediaType(T schema) { - this.schema = schema; - this.encoding = null; - } + T schema(); + U encoding(); } \ No newline at end of file diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/anotherfakedummy/patch/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/anotherfakedummy/patch/responses/Code200Response.java new file mode 100644 index 00000000000..b307c66fba1 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/anotherfakedummy/patch/responses/Code200Response.java @@ -0,0 +1,54 @@ +package org.openapijsonschematools.client.paths.anotherfakedummy.patch.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.anotherfakedummy.patch.responses.code200response.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpHeaders; + +public class Code200Response { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} + public record ApplicationjsonResponseBody(ApplicationjsonSchema.Client1Boxed body) implements SealedResponseBody { } + + public static class Code200Response1 extends ResponseDeserializer { + public Code200Response1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + SealedMediaType mediaType = content.get(contentType); + if (mediaType == null) { + throw new RuntimeException("Invalid contentType was received back from the server that does not exist in the openapi document"); + } + if (mediaType instanceof ApplicationjsonMediaType thisMediaType) { + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } + throw new RuntimeException("contentType="+contentType+" returned by the server is unknown and does not exist in the openapi document"); + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/anotherfakedummy/patch/responses/response200/content/applicationjson/ApplicationjsonSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/anotherfakedummy/patch/responses/code200response/content/applicationjson/ApplicationjsonSchema.java similarity index 91% rename from samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/anotherfakedummy/patch/responses/response200/content/applicationjson/ApplicationjsonSchema.java rename to samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/anotherfakedummy/patch/responses/code200response/content/applicationjson/ApplicationjsonSchema.java index 4140a2dea28..8e0f8a56f68 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/anotherfakedummy/patch/responses/response200/content/applicationjson/ApplicationjsonSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/anotherfakedummy/patch/responses/code200response/content/applicationjson/ApplicationjsonSchema.java @@ -1,4 +1,4 @@ -package org.openapijsonschematools.client.paths.anotherfakedummy.patch.responses.response200.content.applicationjson; +package org.openapijsonschematools.client.paths.anotherfakedummy.patch.responses.code200response.content.applicationjson; import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.components.schemas.Client; diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/delete/HeaderParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/delete/HeaderParameters.java index cd8848fd37c..e8300624dfc 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/delete/HeaderParameters.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/delete/HeaderParameters.java @@ -93,23 +93,19 @@ public HeaderParametersMapBuilder getBuilderAfterSomeHeader(Map } - public static abstract sealed class HeaderParameters1Boxed permits HeaderParameters1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface HeaderParameters1Boxed permits HeaderParameters1BoxedMap { + @Nullable Object getData(); } - public static final class HeaderParameters1BoxedMap extends HeaderParameters1Boxed { - public final HeaderParametersMap data; - private HeaderParameters1BoxedMap(HeaderParametersMap data) { - this.data = data; - } + public record HeaderParameters1BoxedMap(HeaderParametersMap data) implements HeaderParameters1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class HeaderParameters1 extends JsonSchema implements MapSchemaValidator { + public static class HeaderParameters1 extends JsonSchema implements MapSchemaValidator { private static @Nullable HeaderParameters1 instance = null; protected HeaderParameters1() { @@ -140,11 +136,11 @@ public HeaderParametersMap getNewInstance(Map arg, List pathToItem List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof String)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -184,6 +180,13 @@ public HeaderParametersMap validate(Map arg, SchemaConfiguration configura public HeaderParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new HeaderParameters1BoxedMap(validate(arg, configuration)); } + @Override + public HeaderParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/delete/PathParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/delete/PathParameters.java index b0270da0a2a..f7821fd56ce 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/delete/PathParameters.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/delete/PathParameters.java @@ -106,23 +106,19 @@ public PathParametersMap0Builder getBuilderAfterSubDir(Map insta } - public static abstract sealed class PathParameters1Boxed permits PathParameters1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface PathParameters1Boxed permits PathParameters1BoxedMap { + @Nullable Object getData(); } - public static final class PathParameters1BoxedMap extends PathParameters1Boxed { - public final PathParametersMap data; - private PathParameters1BoxedMap(PathParametersMap data) { - this.data = data; - } + public record PathParameters1BoxedMap(PathParametersMap data) implements PathParameters1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class PathParameters1 extends JsonSchema implements MapSchemaValidator { + public static class PathParameters1 extends JsonSchema implements MapSchemaValidator { private static @Nullable PathParameters1 instance = null; protected PathParameters1() { @@ -156,11 +152,11 @@ public PathParametersMap getNewInstance(Map arg, List pathToItem, List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof String)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -200,6 +196,13 @@ public PathParametersMap validate(Map arg, SchemaConfiguration configurati public PathParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new PathParameters1BoxedMap(validate(arg, configuration)); } + @Override + public PathParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/delete/parameters/parameter1/Schema1.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/delete/parameters/parameter1/Schema1.java index dc6bf792213..4f908c5276b 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/delete/parameters/parameter1/Schema1.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/delete/parameters/parameter1/Schema1.java @@ -35,24 +35,20 @@ public String value() { } - public static abstract sealed class Schema11Boxed permits Schema11BoxedString { - public abstract @Nullable Object data(); + public sealed interface Schema11Boxed permits Schema11BoxedString { + @Nullable Object getData(); } - public static final class Schema11BoxedString extends Schema11Boxed { - public final String data; - private Schema11BoxedString(String data) { - this.data = data; - } + public record Schema11BoxedString(String data) implements Schema11Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema11 extends JsonSchema implements StringSchemaValidator, StringEnumValidator { + public static class Schema11 extends JsonSchema implements StringSchemaValidator, StringEnumValidator { private static @Nullable Schema11 instance = null; protected Schema11() { @@ -108,5 +104,12 @@ public String validate(StringSchemaEnums1 arg,SchemaConfiguration configuration) public Schema11BoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema11BoxedString(validate(arg, configuration)); } + @Override + public Schema11Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/delete/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/delete/responses/Code200Response.java new file mode 100644 index 00000000000..d91fc8bb9f7 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/delete/responses/Code200Response.java @@ -0,0 +1,7 @@ +package org.openapijsonschematools.client.paths.commonparamsubdir.delete.responses; + +import org.openapijsonschematools.client.components.responses.SuccessDescriptionOnly; + +public class Code200Response extends SuccessDescriptionOnly { + public static class Code200Response1 extends SuccessDescriptionOnly1 {} +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/get/PathParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/get/PathParameters.java index a5ea19006a4..255e522a255 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/get/PathParameters.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/get/PathParameters.java @@ -106,23 +106,19 @@ public PathParametersMap0Builder getBuilderAfterSubDir(Map insta } - public static abstract sealed class PathParameters1Boxed permits PathParameters1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface PathParameters1Boxed permits PathParameters1BoxedMap { + @Nullable Object getData(); } - public static final class PathParameters1BoxedMap extends PathParameters1Boxed { - public final PathParametersMap data; - private PathParameters1BoxedMap(PathParametersMap data) { - this.data = data; - } + public record PathParameters1BoxedMap(PathParametersMap data) implements PathParameters1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class PathParameters1 extends JsonSchema implements MapSchemaValidator { + public static class PathParameters1 extends JsonSchema implements MapSchemaValidator { private static @Nullable PathParameters1 instance = null; protected PathParameters1() { @@ -156,11 +152,11 @@ public PathParametersMap getNewInstance(Map arg, List pathToItem, List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof String)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -200,6 +196,13 @@ public PathParametersMap validate(Map arg, SchemaConfiguration configurati public PathParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new PathParameters1BoxedMap(validate(arg, configuration)); } + @Override + public PathParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/get/QueryParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/get/QueryParameters.java index 74c006d1d34..dac75cd1483 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/get/QueryParameters.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/get/QueryParameters.java @@ -93,23 +93,19 @@ public QueryParametersMapBuilder getBuilderAfterSearchStr(Map in } - public static abstract sealed class QueryParameters1Boxed permits QueryParameters1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface QueryParameters1Boxed permits QueryParameters1BoxedMap { + @Nullable Object getData(); } - public static final class QueryParameters1BoxedMap extends QueryParameters1Boxed { - public final QueryParametersMap data; - private QueryParameters1BoxedMap(QueryParametersMap data) { - this.data = data; - } + public record QueryParameters1BoxedMap(QueryParametersMap data) implements QueryParameters1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class QueryParameters1 extends JsonSchema implements MapSchemaValidator { + public static class QueryParameters1 extends JsonSchema implements MapSchemaValidator { private static @Nullable QueryParameters1 instance = null; protected QueryParameters1() { @@ -140,11 +136,11 @@ public QueryParametersMap getNewInstance(Map arg, List pathToItem, List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof String)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -184,6 +180,13 @@ public QueryParametersMap validate(Map arg, SchemaConfiguration configurat public QueryParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new QueryParameters1BoxedMap(validate(arg, configuration)); } + @Override + public QueryParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/get/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/get/responses/Code200Response.java new file mode 100644 index 00000000000..92947e99863 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/get/responses/Code200Response.java @@ -0,0 +1,7 @@ +package org.openapijsonschematools.client.paths.commonparamsubdir.get.responses; + +import org.openapijsonschematools.client.components.responses.SuccessDescriptionOnly; + +public class Code200Response extends SuccessDescriptionOnly { + public static class Code200Response1 extends SuccessDescriptionOnly1 {} +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/parameters/parameter0/PathParamSchema0.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/parameters/parameter0/PathParamSchema0.java index b50cad8cd17..ab34e28c0a1 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/parameters/parameter0/PathParamSchema0.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/parameters/parameter0/PathParamSchema0.java @@ -35,24 +35,20 @@ public String value() { } - public static abstract sealed class PathParamSchema01Boxed permits PathParamSchema01BoxedString { - public abstract @Nullable Object data(); + public sealed interface PathParamSchema01Boxed permits PathParamSchema01BoxedString { + @Nullable Object getData(); } - public static final class PathParamSchema01BoxedString extends PathParamSchema01Boxed { - public final String data; - private PathParamSchema01BoxedString(String data) { - this.data = data; - } + public record PathParamSchema01BoxedString(String data) implements PathParamSchema01Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class PathParamSchema01 extends JsonSchema implements StringSchemaValidator, StringEnumValidator { + public static class PathParamSchema01 extends JsonSchema implements StringSchemaValidator, StringEnumValidator { private static @Nullable PathParamSchema01 instance = null; protected PathParamSchema01() { @@ -108,5 +104,12 @@ public String validate(StringPathParamSchemaEnums0 arg,SchemaConfiguration confi public PathParamSchema01BoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new PathParamSchema01BoxedString(validate(arg, configuration)); } + @Override + public PathParamSchema01Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/post/HeaderParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/post/HeaderParameters.java index 08534db2ef8..ceba836e2ef 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/post/HeaderParameters.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/post/HeaderParameters.java @@ -93,23 +93,19 @@ public HeaderParametersMapBuilder getBuilderAfterSomeHeader(Map } - public static abstract sealed class HeaderParameters1Boxed permits HeaderParameters1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface HeaderParameters1Boxed permits HeaderParameters1BoxedMap { + @Nullable Object getData(); } - public static final class HeaderParameters1BoxedMap extends HeaderParameters1Boxed { - public final HeaderParametersMap data; - private HeaderParameters1BoxedMap(HeaderParametersMap data) { - this.data = data; - } + public record HeaderParameters1BoxedMap(HeaderParametersMap data) implements HeaderParameters1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class HeaderParameters1 extends JsonSchema implements MapSchemaValidator { + public static class HeaderParameters1 extends JsonSchema implements MapSchemaValidator { private static @Nullable HeaderParameters1 instance = null; protected HeaderParameters1() { @@ -140,11 +136,11 @@ public HeaderParametersMap getNewInstance(Map arg, List pathToItem List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof String)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -184,6 +180,13 @@ public HeaderParametersMap validate(Map arg, SchemaConfiguration configura public HeaderParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new HeaderParameters1BoxedMap(validate(arg, configuration)); } + @Override + public HeaderParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/post/PathParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/post/PathParameters.java index 47d0634db96..951db208ba2 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/post/PathParameters.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/post/PathParameters.java @@ -106,23 +106,19 @@ public PathParametersMap0Builder getBuilderAfterSubDir(Map insta } - public static abstract sealed class PathParameters1Boxed permits PathParameters1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface PathParameters1Boxed permits PathParameters1BoxedMap { + @Nullable Object getData(); } - public static final class PathParameters1BoxedMap extends PathParameters1Boxed { - public final PathParametersMap data; - private PathParameters1BoxedMap(PathParametersMap data) { - this.data = data; - } + public record PathParameters1BoxedMap(PathParametersMap data) implements PathParameters1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class PathParameters1 extends JsonSchema implements MapSchemaValidator { + public static class PathParameters1 extends JsonSchema implements MapSchemaValidator { private static @Nullable PathParameters1 instance = null; protected PathParameters1() { @@ -156,11 +152,11 @@ public PathParametersMap getNewInstance(Map arg, List pathToItem, List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof String)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -200,6 +196,13 @@ public PathParametersMap validate(Map arg, SchemaConfiguration configurati public PathParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new PathParameters1BoxedMap(validate(arg, configuration)); } + @Override + public PathParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/post/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/post/responses/Code200Response.java new file mode 100644 index 00000000000..81cdc60a4cd --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/post/responses/Code200Response.java @@ -0,0 +1,7 @@ +package org.openapijsonschematools.client.paths.commonparamsubdir.post.responses; + +import org.openapijsonschematools.client.components.responses.SuccessDescriptionOnly; + +public class Code200Response extends SuccessDescriptionOnly { + public static class Code200Response1 extends SuccessDescriptionOnly1 {} +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/delete/HeaderParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/delete/HeaderParameters.java index 47ed9c9699c..1cd54a34b9b 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/delete/HeaderParameters.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/delete/HeaderParameters.java @@ -147,23 +147,19 @@ public HeaderParametersMap0Builder getBuilderAfterRequiredBooleanGroup(Map { + public static class HeaderParameters1 extends JsonSchema implements MapSchemaValidator { private static @Nullable HeaderParameters1 instance = null; protected HeaderParameters1() { @@ -198,11 +194,11 @@ public HeaderParametersMap getNewInstance(Map arg, List pathToItem List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -239,6 +235,13 @@ public HeaderParametersMap validate(Map arg, SchemaConfiguration configura public HeaderParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new HeaderParameters1BoxedMap(validate(arg, configuration)); } + @Override + public HeaderParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/delete/QueryParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/delete/QueryParameters.java index faf82513a90..338a0580300 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/delete/QueryParameters.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/delete/QueryParameters.java @@ -249,23 +249,19 @@ public QueryParametersMap10Builder getBuilderAfterRequiredStringGroup(Map { + public static class QueryParameters1 extends JsonSchema implements MapSchemaValidator { private static @Nullable QueryParameters1 instance = null; protected QueryParameters1() { @@ -303,11 +299,11 @@ public QueryParametersMap getNewInstance(Map arg, List pathToItem, List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -344,6 +340,13 @@ public QueryParametersMap validate(Map arg, SchemaConfiguration configurat public QueryParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new QueryParameters1BoxedMap(validate(arg, configuration)); } + @Override + public QueryParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/delete/parameters/parameter1/Schema1.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/delete/parameters/parameter1/Schema1.java index 74d343a49c1..0fc48284aa6 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/delete/parameters/parameter1/Schema1.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/delete/parameters/parameter1/Schema1.java @@ -35,24 +35,20 @@ public String value() { } - public static abstract sealed class Schema11Boxed permits Schema11BoxedString { - public abstract @Nullable Object data(); + public sealed interface Schema11Boxed permits Schema11BoxedString { + @Nullable Object getData(); } - public static final class Schema11BoxedString extends Schema11Boxed { - public final String data; - private Schema11BoxedString(String data) { - this.data = data; - } + public record Schema11BoxedString(String data) implements Schema11Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema11 extends JsonSchema implements StringSchemaValidator, StringEnumValidator { + public static class Schema11 extends JsonSchema implements StringSchemaValidator, StringEnumValidator { private static @Nullable Schema11 instance = null; protected Schema11() { @@ -108,5 +104,12 @@ public String validate(StringSchemaEnums1 arg,SchemaConfiguration configuration) public Schema11BoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema11BoxedString(validate(arg, configuration)); } + @Override + public Schema11Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/delete/parameters/parameter4/Schema4.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/delete/parameters/parameter4/Schema4.java index deff39bde36..1bb4d6193c5 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/delete/parameters/parameter4/Schema4.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/delete/parameters/parameter4/Schema4.java @@ -35,24 +35,20 @@ public String value() { } - public static abstract sealed class Schema41Boxed permits Schema41BoxedString { - public abstract @Nullable Object data(); + public sealed interface Schema41Boxed permits Schema41BoxedString { + @Nullable Object getData(); } - public static final class Schema41BoxedString extends Schema41Boxed { - public final String data; - private Schema41BoxedString(String data) { - this.data = data; - } + public record Schema41BoxedString(String data) implements Schema41Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema41 extends JsonSchema implements StringSchemaValidator, StringEnumValidator { + public static class Schema41 extends JsonSchema implements StringSchemaValidator, StringEnumValidator { private static @Nullable Schema41 instance = null; protected Schema41() { @@ -108,5 +104,12 @@ public String validate(StringSchemaEnums4 arg,SchemaConfiguration configuration) public Schema41BoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema41BoxedString(validate(arg, configuration)); } + @Override + public Schema41Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/delete/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/delete/responses/Code200Response.java new file mode 100644 index 00000000000..5094d251738 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/delete/responses/Code200Response.java @@ -0,0 +1,7 @@ +package org.openapijsonschematools.client.paths.fake.delete.responses; + +import org.openapijsonschematools.client.components.responses.SuccessDescriptionOnly; + +public class Code200Response extends SuccessDescriptionOnly { + public static class Code200Response1 extends SuccessDescriptionOnly1 {} +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/HeaderParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/HeaderParameters.java index 5ecee77bbdc..f58e04d481f 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/HeaderParameters.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/HeaderParameters.java @@ -132,23 +132,19 @@ public HeaderParametersMapBuilder getBuilderAfterEnumHeaderStringArray(Map { + public static class HeaderParameters1 extends JsonSchema implements MapSchemaValidator { private static @Nullable HeaderParameters1 instance = null; protected HeaderParameters1() { @@ -180,11 +176,11 @@ public HeaderParametersMap getNewInstance(Map arg, List pathToItem List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -221,6 +217,13 @@ public HeaderParametersMap validate(Map arg, SchemaConfiguration configura public HeaderParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new HeaderParameters1BoxedMap(validate(arg, configuration)); } + @Override + public HeaderParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/QueryParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/QueryParameters.java index f6c632fd94f..9e6ff8205ec 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/QueryParameters.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/QueryParameters.java @@ -246,23 +246,19 @@ public QueryParametersMapBuilder getBuilderAfterEnumQueryStringArray(Map { + public static class QueryParameters1 extends JsonSchema implements MapSchemaValidator { private static @Nullable QueryParameters1 instance = null; protected QueryParameters1() { @@ -296,11 +292,11 @@ public QueryParametersMap getNewInstance(Map arg, List pathToItem, List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -337,6 +333,13 @@ public QueryParametersMap validate(Map arg, SchemaConfiguration configurat public QueryParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new QueryParameters1BoxedMap(validate(arg, configuration)); } + @Override + public QueryParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/RequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/RequestBody.java index b4ab13f14a5..c14807b0629 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/RequestBody.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/RequestBody.java @@ -6,22 +6,27 @@ import org.openapijsonschematools.client.requestbody.RequestBodySerializer; import org.openapijsonschematools.client.requestbody.GenericRequestBody; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; import org.openapijsonschematools.client.mediatype.MediaType; import org.openapijsonschematools.client.paths.fake.get.requestbody.content.applicationxwwwformurlencoded.ApplicationxwwwformurlencodedSchema; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; import java.util.AbstractMap; import java.util.Map; public class RequestBody { + public sealed interface SealedMediaType permits ApplicationxwwwformurlencodedMediaType {} - public static class ApplicationxwwwformurlencodedMediaType extends MediaType { + public record ApplicationxwwwformurlencodedMediaType(ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1 schema) implements SealedMediaType, MediaType { public ApplicationxwwwformurlencodedMediaType() { - super(ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1.getInstance()); + this(ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; } } - public static class RequestBody1 extends RequestBodySerializer { + public static class RequestBody1 extends RequestBodySerializer { public RequestBody1() { super( Map.ofEntries( @@ -33,26 +38,15 @@ public RequestBody1() { public SerializedRequestBody serialize(SealedRequestBody requestBody) { ApplicationxwwwformurlencodedRequestBody requestBody0 = (ApplicationxwwwformurlencodedRequestBody) requestBody; - return serialize(requestBody0.contentType(), requestBody0.body().data()); + return serialize(requestBody0.contentType(), requestBody0.body().getData()); } } - public static abstract sealed class SealedRequestBody permits ApplicationxwwwformurlencodedRequestBody {} - public static final class ApplicationxwwwformurlencodedRequestBody extends SealedRequestBody implements GenericRequestBody { - private final String contentType; - private final ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1Boxed body; - public ApplicationxwwwformurlencodedRequestBody(ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1Boxed body) { - contentType = "application/x-www-form-urlencoded"; - this.body = body; - } + public sealed interface SealedRequestBody permits ApplicationxwwwformurlencodedRequestBody {} + public record ApplicationxwwwformurlencodedRequestBody(ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1Boxed body) implements SealedRequestBody, GenericRequestBody { @Override public String contentType() { - return contentType; - } - - @Override - public ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1Boxed body() { - return body; + return "application/x-www-form-urlencoded"; } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/parameters/parameter0/Schema0.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/parameters/parameter0/Schema0.java index 94a1edfd4ca..8d4b0be69ff 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/parameters/parameter0/Schema0.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/parameters/parameter0/Schema0.java @@ -40,24 +40,20 @@ public String value() { } - public static abstract sealed class Items0Boxed permits Items0BoxedString { - public abstract @Nullable Object data(); + public sealed interface Items0Boxed permits Items0BoxedString { + @Nullable Object getData(); } - public static final class Items0BoxedString extends Items0Boxed { - public final String data; - private Items0BoxedString(String data) { - this.data = data; - } + public record Items0BoxedString(String data) implements Items0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Items0 extends JsonSchema implements StringSchemaValidator, StringEnumValidator, DefaultValueMethod { + public static class Items0 extends JsonSchema implements StringSchemaValidator, StringEnumValidator, DefaultValueMethod { private static @Nullable Items0 instance = null; protected Items0() { @@ -120,6 +116,13 @@ public String defaultValue() { public Items0BoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Items0BoxedString(validate(arg, configuration)); } + @Override + public Items0Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class SchemaList0 extends FrozenList { @@ -159,24 +162,20 @@ public List build() { } - public static abstract sealed class Schema01Boxed permits Schema01BoxedList { - public abstract @Nullable Object data(); + public sealed interface Schema01Boxed permits Schema01BoxedList { + @Nullable Object getData(); } - public static final class Schema01BoxedList extends Schema01Boxed { - public final SchemaList0 data; - private Schema01BoxedList(SchemaList0 data) { - this.data = data; - } + public record Schema01BoxedList(SchemaList0 data) implements Schema01Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema01 extends JsonSchema implements ListSchemaValidator { + public static class Schema01 extends JsonSchema implements ListSchemaValidator { private static @Nullable Schema01 instance = null; protected Schema01() { @@ -200,11 +199,11 @@ public SchemaList0 getNewInstance(List arg, List pathToItem, PathToSc for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof String)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -244,5 +243,12 @@ public SchemaList0 validate(List arg, SchemaConfiguration configuration) thro public Schema01BoxedList validateAndBox(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema01BoxedList(validate(arg, configuration)); } + @Override + public Schema01Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/parameters/parameter1/Schema1.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/parameters/parameter1/Schema1.java index 56526ff1a40..c81dd30723a 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/parameters/parameter1/Schema1.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/parameters/parameter1/Schema1.java @@ -37,24 +37,20 @@ public String value() { } - public static abstract sealed class Schema11Boxed permits Schema11BoxedString { - public abstract @Nullable Object data(); + public sealed interface Schema11Boxed permits Schema11BoxedString { + @Nullable Object getData(); } - public static final class Schema11BoxedString extends Schema11Boxed { - public final String data; - private Schema11BoxedString(String data) { - this.data = data; - } + public record Schema11BoxedString(String data) implements Schema11Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema11 extends JsonSchema implements StringSchemaValidator, StringEnumValidator, DefaultValueMethod { + public static class Schema11 extends JsonSchema implements StringSchemaValidator, StringEnumValidator, DefaultValueMethod { private static @Nullable Schema11 instance = null; protected Schema11() { @@ -118,5 +114,12 @@ public String defaultValue() { public Schema11BoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema11BoxedString(validate(arg, configuration)); } + @Override + public Schema11Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/parameters/parameter2/Schema2.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/parameters/parameter2/Schema2.java index 925d0afe23b..df2e535ac26 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/parameters/parameter2/Schema2.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/parameters/parameter2/Schema2.java @@ -40,24 +40,20 @@ public String value() { } - public static abstract sealed class Items2Boxed permits Items2BoxedString { - public abstract @Nullable Object data(); + public sealed interface Items2Boxed permits Items2BoxedString { + @Nullable Object getData(); } - public static final class Items2BoxedString extends Items2Boxed { - public final String data; - private Items2BoxedString(String data) { - this.data = data; - } + public record Items2BoxedString(String data) implements Items2Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Items2 extends JsonSchema implements StringSchemaValidator, StringEnumValidator, DefaultValueMethod { + public static class Items2 extends JsonSchema implements StringSchemaValidator, StringEnumValidator, DefaultValueMethod { private static @Nullable Items2 instance = null; protected Items2() { @@ -120,6 +116,13 @@ public String defaultValue() { public Items2BoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Items2BoxedString(validate(arg, configuration)); } + @Override + public Items2Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class SchemaList2 extends FrozenList { @@ -159,24 +162,20 @@ public List build() { } - public static abstract sealed class Schema21Boxed permits Schema21BoxedList { - public abstract @Nullable Object data(); + public sealed interface Schema21Boxed permits Schema21BoxedList { + @Nullable Object getData(); } - public static final class Schema21BoxedList extends Schema21Boxed { - public final SchemaList2 data; - private Schema21BoxedList(SchemaList2 data) { - this.data = data; - } + public record Schema21BoxedList(SchemaList2 data) implements Schema21Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema21 extends JsonSchema implements ListSchemaValidator { + public static class Schema21 extends JsonSchema implements ListSchemaValidator { private static @Nullable Schema21 instance = null; protected Schema21() { @@ -200,11 +199,11 @@ public SchemaList2 getNewInstance(List arg, List pathToItem, PathToSc for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof String)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -244,5 +243,12 @@ public SchemaList2 validate(List arg, SchemaConfiguration configuration) thro public Schema21BoxedList validateAndBox(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema21BoxedList(validate(arg, configuration)); } + @Override + public Schema21Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/parameters/parameter3/Schema3.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/parameters/parameter3/Schema3.java index 6b24104bcd0..200f9aea989 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/parameters/parameter3/Schema3.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/parameters/parameter3/Schema3.java @@ -37,24 +37,20 @@ public String value() { } - public static abstract sealed class Schema31Boxed permits Schema31BoxedString { - public abstract @Nullable Object data(); + public sealed interface Schema31Boxed permits Schema31BoxedString { + @Nullable Object getData(); } - public static final class Schema31BoxedString extends Schema31Boxed { - public final String data; - private Schema31BoxedString(String data) { - this.data = data; - } + public record Schema31BoxedString(String data) implements Schema31Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema31 extends JsonSchema implements StringSchemaValidator, StringEnumValidator, DefaultValueMethod { + public static class Schema31 extends JsonSchema implements StringSchemaValidator, StringEnumValidator, DefaultValueMethod { private static @Nullable Schema31 instance = null; protected Schema31() { @@ -118,5 +114,12 @@ public String defaultValue() { public Schema31BoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema31BoxedString(validate(arg, configuration)); } + @Override + public Schema31Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/parameters/parameter4/Schema4.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/parameters/parameter4/Schema4.java index 162470a74ae..1e2d7c15b13 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/parameters/parameter4/Schema4.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/parameters/parameter4/Schema4.java @@ -81,24 +81,20 @@ public double value() { } - public static abstract sealed class Schema41Boxed permits Schema41BoxedNumber { - public abstract @Nullable Object data(); + public sealed interface Schema41Boxed permits Schema41BoxedNumber { + @Nullable Object getData(); } - public static final class Schema41BoxedNumber extends Schema41Boxed { - public final Number data; - private Schema41BoxedNumber(Number data) { - this.data = data; - } + public record Schema41BoxedNumber(Number data) implements Schema41Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema41 extends JsonSchema implements IntegerEnumValidator, LongEnumValidator, FloatEnumValidator, DoubleEnumValidator, NumberSchemaValidator { + public static class Schema41 extends JsonSchema implements IntegerEnumValidator, LongEnumValidator, FloatEnumValidator, DoubleEnumValidator, NumberSchemaValidator { private static @Nullable Schema41 instance = null; protected Schema41() { @@ -181,5 +177,12 @@ public double validate(DoubleSchemaEnums4 arg,SchemaConfiguration configuration) public Schema41BoxedNumber validateAndBox(Number arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema41BoxedNumber(validate(arg, configuration)); } + @Override + public Schema41Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/parameters/parameter5/Schema5.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/parameters/parameter5/Schema5.java index 11afd0a248b..d726146199c 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/parameters/parameter5/Schema5.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/parameters/parameter5/Schema5.java @@ -51,24 +51,20 @@ public float value() { } - public static abstract sealed class Schema51Boxed permits Schema51BoxedNumber { - public abstract @Nullable Object data(); + public sealed interface Schema51Boxed permits Schema51BoxedNumber { + @Nullable Object getData(); } - public static final class Schema51BoxedNumber extends Schema51Boxed { - public final Number data; - private Schema51BoxedNumber(Number data) { - this.data = data; - } + public record Schema51BoxedNumber(Number data) implements Schema51Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema51 extends JsonSchema implements FloatEnumValidator, DoubleEnumValidator, NumberSchemaValidator { + public static class Schema51 extends JsonSchema implements FloatEnumValidator, DoubleEnumValidator, NumberSchemaValidator { private static @Nullable Schema51 instance = null; protected Schema51() { @@ -136,5 +132,12 @@ public double validate(DoubleSchemaEnums5 arg,SchemaConfiguration configuration) public Schema51BoxedNumber validateAndBox(Number arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema51BoxedNumber(validate(arg, configuration)); } + @Override + public Schema51Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.java index e1efa627279..373f41b31b0 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.java @@ -48,24 +48,20 @@ public String value() { } - public static abstract sealed class ApplicationxwwwformurlencodedItemsBoxed permits ApplicationxwwwformurlencodedItemsBoxedString { - public abstract @Nullable Object data(); + public sealed interface ApplicationxwwwformurlencodedItemsBoxed permits ApplicationxwwwformurlencodedItemsBoxedString { + @Nullable Object getData(); } - public static final class ApplicationxwwwformurlencodedItemsBoxedString extends ApplicationxwwwformurlencodedItemsBoxed { - public final String data; - private ApplicationxwwwformurlencodedItemsBoxedString(String data) { - this.data = data; - } + public record ApplicationxwwwformurlencodedItemsBoxedString(String data) implements ApplicationxwwwformurlencodedItemsBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ApplicationxwwwformurlencodedItems extends JsonSchema implements StringSchemaValidator, StringEnumValidator, DefaultValueMethod { + public static class ApplicationxwwwformurlencodedItems extends JsonSchema implements StringSchemaValidator, StringEnumValidator, DefaultValueMethod { private static @Nullable ApplicationxwwwformurlencodedItems instance = null; protected ApplicationxwwwformurlencodedItems() { @@ -128,6 +124,13 @@ public String defaultValue() { public ApplicationxwwwformurlencodedItemsBoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ApplicationxwwwformurlencodedItemsBoxedString(validate(arg, configuration)); } + @Override + public ApplicationxwwwformurlencodedItemsBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class ApplicationxwwwformurlencodedEnumFormStringArrayList extends FrozenList { @@ -167,24 +170,20 @@ public List build() { } - public static abstract sealed class ApplicationxwwwformurlencodedEnumFormStringArrayBoxed permits ApplicationxwwwformurlencodedEnumFormStringArrayBoxedList { - public abstract @Nullable Object data(); + public sealed interface ApplicationxwwwformurlencodedEnumFormStringArrayBoxed permits ApplicationxwwwformurlencodedEnumFormStringArrayBoxedList { + @Nullable Object getData(); } - public static final class ApplicationxwwwformurlencodedEnumFormStringArrayBoxedList extends ApplicationxwwwformurlencodedEnumFormStringArrayBoxed { - public final ApplicationxwwwformurlencodedEnumFormStringArrayList data; - private ApplicationxwwwformurlencodedEnumFormStringArrayBoxedList(ApplicationxwwwformurlencodedEnumFormStringArrayList data) { - this.data = data; - } + public record ApplicationxwwwformurlencodedEnumFormStringArrayBoxedList(ApplicationxwwwformurlencodedEnumFormStringArrayList data) implements ApplicationxwwwformurlencodedEnumFormStringArrayBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ApplicationxwwwformurlencodedEnumFormStringArray extends JsonSchema implements ListSchemaValidator { + public static class ApplicationxwwwformurlencodedEnumFormStringArray extends JsonSchema implements ListSchemaValidator { private static @Nullable ApplicationxwwwformurlencodedEnumFormStringArray instance = null; protected ApplicationxwwwformurlencodedEnumFormStringArray() { @@ -208,11 +207,11 @@ public ApplicationxwwwformurlencodedEnumFormStringArrayList getNewInstance(List< for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof String)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -252,6 +251,13 @@ public ApplicationxwwwformurlencodedEnumFormStringArrayList validate(List arg public ApplicationxwwwformurlencodedEnumFormStringArrayBoxedList validateAndBox(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ApplicationxwwwformurlencodedEnumFormStringArrayBoxedList(validate(arg, configuration)); } + @Override + public ApplicationxwwwformurlencodedEnumFormStringArrayBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public enum StringApplicationxwwwformurlencodedEnumFormStringEnums implements StringValueMethod { _ABC("_abc"), @@ -268,24 +274,20 @@ public String value() { } - public static abstract sealed class ApplicationxwwwformurlencodedEnumFormStringBoxed permits ApplicationxwwwformurlencodedEnumFormStringBoxedString { - public abstract @Nullable Object data(); + public sealed interface ApplicationxwwwformurlencodedEnumFormStringBoxed permits ApplicationxwwwformurlencodedEnumFormStringBoxedString { + @Nullable Object getData(); } - public static final class ApplicationxwwwformurlencodedEnumFormStringBoxedString extends ApplicationxwwwformurlencodedEnumFormStringBoxed { - public final String data; - private ApplicationxwwwformurlencodedEnumFormStringBoxedString(String data) { - this.data = data; - } + public record ApplicationxwwwformurlencodedEnumFormStringBoxedString(String data) implements ApplicationxwwwformurlencodedEnumFormStringBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ApplicationxwwwformurlencodedEnumFormString extends JsonSchema implements StringSchemaValidator, StringEnumValidator, DefaultValueMethod { + public static class ApplicationxwwwformurlencodedEnumFormString extends JsonSchema implements StringSchemaValidator, StringEnumValidator, DefaultValueMethod { private static @Nullable ApplicationxwwwformurlencodedEnumFormString instance = null; protected ApplicationxwwwformurlencodedEnumFormString() { @@ -349,6 +351,13 @@ public String defaultValue() { public ApplicationxwwwformurlencodedEnumFormStringBoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ApplicationxwwwformurlencodedEnumFormStringBoxedString(validate(arg, configuration)); } + @Override + public ApplicationxwwwformurlencodedEnumFormStringBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class ApplicationxwwwformurlencodedSchemaMap extends FrozenMap<@Nullable Object> { @@ -449,23 +458,19 @@ public ApplicationxwwwformurlencodedSchemaMapBuilder getBuilderAfterAdditionalPr } - public static abstract sealed class ApplicationxwwwformurlencodedSchema1Boxed permits ApplicationxwwwformurlencodedSchema1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface ApplicationxwwwformurlencodedSchema1Boxed permits ApplicationxwwwformurlencodedSchema1BoxedMap { + @Nullable Object getData(); } - public static final class ApplicationxwwwformurlencodedSchema1BoxedMap extends ApplicationxwwwformurlencodedSchema1Boxed { - public final ApplicationxwwwformurlencodedSchemaMap data; - private ApplicationxwwwformurlencodedSchema1BoxedMap(ApplicationxwwwformurlencodedSchemaMap data) { - this.data = data; - } + public record ApplicationxwwwformurlencodedSchema1BoxedMap(ApplicationxwwwformurlencodedSchemaMap data) implements ApplicationxwwwformurlencodedSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ApplicationxwwwformurlencodedSchema1 extends JsonSchema implements MapSchemaValidator { + public static class ApplicationxwwwformurlencodedSchema1 extends JsonSchema implements MapSchemaValidator { private static @Nullable ApplicationxwwwformurlencodedSchema1 instance = null; protected ApplicationxwwwformurlencodedSchema1() { @@ -496,11 +501,11 @@ public ApplicationxwwwformurlencodedSchemaMap getNewInstance(Map arg, List List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -537,6 +542,13 @@ public ApplicationxwwwformurlencodedSchemaMap validate(Map arg, SchemaConf public ApplicationxwwwformurlencodedSchema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ApplicationxwwwformurlencodedSchema1BoxedMap(validate(arg, configuration)); } + @Override + public ApplicationxwwwformurlencodedSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/responses/Code200Response.java new file mode 100644 index 00000000000..4c45da77e38 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/responses/Code200Response.java @@ -0,0 +1,7 @@ +package org.openapijsonschematools.client.paths.fake.get.responses; + +import org.openapijsonschematools.client.components.responses.SuccessDescriptionOnly; + +public class Code200Response extends SuccessDescriptionOnly { + public static class Code200Response1 extends SuccessDescriptionOnly1 {} +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/responses/Code404Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/responses/Code404Response.java new file mode 100644 index 00000000000..c656c6b1fe0 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/responses/Code404Response.java @@ -0,0 +1,54 @@ +package org.openapijsonschematools.client.paths.fake.get.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fake.get.responses.code404response.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpHeaders; + +public class Code404Response { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} + public record ApplicationjsonResponseBody(ApplicationjsonSchema.MapJsonSchema1Boxed body) implements SealedResponseBody { } + + public static class Code404Response1 extends ResponseDeserializer { + public Code404Response1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + SealedMediaType mediaType = content.get(contentType); + if (mediaType == null) { + throw new RuntimeException("Invalid contentType was received back from the server that does not exist in the openapi document"); + } + if (mediaType instanceof ApplicationjsonMediaType thisMediaType) { + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } + throw new RuntimeException("contentType="+contentType+" returned by the server is unknown and does not exist in the openapi document"); + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/responses/response404/content/applicationjson/ApplicationjsonSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/responses/code404response/content/applicationjson/ApplicationjsonSchema.java similarity index 94% rename from samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/responses/response404/content/applicationjson/ApplicationjsonSchema.java rename to samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/responses/code404response/content/applicationjson/ApplicationjsonSchema.java index fbf4bc44bc1..b9a4b76bd20 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/responses/response404/content/applicationjson/ApplicationjsonSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/responses/code404response/content/applicationjson/ApplicationjsonSchema.java @@ -1,4 +1,4 @@ -package org.openapijsonschematools.client.paths.fake.get.responses.response404.content.applicationjson; +package org.openapijsonschematools.client.paths.fake.get.responses.code404response.content.applicationjson; import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.schemas.MapJsonSchema; import org.openapijsonschematools.client.schemas.validation.FrozenMap; diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/patch/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/patch/responses/Code200Response.java new file mode 100644 index 00000000000..30c92bdccaa --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/patch/responses/Code200Response.java @@ -0,0 +1,54 @@ +package org.openapijsonschematools.client.paths.fake.patch.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fake.patch.responses.code200response.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpHeaders; + +public class Code200Response { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} + public record ApplicationjsonResponseBody(ApplicationjsonSchema.Client1Boxed body) implements SealedResponseBody { } + + public static class Code200Response1 extends ResponseDeserializer { + public Code200Response1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + SealedMediaType mediaType = content.get(contentType); + if (mediaType == null) { + throw new RuntimeException("Invalid contentType was received back from the server that does not exist in the openapi document"); + } + if (mediaType instanceof ApplicationjsonMediaType thisMediaType) { + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } + throw new RuntimeException("contentType="+contentType+" returned by the server is unknown and does not exist in the openapi document"); + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/patch/responses/response200/content/applicationjson/ApplicationjsonSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/patch/responses/code200response/content/applicationjson/ApplicationjsonSchema.java similarity index 93% rename from samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/patch/responses/response200/content/applicationjson/ApplicationjsonSchema.java rename to samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/patch/responses/code200response/content/applicationjson/ApplicationjsonSchema.java index ec4863611be..f61bbf1fe44 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/patch/responses/response200/content/applicationjson/ApplicationjsonSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/patch/responses/code200response/content/applicationjson/ApplicationjsonSchema.java @@ -1,4 +1,4 @@ -package org.openapijsonschematools.client.paths.fake.patch.responses.response200.content.applicationjson; +package org.openapijsonschematools.client.paths.fake.patch.responses.code200response.content.applicationjson; import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.components.schemas.Client; diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/post/RequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/post/RequestBody.java index 61c1aea140a..818941bb213 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/post/RequestBody.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/post/RequestBody.java @@ -6,22 +6,27 @@ import org.openapijsonschematools.client.requestbody.RequestBodySerializer; import org.openapijsonschematools.client.requestbody.GenericRequestBody; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; import org.openapijsonschematools.client.mediatype.MediaType; import org.openapijsonschematools.client.paths.fake.post.requestbody.content.applicationxwwwformurlencoded.ApplicationxwwwformurlencodedSchema; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; import java.util.AbstractMap; import java.util.Map; public class RequestBody { + public sealed interface SealedMediaType permits ApplicationxwwwformurlencodedMediaType {} - public static class ApplicationxwwwformurlencodedMediaType extends MediaType { + public record ApplicationxwwwformurlencodedMediaType(ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1 schema) implements SealedMediaType, MediaType { public ApplicationxwwwformurlencodedMediaType() { - super(ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1.getInstance()); + this(ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; } } - public static class RequestBody1 extends RequestBodySerializer { + public static class RequestBody1 extends RequestBodySerializer { public RequestBody1() { super( Map.ofEntries( @@ -33,26 +38,15 @@ public RequestBody1() { public SerializedRequestBody serialize(SealedRequestBody requestBody) { ApplicationxwwwformurlencodedRequestBody requestBody0 = (ApplicationxwwwformurlencodedRequestBody) requestBody; - return serialize(requestBody0.contentType(), requestBody0.body().data()); + return serialize(requestBody0.contentType(), requestBody0.body().getData()); } } - public static abstract sealed class SealedRequestBody permits ApplicationxwwwformurlencodedRequestBody {} - public static final class ApplicationxwwwformurlencodedRequestBody extends SealedRequestBody implements GenericRequestBody { - private final String contentType; - private final ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1Boxed body; - public ApplicationxwwwformurlencodedRequestBody(ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1Boxed body) { - contentType = "application/x-www-form-urlencoded"; - this.body = body; - } + public sealed interface SealedRequestBody permits ApplicationxwwwformurlencodedRequestBody {} + public record ApplicationxwwwformurlencodedRequestBody(ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1Boxed body) implements SealedRequestBody, GenericRequestBody { @Override public String contentType() { - return contentType; - } - - @Override - public ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1Boxed body() { - return body; + return "application/x-www-form-urlencoded"; } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/post/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/post/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.java index e0b5d153f38..20f4442dd32 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/post/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/post/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.java @@ -36,24 +36,20 @@ public class ApplicationxwwwformurlencodedSchema { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class ApplicationxwwwformurlencodedIntegerBoxed permits ApplicationxwwwformurlencodedIntegerBoxedNumber { - public abstract @Nullable Object data(); + public sealed interface ApplicationxwwwformurlencodedIntegerBoxed permits ApplicationxwwwformurlencodedIntegerBoxedNumber { + @Nullable Object getData(); } - public static final class ApplicationxwwwformurlencodedIntegerBoxedNumber extends ApplicationxwwwformurlencodedIntegerBoxed { - public final Number data; - private ApplicationxwwwformurlencodedIntegerBoxedNumber(Number data) { - this.data = data; - } + public record ApplicationxwwwformurlencodedIntegerBoxedNumber(Number data) implements ApplicationxwwwformurlencodedIntegerBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ApplicationxwwwformurlencodedInteger extends JsonSchema implements NumberSchemaValidator { + public static class ApplicationxwwwformurlencodedInteger extends JsonSchema implements NumberSchemaValidator { private static @Nullable ApplicationxwwwformurlencodedInteger instance = null; protected ApplicationxwwwformurlencodedInteger() { @@ -122,26 +118,29 @@ public double validate(double arg, SchemaConfiguration configuration) throws Val public ApplicationxwwwformurlencodedIntegerBoxedNumber validateAndBox(Number arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ApplicationxwwwformurlencodedIntegerBoxedNumber(validate(arg, configuration)); } + @Override + public ApplicationxwwwformurlencodedIntegerBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class ApplicationxwwwformurlencodedInt32Boxed permits ApplicationxwwwformurlencodedInt32BoxedNumber { - public abstract @Nullable Object data(); + public sealed interface ApplicationxwwwformurlencodedInt32Boxed permits ApplicationxwwwformurlencodedInt32BoxedNumber { + @Nullable Object getData(); } - public static final class ApplicationxwwwformurlencodedInt32BoxedNumber extends ApplicationxwwwformurlencodedInt32Boxed { - public final Number data; - private ApplicationxwwwformurlencodedInt32BoxedNumber(Number data) { - this.data = data; - } + public record ApplicationxwwwformurlencodedInt32BoxedNumber(Number data) implements ApplicationxwwwformurlencodedInt32Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ApplicationxwwwformurlencodedInt32 extends JsonSchema implements NumberSchemaValidator { + public static class ApplicationxwwwformurlencodedInt32 extends JsonSchema implements NumberSchemaValidator { private static @Nullable ApplicationxwwwformurlencodedInt32 instance = null; protected ApplicationxwwwformurlencodedInt32() { @@ -202,6 +201,13 @@ public float validate(float arg, SchemaConfiguration configuration) throws Valid public ApplicationxwwwformurlencodedInt32BoxedNumber validateAndBox(Number arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ApplicationxwwwformurlencodedInt32BoxedNumber(validate(arg, configuration)); } + @Override + public ApplicationxwwwformurlencodedInt32Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class ApplicationxwwwformurlencodedInt64 extends Int64JsonSchema.Int64JsonSchema1 { @@ -215,24 +221,20 @@ public static ApplicationxwwwformurlencodedInt64 getInstance() { } - public static abstract sealed class ApplicationxwwwformurlencodedNumberBoxed permits ApplicationxwwwformurlencodedNumberBoxedNumber { - public abstract @Nullable Object data(); + public sealed interface ApplicationxwwwformurlencodedNumberBoxed permits ApplicationxwwwformurlencodedNumberBoxedNumber { + @Nullable Object getData(); } - public static final class ApplicationxwwwformurlencodedNumberBoxedNumber extends ApplicationxwwwformurlencodedNumberBoxed { - public final Number data; - private ApplicationxwwwformurlencodedNumberBoxedNumber(Number data) { - this.data = data; - } + public record ApplicationxwwwformurlencodedNumberBoxedNumber(Number data) implements ApplicationxwwwformurlencodedNumberBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ApplicationxwwwformurlencodedNumber extends JsonSchema implements NumberSchemaValidator { + public static class ApplicationxwwwformurlencodedNumber extends JsonSchema implements NumberSchemaValidator { private static @Nullable ApplicationxwwwformurlencodedNumber instance = null; protected ApplicationxwwwformurlencodedNumber() { @@ -300,26 +302,29 @@ public double validate(double arg, SchemaConfiguration configuration) throws Val public ApplicationxwwwformurlencodedNumberBoxedNumber validateAndBox(Number arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ApplicationxwwwformurlencodedNumberBoxedNumber(validate(arg, configuration)); } + @Override + public ApplicationxwwwformurlencodedNumberBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class ApplicationxwwwformurlencodedFloatBoxed permits ApplicationxwwwformurlencodedFloatBoxedNumber { - public abstract @Nullable Object data(); + public sealed interface ApplicationxwwwformurlencodedFloatBoxed permits ApplicationxwwwformurlencodedFloatBoxedNumber { + @Nullable Object getData(); } - public static final class ApplicationxwwwformurlencodedFloatBoxedNumber extends ApplicationxwwwformurlencodedFloatBoxed { - public final Number data; - private ApplicationxwwwformurlencodedFloatBoxedNumber(Number data) { - this.data = data; - } + public record ApplicationxwwwformurlencodedFloatBoxedNumber(Number data) implements ApplicationxwwwformurlencodedFloatBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ApplicationxwwwformurlencodedFloat extends JsonSchema implements NumberSchemaValidator { + public static class ApplicationxwwwformurlencodedFloat extends JsonSchema implements NumberSchemaValidator { private static @Nullable ApplicationxwwwformurlencodedFloat instance = null; protected ApplicationxwwwformurlencodedFloat() { @@ -374,26 +379,29 @@ public float validate(float arg, SchemaConfiguration configuration) throws Valid public ApplicationxwwwformurlencodedFloatBoxedNumber validateAndBox(Number arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ApplicationxwwwformurlencodedFloatBoxedNumber(validate(arg, configuration)); } + @Override + public ApplicationxwwwformurlencodedFloatBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class ApplicationxwwwformurlencodedDoubleBoxed permits ApplicationxwwwformurlencodedDoubleBoxedNumber { - public abstract @Nullable Object data(); + public sealed interface ApplicationxwwwformurlencodedDoubleBoxed permits ApplicationxwwwformurlencodedDoubleBoxedNumber { + @Nullable Object getData(); } - public static final class ApplicationxwwwformurlencodedDoubleBoxedNumber extends ApplicationxwwwformurlencodedDoubleBoxed { - public final Number data; - private ApplicationxwwwformurlencodedDoubleBoxedNumber(Number data) { - this.data = data; - } + public record ApplicationxwwwformurlencodedDoubleBoxedNumber(Number data) implements ApplicationxwwwformurlencodedDoubleBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ApplicationxwwwformurlencodedDouble extends JsonSchema implements NumberSchemaValidator { + public static class ApplicationxwwwformurlencodedDouble extends JsonSchema implements NumberSchemaValidator { private static @Nullable ApplicationxwwwformurlencodedDouble instance = null; protected ApplicationxwwwformurlencodedDouble() { @@ -449,26 +457,29 @@ public double validate(double arg, SchemaConfiguration configuration) throws Val public ApplicationxwwwformurlencodedDoubleBoxedNumber validateAndBox(Number arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ApplicationxwwwformurlencodedDoubleBoxedNumber(validate(arg, configuration)); } + @Override + public ApplicationxwwwformurlencodedDoubleBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class ApplicationxwwwformurlencodedStringBoxed permits ApplicationxwwwformurlencodedStringBoxedString { - public abstract @Nullable Object data(); + public sealed interface ApplicationxwwwformurlencodedStringBoxed permits ApplicationxwwwformurlencodedStringBoxedString { + @Nullable Object getData(); } - public static final class ApplicationxwwwformurlencodedStringBoxedString extends ApplicationxwwwformurlencodedStringBoxed { - public final String data; - private ApplicationxwwwformurlencodedStringBoxedString(String data) { - this.data = data; - } + public record ApplicationxwwwformurlencodedStringBoxedString(String data) implements ApplicationxwwwformurlencodedStringBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ApplicationxwwwformurlencodedString extends JsonSchema implements StringSchemaValidator { + public static class ApplicationxwwwformurlencodedString extends JsonSchema implements StringSchemaValidator { private static @Nullable ApplicationxwwwformurlencodedString instance = null; protected ApplicationxwwwformurlencodedString() { @@ -519,26 +530,29 @@ public String validate(String arg, SchemaConfiguration configuration) throws Val public ApplicationxwwwformurlencodedStringBoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ApplicationxwwwformurlencodedStringBoxedString(validate(arg, configuration)); } + @Override + public ApplicationxwwwformurlencodedStringBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class ApplicationxwwwformurlencodedPatternWithoutDelimiterBoxed permits ApplicationxwwwformurlencodedPatternWithoutDelimiterBoxedString { - public abstract @Nullable Object data(); + public sealed interface ApplicationxwwwformurlencodedPatternWithoutDelimiterBoxed permits ApplicationxwwwformurlencodedPatternWithoutDelimiterBoxedString { + @Nullable Object getData(); } - public static final class ApplicationxwwwformurlencodedPatternWithoutDelimiterBoxedString extends ApplicationxwwwformurlencodedPatternWithoutDelimiterBoxed { - public final String data; - private ApplicationxwwwformurlencodedPatternWithoutDelimiterBoxedString(String data) { - this.data = data; - } + public record ApplicationxwwwformurlencodedPatternWithoutDelimiterBoxedString(String data) implements ApplicationxwwwformurlencodedPatternWithoutDelimiterBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ApplicationxwwwformurlencodedPatternWithoutDelimiter extends JsonSchema implements StringSchemaValidator { + public static class ApplicationxwwwformurlencodedPatternWithoutDelimiter extends JsonSchema implements StringSchemaValidator { private static @Nullable ApplicationxwwwformurlencodedPatternWithoutDelimiter instance = null; protected ApplicationxwwwformurlencodedPatternWithoutDelimiter() { @@ -588,6 +602,13 @@ public String validate(String arg, SchemaConfiguration configuration) throws Val public ApplicationxwwwformurlencodedPatternWithoutDelimiterBoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ApplicationxwwwformurlencodedPatternWithoutDelimiterBoxedString(validate(arg, configuration)); } + @Override + public ApplicationxwwwformurlencodedPatternWithoutDelimiterBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class ApplicationxwwwformurlencodedByte extends StringJsonSchema.StringJsonSchema1 { @@ -624,24 +645,20 @@ public static ApplicationxwwwformurlencodedDate getInstance() { } - public static abstract sealed class ApplicationxwwwformurlencodedDateTimeBoxed permits ApplicationxwwwformurlencodedDateTimeBoxedString { - public abstract @Nullable Object data(); + public sealed interface ApplicationxwwwformurlencodedDateTimeBoxed permits ApplicationxwwwformurlencodedDateTimeBoxedString { + @Nullable Object getData(); } - public static final class ApplicationxwwwformurlencodedDateTimeBoxedString extends ApplicationxwwwformurlencodedDateTimeBoxed { - public final String data; - private ApplicationxwwwformurlencodedDateTimeBoxedString(String data) { - this.data = data; - } + public record ApplicationxwwwformurlencodedDateTimeBoxedString(String data) implements ApplicationxwwwformurlencodedDateTimeBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ApplicationxwwwformurlencodedDateTime extends JsonSchema implements StringSchemaValidator, DefaultValueMethod { + public static class ApplicationxwwwformurlencodedDateTime extends JsonSchema implements StringSchemaValidator, DefaultValueMethod { private static @Nullable ApplicationxwwwformurlencodedDateTime instance = null; protected ApplicationxwwwformurlencodedDateTime() { @@ -696,26 +713,29 @@ public String defaultValue() { public ApplicationxwwwformurlencodedDateTimeBoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ApplicationxwwwformurlencodedDateTimeBoxedString(validate(arg, configuration)); } + @Override + public ApplicationxwwwformurlencodedDateTimeBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class ApplicationxwwwformurlencodedPasswordBoxed permits ApplicationxwwwformurlencodedPasswordBoxedString { - public abstract @Nullable Object data(); + public sealed interface ApplicationxwwwformurlencodedPasswordBoxed permits ApplicationxwwwformurlencodedPasswordBoxedString { + @Nullable Object getData(); } - public static final class ApplicationxwwwformurlencodedPasswordBoxedString extends ApplicationxwwwformurlencodedPasswordBoxed { - public final String data; - private ApplicationxwwwformurlencodedPasswordBoxedString(String data) { - this.data = data; - } + public record ApplicationxwwwformurlencodedPasswordBoxedString(String data) implements ApplicationxwwwformurlencodedPasswordBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ApplicationxwwwformurlencodedPassword extends JsonSchema implements StringSchemaValidator { + public static class ApplicationxwwwformurlencodedPassword extends JsonSchema implements StringSchemaValidator { private static @Nullable ApplicationxwwwformurlencodedPassword instance = null; protected ApplicationxwwwformurlencodedPassword() { @@ -765,6 +785,13 @@ public String validate(String arg, SchemaConfiguration configuration) throws Val public ApplicationxwwwformurlencodedPasswordBoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ApplicationxwwwformurlencodedPasswordBoxedString(validate(arg, configuration)); } + @Override + public ApplicationxwwwformurlencodedPasswordBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class ApplicationxwwwformurlencodedCallback extends StringJsonSchema.StringJsonSchema1 { @@ -1451,23 +1478,19 @@ public ApplicationxwwwformurlencodedSchemaMap1110Builder getBuilderAfterApplicat } - public static abstract sealed class ApplicationxwwwformurlencodedSchema1Boxed permits ApplicationxwwwformurlencodedSchema1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface ApplicationxwwwformurlencodedSchema1Boxed permits ApplicationxwwwformurlencodedSchema1BoxedMap { + @Nullable Object getData(); } - public static final class ApplicationxwwwformurlencodedSchema1BoxedMap extends ApplicationxwwwformurlencodedSchema1Boxed { - public final ApplicationxwwwformurlencodedSchemaMap data; - private ApplicationxwwwformurlencodedSchema1BoxedMap(ApplicationxwwwformurlencodedSchemaMap data) { - this.data = data; - } + public record ApplicationxwwwformurlencodedSchema1BoxedMap(ApplicationxwwwformurlencodedSchemaMap data) implements ApplicationxwwwformurlencodedSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ApplicationxwwwformurlencodedSchema1 extends JsonSchema implements MapSchemaValidator { + public static class ApplicationxwwwformurlencodedSchema1 extends JsonSchema implements MapSchemaValidator { private static @Nullable ApplicationxwwwformurlencodedSchema1 instance = null; protected ApplicationxwwwformurlencodedSchema1() { @@ -1516,11 +1539,11 @@ public ApplicationxwwwformurlencodedSchemaMap getNewInstance(Map arg, List List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -1557,6 +1580,13 @@ public ApplicationxwwwformurlencodedSchemaMap validate(Map arg, SchemaConf public ApplicationxwwwformurlencodedSchema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ApplicationxwwwformurlencodedSchema1BoxedMap(validate(arg, configuration)); } + @Override + public ApplicationxwwwformurlencodedSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/post/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/post/responses/Code200Response.java new file mode 100644 index 00000000000..e04e39b1f73 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/post/responses/Code200Response.java @@ -0,0 +1,7 @@ +package org.openapijsonschematools.client.paths.fake.post.responses; + +import org.openapijsonschematools.client.components.responses.SuccessDescriptionOnly; + +public class Code200Response extends SuccessDescriptionOnly { + public static class Code200Response1 extends SuccessDescriptionOnly1 {} +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/post/responses/Code404Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/post/responses/Code404Response.java new file mode 100644 index 00000000000..f6a0bbe8f31 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/post/responses/Code404Response.java @@ -0,0 +1,30 @@ +package org.openapijsonschematools.client.paths.fake.post.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.schemas.validation.MapUtils; + +import java.util.Map; +import java.net.http.HttpHeaders; + +public class Code404Response { + + public static class Code404Response1 extends ResponseDeserializer { + public Code404Response1() { + super( + MapUtils.makeMap( + ) + ); + } + + @Override + protected Void getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + return null; + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeadditionalpropertieswitharrayofenums/get/RequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeadditionalpropertieswitharrayofenums/get/RequestBody.java index d10ff982ed2..c1f5f3adacd 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeadditionalpropertieswitharrayofenums/get/RequestBody.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeadditionalpropertieswitharrayofenums/get/RequestBody.java @@ -6,22 +6,27 @@ import org.openapijsonschematools.client.requestbody.RequestBodySerializer; import org.openapijsonschematools.client.requestbody.GenericRequestBody; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; import org.openapijsonschematools.client.mediatype.MediaType; import org.openapijsonschematools.client.paths.fakeadditionalpropertieswitharrayofenums.get.requestbody.content.applicationjson.ApplicationjsonSchema; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; import java.util.AbstractMap; import java.util.Map; public class RequestBody { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} - public static class ApplicationjsonMediaType extends MediaType { + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { public ApplicationjsonMediaType() { - super(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; } } - public static class RequestBody1 extends RequestBodySerializer { + public static class RequestBody1 extends RequestBodySerializer { public RequestBody1() { super( Map.ofEntries( @@ -33,26 +38,15 @@ public RequestBody1() { public SerializedRequestBody serialize(SealedRequestBody requestBody) { ApplicationjsonRequestBody requestBody0 = (ApplicationjsonRequestBody) requestBody; - return serialize(requestBody0.contentType(), requestBody0.body().data()); + return serialize(requestBody0.contentType(), requestBody0.body().getData()); } } - public static abstract sealed class SealedRequestBody permits ApplicationjsonRequestBody {} - public static final class ApplicationjsonRequestBody extends SealedRequestBody implements GenericRequestBody { - private final String contentType; - private final ApplicationjsonSchema.AdditionalPropertiesWithArrayOfEnums1Boxed body; - public ApplicationjsonRequestBody(ApplicationjsonSchema.AdditionalPropertiesWithArrayOfEnums1Boxed body) { - contentType = "application/json"; - this.body = body; - } + public sealed interface SealedRequestBody permits ApplicationjsonRequestBody {} + public record ApplicationjsonRequestBody(ApplicationjsonSchema.AdditionalPropertiesWithArrayOfEnums1Boxed body) implements SealedRequestBody, GenericRequestBody { @Override public String contentType() { - return contentType; - } - - @Override - public ApplicationjsonSchema.AdditionalPropertiesWithArrayOfEnums1Boxed body() { - return body; + return "application/json"; } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeadditionalpropertieswitharrayofenums/get/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeadditionalpropertieswitharrayofenums/get/responses/Code200Response.java new file mode 100644 index 00000000000..d1d224a9573 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeadditionalpropertieswitharrayofenums/get/responses/Code200Response.java @@ -0,0 +1,54 @@ +package org.openapijsonschematools.client.paths.fakeadditionalpropertieswitharrayofenums.get.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakeadditionalpropertieswitharrayofenums.get.responses.code200response.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpHeaders; + +public class Code200Response { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} + public record ApplicationjsonResponseBody(ApplicationjsonSchema.AdditionalPropertiesWithArrayOfEnums1Boxed body) implements SealedResponseBody { } + + public static class Code200Response1 extends ResponseDeserializer { + public Code200Response1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + SealedMediaType mediaType = content.get(contentType); + if (mediaType == null) { + throw new RuntimeException("Invalid contentType was received back from the server that does not exist in the openapi document"); + } + if (mediaType instanceof ApplicationjsonMediaType thisMediaType) { + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } + throw new RuntimeException("contentType="+contentType+" returned by the server is unknown and does not exist in the openapi document"); + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeadditionalpropertieswitharrayofenums/get/responses/response200/content/applicationjson/ApplicationjsonSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeadditionalpropertieswitharrayofenums/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.java similarity index 89% rename from samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeadditionalpropertieswitharrayofenums/get/responses/response200/content/applicationjson/ApplicationjsonSchema.java rename to samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeadditionalpropertieswitharrayofenums/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.java index 9f831b7d11a..365fe1691e1 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeadditionalpropertieswitharrayofenums/get/responses/response200/content/applicationjson/ApplicationjsonSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeadditionalpropertieswitharrayofenums/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.java @@ -1,4 +1,4 @@ -package org.openapijsonschematools.client.paths.fakeadditionalpropertieswitharrayofenums.get.responses.response200.content.applicationjson; +package org.openapijsonschematools.client.paths.fakeadditionalpropertieswitharrayofenums.get.responses.code200response.content.applicationjson; import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.components.schemas.AdditionalPropertiesWithArrayOfEnums; diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakebodywithfileschema/put/RequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakebodywithfileschema/put/RequestBody.java index 62e2ddc6c26..3ce0af9cb18 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakebodywithfileschema/put/RequestBody.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakebodywithfileschema/put/RequestBody.java @@ -6,22 +6,27 @@ import org.openapijsonschematools.client.requestbody.RequestBodySerializer; import org.openapijsonschematools.client.requestbody.GenericRequestBody; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; import org.openapijsonschematools.client.mediatype.MediaType; import org.openapijsonschematools.client.paths.fakebodywithfileschema.put.requestbody.content.applicationjson.ApplicationjsonSchema; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; import java.util.AbstractMap; import java.util.Map; public class RequestBody { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} - public static class ApplicationjsonMediaType extends MediaType { + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { public ApplicationjsonMediaType() { - super(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; } } - public static class RequestBody1 extends RequestBodySerializer { + public static class RequestBody1 extends RequestBodySerializer { public RequestBody1() { super( Map.ofEntries( @@ -33,26 +38,15 @@ public RequestBody1() { public SerializedRequestBody serialize(SealedRequestBody requestBody) { ApplicationjsonRequestBody requestBody0 = (ApplicationjsonRequestBody) requestBody; - return serialize(requestBody0.contentType(), requestBody0.body().data()); + return serialize(requestBody0.contentType(), requestBody0.body().getData()); } } - public static abstract sealed class SealedRequestBody permits ApplicationjsonRequestBody {} - public static final class ApplicationjsonRequestBody extends SealedRequestBody implements GenericRequestBody { - private final String contentType; - private final ApplicationjsonSchema.FileSchemaTestClass1Boxed body; - public ApplicationjsonRequestBody(ApplicationjsonSchema.FileSchemaTestClass1Boxed body) { - contentType = "application/json"; - this.body = body; - } + public sealed interface SealedRequestBody permits ApplicationjsonRequestBody {} + public record ApplicationjsonRequestBody(ApplicationjsonSchema.FileSchemaTestClass1Boxed body) implements SealedRequestBody, GenericRequestBody { @Override public String contentType() { - return contentType; - } - - @Override - public ApplicationjsonSchema.FileSchemaTestClass1Boxed body() { - return body; + return "application/json"; } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakebodywithfileschema/put/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakebodywithfileschema/put/responses/Code200Response.java new file mode 100644 index 00000000000..71a49134261 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakebodywithfileschema/put/responses/Code200Response.java @@ -0,0 +1,7 @@ +package org.openapijsonschematools.client.paths.fakebodywithfileschema.put.responses; + +import org.openapijsonschematools.client.components.responses.SuccessDescriptionOnly; + +public class Code200Response extends SuccessDescriptionOnly { + public static class Code200Response1 extends SuccessDescriptionOnly1 {} +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakebodywithqueryparams/put/QueryParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakebodywithqueryparams/put/QueryParameters.java index a7c73d7f2d8..24e01b5b448 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakebodywithqueryparams/put/QueryParameters.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakebodywithqueryparams/put/QueryParameters.java @@ -100,23 +100,19 @@ public QueryParametersMap0Builder getBuilderAfterQuery(Map insta } - public static abstract sealed class QueryParameters1Boxed permits QueryParameters1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface QueryParameters1Boxed permits QueryParameters1BoxedMap { + @Nullable Object getData(); } - public static final class QueryParameters1BoxedMap extends QueryParameters1Boxed { - public final QueryParametersMap data; - private QueryParameters1BoxedMap(QueryParametersMap data) { - this.data = data; - } + public record QueryParameters1BoxedMap(QueryParametersMap data) implements QueryParameters1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class QueryParameters1 extends JsonSchema implements MapSchemaValidator { + public static class QueryParameters1 extends JsonSchema implements MapSchemaValidator { private static @Nullable QueryParameters1 instance = null; protected QueryParameters1() { @@ -150,11 +146,11 @@ public QueryParametersMap getNewInstance(Map arg, List pathToItem, List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof String)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -194,6 +190,13 @@ public QueryParametersMap validate(Map arg, SchemaConfiguration configurat public QueryParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new QueryParameters1BoxedMap(validate(arg, configuration)); } + @Override + public QueryParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakebodywithqueryparams/put/RequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakebodywithqueryparams/put/RequestBody.java index 5ad9d18cc56..ec82360b6dd 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakebodywithqueryparams/put/RequestBody.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakebodywithqueryparams/put/RequestBody.java @@ -6,22 +6,27 @@ import org.openapijsonschematools.client.requestbody.RequestBodySerializer; import org.openapijsonschematools.client.requestbody.GenericRequestBody; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; import org.openapijsonschematools.client.mediatype.MediaType; import org.openapijsonschematools.client.paths.fakebodywithqueryparams.put.requestbody.content.applicationjson.ApplicationjsonSchema; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; import java.util.AbstractMap; import java.util.Map; public class RequestBody { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} - public static class ApplicationjsonMediaType extends MediaType { + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { public ApplicationjsonMediaType() { - super(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; } } - public static class RequestBody1 extends RequestBodySerializer { + public static class RequestBody1 extends RequestBodySerializer { public RequestBody1() { super( Map.ofEntries( @@ -33,26 +38,15 @@ public RequestBody1() { public SerializedRequestBody serialize(SealedRequestBody requestBody) { ApplicationjsonRequestBody requestBody0 = (ApplicationjsonRequestBody) requestBody; - return serialize(requestBody0.contentType(), requestBody0.body().data()); + return serialize(requestBody0.contentType(), requestBody0.body().getData()); } } - public static abstract sealed class SealedRequestBody permits ApplicationjsonRequestBody {} - public static final class ApplicationjsonRequestBody extends SealedRequestBody implements GenericRequestBody { - private final String contentType; - private final ApplicationjsonSchema.User1Boxed body; - public ApplicationjsonRequestBody(ApplicationjsonSchema.User1Boxed body) { - contentType = "application/json"; - this.body = body; - } + public sealed interface SealedRequestBody permits ApplicationjsonRequestBody {} + public record ApplicationjsonRequestBody(ApplicationjsonSchema.User1Boxed body) implements SealedRequestBody, GenericRequestBody { @Override public String contentType() { - return contentType; - } - - @Override - public ApplicationjsonSchema.User1Boxed body() { - return body; + return "application/json"; } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakebodywithqueryparams/put/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakebodywithqueryparams/put/responses/Code200Response.java new file mode 100644 index 00000000000..4370c358e93 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakebodywithqueryparams/put/responses/Code200Response.java @@ -0,0 +1,7 @@ +package org.openapijsonschematools.client.paths.fakebodywithqueryparams.put.responses; + +import org.openapijsonschematools.client.components.responses.SuccessDescriptionOnly; + +public class Code200Response extends SuccessDescriptionOnly { + public static class Code200Response1 extends SuccessDescriptionOnly1 {} +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakecasesensitiveparams/put/QueryParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakecasesensitiveparams/put/QueryParameters.java index cda2ba7f59b..4b7ad8f27be 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakecasesensitiveparams/put/QueryParameters.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakecasesensitiveparams/put/QueryParameters.java @@ -241,23 +241,19 @@ public QueryParametersMap110Builder getBuilderAfterSomeVar1(Map { + public static class QueryParameters1 extends JsonSchema implements MapSchemaValidator { private static @Nullable QueryParameters1 instance = null; protected QueryParameters1() { @@ -295,11 +291,11 @@ public QueryParametersMap getNewInstance(Map arg, List pathToItem, List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -336,6 +332,13 @@ public QueryParametersMap validate(Map arg, SchemaConfiguration configurat public QueryParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new QueryParameters1BoxedMap(validate(arg, configuration)); } + @Override + public QueryParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakecasesensitiveparams/put/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakecasesensitiveparams/put/responses/Code200Response.java new file mode 100644 index 00000000000..3b79dac0ee0 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakecasesensitiveparams/put/responses/Code200Response.java @@ -0,0 +1,7 @@ +package org.openapijsonschematools.client.paths.fakecasesensitiveparams.put.responses; + +import org.openapijsonschematools.client.components.responses.SuccessDescriptionOnly; + +public class Code200Response extends SuccessDescriptionOnly { + public static class Code200Response1 extends SuccessDescriptionOnly1 {} +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeclassnametest/patch/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeclassnametest/patch/responses/Code200Response.java new file mode 100644 index 00000000000..a56b33fb4f7 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeclassnametest/patch/responses/Code200Response.java @@ -0,0 +1,54 @@ +package org.openapijsonschematools.client.paths.fakeclassnametest.patch.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakeclassnametest.patch.responses.code200response.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpHeaders; + +public class Code200Response { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} + public record ApplicationjsonResponseBody(ApplicationjsonSchema.Client1Boxed body) implements SealedResponseBody { } + + public static class Code200Response1 extends ResponseDeserializer { + public Code200Response1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + SealedMediaType mediaType = content.get(contentType); + if (mediaType == null) { + throw new RuntimeException("Invalid contentType was received back from the server that does not exist in the openapi document"); + } + if (mediaType instanceof ApplicationjsonMediaType thisMediaType) { + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } + throw new RuntimeException("contentType="+contentType+" returned by the server is unknown and does not exist in the openapi document"); + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeclassnametest/patch/responses/response200/content/applicationjson/ApplicationjsonSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeclassnametest/patch/responses/code200response/content/applicationjson/ApplicationjsonSchema.java similarity index 91% rename from samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeclassnametest/patch/responses/response200/content/applicationjson/ApplicationjsonSchema.java rename to samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeclassnametest/patch/responses/code200response/content/applicationjson/ApplicationjsonSchema.java index 3403aec0de0..ba79861d2e9 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeclassnametest/patch/responses/response200/content/applicationjson/ApplicationjsonSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeclassnametest/patch/responses/code200response/content/applicationjson/ApplicationjsonSchema.java @@ -1,4 +1,4 @@ -package org.openapijsonschematools.client.paths.fakeclassnametest.patch.responses.response200.content.applicationjson; +package org.openapijsonschematools.client.paths.fakeclassnametest.patch.responses.code200response.content.applicationjson; import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.components.schemas.Client; diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakedeletecoffeeid/delete/PathParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakedeletecoffeeid/delete/PathParameters.java index 8269ff17a75..086a2e9a146 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakedeletecoffeeid/delete/PathParameters.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakedeletecoffeeid/delete/PathParameters.java @@ -100,23 +100,19 @@ public PathParametersMap0Builder getBuilderAfterId(Map instance) } - public static abstract sealed class PathParameters1Boxed permits PathParameters1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface PathParameters1Boxed permits PathParameters1BoxedMap { + @Nullable Object getData(); } - public static final class PathParameters1BoxedMap extends PathParameters1Boxed { - public final PathParametersMap data; - private PathParameters1BoxedMap(PathParametersMap data) { - this.data = data; - } + public record PathParameters1BoxedMap(PathParametersMap data) implements PathParameters1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class PathParameters1 extends JsonSchema implements MapSchemaValidator { + public static class PathParameters1 extends JsonSchema implements MapSchemaValidator { private static @Nullable PathParameters1 instance = null; protected PathParameters1() { @@ -150,11 +146,11 @@ public PathParametersMap getNewInstance(Map arg, List pathToItem, List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof String)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -194,6 +190,13 @@ public PathParametersMap validate(Map arg, SchemaConfiguration configurati public PathParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new PathParameters1BoxedMap(validate(arg, configuration)); } + @Override + public PathParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakedeletecoffeeid/delete/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakedeletecoffeeid/delete/responses/Code200Response.java new file mode 100644 index 00000000000..29983a94575 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakedeletecoffeeid/delete/responses/Code200Response.java @@ -0,0 +1,7 @@ +package org.openapijsonschematools.client.paths.fakedeletecoffeeid.delete.responses; + +import org.openapijsonschematools.client.components.responses.SuccessDescriptionOnly; + +public class Code200Response extends SuccessDescriptionOnly { + public static class Code200Response1 extends SuccessDescriptionOnly1 {} +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakedeletecoffeeid/delete/responses/CodedefaultResponse.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakedeletecoffeeid/delete/responses/CodedefaultResponse.java new file mode 100644 index 00000000000..9e753636173 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakedeletecoffeeid/delete/responses/CodedefaultResponse.java @@ -0,0 +1,30 @@ +package org.openapijsonschematools.client.paths.fakedeletecoffeeid.delete.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.schemas.validation.MapUtils; + +import java.util.Map; +import java.net.http.HttpHeaders; + +public class CodedefaultResponse { + + public static class CodedefaultResponse1 extends ResponseDeserializer { + public CodedefaultResponse1() { + super( + MapUtils.makeMap( + ) + ); + } + + @Override + protected Void getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + return null; + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakehealth/get/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakehealth/get/responses/Code200Response.java new file mode 100644 index 00000000000..a504fe0a6ba --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakehealth/get/responses/Code200Response.java @@ -0,0 +1,54 @@ +package org.openapijsonschematools.client.paths.fakehealth.get.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakehealth.get.responses.code200response.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpHeaders; + +public class Code200Response { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} + public record ApplicationjsonResponseBody(ApplicationjsonSchema.HealthCheckResult1Boxed body) implements SealedResponseBody { } + + public static class Code200Response1 extends ResponseDeserializer { + public Code200Response1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + SealedMediaType mediaType = content.get(contentType); + if (mediaType == null) { + throw new RuntimeException("Invalid contentType was received back from the server that does not exist in the openapi document"); + } + if (mediaType instanceof ApplicationjsonMediaType thisMediaType) { + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } + throw new RuntimeException("contentType="+contentType+" returned by the server is unknown and does not exist in the openapi document"); + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakehealth/get/responses/response200/content/applicationjson/ApplicationjsonSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakehealth/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.java similarity index 92% rename from samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakehealth/get/responses/response200/content/applicationjson/ApplicationjsonSchema.java rename to samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakehealth/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.java index dc1f2dc8d3d..e9d84e9a57a 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakehealth/get/responses/response200/content/applicationjson/ApplicationjsonSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakehealth/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.java @@ -1,4 +1,4 @@ -package org.openapijsonschematools.client.paths.fakehealth.get.responses.response200.content.applicationjson; +package org.openapijsonschematools.client.paths.fakehealth.get.responses.code200response.content.applicationjson; import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.components.schemas.HealthCheckResult; diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlineadditionalproperties/post/RequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlineadditionalproperties/post/RequestBody.java index 623ace3cc69..628b1efee55 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlineadditionalproperties/post/RequestBody.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlineadditionalproperties/post/RequestBody.java @@ -6,22 +6,27 @@ import org.openapijsonschematools.client.requestbody.RequestBodySerializer; import org.openapijsonschematools.client.requestbody.GenericRequestBody; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; import org.openapijsonschematools.client.mediatype.MediaType; import org.openapijsonschematools.client.paths.fakeinlineadditionalproperties.post.requestbody.content.applicationjson.ApplicationjsonSchema; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; import java.util.AbstractMap; import java.util.Map; public class RequestBody { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} - public static class ApplicationjsonMediaType extends MediaType { + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { public ApplicationjsonMediaType() { - super(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; } } - public static class RequestBody1 extends RequestBodySerializer { + public static class RequestBody1 extends RequestBodySerializer { public RequestBody1() { super( Map.ofEntries( @@ -33,26 +38,15 @@ public RequestBody1() { public SerializedRequestBody serialize(SealedRequestBody requestBody) { ApplicationjsonRequestBody requestBody0 = (ApplicationjsonRequestBody) requestBody; - return serialize(requestBody0.contentType(), requestBody0.body().data()); + return serialize(requestBody0.contentType(), requestBody0.body().getData()); } } - public static abstract sealed class SealedRequestBody permits ApplicationjsonRequestBody {} - public static final class ApplicationjsonRequestBody extends SealedRequestBody implements GenericRequestBody { - private final String contentType; - private final ApplicationjsonSchema.ApplicationjsonSchema1Boxed body; - public ApplicationjsonRequestBody(ApplicationjsonSchema.ApplicationjsonSchema1Boxed body) { - contentType = "application/json"; - this.body = body; - } + public sealed interface SealedRequestBody permits ApplicationjsonRequestBody {} + public record ApplicationjsonRequestBody(ApplicationjsonSchema.ApplicationjsonSchema1Boxed body) implements SealedRequestBody, GenericRequestBody { @Override public String contentType() { - return contentType; - } - - @Override - public ApplicationjsonSchema.ApplicationjsonSchema1Boxed body() { - return body; + return "application/json"; } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlineadditionalproperties/post/requestbody/content/applicationjson/ApplicationjsonSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlineadditionalproperties/post/requestbody/content/applicationjson/ApplicationjsonSchema.java index 0d2838e4923..76ae9ff97d4 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlineadditionalproperties/post/requestbody/content/applicationjson/ApplicationjsonSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlineadditionalproperties/post/requestbody/content/applicationjson/ApplicationjsonSchema.java @@ -88,23 +88,19 @@ public ApplicationjsonSchemaMapBuilder getBuilderAfterAdditionalProperty(Map { + public static class ApplicationjsonSchema1 extends JsonSchema implements MapSchemaValidator { private static @Nullable ApplicationjsonSchema1 instance = null; protected ApplicationjsonSchema1() { @@ -132,11 +128,11 @@ public ApplicationjsonSchemaMap getNewInstance(Map arg, List pathT List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof String)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -176,6 +172,13 @@ public ApplicationjsonSchemaMap validate(Map arg, SchemaConfiguration conf public ApplicationjsonSchema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ApplicationjsonSchema1BoxedMap(validate(arg, configuration)); } + @Override + public ApplicationjsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlineadditionalproperties/post/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlineadditionalproperties/post/responses/Code200Response.java new file mode 100644 index 00000000000..ce64200111e --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlineadditionalproperties/post/responses/Code200Response.java @@ -0,0 +1,7 @@ +package org.openapijsonschematools.client.paths.fakeinlineadditionalproperties.post.responses; + +import org.openapijsonschematools.client.components.responses.SuccessDescriptionOnly; + +public class Code200Response extends SuccessDescriptionOnly { + public static class Code200Response1 extends SuccessDescriptionOnly1 {} +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/QueryParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/QueryParameters.java index 6f7ce7be9dd..e562508fcb9 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/QueryParameters.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/QueryParameters.java @@ -174,23 +174,19 @@ public QueryParametersMapBuilder getBuilderAfterCompositionInProperty(Map { + public static class QueryParameters1 extends JsonSchema implements MapSchemaValidator { private static @Nullable QueryParameters1 instance = null; protected QueryParameters1() { @@ -222,11 +218,11 @@ public QueryParametersMap getNewInstance(Map arg, List pathToItem, List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -263,6 +259,13 @@ public QueryParametersMap validate(Map arg, SchemaConfiguration configurat public QueryParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new QueryParameters1BoxedMap(validate(arg, configuration)); } + @Override + public QueryParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/RequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/RequestBody.java index 84c52ee8f9d..062e79c82e3 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/RequestBody.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/RequestBody.java @@ -6,29 +6,38 @@ import org.openapijsonschematools.client.requestbody.RequestBodySerializer; import org.openapijsonschematools.client.requestbody.GenericRequestBody; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; import org.openapijsonschematools.client.mediatype.MediaType; import org.openapijsonschematools.client.paths.fakeinlinecomposition.post.requestbody.content.applicationjson.ApplicationjsonSchema; import org.openapijsonschematools.client.paths.fakeinlinecomposition.post.requestbody.content.multipartformdata.MultipartformdataSchema; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; import java.util.AbstractMap; import java.util.Map; public class RequestBody { + public sealed interface SealedMediaType permits ApplicationjsonMediaType, MultipartformdataMediaType {} - public static class ApplicationjsonMediaType extends MediaType { + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { public ApplicationjsonMediaType() { - super(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; } } - public static class MultipartformdataMediaType extends MediaType { + public record MultipartformdataMediaType(MultipartformdataSchema.MultipartformdataSchema1 schema) implements SealedMediaType, MediaType { public MultipartformdataMediaType() { - super(MultipartformdataSchema.MultipartformdataSchema1.getInstance()); + this(MultipartformdataSchema.MultipartformdataSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; } } - public static class RequestBody1 extends RequestBodySerializer { + public static class RequestBody1 extends RequestBodySerializer { public RequestBody1() { super( Map.ofEntries( @@ -41,47 +50,25 @@ public RequestBody1() { public SerializedRequestBody serialize(SealedRequestBody requestBody) { if (requestBody instanceof ApplicationjsonRequestBody requestBody0) { - return serialize(requestBody0.contentType(), requestBody0.body().data()); + return serialize(requestBody0.contentType(), requestBody0.body().getData()); } else { MultipartformdataRequestBody requestBody1 = (MultipartformdataRequestBody) requestBody; - return serialize(requestBody1.contentType(), requestBody1.body().data()); + return serialize(requestBody1.contentType(), requestBody1.body().getData()); } } } - public static abstract sealed class SealedRequestBody permits ApplicationjsonRequestBody, MultipartformdataRequestBody {} - public static final class ApplicationjsonRequestBody extends SealedRequestBody implements GenericRequestBody { - private final String contentType; - private final ApplicationjsonSchema.ApplicationjsonSchema1Boxed body; - public ApplicationjsonRequestBody(ApplicationjsonSchema.ApplicationjsonSchema1Boxed body) { - contentType = "application/json"; - this.body = body; - } + public sealed interface SealedRequestBody permits ApplicationjsonRequestBody, MultipartformdataRequestBody {} + public record ApplicationjsonRequestBody(ApplicationjsonSchema.ApplicationjsonSchema1Boxed body) implements SealedRequestBody, GenericRequestBody { @Override public String contentType() { - return contentType; - } - - @Override - public ApplicationjsonSchema.ApplicationjsonSchema1Boxed body() { - return body; + return "application/json"; } } - public static final class MultipartformdataRequestBody extends SealedRequestBody implements GenericRequestBody { - private final String contentType; - private final MultipartformdataSchema.MultipartformdataSchema1Boxed body; - public MultipartformdataRequestBody(MultipartformdataSchema.MultipartformdataSchema1Boxed body) { - contentType = "multipart/form-data"; - this.body = body; - } + public record MultipartformdataRequestBody(MultipartformdataSchema.MultipartformdataSchema1Boxed body) implements SealedRequestBody, GenericRequestBody { @Override public String contentType() { - return contentType; - } - - @Override - public MultipartformdataSchema.MultipartformdataSchema1Boxed body() { - return body; + return "multipart/form-data"; } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/parameters/parameter0/Schema0.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/parameters/parameter0/Schema0.java index a0f49340781..ccc4f70f4e3 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/parameters/parameter0/Schema0.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/parameters/parameter0/Schema0.java @@ -35,24 +35,20 @@ public class Schema0 { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class Schema00Boxed permits Schema00BoxedString { - public abstract @Nullable Object data(); + public sealed interface Schema00Boxed permits Schema00BoxedString { + @Nullable Object getData(); } - public static final class Schema00BoxedString extends Schema00Boxed { - public final String data; - private Schema00BoxedString(String data) { - this.data = data; - } + public record Schema00BoxedString(String data) implements Schema00Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema00 extends JsonSchema implements StringSchemaValidator { + public static class Schema00 extends JsonSchema implements StringSchemaValidator { private static @Nullable Schema00 instance = null; protected Schema00() { @@ -100,80 +96,63 @@ public String validate(String arg, SchemaConfiguration configuration) throws Val public Schema00BoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema00BoxedString(validate(arg, configuration)); } + @Override + public Schema00Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class Schema01Boxed permits Schema01BoxedVoid, Schema01BoxedBoolean, Schema01BoxedNumber, Schema01BoxedString, Schema01BoxedList, Schema01BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Schema01Boxed permits Schema01BoxedVoid, Schema01BoxedBoolean, Schema01BoxedNumber, Schema01BoxedString, Schema01BoxedList, Schema01BoxedMap { + @Nullable Object getData(); } - public static final class Schema01BoxedVoid extends Schema01Boxed { - public final Void data; - private Schema01BoxedVoid(Void data) { - this.data = data; - } + public record Schema01BoxedVoid(Void data) implements Schema01Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema01BoxedBoolean extends Schema01Boxed { - public final boolean data; - private Schema01BoxedBoolean(boolean data) { - this.data = data; - } + public record Schema01BoxedBoolean(boolean data) implements Schema01Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema01BoxedNumber extends Schema01Boxed { - public final Number data; - private Schema01BoxedNumber(Number data) { - this.data = data; - } + public record Schema01BoxedNumber(Number data) implements Schema01Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema01BoxedString extends Schema01Boxed { - public final String data; - private Schema01BoxedString(String data) { - this.data = data; - } + public record Schema01BoxedString(String data) implements Schema01Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema01BoxedList extends Schema01Boxed { - public final FrozenList<@Nullable Object> data; - private Schema01BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record Schema01BoxedList(FrozenList<@Nullable Object> data) implements Schema01Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class Schema01BoxedMap extends Schema01Boxed { - public final FrozenMap<@Nullable Object> data; - private Schema01BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record Schema01BoxedMap(FrozenMap<@Nullable Object> data) implements Schema01Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema01 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema01BoxedList>, MapSchemaValidator, Schema01BoxedMap> { + public static class Schema01 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, Schema01BoxedList>, MapSchemaValidator, Schema01BoxedMap> { private static @Nullable Schema01 instance = null; protected Schema01() { @@ -274,11 +253,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -309,11 +288,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -392,5 +371,24 @@ public Schema01BoxedList validateAndBox(List arg, SchemaConfiguration configu public Schema01BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema01BoxedMap(validate(arg, configuration)); } + @Override + public Schema01Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/parameters/parameter1/Schema1.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/parameters/parameter1/Schema1.java index b99ef5b4cde..53b54f01e86 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/parameters/parameter1/Schema1.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/parameters/parameter1/Schema1.java @@ -37,24 +37,20 @@ public class Schema1 { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class Schema01Boxed permits Schema01BoxedString { - public abstract @Nullable Object data(); + public sealed interface Schema01Boxed permits Schema01BoxedString { + @Nullable Object getData(); } - public static final class Schema01BoxedString extends Schema01Boxed { - public final String data; - private Schema01BoxedString(String data) { - this.data = data; - } + public record Schema01BoxedString(String data) implements Schema01Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema01 extends JsonSchema implements StringSchemaValidator { + public static class Schema01 extends JsonSchema implements StringSchemaValidator { private static @Nullable Schema01 instance = null; protected Schema01() { @@ -102,80 +98,63 @@ public String validate(String arg, SchemaConfiguration configuration) throws Val public Schema01BoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema01BoxedString(validate(arg, configuration)); } + @Override + public Schema01Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class SomeProp1Boxed permits SomeProp1BoxedVoid, SomeProp1BoxedBoolean, SomeProp1BoxedNumber, SomeProp1BoxedString, SomeProp1BoxedList, SomeProp1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface SomeProp1Boxed permits SomeProp1BoxedVoid, SomeProp1BoxedBoolean, SomeProp1BoxedNumber, SomeProp1BoxedString, SomeProp1BoxedList, SomeProp1BoxedMap { + @Nullable Object getData(); } - public static final class SomeProp1BoxedVoid extends SomeProp1Boxed { - public final Void data; - private SomeProp1BoxedVoid(Void data) { - this.data = data; - } + public record SomeProp1BoxedVoid(Void data) implements SomeProp1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class SomeProp1BoxedBoolean extends SomeProp1Boxed { - public final boolean data; - private SomeProp1BoxedBoolean(boolean data) { - this.data = data; - } + public record SomeProp1BoxedBoolean(boolean data) implements SomeProp1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class SomeProp1BoxedNumber extends SomeProp1Boxed { - public final Number data; - private SomeProp1BoxedNumber(Number data) { - this.data = data; - } + public record SomeProp1BoxedNumber(Number data) implements SomeProp1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class SomeProp1BoxedString extends SomeProp1Boxed { - public final String data; - private SomeProp1BoxedString(String data) { - this.data = data; - } + public record SomeProp1BoxedString(String data) implements SomeProp1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class SomeProp1BoxedList extends SomeProp1Boxed { - public final FrozenList<@Nullable Object> data; - private SomeProp1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record SomeProp1BoxedList(FrozenList<@Nullable Object> data) implements SomeProp1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class SomeProp1BoxedMap extends SomeProp1Boxed { - public final FrozenMap<@Nullable Object> data; - private SomeProp1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record SomeProp1BoxedMap(FrozenMap<@Nullable Object> data) implements SomeProp1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class SomeProp1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, SomeProp1BoxedList>, MapSchemaValidator, SomeProp1BoxedMap> { + public static class SomeProp1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, SomeProp1BoxedList>, MapSchemaValidator, SomeProp1BoxedMap> { private static @Nullable SomeProp1 instance = null; protected SomeProp1() { @@ -276,11 +255,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -311,11 +290,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -394,6 +373,25 @@ public SomeProp1BoxedList validateAndBox(List arg, SchemaConfiguration config public SomeProp1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new SomeProp1BoxedMap(validate(arg, configuration)); } + @Override + public SomeProp1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class SchemaMap1 extends FrozenMap<@Nullable Object> { @@ -504,23 +502,19 @@ public SchemaMapBuilder1 getBuilderAfterAdditionalProperty(Map { + public static class Schema11 extends JsonSchema implements MapSchemaValidator { private static @Nullable Schema11 instance = null; protected Schema11() { @@ -550,11 +544,11 @@ public SchemaMap1 getNewInstance(Map arg, List pathToItem, PathToS List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -591,6 +585,13 @@ public SchemaMap1 validate(Map arg, SchemaConfiguration configuration) thr public Schema11BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema11BoxedMap(validate(arg, configuration)); } + @Override + public Schema11Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/requestbody/content/applicationjson/ApplicationjsonSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/requestbody/content/applicationjson/ApplicationjsonSchema.java index 9ebdc5fb50d..2c96cc9523d 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/requestbody/content/applicationjson/ApplicationjsonSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/requestbody/content/applicationjson/ApplicationjsonSchema.java @@ -35,24 +35,20 @@ public class ApplicationjsonSchema { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class Applicationjson0Boxed permits Applicationjson0BoxedString { - public abstract @Nullable Object data(); + public sealed interface Applicationjson0Boxed permits Applicationjson0BoxedString { + @Nullable Object getData(); } - public static final class Applicationjson0BoxedString extends Applicationjson0Boxed { - public final String data; - private Applicationjson0BoxedString(String data) { - this.data = data; - } + public record Applicationjson0BoxedString(String data) implements Applicationjson0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Applicationjson0 extends JsonSchema implements StringSchemaValidator { + public static class Applicationjson0 extends JsonSchema implements StringSchemaValidator { private static @Nullable Applicationjson0 instance = null; protected Applicationjson0() { @@ -100,80 +96,63 @@ public String validate(String arg, SchemaConfiguration configuration) throws Val public Applicationjson0BoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Applicationjson0BoxedString(validate(arg, configuration)); } + @Override + public Applicationjson0Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class ApplicationjsonSchema1Boxed permits ApplicationjsonSchema1BoxedVoid, ApplicationjsonSchema1BoxedBoolean, ApplicationjsonSchema1BoxedNumber, ApplicationjsonSchema1BoxedString, ApplicationjsonSchema1BoxedList, ApplicationjsonSchema1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface ApplicationjsonSchema1Boxed permits ApplicationjsonSchema1BoxedVoid, ApplicationjsonSchema1BoxedBoolean, ApplicationjsonSchema1BoxedNumber, ApplicationjsonSchema1BoxedString, ApplicationjsonSchema1BoxedList, ApplicationjsonSchema1BoxedMap { + @Nullable Object getData(); } - public static final class ApplicationjsonSchema1BoxedVoid extends ApplicationjsonSchema1Boxed { - public final Void data; - private ApplicationjsonSchema1BoxedVoid(Void data) { - this.data = data; - } + public record ApplicationjsonSchema1BoxedVoid(Void data) implements ApplicationjsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ApplicationjsonSchema1BoxedBoolean extends ApplicationjsonSchema1Boxed { - public final boolean data; - private ApplicationjsonSchema1BoxedBoolean(boolean data) { - this.data = data; - } + public record ApplicationjsonSchema1BoxedBoolean(boolean data) implements ApplicationjsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ApplicationjsonSchema1BoxedNumber extends ApplicationjsonSchema1Boxed { - public final Number data; - private ApplicationjsonSchema1BoxedNumber(Number data) { - this.data = data; - } + public record ApplicationjsonSchema1BoxedNumber(Number data) implements ApplicationjsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ApplicationjsonSchema1BoxedString extends ApplicationjsonSchema1Boxed { - public final String data; - private ApplicationjsonSchema1BoxedString(String data) { - this.data = data; - } + public record ApplicationjsonSchema1BoxedString(String data) implements ApplicationjsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ApplicationjsonSchema1BoxedList extends ApplicationjsonSchema1Boxed { - public final FrozenList<@Nullable Object> data; - private ApplicationjsonSchema1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record ApplicationjsonSchema1BoxedList(FrozenList<@Nullable Object> data) implements ApplicationjsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ApplicationjsonSchema1BoxedMap extends ApplicationjsonSchema1Boxed { - public final FrozenMap<@Nullable Object> data; - private ApplicationjsonSchema1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record ApplicationjsonSchema1BoxedMap(FrozenMap<@Nullable Object> data) implements ApplicationjsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ApplicationjsonSchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ApplicationjsonSchema1BoxedList>, MapSchemaValidator, ApplicationjsonSchema1BoxedMap> { + public static class ApplicationjsonSchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ApplicationjsonSchema1BoxedList>, MapSchemaValidator, ApplicationjsonSchema1BoxedMap> { private static @Nullable ApplicationjsonSchema1 instance = null; protected ApplicationjsonSchema1() { @@ -274,11 +253,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -309,11 +288,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -392,5 +371,24 @@ public ApplicationjsonSchema1BoxedList validateAndBox(List arg, SchemaConfigu public ApplicationjsonSchema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ApplicationjsonSchema1BoxedMap(validate(arg, configuration)); } + @Override + public ApplicationjsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/requestbody/content/multipartformdata/MultipartformdataSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/requestbody/content/multipartformdata/MultipartformdataSchema.java index 6f0046bd2be..21b63d62157 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/requestbody/content/multipartformdata/MultipartformdataSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/requestbody/content/multipartformdata/MultipartformdataSchema.java @@ -37,24 +37,20 @@ public class MultipartformdataSchema { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class Multipartformdata0Boxed permits Multipartformdata0BoxedString { - public abstract @Nullable Object data(); + public sealed interface Multipartformdata0Boxed permits Multipartformdata0BoxedString { + @Nullable Object getData(); } - public static final class Multipartformdata0BoxedString extends Multipartformdata0Boxed { - public final String data; - private Multipartformdata0BoxedString(String data) { - this.data = data; - } + public record Multipartformdata0BoxedString(String data) implements Multipartformdata0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Multipartformdata0 extends JsonSchema implements StringSchemaValidator { + public static class Multipartformdata0 extends JsonSchema implements StringSchemaValidator { private static @Nullable Multipartformdata0 instance = null; protected Multipartformdata0() { @@ -102,80 +98,63 @@ public String validate(String arg, SchemaConfiguration configuration) throws Val public Multipartformdata0BoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Multipartformdata0BoxedString(validate(arg, configuration)); } + @Override + public Multipartformdata0Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class MultipartformdataSomePropBoxed permits MultipartformdataSomePropBoxedVoid, MultipartformdataSomePropBoxedBoolean, MultipartformdataSomePropBoxedNumber, MultipartformdataSomePropBoxedString, MultipartformdataSomePropBoxedList, MultipartformdataSomePropBoxedMap { - public abstract @Nullable Object data(); + public sealed interface MultipartformdataSomePropBoxed permits MultipartformdataSomePropBoxedVoid, MultipartformdataSomePropBoxedBoolean, MultipartformdataSomePropBoxedNumber, MultipartformdataSomePropBoxedString, MultipartformdataSomePropBoxedList, MultipartformdataSomePropBoxedMap { + @Nullable Object getData(); } - public static final class MultipartformdataSomePropBoxedVoid extends MultipartformdataSomePropBoxed { - public final Void data; - private MultipartformdataSomePropBoxedVoid(Void data) { - this.data = data; - } + public record MultipartformdataSomePropBoxedVoid(Void data) implements MultipartformdataSomePropBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MultipartformdataSomePropBoxedBoolean extends MultipartformdataSomePropBoxed { - public final boolean data; - private MultipartformdataSomePropBoxedBoolean(boolean data) { - this.data = data; - } + public record MultipartformdataSomePropBoxedBoolean(boolean data) implements MultipartformdataSomePropBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MultipartformdataSomePropBoxedNumber extends MultipartformdataSomePropBoxed { - public final Number data; - private MultipartformdataSomePropBoxedNumber(Number data) { - this.data = data; - } + public record MultipartformdataSomePropBoxedNumber(Number data) implements MultipartformdataSomePropBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MultipartformdataSomePropBoxedString extends MultipartformdataSomePropBoxed { - public final String data; - private MultipartformdataSomePropBoxedString(String data) { - this.data = data; - } + public record MultipartformdataSomePropBoxedString(String data) implements MultipartformdataSomePropBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MultipartformdataSomePropBoxedList extends MultipartformdataSomePropBoxed { - public final FrozenList<@Nullable Object> data; - private MultipartformdataSomePropBoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record MultipartformdataSomePropBoxedList(FrozenList<@Nullable Object> data) implements MultipartformdataSomePropBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MultipartformdataSomePropBoxedMap extends MultipartformdataSomePropBoxed { - public final FrozenMap<@Nullable Object> data; - private MultipartformdataSomePropBoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record MultipartformdataSomePropBoxedMap(FrozenMap<@Nullable Object> data) implements MultipartformdataSomePropBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class MultipartformdataSomeProp extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, MultipartformdataSomePropBoxedList>, MapSchemaValidator, MultipartformdataSomePropBoxedMap> { + public static class MultipartformdataSomeProp extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, MultipartformdataSomePropBoxedList>, MapSchemaValidator, MultipartformdataSomePropBoxedMap> { private static @Nullable MultipartformdataSomeProp instance = null; protected MultipartformdataSomeProp() { @@ -276,11 +255,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -311,11 +290,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -394,6 +373,25 @@ public MultipartformdataSomePropBoxedList validateAndBox(List arg, SchemaConf public MultipartformdataSomePropBoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new MultipartformdataSomePropBoxedMap(validate(arg, configuration)); } + @Override + public MultipartformdataSomePropBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class MultipartformdataSchemaMap extends FrozenMap<@Nullable Object> { @@ -504,23 +502,19 @@ public MultipartformdataSchemaMapBuilder getBuilderAfterAdditionalProperty(Map { + public static class MultipartformdataSchema1 extends JsonSchema implements MapSchemaValidator { private static @Nullable MultipartformdataSchema1 instance = null; protected MultipartformdataSchema1() { @@ -550,11 +544,11 @@ public MultipartformdataSchemaMap getNewInstance(Map arg, List pat List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -591,6 +585,13 @@ public MultipartformdataSchemaMap validate(Map arg, SchemaConfiguration co public MultipartformdataSchema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new MultipartformdataSchema1BoxedMap(validate(arg, configuration)); } + @Override + public MultipartformdataSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/responses/Code200Response.java new file mode 100644 index 00000000000..7d4e5e617e9 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/responses/Code200Response.java @@ -0,0 +1,70 @@ +package org.openapijsonschematools.client.paths.fakeinlinecomposition.post.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakeinlinecomposition.post.responses.code200response.content.applicationjson.ApplicationjsonSchema; +import org.openapijsonschematools.client.paths.fakeinlinecomposition.post.responses.code200response.content.multipartformdata.MultipartformdataSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpHeaders; + +public class Code200Response { + public sealed interface SealedMediaType permits ApplicationjsonMediaType, MultipartformdataMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + + public record MultipartformdataMediaType(MultipartformdataSchema.MultipartformdataSchema1 schema) implements SealedMediaType, MediaType { + public MultipartformdataMediaType() { + this(MultipartformdataSchema.MultipartformdataSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationjsonResponseBody, MultipartformdataResponseBody {} + public record ApplicationjsonResponseBody(ApplicationjsonSchema.ApplicationjsonSchema1Boxed body) implements SealedResponseBody { } + public record MultipartformdataResponseBody(MultipartformdataSchema.MultipartformdataSchema1Boxed body) implements SealedResponseBody { } + + public static class Code200Response1 extends ResponseDeserializer { + public Code200Response1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()), + new AbstractMap.SimpleEntry<>("multipart/form-data", new MultipartformdataMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + SealedMediaType mediaType = content.get(contentType); + if (mediaType == null) { + throw new RuntimeException("Invalid contentType was received back from the server that does not exist in the openapi document"); + } + if (mediaType instanceof ApplicationjsonMediaType thisMediaType) { + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } else if (mediaType instanceof MultipartformdataMediaType thisMediaType) { + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new MultipartformdataResponseBody(deserializedBody); + } + throw new RuntimeException("contentType="+contentType+" returned by the server is unknown and does not exist in the openapi document"); + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/responses/response200/content/applicationjson/ApplicationjsonSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java similarity index 81% rename from samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/responses/response200/content/applicationjson/ApplicationjsonSchema.java rename to samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java index 6971088147a..695b0da9c5b 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/responses/response200/content/applicationjson/ApplicationjsonSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java @@ -1,4 +1,4 @@ -package org.openapijsonschematools.client.paths.fakeinlinecomposition.post.responses.response200.content.applicationjson; +package org.openapijsonschematools.client.paths.fakeinlinecomposition.post.responses.code200response.content.applicationjson; import java.time.LocalDate; import java.time.ZonedDateTime; import java.util.ArrayList; @@ -35,24 +35,20 @@ public class ApplicationjsonSchema { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class Applicationjson0Boxed permits Applicationjson0BoxedString { - public abstract @Nullable Object data(); + public sealed interface Applicationjson0Boxed permits Applicationjson0BoxedString { + @Nullable Object getData(); } - public static final class Applicationjson0BoxedString extends Applicationjson0Boxed { - public final String data; - private Applicationjson0BoxedString(String data) { - this.data = data; - } + public record Applicationjson0BoxedString(String data) implements Applicationjson0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Applicationjson0 extends JsonSchema implements StringSchemaValidator { + public static class Applicationjson0 extends JsonSchema implements StringSchemaValidator { private static @Nullable Applicationjson0 instance = null; protected Applicationjson0() { @@ -100,80 +96,63 @@ public String validate(String arg, SchemaConfiguration configuration) throws Val public Applicationjson0BoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Applicationjson0BoxedString(validate(arg, configuration)); } + @Override + public Applicationjson0Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class ApplicationjsonSchema1Boxed permits ApplicationjsonSchema1BoxedVoid, ApplicationjsonSchema1BoxedBoolean, ApplicationjsonSchema1BoxedNumber, ApplicationjsonSchema1BoxedString, ApplicationjsonSchema1BoxedList, ApplicationjsonSchema1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface ApplicationjsonSchema1Boxed permits ApplicationjsonSchema1BoxedVoid, ApplicationjsonSchema1BoxedBoolean, ApplicationjsonSchema1BoxedNumber, ApplicationjsonSchema1BoxedString, ApplicationjsonSchema1BoxedList, ApplicationjsonSchema1BoxedMap { + @Nullable Object getData(); } - public static final class ApplicationjsonSchema1BoxedVoid extends ApplicationjsonSchema1Boxed { - public final Void data; - private ApplicationjsonSchema1BoxedVoid(Void data) { - this.data = data; - } + public record ApplicationjsonSchema1BoxedVoid(Void data) implements ApplicationjsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ApplicationjsonSchema1BoxedBoolean extends ApplicationjsonSchema1Boxed { - public final boolean data; - private ApplicationjsonSchema1BoxedBoolean(boolean data) { - this.data = data; - } + public record ApplicationjsonSchema1BoxedBoolean(boolean data) implements ApplicationjsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ApplicationjsonSchema1BoxedNumber extends ApplicationjsonSchema1Boxed { - public final Number data; - private ApplicationjsonSchema1BoxedNumber(Number data) { - this.data = data; - } + public record ApplicationjsonSchema1BoxedNumber(Number data) implements ApplicationjsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ApplicationjsonSchema1BoxedString extends ApplicationjsonSchema1Boxed { - public final String data; - private ApplicationjsonSchema1BoxedString(String data) { - this.data = data; - } + public record ApplicationjsonSchema1BoxedString(String data) implements ApplicationjsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ApplicationjsonSchema1BoxedList extends ApplicationjsonSchema1Boxed { - public final FrozenList<@Nullable Object> data; - private ApplicationjsonSchema1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record ApplicationjsonSchema1BoxedList(FrozenList<@Nullable Object> data) implements ApplicationjsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class ApplicationjsonSchema1BoxedMap extends ApplicationjsonSchema1Boxed { - public final FrozenMap<@Nullable Object> data; - private ApplicationjsonSchema1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record ApplicationjsonSchema1BoxedMap(FrozenMap<@Nullable Object> data) implements ApplicationjsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ApplicationjsonSchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ApplicationjsonSchema1BoxedList>, MapSchemaValidator, ApplicationjsonSchema1BoxedMap> { + public static class ApplicationjsonSchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, ApplicationjsonSchema1BoxedList>, MapSchemaValidator, ApplicationjsonSchema1BoxedMap> { private static @Nullable ApplicationjsonSchema1 instance = null; protected ApplicationjsonSchema1() { @@ -274,11 +253,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -309,11 +288,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -392,5 +371,24 @@ public ApplicationjsonSchema1BoxedList validateAndBox(List arg, SchemaConfigu public ApplicationjsonSchema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ApplicationjsonSchema1BoxedMap(validate(arg, configuration)); } + @Override + public ApplicationjsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/responses/response200/content/multipartformdata/MultipartformdataSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/responses/code200response/content/multipartformdata/MultipartformdataSchema.java similarity index 83% rename from samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/responses/response200/content/multipartformdata/MultipartformdataSchema.java rename to samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/responses/code200response/content/multipartformdata/MultipartformdataSchema.java index 82d23910307..2a1e790f1a2 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/responses/response200/content/multipartformdata/MultipartformdataSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/responses/code200response/content/multipartformdata/MultipartformdataSchema.java @@ -1,4 +1,4 @@ -package org.openapijsonschematools.client.paths.fakeinlinecomposition.post.responses.response200.content.multipartformdata; +package org.openapijsonschematools.client.paths.fakeinlinecomposition.post.responses.code200response.content.multipartformdata; import java.time.LocalDate; import java.time.ZonedDateTime; import java.util.ArrayList; @@ -37,24 +37,20 @@ public class MultipartformdataSchema { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class Multipartformdata0Boxed permits Multipartformdata0BoxedString { - public abstract @Nullable Object data(); + public sealed interface Multipartformdata0Boxed permits Multipartformdata0BoxedString { + @Nullable Object getData(); } - public static final class Multipartformdata0BoxedString extends Multipartformdata0Boxed { - public final String data; - private Multipartformdata0BoxedString(String data) { - this.data = data; - } + public record Multipartformdata0BoxedString(String data) implements Multipartformdata0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Multipartformdata0 extends JsonSchema implements StringSchemaValidator { + public static class Multipartformdata0 extends JsonSchema implements StringSchemaValidator { private static @Nullable Multipartformdata0 instance = null; protected Multipartformdata0() { @@ -102,80 +98,63 @@ public String validate(String arg, SchemaConfiguration configuration) throws Val public Multipartformdata0BoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Multipartformdata0BoxedString(validate(arg, configuration)); } + @Override + public Multipartformdata0Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class MultipartformdataSomePropBoxed permits MultipartformdataSomePropBoxedVoid, MultipartformdataSomePropBoxedBoolean, MultipartformdataSomePropBoxedNumber, MultipartformdataSomePropBoxedString, MultipartformdataSomePropBoxedList, MultipartformdataSomePropBoxedMap { - public abstract @Nullable Object data(); + public sealed interface MultipartformdataSomePropBoxed permits MultipartformdataSomePropBoxedVoid, MultipartformdataSomePropBoxedBoolean, MultipartformdataSomePropBoxedNumber, MultipartformdataSomePropBoxedString, MultipartformdataSomePropBoxedList, MultipartformdataSomePropBoxedMap { + @Nullable Object getData(); } - public static final class MultipartformdataSomePropBoxedVoid extends MultipartformdataSomePropBoxed { - public final Void data; - private MultipartformdataSomePropBoxedVoid(Void data) { - this.data = data; - } + public record MultipartformdataSomePropBoxedVoid(Void data) implements MultipartformdataSomePropBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MultipartformdataSomePropBoxedBoolean extends MultipartformdataSomePropBoxed { - public final boolean data; - private MultipartformdataSomePropBoxedBoolean(boolean data) { - this.data = data; - } + public record MultipartformdataSomePropBoxedBoolean(boolean data) implements MultipartformdataSomePropBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MultipartformdataSomePropBoxedNumber extends MultipartformdataSomePropBoxed { - public final Number data; - private MultipartformdataSomePropBoxedNumber(Number data) { - this.data = data; - } + public record MultipartformdataSomePropBoxedNumber(Number data) implements MultipartformdataSomePropBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MultipartformdataSomePropBoxedString extends MultipartformdataSomePropBoxed { - public final String data; - private MultipartformdataSomePropBoxedString(String data) { - this.data = data; - } + public record MultipartformdataSomePropBoxedString(String data) implements MultipartformdataSomePropBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MultipartformdataSomePropBoxedList extends MultipartformdataSomePropBoxed { - public final FrozenList<@Nullable Object> data; - private MultipartformdataSomePropBoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record MultipartformdataSomePropBoxedList(FrozenList<@Nullable Object> data) implements MultipartformdataSomePropBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class MultipartformdataSomePropBoxedMap extends MultipartformdataSomePropBoxed { - public final FrozenMap<@Nullable Object> data; - private MultipartformdataSomePropBoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record MultipartformdataSomePropBoxedMap(FrozenMap<@Nullable Object> data) implements MultipartformdataSomePropBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class MultipartformdataSomeProp extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, MultipartformdataSomePropBoxedList>, MapSchemaValidator, MultipartformdataSomePropBoxedMap> { + public static class MultipartformdataSomeProp extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, MultipartformdataSomePropBoxedList>, MapSchemaValidator, MultipartformdataSomePropBoxedMap> { private static @Nullable MultipartformdataSomeProp instance = null; protected MultipartformdataSomeProp() { @@ -276,11 +255,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(itemInstance); i += 1; @@ -311,11 +290,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -394,6 +373,25 @@ public MultipartformdataSomePropBoxedList validateAndBox(List arg, SchemaConf public MultipartformdataSomePropBoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new MultipartformdataSomePropBoxedMap(validate(arg, configuration)); } + @Override + public MultipartformdataSomePropBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class MultipartformdataSchemaMap extends FrozenMap<@Nullable Object> { @@ -504,23 +502,19 @@ public MultipartformdataSchemaMapBuilder getBuilderAfterAdditionalProperty(Map { + public static class MultipartformdataSchema1 extends JsonSchema implements MapSchemaValidator { private static @Nullable MultipartformdataSchema1 instance = null; protected MultipartformdataSchema1() { @@ -550,11 +544,11 @@ public MultipartformdataSchemaMap getNewInstance(Map arg, List pat List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -591,6 +585,13 @@ public MultipartformdataSchemaMap validate(Map arg, SchemaConfiguration co public MultipartformdataSchema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new MultipartformdataSchema1BoxedMap(validate(arg, configuration)); } + @Override + public MultipartformdataSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonformdata/get/RequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonformdata/get/RequestBody.java index 8dd9c461307..d7fbbcbadcb 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonformdata/get/RequestBody.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonformdata/get/RequestBody.java @@ -6,22 +6,27 @@ import org.openapijsonschematools.client.requestbody.RequestBodySerializer; import org.openapijsonschematools.client.requestbody.GenericRequestBody; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; import org.openapijsonschematools.client.mediatype.MediaType; import org.openapijsonschematools.client.paths.fakejsonformdata.get.requestbody.content.applicationxwwwformurlencoded.ApplicationxwwwformurlencodedSchema; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; import java.util.AbstractMap; import java.util.Map; public class RequestBody { + public sealed interface SealedMediaType permits ApplicationxwwwformurlencodedMediaType {} - public static class ApplicationxwwwformurlencodedMediaType extends MediaType { + public record ApplicationxwwwformurlencodedMediaType(ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1 schema) implements SealedMediaType, MediaType { public ApplicationxwwwformurlencodedMediaType() { - super(ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1.getInstance()); + this(ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; } } - public static class RequestBody1 extends RequestBodySerializer { + public static class RequestBody1 extends RequestBodySerializer { public RequestBody1() { super( Map.ofEntries( @@ -33,26 +38,15 @@ public RequestBody1() { public SerializedRequestBody serialize(SealedRequestBody requestBody) { ApplicationxwwwformurlencodedRequestBody requestBody0 = (ApplicationxwwwformurlencodedRequestBody) requestBody; - return serialize(requestBody0.contentType(), requestBody0.body().data()); + return serialize(requestBody0.contentType(), requestBody0.body().getData()); } } - public static abstract sealed class SealedRequestBody permits ApplicationxwwwformurlencodedRequestBody {} - public static final class ApplicationxwwwformurlencodedRequestBody extends SealedRequestBody implements GenericRequestBody { - private final String contentType; - private final ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1Boxed body; - public ApplicationxwwwformurlencodedRequestBody(ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1Boxed body) { - contentType = "application/x-www-form-urlencoded"; - this.body = body; - } + public sealed interface SealedRequestBody permits ApplicationxwwwformurlencodedRequestBody {} + public record ApplicationxwwwformurlencodedRequestBody(ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1Boxed body) implements SealedRequestBody, GenericRequestBody { @Override public String contentType() { - return contentType; - } - - @Override - public ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1Boxed body() { - return body; + return "application/x-www-form-urlencoded"; } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonformdata/get/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonformdata/get/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.java index f096269832c..6ecf0882708 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonformdata/get/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonformdata/get/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.java @@ -175,23 +175,19 @@ public ApplicationxwwwformurlencodedSchemaMap10Builder getBuilderAfterApplicatio } - public static abstract sealed class ApplicationxwwwformurlencodedSchema1Boxed permits ApplicationxwwwformurlencodedSchema1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface ApplicationxwwwformurlencodedSchema1Boxed permits ApplicationxwwwformurlencodedSchema1BoxedMap { + @Nullable Object getData(); } - public static final class ApplicationxwwwformurlencodedSchema1BoxedMap extends ApplicationxwwwformurlencodedSchema1Boxed { - public final ApplicationxwwwformurlencodedSchemaMap data; - private ApplicationxwwwformurlencodedSchema1BoxedMap(ApplicationxwwwformurlencodedSchemaMap data) { - this.data = data; - } + public record ApplicationxwwwformurlencodedSchema1BoxedMap(ApplicationxwwwformurlencodedSchemaMap data) implements ApplicationxwwwformurlencodedSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ApplicationxwwwformurlencodedSchema1 extends JsonSchema implements MapSchemaValidator { + public static class ApplicationxwwwformurlencodedSchema1 extends JsonSchema implements MapSchemaValidator { private static @Nullable ApplicationxwwwformurlencodedSchema1 instance = null; protected ApplicationxwwwformurlencodedSchema1() { @@ -226,11 +222,11 @@ public ApplicationxwwwformurlencodedSchemaMap getNewInstance(Map arg, List List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -267,6 +263,13 @@ public ApplicationxwwwformurlencodedSchemaMap validate(Map arg, SchemaConf public ApplicationxwwwformurlencodedSchema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ApplicationxwwwformurlencodedSchema1BoxedMap(validate(arg, configuration)); } + @Override + public ApplicationxwwwformurlencodedSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonformdata/get/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonformdata/get/responses/Code200Response.java new file mode 100644 index 00000000000..7973ff46632 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonformdata/get/responses/Code200Response.java @@ -0,0 +1,7 @@ +package org.openapijsonschematools.client.paths.fakejsonformdata.get.responses; + +import org.openapijsonschematools.client.components.responses.SuccessDescriptionOnly; + +public class Code200Response extends SuccessDescriptionOnly { + public static class Code200Response1 extends SuccessDescriptionOnly1 {} +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonpatch/patch/RequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonpatch/patch/RequestBody.java index 9eab3a6e49a..468041f351a 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonpatch/patch/RequestBody.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonpatch/patch/RequestBody.java @@ -6,22 +6,27 @@ import org.openapijsonschematools.client.requestbody.RequestBodySerializer; import org.openapijsonschematools.client.requestbody.GenericRequestBody; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; import org.openapijsonschematools.client.mediatype.MediaType; import org.openapijsonschematools.client.paths.fakejsonpatch.patch.requestbody.content.applicationjsonpatchjson.ApplicationjsonpatchjsonSchema; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; import java.util.AbstractMap; import java.util.Map; public class RequestBody { + public sealed interface SealedMediaType permits ApplicationjsonpatchjsonMediaType {} - public static class ApplicationjsonpatchjsonMediaType extends MediaType { + public record ApplicationjsonpatchjsonMediaType(ApplicationjsonpatchjsonSchema.ApplicationjsonpatchjsonSchema1 schema) implements SealedMediaType, MediaType { public ApplicationjsonpatchjsonMediaType() { - super(ApplicationjsonpatchjsonSchema.ApplicationjsonpatchjsonSchema1.getInstance()); + this(ApplicationjsonpatchjsonSchema.ApplicationjsonpatchjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; } } - public static class RequestBody1 extends RequestBodySerializer { + public static class RequestBody1 extends RequestBodySerializer { public RequestBody1() { super( Map.ofEntries( @@ -33,26 +38,15 @@ public RequestBody1() { public SerializedRequestBody serialize(SealedRequestBody requestBody) { ApplicationjsonpatchjsonRequestBody requestBody0 = (ApplicationjsonpatchjsonRequestBody) requestBody; - return serialize(requestBody0.contentType(), requestBody0.body().data()); + return serialize(requestBody0.contentType(), requestBody0.body().getData()); } } - public static abstract sealed class SealedRequestBody permits ApplicationjsonpatchjsonRequestBody {} - public static final class ApplicationjsonpatchjsonRequestBody extends SealedRequestBody implements GenericRequestBody { - private final String contentType; - private final ApplicationjsonpatchjsonSchema.JSONPatchRequest1Boxed body; - public ApplicationjsonpatchjsonRequestBody(ApplicationjsonpatchjsonSchema.JSONPatchRequest1Boxed body) { - contentType = "application/json-patch+json"; - this.body = body; - } + public sealed interface SealedRequestBody permits ApplicationjsonpatchjsonRequestBody {} + public record ApplicationjsonpatchjsonRequestBody(ApplicationjsonpatchjsonSchema.JSONPatchRequest1Boxed body) implements SealedRequestBody, GenericRequestBody { @Override public String contentType() { - return contentType; - } - - @Override - public ApplicationjsonpatchjsonSchema.JSONPatchRequest1Boxed body() { - return body; + return "application/json-patch+json"; } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonpatch/patch/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonpatch/patch/responses/Code200Response.java new file mode 100644 index 00000000000..261e52cbb39 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonpatch/patch/responses/Code200Response.java @@ -0,0 +1,7 @@ +package org.openapijsonschematools.client.paths.fakejsonpatch.patch.responses; + +import org.openapijsonschematools.client.components.responses.SuccessDescriptionOnly; + +public class Code200Response extends SuccessDescriptionOnly { + public static class Code200Response1 extends SuccessDescriptionOnly1 {} +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonwithcharset/post/RequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonwithcharset/post/RequestBody.java index f7387ab7d08..5ae2a3289b0 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonwithcharset/post/RequestBody.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonwithcharset/post/RequestBody.java @@ -6,22 +6,27 @@ import org.openapijsonschematools.client.requestbody.RequestBodySerializer; import org.openapijsonschematools.client.requestbody.GenericRequestBody; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; import org.openapijsonschematools.client.mediatype.MediaType; import org.openapijsonschematools.client.paths.fakejsonwithcharset.post.requestbody.content.applicationjsoncharsetutf8.Applicationjsoncharsetutf8Schema; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; import java.util.AbstractMap; import java.util.Map; public class RequestBody { + public sealed interface SealedMediaType permits Applicationjsoncharsetutf8MediaType {} - public static class Applicationjsoncharsetutf8MediaType extends MediaType { + public record Applicationjsoncharsetutf8MediaType(Applicationjsoncharsetutf8Schema.Applicationjsoncharsetutf8Schema1 schema) implements SealedMediaType, MediaType { public Applicationjsoncharsetutf8MediaType() { - super(Applicationjsoncharsetutf8Schema.Applicationjsoncharsetutf8Schema1.getInstance()); + this(Applicationjsoncharsetutf8Schema.Applicationjsoncharsetutf8Schema1.getInstance()); + } + @Override + public Void encoding() { + return null; } } - public static class RequestBody1 extends RequestBodySerializer { + public static class RequestBody1 extends RequestBodySerializer { public RequestBody1() { super( Map.ofEntries( @@ -33,26 +38,15 @@ public RequestBody1() { public SerializedRequestBody serialize(SealedRequestBody requestBody) { Applicationjsoncharsetutf8RequestBody requestBody0 = (Applicationjsoncharsetutf8RequestBody) requestBody; - return serialize(requestBody0.contentType(), requestBody0.body().data()); + return serialize(requestBody0.contentType(), requestBody0.body().getData()); } } - public static abstract sealed class SealedRequestBody permits Applicationjsoncharsetutf8RequestBody {} - public static final class Applicationjsoncharsetutf8RequestBody extends SealedRequestBody implements GenericRequestBody { - private final String contentType; - private final Applicationjsoncharsetutf8Schema.AnyTypeJsonSchema1Boxed body; - public Applicationjsoncharsetutf8RequestBody(Applicationjsoncharsetutf8Schema.AnyTypeJsonSchema1Boxed body) { - contentType = "application/json; charset=utf-8"; - this.body = body; - } + public sealed interface SealedRequestBody permits Applicationjsoncharsetutf8RequestBody {} + public record Applicationjsoncharsetutf8RequestBody(Applicationjsoncharsetutf8Schema.AnyTypeJsonSchema1Boxed body) implements SealedRequestBody, GenericRequestBody { @Override public String contentType() { - return contentType; - } - - @Override - public Applicationjsoncharsetutf8Schema.AnyTypeJsonSchema1Boxed body() { - return body; + return "application/json; charset=utf-8"; } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonwithcharset/post/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonwithcharset/post/responses/Code200Response.java new file mode 100644 index 00000000000..37dcb4fe272 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonwithcharset/post/responses/Code200Response.java @@ -0,0 +1,54 @@ +package org.openapijsonschematools.client.paths.fakejsonwithcharset.post.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakejsonwithcharset.post.responses.code200response.content.applicationjsoncharsetutf8.Applicationjsoncharsetutf8Schema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpHeaders; + +public class Code200Response { + public sealed interface SealedMediaType permits Applicationjsoncharsetutf8MediaType {} + + public record Applicationjsoncharsetutf8MediaType(Applicationjsoncharsetutf8Schema.Applicationjsoncharsetutf8Schema1 schema) implements SealedMediaType, MediaType { + public Applicationjsoncharsetutf8MediaType() { + this(Applicationjsoncharsetutf8Schema.Applicationjsoncharsetutf8Schema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits Applicationjsoncharsetutf8ResponseBody {} + public record Applicationjsoncharsetutf8ResponseBody(Applicationjsoncharsetutf8Schema.AnyTypeJsonSchema1Boxed body) implements SealedResponseBody { } + + public static class Code200Response1 extends ResponseDeserializer { + public Code200Response1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json; charset=utf-8", new Applicationjsoncharsetutf8MediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + SealedMediaType mediaType = content.get(contentType); + if (mediaType == null) { + throw new RuntimeException("Invalid contentType was received back from the server that does not exist in the openapi document"); + } + if (mediaType instanceof Applicationjsoncharsetutf8MediaType thisMediaType) { + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new Applicationjsoncharsetutf8ResponseBody(deserializedBody); + } + throw new RuntimeException("contentType="+contentType+" returned by the server is unknown and does not exist in the openapi document"); + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonwithcharset/post/responses/response200/content/applicationjsoncharsetutf8/Applicationjsoncharsetutf8Schema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonwithcharset/post/responses/code200response/content/applicationjsoncharsetutf8/Applicationjsoncharsetutf8Schema.java similarity index 91% rename from samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonwithcharset/post/responses/response200/content/applicationjsoncharsetutf8/Applicationjsoncharsetutf8Schema.java rename to samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonwithcharset/post/responses/code200response/content/applicationjsoncharsetutf8/Applicationjsoncharsetutf8Schema.java index ad286ed4678..8e4d5dbf902 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonwithcharset/post/responses/response200/content/applicationjsoncharsetutf8/Applicationjsoncharsetutf8Schema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonwithcharset/post/responses/code200response/content/applicationjsoncharsetutf8/Applicationjsoncharsetutf8Schema.java @@ -1,4 +1,4 @@ -package org.openapijsonschematools.client.paths.fakejsonwithcharset.post.responses.response200.content.applicationjsoncharsetutf8; +package org.openapijsonschematools.client.paths.fakejsonwithcharset.post.responses.code200response.content.applicationjsoncharsetutf8; import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultiplerequestbodycontenttypes/post/RequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultiplerequestbodycontenttypes/post/RequestBody.java index 2ede7b216b9..bfc18b8c3f8 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultiplerequestbodycontenttypes/post/RequestBody.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultiplerequestbodycontenttypes/post/RequestBody.java @@ -6,29 +6,38 @@ import org.openapijsonschematools.client.requestbody.RequestBodySerializer; import org.openapijsonschematools.client.requestbody.GenericRequestBody; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; import org.openapijsonschematools.client.mediatype.MediaType; import org.openapijsonschematools.client.paths.fakemultiplerequestbodycontenttypes.post.requestbody.content.applicationjson.ApplicationjsonSchema; import org.openapijsonschematools.client.paths.fakemultiplerequestbodycontenttypes.post.requestbody.content.multipartformdata.MultipartformdataSchema; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; import java.util.AbstractMap; import java.util.Map; public class RequestBody { + public sealed interface SealedMediaType permits ApplicationjsonMediaType, MultipartformdataMediaType {} - public static class ApplicationjsonMediaType extends MediaType { + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { public ApplicationjsonMediaType() { - super(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; } } - public static class MultipartformdataMediaType extends MediaType { + public record MultipartformdataMediaType(MultipartformdataSchema.MultipartformdataSchema1 schema) implements SealedMediaType, MediaType { public MultipartformdataMediaType() { - super(MultipartformdataSchema.MultipartformdataSchema1.getInstance()); + this(MultipartformdataSchema.MultipartformdataSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; } } - public static class RequestBody1 extends RequestBodySerializer { + public static class RequestBody1 extends RequestBodySerializer { public RequestBody1() { super( Map.ofEntries( @@ -41,47 +50,25 @@ public RequestBody1() { public SerializedRequestBody serialize(SealedRequestBody requestBody) { if (requestBody instanceof ApplicationjsonRequestBody requestBody0) { - return serialize(requestBody0.contentType(), requestBody0.body().data()); + return serialize(requestBody0.contentType(), requestBody0.body().getData()); } else { MultipartformdataRequestBody requestBody1 = (MultipartformdataRequestBody) requestBody; - return serialize(requestBody1.contentType(), requestBody1.body().data()); + return serialize(requestBody1.contentType(), requestBody1.body().getData()); } } } - public static abstract sealed class SealedRequestBody permits ApplicationjsonRequestBody, MultipartformdataRequestBody {} - public static final class ApplicationjsonRequestBody extends SealedRequestBody implements GenericRequestBody { - private final String contentType; - private final ApplicationjsonSchema.ApplicationjsonSchema1Boxed body; - public ApplicationjsonRequestBody(ApplicationjsonSchema.ApplicationjsonSchema1Boxed body) { - contentType = "application/json"; - this.body = body; - } + public sealed interface SealedRequestBody permits ApplicationjsonRequestBody, MultipartformdataRequestBody {} + public record ApplicationjsonRequestBody(ApplicationjsonSchema.ApplicationjsonSchema1Boxed body) implements SealedRequestBody, GenericRequestBody { @Override public String contentType() { - return contentType; - } - - @Override - public ApplicationjsonSchema.ApplicationjsonSchema1Boxed body() { - return body; + return "application/json"; } } - public static final class MultipartformdataRequestBody extends SealedRequestBody implements GenericRequestBody { - private final String contentType; - private final MultipartformdataSchema.MultipartformdataSchema1Boxed body; - public MultipartformdataRequestBody(MultipartformdataSchema.MultipartformdataSchema1Boxed body) { - contentType = "multipart/form-data"; - this.body = body; - } + public record MultipartformdataRequestBody(MultipartformdataSchema.MultipartformdataSchema1Boxed body) implements SealedRequestBody, GenericRequestBody { @Override public String contentType() { - return contentType; - } - - @Override - public MultipartformdataSchema.MultipartformdataSchema1Boxed body() { - return body; + return "multipart/form-data"; } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultiplerequestbodycontenttypes/post/requestbody/content/applicationjson/ApplicationjsonSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultiplerequestbodycontenttypes/post/requestbody/content/applicationjson/ApplicationjsonSchema.java index 34f2212b49c..7abe38bfe8a 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultiplerequestbodycontenttypes/post/requestbody/content/applicationjson/ApplicationjsonSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultiplerequestbodycontenttypes/post/requestbody/content/applicationjson/ApplicationjsonSchema.java @@ -106,23 +106,19 @@ public ApplicationjsonSchemaMapBuilder getBuilderAfterAdditionalProperty(Map { + public static class ApplicationjsonSchema1 extends JsonSchema implements MapSchemaValidator { private static @Nullable ApplicationjsonSchema1 instance = null; protected ApplicationjsonSchema1() { @@ -152,11 +148,11 @@ public ApplicationjsonSchemaMap getNewInstance(Map arg, List pathT List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -193,6 +189,13 @@ public ApplicationjsonSchemaMap validate(Map arg, SchemaConfiguration conf public ApplicationjsonSchema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ApplicationjsonSchema1BoxedMap(validate(arg, configuration)); } + @Override + public ApplicationjsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultiplerequestbodycontenttypes/post/requestbody/content/multipartformdata/MultipartformdataSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultiplerequestbodycontenttypes/post/requestbody/content/multipartformdata/MultipartformdataSchema.java index 4552b3c2c2e..79627668a08 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultiplerequestbodycontenttypes/post/requestbody/content/multipartformdata/MultipartformdataSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultiplerequestbodycontenttypes/post/requestbody/content/multipartformdata/MultipartformdataSchema.java @@ -106,23 +106,19 @@ public MultipartformdataSchemaMapBuilder getBuilderAfterAdditionalProperty(Map { + public static class MultipartformdataSchema1 extends JsonSchema implements MapSchemaValidator { private static @Nullable MultipartformdataSchema1 instance = null; protected MultipartformdataSchema1() { @@ -152,11 +148,11 @@ public MultipartformdataSchemaMap getNewInstance(Map arg, List pat List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -193,6 +189,13 @@ public MultipartformdataSchemaMap validate(Map arg, SchemaConfiguration co public MultipartformdataSchema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new MultipartformdataSchema1BoxedMap(validate(arg, configuration)); } + @Override + public MultipartformdataSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultiplerequestbodycontenttypes/post/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultiplerequestbodycontenttypes/post/responses/Code200Response.java new file mode 100644 index 00000000000..c5dce785061 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultiplerequestbodycontenttypes/post/responses/Code200Response.java @@ -0,0 +1,54 @@ +package org.openapijsonschematools.client.paths.fakemultiplerequestbodycontenttypes.post.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakemultiplerequestbodycontenttypes.post.responses.code200response.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpHeaders; + +public class Code200Response { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} + public record ApplicationjsonResponseBody(ApplicationjsonSchema.AnyTypeJsonSchema1Boxed body) implements SealedResponseBody { } + + public static class Code200Response1 extends ResponseDeserializer { + public Code200Response1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + SealedMediaType mediaType = content.get(contentType); + if (mediaType == null) { + throw new RuntimeException("Invalid contentType was received back from the server that does not exist in the openapi document"); + } + if (mediaType instanceof ApplicationjsonMediaType thisMediaType) { + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } + throw new RuntimeException("contentType="+contentType+" returned by the server is unknown and does not exist in the openapi document"); + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultiplerequestbodycontenttypes/post/responses/response200/content/applicationjson/ApplicationjsonSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultiplerequestbodycontenttypes/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java similarity index 90% rename from samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultiplerequestbodycontenttypes/post/responses/response200/content/applicationjson/ApplicationjsonSchema.java rename to samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultiplerequestbodycontenttypes/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java index 61ea6619cf0..68f600e23d6 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultiplerequestbodycontenttypes/post/responses/response200/content/applicationjson/ApplicationjsonSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultiplerequestbodycontenttypes/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java @@ -1,4 +1,4 @@ -package org.openapijsonschematools.client.paths.fakemultiplerequestbodycontenttypes.post.responses.response200.content.applicationjson; +package org.openapijsonschematools.client.paths.fakemultiplerequestbodycontenttypes.post.responses.code200response.content.applicationjson; import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultipleresponsebodies/get/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultipleresponsebodies/get/responses/Code200Response.java new file mode 100644 index 00000000000..ef8dc875a8e --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultipleresponsebodies/get/responses/Code200Response.java @@ -0,0 +1,54 @@ +package org.openapijsonschematools.client.paths.fakemultipleresponsebodies.get.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakemultipleresponsebodies.get.responses.code200response.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpHeaders; + +public class Code200Response { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} + public record ApplicationjsonResponseBody(ApplicationjsonSchema.AnyTypeJsonSchema1Boxed body) implements SealedResponseBody { } + + public static class Code200Response1 extends ResponseDeserializer { + public Code200Response1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + SealedMediaType mediaType = content.get(contentType); + if (mediaType == null) { + throw new RuntimeException("Invalid contentType was received back from the server that does not exist in the openapi document"); + } + if (mediaType instanceof ApplicationjsonMediaType thisMediaType) { + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } + throw new RuntimeException("contentType="+contentType+" returned by the server is unknown and does not exist in the openapi document"); + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultipleresponsebodies/get/responses/Code202Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultipleresponsebodies/get/responses/Code202Response.java new file mode 100644 index 00000000000..baafae85a7b --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultipleresponsebodies/get/responses/Code202Response.java @@ -0,0 +1,54 @@ +package org.openapijsonschematools.client.paths.fakemultipleresponsebodies.get.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakemultipleresponsebodies.get.responses.code202response.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpHeaders; + +public class Code202Response { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} + public record ApplicationjsonResponseBody(ApplicationjsonSchema.AnyTypeJsonSchema1Boxed body) implements SealedResponseBody { } + + public static class Code202Response1 extends ResponseDeserializer { + public Code202Response1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + SealedMediaType mediaType = content.get(contentType); + if (mediaType == null) { + throw new RuntimeException("Invalid contentType was received back from the server that does not exist in the openapi document"); + } + if (mediaType instanceof ApplicationjsonMediaType thisMediaType) { + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } + throw new RuntimeException("contentType="+contentType+" returned by the server is unknown and does not exist in the openapi document"); + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultipleresponsebodies/get/responses/response200/content/applicationjson/ApplicationjsonSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultipleresponsebodies/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.java similarity index 91% rename from samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultipleresponsebodies/get/responses/response200/content/applicationjson/ApplicationjsonSchema.java rename to samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultipleresponsebodies/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.java index 7525189004e..0a2a9520c57 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultipleresponsebodies/get/responses/response200/content/applicationjson/ApplicationjsonSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultipleresponsebodies/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.java @@ -1,4 +1,4 @@ -package org.openapijsonschematools.client.paths.fakemultipleresponsebodies.get.responses.response200.content.applicationjson; +package org.openapijsonschematools.client.paths.fakemultipleresponsebodies.get.responses.code200response.content.applicationjson; import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultipleresponsebodies/get/responses/response202/content/applicationjson/ApplicationjsonSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultipleresponsebodies/get/responses/code202response/content/applicationjson/ApplicationjsonSchema.java similarity index 91% rename from samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultipleresponsebodies/get/responses/response202/content/applicationjson/ApplicationjsonSchema.java rename to samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultipleresponsebodies/get/responses/code202response/content/applicationjson/ApplicationjsonSchema.java index 15a07422ebe..53ce26bfe16 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultipleresponsebodies/get/responses/response202/content/applicationjson/ApplicationjsonSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultipleresponsebodies/get/responses/code202response/content/applicationjson/ApplicationjsonSchema.java @@ -1,4 +1,4 @@ -package org.openapijsonschematools.client.paths.fakemultipleresponsebodies.get.responses.response202.content.applicationjson; +package org.openapijsonschematools.client.paths.fakemultipleresponsebodies.get.responses.code202response.content.applicationjson; import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultiplesecurities/get/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultiplesecurities/get/responses/Code200Response.java new file mode 100644 index 00000000000..cb30e9398b4 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultiplesecurities/get/responses/Code200Response.java @@ -0,0 +1,54 @@ +package org.openapijsonschematools.client.paths.fakemultiplesecurities.get.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakemultiplesecurities.get.responses.code200response.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpHeaders; + +public class Code200Response { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} + public record ApplicationjsonResponseBody(ApplicationjsonSchema.AnyTypeJsonSchema1Boxed body) implements SealedResponseBody { } + + public static class Code200Response1 extends ResponseDeserializer { + public Code200Response1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + SealedMediaType mediaType = content.get(contentType); + if (mediaType == null) { + throw new RuntimeException("Invalid contentType was received back from the server that does not exist in the openapi document"); + } + if (mediaType instanceof ApplicationjsonMediaType thisMediaType) { + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } + throw new RuntimeException("contentType="+contentType+" returned by the server is unknown and does not exist in the openapi document"); + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultiplesecurities/get/responses/response200/content/applicationjson/ApplicationjsonSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultiplesecurities/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.java similarity index 92% rename from samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultiplesecurities/get/responses/response200/content/applicationjson/ApplicationjsonSchema.java rename to samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultiplesecurities/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.java index 19f1aaf5196..19cca1a1b80 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultiplesecurities/get/responses/response200/content/applicationjson/ApplicationjsonSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultiplesecurities/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.java @@ -1,4 +1,4 @@ -package org.openapijsonschematools.client.paths.fakemultiplesecurities.get.responses.response200.content.applicationjson; +package org.openapijsonschematools.client.paths.fakemultiplesecurities.get.responses.code200response.content.applicationjson; import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeobjinquery/get/QueryParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeobjinquery/get/QueryParameters.java index 5a675be82a4..b5adb891967 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeobjinquery/get/QueryParameters.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeobjinquery/get/QueryParameters.java @@ -93,23 +93,19 @@ public QueryParametersMapBuilder getBuilderAfterMapBean(Map { + public static class QueryParameters1 extends JsonSchema implements MapSchemaValidator { private static @Nullable QueryParameters1 instance = null; protected QueryParameters1() { @@ -140,11 +136,11 @@ public QueryParametersMap getNewInstance(Map arg, List pathToItem, List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Schema0.SchemaMap0)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -184,6 +180,13 @@ public QueryParametersMap validate(Map arg, SchemaConfiguration configurat public QueryParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new QueryParameters1BoxedMap(validate(arg, configuration)); } + @Override + public QueryParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeobjinquery/get/parameters/parameter0/Schema0.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeobjinquery/get/parameters/parameter0/Schema0.java index 88da1b3e6a3..de7150e15d9 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeobjinquery/get/parameters/parameter0/Schema0.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeobjinquery/get/parameters/parameter0/Schema0.java @@ -106,23 +106,19 @@ public SchemaMapBuilder0 getBuilderAfterAdditionalProperty(Map { + public static class Schema01 extends JsonSchema implements MapSchemaValidator { private static @Nullable Schema01 instance = null; protected Schema01() { @@ -152,11 +148,11 @@ public SchemaMap0 getNewInstance(Map arg, List pathToItem, PathToS List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -193,6 +189,13 @@ public SchemaMap0 validate(Map arg, SchemaConfiguration configuration) thr public Schema01BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema01BoxedMap(validate(arg, configuration)); } + @Override + public Schema01Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeobjinquery/get/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeobjinquery/get/responses/Code200Response.java new file mode 100644 index 00000000000..3e317ea4671 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeobjinquery/get/responses/Code200Response.java @@ -0,0 +1,7 @@ +package org.openapijsonschematools.client.paths.fakeobjinquery.get.responses; + +import org.openapijsonschematools.client.components.responses.SuccessDescriptionOnly; + +public class Code200Response extends SuccessDescriptionOnly { + public static class Code200Response1 extends SuccessDescriptionOnly1 {} +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/CookieParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/CookieParameters.java index 748baef8502..74ba316da21 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/CookieParameters.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/CookieParameters.java @@ -187,23 +187,19 @@ public CookieParametersMapBuilder getBuilderAfterSelf(Map { + public static class CookieParameters1 extends JsonSchema implements MapSchemaValidator { private static @Nullable CookieParameters1 instance = null; protected CookieParameters1() { @@ -238,11 +234,11 @@ public CookieParametersMap getNewInstance(Map arg, List pathToItem List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -279,6 +275,13 @@ public CookieParametersMap validate(Map arg, SchemaConfiguration configura public CookieParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new CookieParameters1BoxedMap(validate(arg, configuration)); } + @Override + public CookieParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/HeaderParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/HeaderParameters.java index 1a43f87b75e..2c7135c6a8c 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/HeaderParameters.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/HeaderParameters.java @@ -160,23 +160,19 @@ public HeaderParametersMapBuilder getBuilderAfterSelf(Map { + public static class HeaderParameters1 extends JsonSchema implements MapSchemaValidator { private static @Nullable HeaderParameters1 instance = null; protected HeaderParameters1() { @@ -210,11 +206,11 @@ public HeaderParametersMap getNewInstance(Map arg, List pathToItem List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -251,6 +247,13 @@ public HeaderParametersMap validate(Map arg, SchemaConfiguration configura public HeaderParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new HeaderParameters1BoxedMap(validate(arg, configuration)); } + @Override + public HeaderParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/PathParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/PathParameters.java index e70b541d26c..026de5c455b 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/PathParameters.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/PathParameters.java @@ -713,23 +713,19 @@ public PathParametersMap11110Builder getBuilderAfterSelf(Map { + public static class PathParameters1 extends JsonSchema implements MapSchemaValidator { private static @Nullable PathParameters1 instance = null; protected PathParameters1() { @@ -771,11 +767,11 @@ public PathParametersMap getNewInstance(Map arg, List pathToItem, List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -812,6 +808,13 @@ public PathParametersMap validate(Map arg, SchemaConfiguration configurati public PathParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new PathParameters1BoxedMap(validate(arg, configuration)); } + @Override + public PathParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/QueryParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/QueryParameters.java index bacdf16966e..7464d4071f8 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/QueryParameters.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/QueryParameters.java @@ -187,23 +187,19 @@ public QueryParametersMapBuilder getBuilderAfterSelf(Map { + public static class QueryParameters1 extends JsonSchema implements MapSchemaValidator { private static @Nullable QueryParameters1 instance = null; protected QueryParameters1() { @@ -238,11 +234,11 @@ public QueryParametersMap getNewInstance(Map arg, List pathToItem, List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -279,6 +275,13 @@ public QueryParametersMap validate(Map arg, SchemaConfiguration configurat public QueryParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new QueryParameters1BoxedMap(validate(arg, configuration)); } + @Override + public QueryParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/RequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/RequestBody.java index d62a4203636..61c0cb2c691 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/RequestBody.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/RequestBody.java @@ -6,22 +6,27 @@ import org.openapijsonschematools.client.requestbody.RequestBodySerializer; import org.openapijsonschematools.client.requestbody.GenericRequestBody; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; import org.openapijsonschematools.client.mediatype.MediaType; import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.requestbody.content.applicationjson.ApplicationjsonSchema; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; import java.util.AbstractMap; import java.util.Map; public class RequestBody { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} - public static class ApplicationjsonMediaType extends MediaType { + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { public ApplicationjsonMediaType() { - super(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; } } - public static class RequestBody1 extends RequestBodySerializer { + public static class RequestBody1 extends RequestBodySerializer { public RequestBody1() { super( Map.ofEntries( @@ -33,26 +38,15 @@ public RequestBody1() { public SerializedRequestBody serialize(SealedRequestBody requestBody) { ApplicationjsonRequestBody requestBody0 = (ApplicationjsonRequestBody) requestBody; - return serialize(requestBody0.contentType(), requestBody0.body().data()); + return serialize(requestBody0.contentType(), requestBody0.body().getData()); } } - public static abstract sealed class SealedRequestBody permits ApplicationjsonRequestBody {} - public static final class ApplicationjsonRequestBody extends SealedRequestBody implements GenericRequestBody { - private final String contentType; - private final ApplicationjsonSchema.AnyTypeJsonSchema1Boxed body; - public ApplicationjsonRequestBody(ApplicationjsonSchema.AnyTypeJsonSchema1Boxed body) { - contentType = "application/json"; - this.body = body; - } + public sealed interface SealedRequestBody permits ApplicationjsonRequestBody {} + public record ApplicationjsonRequestBody(ApplicationjsonSchema.AnyTypeJsonSchema1Boxed body) implements SealedRequestBody, GenericRequestBody { @Override public String contentType() { - return contentType; - } - - @Override - public ApplicationjsonSchema.AnyTypeJsonSchema1Boxed body() { - return body; + return "application/json"; } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/responses/Code200Response.java new file mode 100644 index 00000000000..d4528d09986 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/responses/Code200Response.java @@ -0,0 +1,54 @@ +package org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.responses.code200response.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpHeaders; + +public class Code200Response { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} + public record ApplicationjsonResponseBody(ApplicationjsonSchema.AnyTypeJsonSchema1Boxed body) implements SealedResponseBody { } + + public static class Code200Response1 extends ResponseDeserializer { + public Code200Response1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + SealedMediaType mediaType = content.get(contentType); + if (mediaType == null) { + throw new RuntimeException("Invalid contentType was received back from the server that does not exist in the openapi document"); + } + if (mediaType instanceof ApplicationjsonMediaType thisMediaType) { + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } + throw new RuntimeException("contentType="+contentType+" returned by the server is unknown and does not exist in the openapi document"); + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/responses/response200/content/applicationjson/ApplicationjsonSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java similarity index 90% rename from samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/responses/response200/content/applicationjson/ApplicationjsonSchema.java rename to samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java index afe56ce05c6..bb2a30a2a2e 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/responses/response200/content/applicationjson/ApplicationjsonSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java @@ -1,4 +1,4 @@ -package org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.responses.response200.content.applicationjson; +package org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.responses.code200response.content.applicationjson; import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepemcontenttype/get/RequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepemcontenttype/get/RequestBody.java index c200fa37577..ff68a6c95d5 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepemcontenttype/get/RequestBody.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepemcontenttype/get/RequestBody.java @@ -6,22 +6,27 @@ import org.openapijsonschematools.client.requestbody.RequestBodySerializer; import org.openapijsonschematools.client.requestbody.GenericRequestBody; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; import org.openapijsonschematools.client.mediatype.MediaType; import org.openapijsonschematools.client.paths.fakepemcontenttype.get.requestbody.content.applicationxpemfile.ApplicationxpemfileSchema; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; import java.util.AbstractMap; import java.util.Map; public class RequestBody { + public sealed interface SealedMediaType permits ApplicationxpemfileMediaType {} - public static class ApplicationxpemfileMediaType extends MediaType { + public record ApplicationxpemfileMediaType(ApplicationxpemfileSchema.ApplicationxpemfileSchema1 schema) implements SealedMediaType, MediaType { public ApplicationxpemfileMediaType() { - super(ApplicationxpemfileSchema.ApplicationxpemfileSchema1.getInstance()); + this(ApplicationxpemfileSchema.ApplicationxpemfileSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; } } - public static class RequestBody1 extends RequestBodySerializer { + public static class RequestBody1 extends RequestBodySerializer { public RequestBody1() { super( Map.ofEntries( @@ -33,26 +38,15 @@ public RequestBody1() { public SerializedRequestBody serialize(SealedRequestBody requestBody) { ApplicationxpemfileRequestBody requestBody0 = (ApplicationxpemfileRequestBody) requestBody; - return serialize(requestBody0.contentType(), requestBody0.body().data()); + return serialize(requestBody0.contentType(), requestBody0.body().getData()); } } - public static abstract sealed class SealedRequestBody permits ApplicationxpemfileRequestBody {} - public static final class ApplicationxpemfileRequestBody extends SealedRequestBody implements GenericRequestBody { - private final String contentType; - private final ApplicationxpemfileSchema.StringJsonSchema1Boxed body; - public ApplicationxpemfileRequestBody(ApplicationxpemfileSchema.StringJsonSchema1Boxed body) { - contentType = "application/x-pem-file"; - this.body = body; - } + public sealed interface SealedRequestBody permits ApplicationxpemfileRequestBody {} + public record ApplicationxpemfileRequestBody(ApplicationxpemfileSchema.StringJsonSchema1Boxed body) implements SealedRequestBody, GenericRequestBody { @Override public String contentType() { - return contentType; - } - - @Override - public ApplicationxpemfileSchema.StringJsonSchema1Boxed body() { - return body; + return "application/x-pem-file"; } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepemcontenttype/get/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepemcontenttype/get/responses/Code200Response.java new file mode 100644 index 00000000000..e63e3c08bfe --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepemcontenttype/get/responses/Code200Response.java @@ -0,0 +1,54 @@ +package org.openapijsonschematools.client.paths.fakepemcontenttype.get.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakepemcontenttype.get.responses.code200response.content.applicationxpemfile.ApplicationxpemfileSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpHeaders; + +public class Code200Response { + public sealed interface SealedMediaType permits ApplicationxpemfileMediaType {} + + public record ApplicationxpemfileMediaType(ApplicationxpemfileSchema.ApplicationxpemfileSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationxpemfileMediaType() { + this(ApplicationxpemfileSchema.ApplicationxpemfileSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationxpemfileResponseBody {} + public record ApplicationxpemfileResponseBody(ApplicationxpemfileSchema.StringJsonSchema1Boxed body) implements SealedResponseBody { } + + public static class Code200Response1 extends ResponseDeserializer { + public Code200Response1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/x-pem-file", new ApplicationxpemfileMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + SealedMediaType mediaType = content.get(contentType); + if (mediaType == null) { + throw new RuntimeException("Invalid contentType was received back from the server that does not exist in the openapi document"); + } + if (mediaType instanceof ApplicationxpemfileMediaType thisMediaType) { + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationxpemfileResponseBody(deserializedBody); + } + throw new RuntimeException("contentType="+contentType+" returned by the server is unknown and does not exist in the openapi document"); + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepemcontenttype/get/responses/response200/content/applicationxpemfile/ApplicationxpemfileSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepemcontenttype/get/responses/code200response/content/applicationxpemfile/ApplicationxpemfileSchema.java similarity index 92% rename from samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepemcontenttype/get/responses/response200/content/applicationxpemfile/ApplicationxpemfileSchema.java rename to samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepemcontenttype/get/responses/code200response/content/applicationxpemfile/ApplicationxpemfileSchema.java index 8063adce1e0..0d12b96b19a 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepemcontenttype/get/responses/response200/content/applicationxpemfile/ApplicationxpemfileSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepemcontenttype/get/responses/code200response/content/applicationxpemfile/ApplicationxpemfileSchema.java @@ -1,4 +1,4 @@ -package org.openapijsonschematools.client.paths.fakepemcontenttype.get.responses.response200.content.applicationxpemfile; +package org.openapijsonschematools.client.paths.fakepemcontenttype.get.responses.code200response.content.applicationxpemfile; import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.schemas.StringJsonSchema; diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/post/PathParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/post/PathParameters.java index 9a9062e76a8..136cee7d885 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/post/PathParameters.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/post/PathParameters.java @@ -118,23 +118,19 @@ public PathParametersMap0Builder getBuilderAfterPetId(Map instan } - public static abstract sealed class PathParameters1Boxed permits PathParameters1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface PathParameters1Boxed permits PathParameters1BoxedMap { + @Nullable Object getData(); } - public static final class PathParameters1BoxedMap extends PathParameters1Boxed { - public final PathParametersMap data; - private PathParameters1BoxedMap(PathParametersMap data) { - this.data = data; - } + public record PathParameters1BoxedMap(PathParametersMap data) implements PathParameters1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class PathParameters1 extends JsonSchema implements MapSchemaValidator { + public static class PathParameters1 extends JsonSchema implements MapSchemaValidator { private static @Nullable PathParameters1 instance = null; protected PathParameters1() { @@ -168,11 +164,11 @@ public PathParametersMap getNewInstance(Map arg, List pathToItem, List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Number)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -212,6 +208,13 @@ public PathParametersMap validate(Map arg, SchemaConfiguration configurati public PathParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new PathParameters1BoxedMap(validate(arg, configuration)); } + @Override + public PathParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/post/RequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/post/RequestBody.java index 7429fc34020..3fc03d40157 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/post/RequestBody.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/post/RequestBody.java @@ -6,22 +6,27 @@ import org.openapijsonschematools.client.requestbody.RequestBodySerializer; import org.openapijsonschematools.client.requestbody.GenericRequestBody; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; import org.openapijsonschematools.client.mediatype.MediaType; import org.openapijsonschematools.client.paths.fakepetiduploadimagewithrequiredfile.post.requestbody.content.multipartformdata.MultipartformdataSchema; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; import java.util.AbstractMap; import java.util.Map; public class RequestBody { + public sealed interface SealedMediaType permits MultipartformdataMediaType {} - public static class MultipartformdataMediaType extends MediaType { + public record MultipartformdataMediaType(MultipartformdataSchema.MultipartformdataSchema1 schema) implements SealedMediaType, MediaType { public MultipartformdataMediaType() { - super(MultipartformdataSchema.MultipartformdataSchema1.getInstance()); + this(MultipartformdataSchema.MultipartformdataSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; } } - public static class RequestBody1 extends RequestBodySerializer { + public static class RequestBody1 extends RequestBodySerializer { public RequestBody1() { super( Map.ofEntries( @@ -33,26 +38,15 @@ public RequestBody1() { public SerializedRequestBody serialize(SealedRequestBody requestBody) { MultipartformdataRequestBody requestBody0 = (MultipartformdataRequestBody) requestBody; - return serialize(requestBody0.contentType(), requestBody0.body().data()); + return serialize(requestBody0.contentType(), requestBody0.body().getData()); } } - public static abstract sealed class SealedRequestBody permits MultipartformdataRequestBody {} - public static final class MultipartformdataRequestBody extends SealedRequestBody implements GenericRequestBody { - private final String contentType; - private final MultipartformdataSchema.MultipartformdataSchema1Boxed body; - public MultipartformdataRequestBody(MultipartformdataSchema.MultipartformdataSchema1Boxed body) { - contentType = "multipart/form-data"; - this.body = body; - } + public sealed interface SealedRequestBody permits MultipartformdataRequestBody {} + public record MultipartformdataRequestBody(MultipartformdataSchema.MultipartformdataSchema1Boxed body) implements SealedRequestBody, GenericRequestBody { @Override public String contentType() { - return contentType; - } - - @Override - public MultipartformdataSchema.MultipartformdataSchema1Boxed body() { - return body; + return "multipart/form-data"; } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/post/requestbody/content/multipartformdata/MultipartformdataSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/post/requestbody/content/multipartformdata/MultipartformdataSchema.java index 1401af64f66..ff272e85252 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/post/requestbody/content/multipartformdata/MultipartformdataSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/post/requestbody/content/multipartformdata/MultipartformdataSchema.java @@ -153,23 +153,19 @@ public MultipartformdataSchemaMap0Builder getBuilderAfterMultipartformdataRequir } - public static abstract sealed class MultipartformdataSchema1Boxed permits MultipartformdataSchema1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface MultipartformdataSchema1Boxed permits MultipartformdataSchema1BoxedMap { + @Nullable Object getData(); } - public static final class MultipartformdataSchema1BoxedMap extends MultipartformdataSchema1Boxed { - public final MultipartformdataSchemaMap data; - private MultipartformdataSchema1BoxedMap(MultipartformdataSchemaMap data) { - this.data = data; - } + public record MultipartformdataSchema1BoxedMap(MultipartformdataSchemaMap data) implements MultipartformdataSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class MultipartformdataSchema1 extends JsonSchema implements MapSchemaValidator { + public static class MultipartformdataSchema1 extends JsonSchema implements MapSchemaValidator { private static @Nullable MultipartformdataSchema1 instance = null; protected MultipartformdataSchema1() { @@ -203,11 +199,11 @@ public MultipartformdataSchemaMap getNewInstance(Map arg, List pat List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -244,6 +240,13 @@ public MultipartformdataSchemaMap validate(Map arg, SchemaConfiguration co public MultipartformdataSchema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new MultipartformdataSchema1BoxedMap(validate(arg, configuration)); } + @Override + public MultipartformdataSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/post/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/post/responses/Code200Response.java new file mode 100644 index 00000000000..24e2ecf827b --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/post/responses/Code200Response.java @@ -0,0 +1,54 @@ +package org.openapijsonschematools.client.paths.fakepetiduploadimagewithrequiredfile.post.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakepetiduploadimagewithrequiredfile.post.responses.code200response.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpHeaders; + +public class Code200Response { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} + public record ApplicationjsonResponseBody(ApplicationjsonSchema.ApiResponseSchema1Boxed body) implements SealedResponseBody { } + + public static class Code200Response1 extends ResponseDeserializer { + public Code200Response1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + SealedMediaType mediaType = content.get(contentType); + if (mediaType == null) { + throw new RuntimeException("Invalid contentType was received back from the server that does not exist in the openapi document"); + } + if (mediaType instanceof ApplicationjsonMediaType thisMediaType) { + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } + throw new RuntimeException("contentType="+contentType+" returned by the server is unknown and does not exist in the openapi document"); + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/post/responses/response200/content/applicationjson/ApplicationjsonSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java similarity index 89% rename from samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/post/responses/response200/content/applicationjson/ApplicationjsonSchema.java rename to samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java index 88c88b000e0..42e57377e16 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/post/responses/response200/content/applicationjson/ApplicationjsonSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java @@ -1,4 +1,4 @@ -package org.openapijsonschematools.client.paths.fakepetiduploadimagewithrequiredfile.post.responses.response200.content.applicationjson; +package org.openapijsonschematools.client.paths.fakepetiduploadimagewithrequiredfile.post.responses.code200response.content.applicationjson; import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.components.schemas.ApiResponseSchema; diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakequeryparamwithjsoncontenttype/get/QueryParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakequeryparamwithjsoncontenttype/get/QueryParameters.java index b1184b9a807..8cd9c1628ed 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakequeryparamwithjsoncontenttype/get/QueryParameters.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakequeryparamwithjsoncontenttype/get/QueryParameters.java @@ -148,23 +148,19 @@ public QueryParametersMap0Builder getBuilderAfterSomeParam(Map { + public static class QueryParameters1 extends JsonSchema implements MapSchemaValidator { private static @Nullable QueryParameters1 instance = null; protected QueryParameters1() { @@ -198,11 +194,11 @@ public QueryParametersMap getNewInstance(Map arg, List pathToItem, List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Object)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -242,6 +238,13 @@ public QueryParametersMap validate(Map arg, SchemaConfiguration configurat public QueryParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new QueryParameters1BoxedMap(validate(arg, configuration)); } + @Override + public QueryParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakequeryparamwithjsoncontenttype/get/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakequeryparamwithjsoncontenttype/get/responses/Code200Response.java new file mode 100644 index 00000000000..3d6b23dbf11 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakequeryparamwithjsoncontenttype/get/responses/Code200Response.java @@ -0,0 +1,54 @@ +package org.openapijsonschematools.client.paths.fakequeryparamwithjsoncontenttype.get.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakequeryparamwithjsoncontenttype.get.responses.code200response.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpHeaders; + +public class Code200Response { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} + public record ApplicationjsonResponseBody(ApplicationjsonSchema.AnyTypeJsonSchema1Boxed body) implements SealedResponseBody { } + + public static class Code200Response1 extends ResponseDeserializer { + public Code200Response1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + SealedMediaType mediaType = content.get(contentType); + if (mediaType == null) { + throw new RuntimeException("Invalid contentType was received back from the server that does not exist in the openapi document"); + } + if (mediaType instanceof ApplicationjsonMediaType thisMediaType) { + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } + throw new RuntimeException("contentType="+contentType+" returned by the server is unknown and does not exist in the openapi document"); + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakequeryparamwithjsoncontenttype/get/responses/response200/content/applicationjson/ApplicationjsonSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakequeryparamwithjsoncontenttype/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.java similarity index 90% rename from samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakequeryparamwithjsoncontenttype/get/responses/response200/content/applicationjson/ApplicationjsonSchema.java rename to samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakequeryparamwithjsoncontenttype/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.java index a899c3992b0..b9b66780181 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakequeryparamwithjsoncontenttype/get/responses/response200/content/applicationjson/ApplicationjsonSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakequeryparamwithjsoncontenttype/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.java @@ -1,4 +1,4 @@ -package org.openapijsonschematools.client.paths.fakequeryparamwithjsoncontenttype.get.responses.response200.content.applicationjson; +package org.openapijsonschematools.client.paths.fakequeryparamwithjsoncontenttype.get.responses.code200response.content.applicationjson; import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeredirection/get/responses/Code303Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeredirection/get/responses/Code303Response.java new file mode 100644 index 00000000000..7c32fb69139 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeredirection/get/responses/Code303Response.java @@ -0,0 +1,30 @@ +package org.openapijsonschematools.client.paths.fakeredirection.get.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.schemas.validation.MapUtils; + +import java.util.Map; +import java.net.http.HttpHeaders; + +public class Code303Response { + + public static class Code303Response1 extends ResponseDeserializer { + public Code303Response1() { + super( + MapUtils.makeMap( + ) + ); + } + + @Override + protected Void getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + return null; + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeredirection/get/responses/Code3XXResponse.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeredirection/get/responses/Code3XXResponse.java new file mode 100644 index 00000000000..b6b5bfd0eaa --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeredirection/get/responses/Code3XXResponse.java @@ -0,0 +1,30 @@ +package org.openapijsonschematools.client.paths.fakeredirection.get.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.schemas.validation.MapUtils; + +import java.util.Map; +import java.net.http.HttpHeaders; + +public class Code3XXResponse { + + public static class Code3XXResponse1 extends ResponseDeserializer { + public Code3XXResponse1() { + super( + MapUtils.makeMap( + ) + ); + } + + @Override + protected Void getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + return null; + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefobjinquery/get/QueryParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefobjinquery/get/QueryParameters.java index ede01fdfa03..b8e5f47e5e7 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefobjinquery/get/QueryParameters.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefobjinquery/get/QueryParameters.java @@ -93,23 +93,19 @@ public QueryParametersMapBuilder getBuilderAfterMapBean(Map { + public static class QueryParameters1 extends JsonSchema implements MapSchemaValidator { private static @Nullable QueryParameters1 instance = null; protected QueryParameters1() { @@ -140,11 +136,11 @@ public QueryParametersMap getNewInstance(Map arg, List pathToItem, List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Foo.FooMap)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -184,6 +180,13 @@ public QueryParametersMap validate(Map arg, SchemaConfiguration configurat public QueryParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new QueryParameters1BoxedMap(validate(arg, configuration)); } + @Override + public QueryParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefobjinquery/get/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefobjinquery/get/responses/Code200Response.java new file mode 100644 index 00000000000..ef459550ec7 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefobjinquery/get/responses/Code200Response.java @@ -0,0 +1,7 @@ +package org.openapijsonschematools.client.paths.fakerefobjinquery.get.responses; + +import org.openapijsonschematools.client.components.responses.SuccessDescriptionOnly; + +public class Code200Response extends SuccessDescriptionOnly { + public static class Code200Response1 extends SuccessDescriptionOnly1 {} +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsarraymodel/post/RequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsarraymodel/post/RequestBody.java index 35035a80b12..331c85336ed 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsarraymodel/post/RequestBody.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsarraymodel/post/RequestBody.java @@ -6,22 +6,27 @@ import org.openapijsonschematools.client.requestbody.RequestBodySerializer; import org.openapijsonschematools.client.requestbody.GenericRequestBody; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; import org.openapijsonschematools.client.mediatype.MediaType; import org.openapijsonschematools.client.paths.fakerefsarraymodel.post.requestbody.content.applicationjson.ApplicationjsonSchema; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; import java.util.AbstractMap; import java.util.Map; public class RequestBody { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} - public static class ApplicationjsonMediaType extends MediaType { + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { public ApplicationjsonMediaType() { - super(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; } } - public static class RequestBody1 extends RequestBodySerializer { + public static class RequestBody1 extends RequestBodySerializer { public RequestBody1() { super( Map.ofEntries( @@ -33,26 +38,15 @@ public RequestBody1() { public SerializedRequestBody serialize(SealedRequestBody requestBody) { ApplicationjsonRequestBody requestBody0 = (ApplicationjsonRequestBody) requestBody; - return serialize(requestBody0.contentType(), requestBody0.body().data()); + return serialize(requestBody0.contentType(), requestBody0.body().getData()); } } - public static abstract sealed class SealedRequestBody permits ApplicationjsonRequestBody {} - public static final class ApplicationjsonRequestBody extends SealedRequestBody implements GenericRequestBody { - private final String contentType; - private final ApplicationjsonSchema.AnimalFarm1Boxed body; - public ApplicationjsonRequestBody(ApplicationjsonSchema.AnimalFarm1Boxed body) { - contentType = "application/json"; - this.body = body; - } + public sealed interface SealedRequestBody permits ApplicationjsonRequestBody {} + public record ApplicationjsonRequestBody(ApplicationjsonSchema.AnimalFarm1Boxed body) implements SealedRequestBody, GenericRequestBody { @Override public String contentType() { - return contentType; - } - - @Override - public ApplicationjsonSchema.AnimalFarm1Boxed body() { - return body; + return "application/json"; } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsarraymodel/post/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsarraymodel/post/responses/Code200Response.java new file mode 100644 index 00000000000..87967b8848d --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsarraymodel/post/responses/Code200Response.java @@ -0,0 +1,54 @@ +package org.openapijsonschematools.client.paths.fakerefsarraymodel.post.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakerefsarraymodel.post.responses.code200response.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpHeaders; + +public class Code200Response { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} + public record ApplicationjsonResponseBody(ApplicationjsonSchema.AnimalFarm1Boxed body) implements SealedResponseBody { } + + public static class Code200Response1 extends ResponseDeserializer { + public Code200Response1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + SealedMediaType mediaType = content.get(contentType); + if (mediaType == null) { + throw new RuntimeException("Invalid contentType was received back from the server that does not exist in the openapi document"); + } + if (mediaType instanceof ApplicationjsonMediaType thisMediaType) { + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } + throw new RuntimeException("contentType="+contentType+" returned by the server is unknown and does not exist in the openapi document"); + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsarraymodel/post/responses/response200/content/applicationjson/ApplicationjsonSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsarraymodel/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java similarity index 91% rename from samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsarraymodel/post/responses/response200/content/applicationjson/ApplicationjsonSchema.java rename to samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsarraymodel/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java index 6d432a25447..3183986a750 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsarraymodel/post/responses/response200/content/applicationjson/ApplicationjsonSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsarraymodel/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java @@ -1,4 +1,4 @@ -package org.openapijsonschematools.client.paths.fakerefsarraymodel.post.responses.response200.content.applicationjson; +package org.openapijsonschematools.client.paths.fakerefsarraymodel.post.responses.code200response.content.applicationjson; import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.components.schemas.AnimalFarm; diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsarrayofenums/post/RequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsarrayofenums/post/RequestBody.java index fcd14e1e62e..614bd30d021 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsarrayofenums/post/RequestBody.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsarrayofenums/post/RequestBody.java @@ -6,22 +6,27 @@ import org.openapijsonschematools.client.requestbody.RequestBodySerializer; import org.openapijsonschematools.client.requestbody.GenericRequestBody; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; import org.openapijsonschematools.client.mediatype.MediaType; import org.openapijsonschematools.client.paths.fakerefsarrayofenums.post.requestbody.content.applicationjson.ApplicationjsonSchema; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; import java.util.AbstractMap; import java.util.Map; public class RequestBody { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} - public static class ApplicationjsonMediaType extends MediaType { + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { public ApplicationjsonMediaType() { - super(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; } } - public static class RequestBody1 extends RequestBodySerializer { + public static class RequestBody1 extends RequestBodySerializer { public RequestBody1() { super( Map.ofEntries( @@ -33,26 +38,15 @@ public RequestBody1() { public SerializedRequestBody serialize(SealedRequestBody requestBody) { ApplicationjsonRequestBody requestBody0 = (ApplicationjsonRequestBody) requestBody; - return serialize(requestBody0.contentType(), requestBody0.body().data()); + return serialize(requestBody0.contentType(), requestBody0.body().getData()); } } - public static abstract sealed class SealedRequestBody permits ApplicationjsonRequestBody {} - public static final class ApplicationjsonRequestBody extends SealedRequestBody implements GenericRequestBody { - private final String contentType; - private final ApplicationjsonSchema.ArrayOfEnums1Boxed body; - public ApplicationjsonRequestBody(ApplicationjsonSchema.ArrayOfEnums1Boxed body) { - contentType = "application/json"; - this.body = body; - } + public sealed interface SealedRequestBody permits ApplicationjsonRequestBody {} + public record ApplicationjsonRequestBody(ApplicationjsonSchema.ArrayOfEnums1Boxed body) implements SealedRequestBody, GenericRequestBody { @Override public String contentType() { - return contentType; - } - - @Override - public ApplicationjsonSchema.ArrayOfEnums1Boxed body() { - return body; + return "application/json"; } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsarrayofenums/post/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsarrayofenums/post/responses/Code200Response.java new file mode 100644 index 00000000000..9dd347dd3cb --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsarrayofenums/post/responses/Code200Response.java @@ -0,0 +1,54 @@ +package org.openapijsonschematools.client.paths.fakerefsarrayofenums.post.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakerefsarrayofenums.post.responses.code200response.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpHeaders; + +public class Code200Response { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} + public record ApplicationjsonResponseBody(ApplicationjsonSchema.ArrayOfEnums1Boxed body) implements SealedResponseBody { } + + public static class Code200Response1 extends ResponseDeserializer { + public Code200Response1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + SealedMediaType mediaType = content.get(contentType); + if (mediaType == null) { + throw new RuntimeException("Invalid contentType was received back from the server that does not exist in the openapi document"); + } + if (mediaType instanceof ApplicationjsonMediaType thisMediaType) { + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } + throw new RuntimeException("contentType="+contentType+" returned by the server is unknown and does not exist in the openapi document"); + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsarrayofenums/post/responses/response200/content/applicationjson/ApplicationjsonSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsarrayofenums/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java similarity index 91% rename from samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsarrayofenums/post/responses/response200/content/applicationjson/ApplicationjsonSchema.java rename to samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsarrayofenums/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java index fa90b99901d..aae5071d1b6 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsarrayofenums/post/responses/response200/content/applicationjson/ApplicationjsonSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsarrayofenums/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java @@ -1,4 +1,4 @@ -package org.openapijsonschematools.client.paths.fakerefsarrayofenums.post.responses.response200.content.applicationjson; +package org.openapijsonschematools.client.paths.fakerefsarrayofenums.post.responses.code200response.content.applicationjson; import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.components.schemas.ArrayOfEnums; diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsboolean/post/RequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsboolean/post/RequestBody.java index c1e6cc1bd59..892772867fc 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsboolean/post/RequestBody.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsboolean/post/RequestBody.java @@ -6,22 +6,27 @@ import org.openapijsonschematools.client.requestbody.RequestBodySerializer; import org.openapijsonschematools.client.requestbody.GenericRequestBody; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; import org.openapijsonschematools.client.mediatype.MediaType; import org.openapijsonschematools.client.paths.fakerefsboolean.post.requestbody.content.applicationjson.ApplicationjsonSchema; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; import java.util.AbstractMap; import java.util.Map; public class RequestBody { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} - public static class ApplicationjsonMediaType extends MediaType { + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { public ApplicationjsonMediaType() { - super(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; } } - public static class RequestBody1 extends RequestBodySerializer { + public static class RequestBody1 extends RequestBodySerializer { public RequestBody1() { super( Map.ofEntries( @@ -33,26 +38,15 @@ public RequestBody1() { public SerializedRequestBody serialize(SealedRequestBody requestBody) { ApplicationjsonRequestBody requestBody0 = (ApplicationjsonRequestBody) requestBody; - return serialize(requestBody0.contentType(), requestBody0.body().data()); + return serialize(requestBody0.contentType(), requestBody0.body().getData()); } } - public static abstract sealed class SealedRequestBody permits ApplicationjsonRequestBody {} - public static final class ApplicationjsonRequestBody extends SealedRequestBody implements GenericRequestBody { - private final String contentType; - private final ApplicationjsonSchema.BooleanJsonSchema1Boxed body; - public ApplicationjsonRequestBody(ApplicationjsonSchema.BooleanJsonSchema1Boxed body) { - contentType = "application/json"; - this.body = body; - } + public sealed interface SealedRequestBody permits ApplicationjsonRequestBody {} + public record ApplicationjsonRequestBody(ApplicationjsonSchema.BooleanJsonSchema1Boxed body) implements SealedRequestBody, GenericRequestBody { @Override public String contentType() { - return contentType; - } - - @Override - public ApplicationjsonSchema.BooleanJsonSchema1Boxed body() { - return body; + return "application/json"; } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsboolean/post/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsboolean/post/responses/Code200Response.java new file mode 100644 index 00000000000..dcf965a7bd8 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsboolean/post/responses/Code200Response.java @@ -0,0 +1,54 @@ +package org.openapijsonschematools.client.paths.fakerefsboolean.post.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakerefsboolean.post.responses.code200response.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpHeaders; + +public class Code200Response { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} + public record ApplicationjsonResponseBody(ApplicationjsonSchema.BooleanJsonSchema1Boxed body) implements SealedResponseBody { } + + public static class Code200Response1 extends ResponseDeserializer { + public Code200Response1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + SealedMediaType mediaType = content.get(contentType); + if (mediaType == null) { + throw new RuntimeException("Invalid contentType was received back from the server that does not exist in the openapi document"); + } + if (mediaType instanceof ApplicationjsonMediaType thisMediaType) { + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } + throw new RuntimeException("contentType="+contentType+" returned by the server is unknown and does not exist in the openapi document"); + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsboolean/post/responses/response200/content/applicationjson/ApplicationjsonSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsboolean/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java similarity index 92% rename from samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsboolean/post/responses/response200/content/applicationjson/ApplicationjsonSchema.java rename to samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsboolean/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java index 46e1e12787b..064050b09bf 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsboolean/post/responses/response200/content/applicationjson/ApplicationjsonSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsboolean/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java @@ -1,4 +1,4 @@ -package org.openapijsonschematools.client.paths.fakerefsboolean.post.responses.response200.content.applicationjson; +package org.openapijsonschematools.client.paths.fakerefsboolean.post.responses.code200response.content.applicationjson; import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.components.schemas.BooleanSchema; diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefscomposedoneofnumberwithvalidations/post/RequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefscomposedoneofnumberwithvalidations/post/RequestBody.java index cc6745bcd1f..705f750a6d0 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefscomposedoneofnumberwithvalidations/post/RequestBody.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefscomposedoneofnumberwithvalidations/post/RequestBody.java @@ -6,22 +6,27 @@ import org.openapijsonschematools.client.requestbody.RequestBodySerializer; import org.openapijsonschematools.client.requestbody.GenericRequestBody; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; import org.openapijsonschematools.client.mediatype.MediaType; import org.openapijsonschematools.client.paths.fakerefscomposedoneofnumberwithvalidations.post.requestbody.content.applicationjson.ApplicationjsonSchema; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; import java.util.AbstractMap; import java.util.Map; public class RequestBody { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} - public static class ApplicationjsonMediaType extends MediaType { + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { public ApplicationjsonMediaType() { - super(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; } } - public static class RequestBody1 extends RequestBodySerializer { + public static class RequestBody1 extends RequestBodySerializer { public RequestBody1() { super( Map.ofEntries( @@ -33,26 +38,15 @@ public RequestBody1() { public SerializedRequestBody serialize(SealedRequestBody requestBody) { ApplicationjsonRequestBody requestBody0 = (ApplicationjsonRequestBody) requestBody; - return serialize(requestBody0.contentType(), requestBody0.body().data()); + return serialize(requestBody0.contentType(), requestBody0.body().getData()); } } - public static abstract sealed class SealedRequestBody permits ApplicationjsonRequestBody {} - public static final class ApplicationjsonRequestBody extends SealedRequestBody implements GenericRequestBody { - private final String contentType; - private final ApplicationjsonSchema.ComposedOneOfDifferentTypes1Boxed body; - public ApplicationjsonRequestBody(ApplicationjsonSchema.ComposedOneOfDifferentTypes1Boxed body) { - contentType = "application/json"; - this.body = body; - } + public sealed interface SealedRequestBody permits ApplicationjsonRequestBody {} + public record ApplicationjsonRequestBody(ApplicationjsonSchema.ComposedOneOfDifferentTypes1Boxed body) implements SealedRequestBody, GenericRequestBody { @Override public String contentType() { - return contentType; - } - - @Override - public ApplicationjsonSchema.ComposedOneOfDifferentTypes1Boxed body() { - return body; + return "application/json"; } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefscomposedoneofnumberwithvalidations/post/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefscomposedoneofnumberwithvalidations/post/responses/Code200Response.java new file mode 100644 index 00000000000..32c14d6f16c --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefscomposedoneofnumberwithvalidations/post/responses/Code200Response.java @@ -0,0 +1,54 @@ +package org.openapijsonschematools.client.paths.fakerefscomposedoneofnumberwithvalidations.post.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakerefscomposedoneofnumberwithvalidations.post.responses.code200response.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpHeaders; + +public class Code200Response { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} + public record ApplicationjsonResponseBody(ApplicationjsonSchema.ComposedOneOfDifferentTypes1Boxed body) implements SealedResponseBody { } + + public static class Code200Response1 extends ResponseDeserializer { + public Code200Response1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + SealedMediaType mediaType = content.get(contentType); + if (mediaType == null) { + throw new RuntimeException("Invalid contentType was received back from the server that does not exist in the openapi document"); + } + if (mediaType instanceof ApplicationjsonMediaType thisMediaType) { + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } + throw new RuntimeException("contentType="+contentType+" returned by the server is unknown and does not exist in the openapi document"); + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefscomposedoneofnumberwithvalidations/post/responses/response200/content/applicationjson/ApplicationjsonSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefscomposedoneofnumberwithvalidations/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java similarity index 89% rename from samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefscomposedoneofnumberwithvalidations/post/responses/response200/content/applicationjson/ApplicationjsonSchema.java rename to samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefscomposedoneofnumberwithvalidations/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java index 577f97e58df..075b7ade4dd 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefscomposedoneofnumberwithvalidations/post/responses/response200/content/applicationjson/ApplicationjsonSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefscomposedoneofnumberwithvalidations/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java @@ -1,4 +1,4 @@ -package org.openapijsonschematools.client.paths.fakerefscomposedoneofnumberwithvalidations.post.responses.response200.content.applicationjson; +package org.openapijsonschematools.client.paths.fakerefscomposedoneofnumberwithvalidations.post.responses.code200response.content.applicationjson; import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.components.schemas.ComposedOneOfDifferentTypes; diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsenum/post/RequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsenum/post/RequestBody.java index 103b96543e8..f149f2bc22f 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsenum/post/RequestBody.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsenum/post/RequestBody.java @@ -6,22 +6,27 @@ import org.openapijsonschematools.client.requestbody.RequestBodySerializer; import org.openapijsonschematools.client.requestbody.GenericRequestBody; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; import org.openapijsonschematools.client.mediatype.MediaType; import org.openapijsonschematools.client.paths.fakerefsenum.post.requestbody.content.applicationjson.ApplicationjsonSchema; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; import java.util.AbstractMap; import java.util.Map; public class RequestBody { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} - public static class ApplicationjsonMediaType extends MediaType { + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { public ApplicationjsonMediaType() { - super(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; } } - public static class RequestBody1 extends RequestBodySerializer { + public static class RequestBody1 extends RequestBodySerializer { public RequestBody1() { super( Map.ofEntries( @@ -33,26 +38,15 @@ public RequestBody1() { public SerializedRequestBody serialize(SealedRequestBody requestBody) { ApplicationjsonRequestBody requestBody0 = (ApplicationjsonRequestBody) requestBody; - return serialize(requestBody0.contentType(), requestBody0.body().data()); + return serialize(requestBody0.contentType(), requestBody0.body().getData()); } } - public static abstract sealed class SealedRequestBody permits ApplicationjsonRequestBody {} - public static final class ApplicationjsonRequestBody extends SealedRequestBody implements GenericRequestBody { - private final String contentType; - private final ApplicationjsonSchema.StringEnum1Boxed body; - public ApplicationjsonRequestBody(ApplicationjsonSchema.StringEnum1Boxed body) { - contentType = "application/json"; - this.body = body; - } + public sealed interface SealedRequestBody permits ApplicationjsonRequestBody {} + public record ApplicationjsonRequestBody(ApplicationjsonSchema.StringEnum1Boxed body) implements SealedRequestBody, GenericRequestBody { @Override public String contentType() { - return contentType; - } - - @Override - public ApplicationjsonSchema.StringEnum1Boxed body() { - return body; + return "application/json"; } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsenum/post/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsenum/post/responses/Code200Response.java new file mode 100644 index 00000000000..e20627544e3 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsenum/post/responses/Code200Response.java @@ -0,0 +1,54 @@ +package org.openapijsonschematools.client.paths.fakerefsenum.post.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakerefsenum.post.responses.code200response.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpHeaders; + +public class Code200Response { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} + public record ApplicationjsonResponseBody(ApplicationjsonSchema.StringEnum1Boxed body) implements SealedResponseBody { } + + public static class Code200Response1 extends ResponseDeserializer { + public Code200Response1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + SealedMediaType mediaType = content.get(contentType); + if (mediaType == null) { + throw new RuntimeException("Invalid contentType was received back from the server that does not exist in the openapi document"); + } + if (mediaType instanceof ApplicationjsonMediaType thisMediaType) { + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } + throw new RuntimeException("contentType="+contentType+" returned by the server is unknown and does not exist in the openapi document"); + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsenum/post/responses/response200/content/applicationjson/ApplicationjsonSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsenum/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java similarity index 92% rename from samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsenum/post/responses/response200/content/applicationjson/ApplicationjsonSchema.java rename to samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsenum/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java index 82b4434b894..f32e80d609f 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsenum/post/responses/response200/content/applicationjson/ApplicationjsonSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsenum/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java @@ -1,4 +1,4 @@ -package org.openapijsonschematools.client.paths.fakerefsenum.post.responses.response200.content.applicationjson; +package org.openapijsonschematools.client.paths.fakerefsenum.post.responses.code200response.content.applicationjson; import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.components.schemas.StringEnum; diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsmammal/post/RequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsmammal/post/RequestBody.java index 65860504af4..c5b28579c34 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsmammal/post/RequestBody.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsmammal/post/RequestBody.java @@ -6,22 +6,27 @@ import org.openapijsonschematools.client.requestbody.RequestBodySerializer; import org.openapijsonschematools.client.requestbody.GenericRequestBody; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; import org.openapijsonschematools.client.mediatype.MediaType; import org.openapijsonschematools.client.paths.fakerefsmammal.post.requestbody.content.applicationjson.ApplicationjsonSchema; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; import java.util.AbstractMap; import java.util.Map; public class RequestBody { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} - public static class ApplicationjsonMediaType extends MediaType { + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { public ApplicationjsonMediaType() { - super(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; } } - public static class RequestBody1 extends RequestBodySerializer { + public static class RequestBody1 extends RequestBodySerializer { public RequestBody1() { super( Map.ofEntries( @@ -33,26 +38,15 @@ public RequestBody1() { public SerializedRequestBody serialize(SealedRequestBody requestBody) { ApplicationjsonRequestBody requestBody0 = (ApplicationjsonRequestBody) requestBody; - return serialize(requestBody0.contentType(), requestBody0.body().data()); + return serialize(requestBody0.contentType(), requestBody0.body().getData()); } } - public static abstract sealed class SealedRequestBody permits ApplicationjsonRequestBody {} - public static final class ApplicationjsonRequestBody extends SealedRequestBody implements GenericRequestBody { - private final String contentType; - private final ApplicationjsonSchema.Mammal1Boxed body; - public ApplicationjsonRequestBody(ApplicationjsonSchema.Mammal1Boxed body) { - contentType = "application/json"; - this.body = body; - } + public sealed interface SealedRequestBody permits ApplicationjsonRequestBody {} + public record ApplicationjsonRequestBody(ApplicationjsonSchema.Mammal1Boxed body) implements SealedRequestBody, GenericRequestBody { @Override public String contentType() { - return contentType; - } - - @Override - public ApplicationjsonSchema.Mammal1Boxed body() { - return body; + return "application/json"; } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsmammal/post/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsmammal/post/responses/Code200Response.java new file mode 100644 index 00000000000..68e8bc37f17 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsmammal/post/responses/Code200Response.java @@ -0,0 +1,54 @@ +package org.openapijsonschematools.client.paths.fakerefsmammal.post.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakerefsmammal.post.responses.code200response.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpHeaders; + +public class Code200Response { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} + public record ApplicationjsonResponseBody(ApplicationjsonSchema.Mammal1Boxed body) implements SealedResponseBody { } + + public static class Code200Response1 extends ResponseDeserializer { + public Code200Response1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + SealedMediaType mediaType = content.get(contentType); + if (mediaType == null) { + throw new RuntimeException("Invalid contentType was received back from the server that does not exist in the openapi document"); + } + if (mediaType instanceof ApplicationjsonMediaType thisMediaType) { + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } + throw new RuntimeException("contentType="+contentType+" returned by the server is unknown and does not exist in the openapi document"); + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsmammal/post/responses/response200/content/applicationjson/ApplicationjsonSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsmammal/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java similarity index 91% rename from samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsmammal/post/responses/response200/content/applicationjson/ApplicationjsonSchema.java rename to samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsmammal/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java index a08ee0f2c39..89dac1bf71a 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsmammal/post/responses/response200/content/applicationjson/ApplicationjsonSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsmammal/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java @@ -1,4 +1,4 @@ -package org.openapijsonschematools.client.paths.fakerefsmammal.post.responses.response200.content.applicationjson; +package org.openapijsonschematools.client.paths.fakerefsmammal.post.responses.code200response.content.applicationjson; import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.components.schemas.Mammal; diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsnumber/post/RequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsnumber/post/RequestBody.java index aae1f6433bf..dd306ec59bd 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsnumber/post/RequestBody.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsnumber/post/RequestBody.java @@ -6,22 +6,27 @@ import org.openapijsonschematools.client.requestbody.RequestBodySerializer; import org.openapijsonschematools.client.requestbody.GenericRequestBody; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; import org.openapijsonschematools.client.mediatype.MediaType; import org.openapijsonschematools.client.paths.fakerefsnumber.post.requestbody.content.applicationjson.ApplicationjsonSchema; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; import java.util.AbstractMap; import java.util.Map; public class RequestBody { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} - public static class ApplicationjsonMediaType extends MediaType { + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { public ApplicationjsonMediaType() { - super(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; } } - public static class RequestBody1 extends RequestBodySerializer { + public static class RequestBody1 extends RequestBodySerializer { public RequestBody1() { super( Map.ofEntries( @@ -33,26 +38,15 @@ public RequestBody1() { public SerializedRequestBody serialize(SealedRequestBody requestBody) { ApplicationjsonRequestBody requestBody0 = (ApplicationjsonRequestBody) requestBody; - return serialize(requestBody0.contentType(), requestBody0.body().data()); + return serialize(requestBody0.contentType(), requestBody0.body().getData()); } } - public static abstract sealed class SealedRequestBody permits ApplicationjsonRequestBody {} - public static final class ApplicationjsonRequestBody extends SealedRequestBody implements GenericRequestBody { - private final String contentType; - private final ApplicationjsonSchema.NumberWithValidations1Boxed body; - public ApplicationjsonRequestBody(ApplicationjsonSchema.NumberWithValidations1Boxed body) { - contentType = "application/json"; - this.body = body; - } + public sealed interface SealedRequestBody permits ApplicationjsonRequestBody {} + public record ApplicationjsonRequestBody(ApplicationjsonSchema.NumberWithValidations1Boxed body) implements SealedRequestBody, GenericRequestBody { @Override public String contentType() { - return contentType; - } - - @Override - public ApplicationjsonSchema.NumberWithValidations1Boxed body() { - return body; + return "application/json"; } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsnumber/post/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsnumber/post/responses/Code200Response.java new file mode 100644 index 00000000000..6a4a1829e56 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsnumber/post/responses/Code200Response.java @@ -0,0 +1,54 @@ +package org.openapijsonschematools.client.paths.fakerefsnumber.post.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakerefsnumber.post.responses.code200response.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpHeaders; + +public class Code200Response { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} + public record ApplicationjsonResponseBody(ApplicationjsonSchema.NumberWithValidations1Boxed body) implements SealedResponseBody { } + + public static class Code200Response1 extends ResponseDeserializer { + public Code200Response1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + SealedMediaType mediaType = content.get(contentType); + if (mediaType == null) { + throw new RuntimeException("Invalid contentType was received back from the server that does not exist in the openapi document"); + } + if (mediaType instanceof ApplicationjsonMediaType thisMediaType) { + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } + throw new RuntimeException("contentType="+contentType+" returned by the server is unknown and does not exist in the openapi document"); + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsnumber/post/responses/response200/content/applicationjson/ApplicationjsonSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsnumber/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java similarity index 92% rename from samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsnumber/post/responses/response200/content/applicationjson/ApplicationjsonSchema.java rename to samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsnumber/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java index 4b5413ba9d6..735f78f40f2 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsnumber/post/responses/response200/content/applicationjson/ApplicationjsonSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsnumber/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java @@ -1,4 +1,4 @@ -package org.openapijsonschematools.client.paths.fakerefsnumber.post.responses.response200.content.applicationjson; +package org.openapijsonschematools.client.paths.fakerefsnumber.post.responses.code200response.content.applicationjson; import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.components.schemas.NumberWithValidations; diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsobjectmodelwithrefprops/post/RequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsobjectmodelwithrefprops/post/RequestBody.java index 434b149959c..c00f02f2221 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsobjectmodelwithrefprops/post/RequestBody.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsobjectmodelwithrefprops/post/RequestBody.java @@ -6,22 +6,27 @@ import org.openapijsonschematools.client.requestbody.RequestBodySerializer; import org.openapijsonschematools.client.requestbody.GenericRequestBody; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; import org.openapijsonschematools.client.mediatype.MediaType; import org.openapijsonschematools.client.paths.fakerefsobjectmodelwithrefprops.post.requestbody.content.applicationjson.ApplicationjsonSchema; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; import java.util.AbstractMap; import java.util.Map; public class RequestBody { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} - public static class ApplicationjsonMediaType extends MediaType { + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { public ApplicationjsonMediaType() { - super(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; } } - public static class RequestBody1 extends RequestBodySerializer { + public static class RequestBody1 extends RequestBodySerializer { public RequestBody1() { super( Map.ofEntries( @@ -33,26 +38,15 @@ public RequestBody1() { public SerializedRequestBody serialize(SealedRequestBody requestBody) { ApplicationjsonRequestBody requestBody0 = (ApplicationjsonRequestBody) requestBody; - return serialize(requestBody0.contentType(), requestBody0.body().data()); + return serialize(requestBody0.contentType(), requestBody0.body().getData()); } } - public static abstract sealed class SealedRequestBody permits ApplicationjsonRequestBody {} - public static final class ApplicationjsonRequestBody extends SealedRequestBody implements GenericRequestBody { - private final String contentType; - private final ApplicationjsonSchema.ObjectModelWithRefProps1Boxed body; - public ApplicationjsonRequestBody(ApplicationjsonSchema.ObjectModelWithRefProps1Boxed body) { - contentType = "application/json"; - this.body = body; - } + public sealed interface SealedRequestBody permits ApplicationjsonRequestBody {} + public record ApplicationjsonRequestBody(ApplicationjsonSchema.ObjectModelWithRefProps1Boxed body) implements SealedRequestBody, GenericRequestBody { @Override public String contentType() { - return contentType; - } - - @Override - public ApplicationjsonSchema.ObjectModelWithRefProps1Boxed body() { - return body; + return "application/json"; } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsobjectmodelwithrefprops/post/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsobjectmodelwithrefprops/post/responses/Code200Response.java new file mode 100644 index 00000000000..e2c6082a8ea --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsobjectmodelwithrefprops/post/responses/Code200Response.java @@ -0,0 +1,54 @@ +package org.openapijsonschematools.client.paths.fakerefsobjectmodelwithrefprops.post.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakerefsobjectmodelwithrefprops.post.responses.code200response.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpHeaders; + +public class Code200Response { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} + public record ApplicationjsonResponseBody(ApplicationjsonSchema.ObjectModelWithRefProps1Boxed body) implements SealedResponseBody { } + + public static class Code200Response1 extends ResponseDeserializer { + public Code200Response1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + SealedMediaType mediaType = content.get(contentType); + if (mediaType == null) { + throw new RuntimeException("Invalid contentType was received back from the server that does not exist in the openapi document"); + } + if (mediaType instanceof ApplicationjsonMediaType thisMediaType) { + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } + throw new RuntimeException("contentType="+contentType+" returned by the server is unknown and does not exist in the openapi document"); + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsobjectmodelwithrefprops/post/responses/response200/content/applicationjson/ApplicationjsonSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsobjectmodelwithrefprops/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java similarity index 90% rename from samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsobjectmodelwithrefprops/post/responses/response200/content/applicationjson/ApplicationjsonSchema.java rename to samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsobjectmodelwithrefprops/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java index 55b36e6e1bf..ae20e625adc 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsobjectmodelwithrefprops/post/responses/response200/content/applicationjson/ApplicationjsonSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsobjectmodelwithrefprops/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java @@ -1,4 +1,4 @@ -package org.openapijsonschematools.client.paths.fakerefsobjectmodelwithrefprops.post.responses.response200.content.applicationjson; +package org.openapijsonschematools.client.paths.fakerefsobjectmodelwithrefprops.post.responses.code200response.content.applicationjson; import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.components.schemas.ObjectModelWithRefProps; diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsstring/post/RequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsstring/post/RequestBody.java index 569ceebfb34..ba47936d312 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsstring/post/RequestBody.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsstring/post/RequestBody.java @@ -6,22 +6,27 @@ import org.openapijsonschematools.client.requestbody.RequestBodySerializer; import org.openapijsonschematools.client.requestbody.GenericRequestBody; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; import org.openapijsonschematools.client.mediatype.MediaType; import org.openapijsonschematools.client.paths.fakerefsstring.post.requestbody.content.applicationjson.ApplicationjsonSchema; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; import java.util.AbstractMap; import java.util.Map; public class RequestBody { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} - public static class ApplicationjsonMediaType extends MediaType { + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { public ApplicationjsonMediaType() { - super(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; } } - public static class RequestBody1 extends RequestBodySerializer { + public static class RequestBody1 extends RequestBodySerializer { public RequestBody1() { super( Map.ofEntries( @@ -33,26 +38,15 @@ public RequestBody1() { public SerializedRequestBody serialize(SealedRequestBody requestBody) { ApplicationjsonRequestBody requestBody0 = (ApplicationjsonRequestBody) requestBody; - return serialize(requestBody0.contentType(), requestBody0.body().data()); + return serialize(requestBody0.contentType(), requestBody0.body().getData()); } } - public static abstract sealed class SealedRequestBody permits ApplicationjsonRequestBody {} - public static final class ApplicationjsonRequestBody extends SealedRequestBody implements GenericRequestBody { - private final String contentType; - private final ApplicationjsonSchema.StringJsonSchema1Boxed body; - public ApplicationjsonRequestBody(ApplicationjsonSchema.StringJsonSchema1Boxed body) { - contentType = "application/json"; - this.body = body; - } + public sealed interface SealedRequestBody permits ApplicationjsonRequestBody {} + public record ApplicationjsonRequestBody(ApplicationjsonSchema.StringJsonSchema1Boxed body) implements SealedRequestBody, GenericRequestBody { @Override public String contentType() { - return contentType; - } - - @Override - public ApplicationjsonSchema.StringJsonSchema1Boxed body() { - return body; + return "application/json"; } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsstring/post/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsstring/post/responses/Code200Response.java new file mode 100644 index 00000000000..0ef09b42463 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsstring/post/responses/Code200Response.java @@ -0,0 +1,54 @@ +package org.openapijsonschematools.client.paths.fakerefsstring.post.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakerefsstring.post.responses.code200response.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpHeaders; + +public class Code200Response { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} + public record ApplicationjsonResponseBody(ApplicationjsonSchema.StringJsonSchema1Boxed body) implements SealedResponseBody { } + + public static class Code200Response1 extends ResponseDeserializer { + public Code200Response1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + SealedMediaType mediaType = content.get(contentType); + if (mediaType == null) { + throw new RuntimeException("Invalid contentType was received back from the server that does not exist in the openapi document"); + } + if (mediaType instanceof ApplicationjsonMediaType thisMediaType) { + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } + throw new RuntimeException("contentType="+contentType+" returned by the server is unknown and does not exist in the openapi document"); + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsstring/post/responses/response200/content/applicationjson/ApplicationjsonSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsstring/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java similarity index 92% rename from samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsstring/post/responses/response200/content/applicationjson/ApplicationjsonSchema.java rename to samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsstring/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java index a6ccbbf4963..9f140dc31c3 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsstring/post/responses/response200/content/applicationjson/ApplicationjsonSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsstring/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java @@ -1,4 +1,4 @@ -package org.openapijsonschematools.client.paths.fakerefsstring.post.responses.response200.content.applicationjson; +package org.openapijsonschematools.client.paths.fakerefsstring.post.responses.code200response.content.applicationjson; import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.components.schemas.StringSchema; diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeresponsewithoutschema/get/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeresponsewithoutschema/get/responses/Code200Response.java new file mode 100644 index 00000000000..c461d9035bf --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeresponsewithoutschema/get/responses/Code200Response.java @@ -0,0 +1,33 @@ +package org.openapijsonschematools.client.paths.fakeresponsewithoutschema.get.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.schemas.validation.MapUtils; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpHeaders; + +public class Code200Response { + + public static class Code200Response1 extends ResponseDeserializer { + public Code200Response1() { + super( + MapUtils.makeMap( + new AbstractMap.SimpleEntry("application/json", null), + new AbstractMap.SimpleEntry("application/xml", null) + ) + ); + } + + @Override + protected Void getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + return null; + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/faketestqueryparamters/put/QueryParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/faketestqueryparamters/put/QueryParameters.java index f5c1e78c19f..8c8a5f005bf 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/faketestqueryparamters/put/QueryParameters.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/faketestqueryparamters/put/QueryParameters.java @@ -1407,23 +1407,19 @@ public QueryParametersMap111110Builder getBuilderAfterUrl(Map { + public static class QueryParameters1 extends JsonSchema implements MapSchemaValidator { private static @Nullable QueryParameters1 instance = null; protected QueryParameters1() { @@ -1467,11 +1463,11 @@ public QueryParametersMap getNewInstance(Map arg, List pathToItem, List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -1508,6 +1504,13 @@ public QueryParametersMap validate(Map arg, SchemaConfiguration configurat public QueryParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new QueryParameters1BoxedMap(validate(arg, configuration)); } + @Override + public QueryParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/faketestqueryparamters/put/parameters/parameter0/Schema0.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/faketestqueryparamters/put/parameters/parameter0/Schema0.java index be6ae0ccf9f..0c364247e83 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/faketestqueryparamters/put/parameters/parameter0/Schema0.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/faketestqueryparamters/put/parameters/parameter0/Schema0.java @@ -66,24 +66,20 @@ public List build() { } - public static abstract sealed class Schema01Boxed permits Schema01BoxedList { - public abstract @Nullable Object data(); + public sealed interface Schema01Boxed permits Schema01BoxedList { + @Nullable Object getData(); } - public static final class Schema01BoxedList extends Schema01Boxed { - public final SchemaList0 data; - private Schema01BoxedList(SchemaList0 data) { - this.data = data; - } + public record Schema01BoxedList(SchemaList0 data) implements Schema01Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema01 extends JsonSchema implements ListSchemaValidator { + public static class Schema01 extends JsonSchema implements ListSchemaValidator { private static @Nullable Schema01 instance = null; protected Schema01() { @@ -107,11 +103,11 @@ public SchemaList0 getNewInstance(List arg, List pathToItem, PathToSc for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof String)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -151,5 +147,12 @@ public SchemaList0 validate(List arg, SchemaConfiguration configuration) thro public Schema01BoxedList validateAndBox(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema01BoxedList(validate(arg, configuration)); } + @Override + public Schema01Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/faketestqueryparamters/put/parameters/parameter1/Schema1.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/faketestqueryparamters/put/parameters/parameter1/Schema1.java index badd1707665..53e9e106e7b 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/faketestqueryparamters/put/parameters/parameter1/Schema1.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/faketestqueryparamters/put/parameters/parameter1/Schema1.java @@ -66,24 +66,20 @@ public List build() { } - public static abstract sealed class Schema11Boxed permits Schema11BoxedList { - public abstract @Nullable Object data(); + public sealed interface Schema11Boxed permits Schema11BoxedList { + @Nullable Object getData(); } - public static final class Schema11BoxedList extends Schema11Boxed { - public final SchemaList1 data; - private Schema11BoxedList(SchemaList1 data) { - this.data = data; - } + public record Schema11BoxedList(SchemaList1 data) implements Schema11Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema11 extends JsonSchema implements ListSchemaValidator { + public static class Schema11 extends JsonSchema implements ListSchemaValidator { private static @Nullable Schema11 instance = null; protected Schema11() { @@ -107,11 +103,11 @@ public SchemaList1 getNewInstance(List arg, List pathToItem, PathToSc for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof String)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -151,5 +147,12 @@ public SchemaList1 validate(List arg, SchemaConfiguration configuration) thro public Schema11BoxedList validateAndBox(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema11BoxedList(validate(arg, configuration)); } + @Override + public Schema11Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/faketestqueryparamters/put/parameters/parameter2/Schema2.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/faketestqueryparamters/put/parameters/parameter2/Schema2.java index 2158eb018e6..8b001cea7dc 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/faketestqueryparamters/put/parameters/parameter2/Schema2.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/faketestqueryparamters/put/parameters/parameter2/Schema2.java @@ -66,24 +66,20 @@ public List build() { } - public static abstract sealed class Schema21Boxed permits Schema21BoxedList { - public abstract @Nullable Object data(); + public sealed interface Schema21Boxed permits Schema21BoxedList { + @Nullable Object getData(); } - public static final class Schema21BoxedList extends Schema21Boxed { - public final SchemaList2 data; - private Schema21BoxedList(SchemaList2 data) { - this.data = data; - } + public record Schema21BoxedList(SchemaList2 data) implements Schema21Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema21 extends JsonSchema implements ListSchemaValidator { + public static class Schema21 extends JsonSchema implements ListSchemaValidator { private static @Nullable Schema21 instance = null; protected Schema21() { @@ -107,11 +103,11 @@ public SchemaList2 getNewInstance(List arg, List pathToItem, PathToSc for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof String)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -151,5 +147,12 @@ public SchemaList2 validate(List arg, SchemaConfiguration configuration) thro public Schema21BoxedList validateAndBox(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema21BoxedList(validate(arg, configuration)); } + @Override + public Schema21Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/faketestqueryparamters/put/parameters/parameter3/Schema3.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/faketestqueryparamters/put/parameters/parameter3/Schema3.java index ce9acdad4cb..6f94b32c521 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/faketestqueryparamters/put/parameters/parameter3/Schema3.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/faketestqueryparamters/put/parameters/parameter3/Schema3.java @@ -66,24 +66,20 @@ public List build() { } - public static abstract sealed class Schema31Boxed permits Schema31BoxedList { - public abstract @Nullable Object data(); + public sealed interface Schema31Boxed permits Schema31BoxedList { + @Nullable Object getData(); } - public static final class Schema31BoxedList extends Schema31Boxed { - public final SchemaList3 data; - private Schema31BoxedList(SchemaList3 data) { - this.data = data; - } + public record Schema31BoxedList(SchemaList3 data) implements Schema31Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema31 extends JsonSchema implements ListSchemaValidator { + public static class Schema31 extends JsonSchema implements ListSchemaValidator { private static @Nullable Schema31 instance = null; protected Schema31() { @@ -107,11 +103,11 @@ public SchemaList3 getNewInstance(List arg, List pathToItem, PathToSc for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof String)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -151,5 +147,12 @@ public SchemaList3 validate(List arg, SchemaConfiguration configuration) thro public Schema31BoxedList validateAndBox(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema31BoxedList(validate(arg, configuration)); } + @Override + public Schema31Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/faketestqueryparamters/put/parameters/parameter4/Schema4.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/faketestqueryparamters/put/parameters/parameter4/Schema4.java index cf4649ff7c8..92352108c2d 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/faketestqueryparamters/put/parameters/parameter4/Schema4.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/faketestqueryparamters/put/parameters/parameter4/Schema4.java @@ -66,24 +66,20 @@ public List build() { } - public static abstract sealed class Schema41Boxed permits Schema41BoxedList { - public abstract @Nullable Object data(); + public sealed interface Schema41Boxed permits Schema41BoxedList { + @Nullable Object getData(); } - public static final class Schema41BoxedList extends Schema41Boxed { - public final SchemaList4 data; - private Schema41BoxedList(SchemaList4 data) { - this.data = data; - } + public record Schema41BoxedList(SchemaList4 data) implements Schema41Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema41 extends JsonSchema implements ListSchemaValidator { + public static class Schema41 extends JsonSchema implements ListSchemaValidator { private static @Nullable Schema41 instance = null; protected Schema41() { @@ -107,11 +103,11 @@ public SchemaList4 getNewInstance(List arg, List pathToItem, PathToSc for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof String)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -151,5 +147,12 @@ public SchemaList4 validate(List arg, SchemaConfiguration configuration) thro public Schema41BoxedList validateAndBox(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema41BoxedList(validate(arg, configuration)); } + @Override + public Schema41Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/faketestqueryparamters/put/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/faketestqueryparamters/put/responses/Code200Response.java new file mode 100644 index 00000000000..ca41d3b2624 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/faketestqueryparamters/put/responses/Code200Response.java @@ -0,0 +1,7 @@ +package org.openapijsonschematools.client.paths.faketestqueryparamters.put.responses; + +import org.openapijsonschematools.client.components.responses.SuccessDescriptionOnly; + +public class Code200Response extends SuccessDescriptionOnly { + public static class Code200Response1 extends SuccessDescriptionOnly1 {} +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploaddownloadfile/post/RequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploaddownloadfile/post/RequestBody.java index b2aaf8e7bcf..0dbaf136d1e 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploaddownloadfile/post/RequestBody.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploaddownloadfile/post/RequestBody.java @@ -6,22 +6,27 @@ import org.openapijsonschematools.client.requestbody.RequestBodySerializer; import org.openapijsonschematools.client.requestbody.GenericRequestBody; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; import org.openapijsonschematools.client.mediatype.MediaType; import org.openapijsonschematools.client.paths.fakeuploaddownloadfile.post.requestbody.content.applicationoctetstream.ApplicationoctetstreamSchema; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; import java.util.AbstractMap; import java.util.Map; public class RequestBody { + public sealed interface SealedMediaType permits ApplicationoctetstreamMediaType {} - public static class ApplicationoctetstreamMediaType extends MediaType { + public record ApplicationoctetstreamMediaType(ApplicationoctetstreamSchema.ApplicationoctetstreamSchema1 schema) implements SealedMediaType, MediaType { public ApplicationoctetstreamMediaType() { - super(ApplicationoctetstreamSchema.ApplicationoctetstreamSchema1.getInstance()); + this(ApplicationoctetstreamSchema.ApplicationoctetstreamSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; } } - public static class RequestBody1 extends RequestBodySerializer { + public static class RequestBody1 extends RequestBodySerializer { public RequestBody1() { super( Map.ofEntries( @@ -33,26 +38,15 @@ public RequestBody1() { public SerializedRequestBody serialize(SealedRequestBody requestBody) { ApplicationoctetstreamRequestBody requestBody0 = (ApplicationoctetstreamRequestBody) requestBody; - return serialize(requestBody0.contentType(), requestBody0.body().data()); + return serialize(requestBody0.contentType(), requestBody0.body().getData()); } } - public static abstract sealed class SealedRequestBody permits ApplicationoctetstreamRequestBody {} - public static final class ApplicationoctetstreamRequestBody extends SealedRequestBody implements GenericRequestBody { - private final String contentType; - private final ApplicationoctetstreamSchema.StringJsonSchema1Boxed body; - public ApplicationoctetstreamRequestBody(ApplicationoctetstreamSchema.StringJsonSchema1Boxed body) { - contentType = "application/octet-stream"; - this.body = body; - } + public sealed interface SealedRequestBody permits ApplicationoctetstreamRequestBody {} + public record ApplicationoctetstreamRequestBody(ApplicationoctetstreamSchema.StringJsonSchema1Boxed body) implements SealedRequestBody, GenericRequestBody { @Override public String contentType() { - return contentType; - } - - @Override - public ApplicationoctetstreamSchema.StringJsonSchema1Boxed body() { - return body; + return "application/octet-stream"; } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploaddownloadfile/post/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploaddownloadfile/post/responses/Code200Response.java new file mode 100644 index 00000000000..63236fb8e64 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploaddownloadfile/post/responses/Code200Response.java @@ -0,0 +1,54 @@ +package org.openapijsonschematools.client.paths.fakeuploaddownloadfile.post.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakeuploaddownloadfile.post.responses.code200response.content.applicationoctetstream.ApplicationoctetstreamSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpHeaders; + +public class Code200Response { + public sealed interface SealedMediaType permits ApplicationoctetstreamMediaType {} + + public record ApplicationoctetstreamMediaType(ApplicationoctetstreamSchema.ApplicationoctetstreamSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationoctetstreamMediaType() { + this(ApplicationoctetstreamSchema.ApplicationoctetstreamSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationoctetstreamResponseBody {} + public record ApplicationoctetstreamResponseBody(ApplicationoctetstreamSchema.StringJsonSchema1Boxed body) implements SealedResponseBody { } + + public static class Code200Response1 extends ResponseDeserializer { + public Code200Response1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/octet-stream", new ApplicationoctetstreamMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + SealedMediaType mediaType = content.get(contentType); + if (mediaType == null) { + throw new RuntimeException("Invalid contentType was received back from the server that does not exist in the openapi document"); + } + if (mediaType instanceof ApplicationoctetstreamMediaType thisMediaType) { + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationoctetstreamResponseBody(deserializedBody); + } + throw new RuntimeException("contentType="+contentType+" returned by the server is unknown and does not exist in the openapi document"); + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploaddownloadfile/post/responses/response200/content/applicationoctetstream/ApplicationoctetstreamSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploaddownloadfile/post/responses/code200response/content/applicationoctetstream/ApplicationoctetstreamSchema.java similarity index 91% rename from samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploaddownloadfile/post/responses/response200/content/applicationoctetstream/ApplicationoctetstreamSchema.java rename to samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploaddownloadfile/post/responses/code200response/content/applicationoctetstream/ApplicationoctetstreamSchema.java index 88c3716da57..4560be3af67 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploaddownloadfile/post/responses/response200/content/applicationoctetstream/ApplicationoctetstreamSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploaddownloadfile/post/responses/code200response/content/applicationoctetstream/ApplicationoctetstreamSchema.java @@ -1,4 +1,4 @@ -package org.openapijsonschematools.client.paths.fakeuploaddownloadfile.post.responses.response200.content.applicationoctetstream; +package org.openapijsonschematools.client.paths.fakeuploaddownloadfile.post.responses.code200response.content.applicationoctetstream; import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.schemas.StringJsonSchema; diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfile/post/RequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfile/post/RequestBody.java index 9936337d4ef..972187e5cca 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfile/post/RequestBody.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfile/post/RequestBody.java @@ -6,22 +6,27 @@ import org.openapijsonschematools.client.requestbody.RequestBodySerializer; import org.openapijsonschematools.client.requestbody.GenericRequestBody; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; import org.openapijsonschematools.client.mediatype.MediaType; import org.openapijsonschematools.client.paths.fakeuploadfile.post.requestbody.content.multipartformdata.MultipartformdataSchema; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; import java.util.AbstractMap; import java.util.Map; public class RequestBody { + public sealed interface SealedMediaType permits MultipartformdataMediaType {} - public static class MultipartformdataMediaType extends MediaType { + public record MultipartformdataMediaType(MultipartformdataSchema.MultipartformdataSchema1 schema) implements SealedMediaType, MediaType { public MultipartformdataMediaType() { - super(MultipartformdataSchema.MultipartformdataSchema1.getInstance()); + this(MultipartformdataSchema.MultipartformdataSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; } } - public static class RequestBody1 extends RequestBodySerializer { + public static class RequestBody1 extends RequestBodySerializer { public RequestBody1() { super( Map.ofEntries( @@ -33,26 +38,15 @@ public RequestBody1() { public SerializedRequestBody serialize(SealedRequestBody requestBody) { MultipartformdataRequestBody requestBody0 = (MultipartformdataRequestBody) requestBody; - return serialize(requestBody0.contentType(), requestBody0.body().data()); + return serialize(requestBody0.contentType(), requestBody0.body().getData()); } } - public static abstract sealed class SealedRequestBody permits MultipartformdataRequestBody {} - public static final class MultipartformdataRequestBody extends SealedRequestBody implements GenericRequestBody { - private final String contentType; - private final MultipartformdataSchema.MultipartformdataSchema1Boxed body; - public MultipartformdataRequestBody(MultipartformdataSchema.MultipartformdataSchema1Boxed body) { - contentType = "multipart/form-data"; - this.body = body; - } + public sealed interface SealedRequestBody permits MultipartformdataRequestBody {} + public record MultipartformdataRequestBody(MultipartformdataSchema.MultipartformdataSchema1Boxed body) implements SealedRequestBody, GenericRequestBody { @Override public String contentType() { - return contentType; - } - - @Override - public MultipartformdataSchema.MultipartformdataSchema1Boxed body() { - return body; + return "multipart/form-data"; } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfile/post/requestbody/content/multipartformdata/MultipartformdataSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfile/post/requestbody/content/multipartformdata/MultipartformdataSchema.java index 7175c1fc751..36009ea124b 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfile/post/requestbody/content/multipartformdata/MultipartformdataSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfile/post/requestbody/content/multipartformdata/MultipartformdataSchema.java @@ -153,23 +153,19 @@ public MultipartformdataSchemaMap0Builder getBuilderAfterMultipartformdataFile(M } - public static abstract sealed class MultipartformdataSchema1Boxed permits MultipartformdataSchema1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface MultipartformdataSchema1Boxed permits MultipartformdataSchema1BoxedMap { + @Nullable Object getData(); } - public static final class MultipartformdataSchema1BoxedMap extends MultipartformdataSchema1Boxed { - public final MultipartformdataSchemaMap data; - private MultipartformdataSchema1BoxedMap(MultipartformdataSchemaMap data) { - this.data = data; - } + public record MultipartformdataSchema1BoxedMap(MultipartformdataSchemaMap data) implements MultipartformdataSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class MultipartformdataSchema1 extends JsonSchema implements MapSchemaValidator { + public static class MultipartformdataSchema1 extends JsonSchema implements MapSchemaValidator { private static @Nullable MultipartformdataSchema1 instance = null; protected MultipartformdataSchema1() { @@ -203,11 +199,11 @@ public MultipartformdataSchemaMap getNewInstance(Map arg, List pat List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -244,6 +240,13 @@ public MultipartformdataSchemaMap validate(Map arg, SchemaConfiguration co public MultipartformdataSchema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new MultipartformdataSchema1BoxedMap(validate(arg, configuration)); } + @Override + public MultipartformdataSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfile/post/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfile/post/responses/Code200Response.java new file mode 100644 index 00000000000..eb4aeb00121 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfile/post/responses/Code200Response.java @@ -0,0 +1,54 @@ +package org.openapijsonschematools.client.paths.fakeuploadfile.post.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakeuploadfile.post.responses.code200response.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpHeaders; + +public class Code200Response { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} + public record ApplicationjsonResponseBody(ApplicationjsonSchema.ApiResponseSchema1Boxed body) implements SealedResponseBody { } + + public static class Code200Response1 extends ResponseDeserializer { + public Code200Response1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + SealedMediaType mediaType = content.get(contentType); + if (mediaType == null) { + throw new RuntimeException("Invalid contentType was received back from the server that does not exist in the openapi document"); + } + if (mediaType instanceof ApplicationjsonMediaType thisMediaType) { + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } + throw new RuntimeException("contentType="+contentType+" returned by the server is unknown and does not exist in the openapi document"); + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfile/post/responses/response200/content/applicationjson/ApplicationjsonSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfile/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java similarity index 92% rename from samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfile/post/responses/response200/content/applicationjson/ApplicationjsonSchema.java rename to samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfile/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java index 1cf13d84d64..efbbe4fc405 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfile/post/responses/response200/content/applicationjson/ApplicationjsonSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfile/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java @@ -1,4 +1,4 @@ -package org.openapijsonschematools.client.paths.fakeuploadfile.post.responses.response200.content.applicationjson; +package org.openapijsonschematools.client.paths.fakeuploadfile.post.responses.code200response.content.applicationjson; import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.components.schemas.ApiResponseSchema; diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfiles/post/RequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfiles/post/RequestBody.java index 6361c2a763a..221c62968d4 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfiles/post/RequestBody.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfiles/post/RequestBody.java @@ -6,22 +6,27 @@ import org.openapijsonschematools.client.requestbody.RequestBodySerializer; import org.openapijsonschematools.client.requestbody.GenericRequestBody; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; import org.openapijsonschematools.client.mediatype.MediaType; import org.openapijsonschematools.client.paths.fakeuploadfiles.post.requestbody.content.multipartformdata.MultipartformdataSchema; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; import java.util.AbstractMap; import java.util.Map; public class RequestBody { + public sealed interface SealedMediaType permits MultipartformdataMediaType {} - public static class MultipartformdataMediaType extends MediaType { + public record MultipartformdataMediaType(MultipartformdataSchema.MultipartformdataSchema1 schema) implements SealedMediaType, MediaType { public MultipartformdataMediaType() { - super(MultipartformdataSchema.MultipartformdataSchema1.getInstance()); + this(MultipartformdataSchema.MultipartformdataSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; } } - public static class RequestBody1 extends RequestBodySerializer { + public static class RequestBody1 extends RequestBodySerializer { public RequestBody1() { super( Map.ofEntries( @@ -33,26 +38,15 @@ public RequestBody1() { public SerializedRequestBody serialize(SealedRequestBody requestBody) { MultipartformdataRequestBody requestBody0 = (MultipartformdataRequestBody) requestBody; - return serialize(requestBody0.contentType(), requestBody0.body().data()); + return serialize(requestBody0.contentType(), requestBody0.body().getData()); } } - public static abstract sealed class SealedRequestBody permits MultipartformdataRequestBody {} - public static final class MultipartformdataRequestBody extends SealedRequestBody implements GenericRequestBody { - private final String contentType; - private final MultipartformdataSchema.MultipartformdataSchema1Boxed body; - public MultipartformdataRequestBody(MultipartformdataSchema.MultipartformdataSchema1Boxed body) { - contentType = "multipart/form-data"; - this.body = body; - } + public sealed interface SealedRequestBody permits MultipartformdataRequestBody {} + public record MultipartformdataRequestBody(MultipartformdataSchema.MultipartformdataSchema1Boxed body) implements SealedRequestBody, GenericRequestBody { @Override public String contentType() { - return contentType; - } - - @Override - public MultipartformdataSchema.MultipartformdataSchema1Boxed body() { - return body; + return "multipart/form-data"; } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfiles/post/requestbody/content/multipartformdata/MultipartformdataSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfiles/post/requestbody/content/multipartformdata/MultipartformdataSchema.java index c6fa74941e9..08b9aaee4b3 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfiles/post/requestbody/content/multipartformdata/MultipartformdataSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfiles/post/requestbody/content/multipartformdata/MultipartformdataSchema.java @@ -75,24 +75,20 @@ public List build() { } - public static abstract sealed class MultipartformdataFilesBoxed permits MultipartformdataFilesBoxedList { - public abstract @Nullable Object data(); + public sealed interface MultipartformdataFilesBoxed permits MultipartformdataFilesBoxedList { + @Nullable Object getData(); } - public static final class MultipartformdataFilesBoxedList extends MultipartformdataFilesBoxed { - public final MultipartformdataFilesList data; - private MultipartformdataFilesBoxedList(MultipartformdataFilesList data) { - this.data = data; - } + public record MultipartformdataFilesBoxedList(MultipartformdataFilesList data) implements MultipartformdataFilesBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class MultipartformdataFiles extends JsonSchema implements ListSchemaValidator { + public static class MultipartformdataFiles extends JsonSchema implements ListSchemaValidator { private static @Nullable MultipartformdataFiles instance = null; protected MultipartformdataFiles() { @@ -116,11 +112,11 @@ public MultipartformdataFilesList getNewInstance(List arg, List pathT for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof String)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -160,6 +156,13 @@ public MultipartformdataFilesList validate(List arg, SchemaConfiguration conf public MultipartformdataFilesBoxedList validateAndBox(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new MultipartformdataFilesBoxedList(validate(arg, configuration)); } + @Override + public MultipartformdataFilesBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class MultipartformdataSchemaMap extends FrozenMap<@Nullable Object> { @@ -228,23 +231,19 @@ public MultipartformdataSchemaMapBuilder getBuilderAfterAdditionalProperty(Map { + public static class MultipartformdataSchema1 extends JsonSchema implements MapSchemaValidator { private static @Nullable MultipartformdataSchema1 instance = null; protected MultipartformdataSchema1() { @@ -274,11 +273,11 @@ public MultipartformdataSchemaMap getNewInstance(Map arg, List pat List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -315,6 +314,13 @@ public MultipartformdataSchemaMap validate(Map arg, SchemaConfiguration co public MultipartformdataSchema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new MultipartformdataSchema1BoxedMap(validate(arg, configuration)); } + @Override + public MultipartformdataSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfiles/post/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfiles/post/responses/Code200Response.java new file mode 100644 index 00000000000..8b5a4469414 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfiles/post/responses/Code200Response.java @@ -0,0 +1,54 @@ +package org.openapijsonschematools.client.paths.fakeuploadfiles.post.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakeuploadfiles.post.responses.code200response.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpHeaders; + +public class Code200Response { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} + public record ApplicationjsonResponseBody(ApplicationjsonSchema.ApiResponseSchema1Boxed body) implements SealedResponseBody { } + + public static class Code200Response1 extends ResponseDeserializer { + public Code200Response1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + SealedMediaType mediaType = content.get(contentType); + if (mediaType == null) { + throw new RuntimeException("Invalid contentType was received back from the server that does not exist in the openapi document"); + } + if (mediaType instanceof ApplicationjsonMediaType thisMediaType) { + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } + throw new RuntimeException("contentType="+contentType+" returned by the server is unknown and does not exist in the openapi document"); + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfiles/post/responses/response200/content/applicationjson/ApplicationjsonSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfiles/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java similarity index 92% rename from samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfiles/post/responses/response200/content/applicationjson/ApplicationjsonSchema.java rename to samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfiles/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java index 2a8dca40c8b..df28450acdb 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfiles/post/responses/response200/content/applicationjson/ApplicationjsonSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfiles/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java @@ -1,4 +1,4 @@ -package org.openapijsonschematools.client.paths.fakeuploadfiles.post.responses.response200.content.applicationjson; +package org.openapijsonschematools.client.paths.fakeuploadfiles.post.responses.code200response.content.applicationjson; import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.components.schemas.ApiResponseSchema; diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/Code1XXResponse.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/Code1XXResponse.java new file mode 100644 index 00000000000..1035450a564 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/Code1XXResponse.java @@ -0,0 +1,54 @@ +package org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses.code1xxresponse.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpHeaders; + +public class Code1XXResponse { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} + public record ApplicationjsonResponseBody(ApplicationjsonSchema.AnyTypeJsonSchema1Boxed body) implements SealedResponseBody { } + + public static class Code1XXResponse1 extends ResponseDeserializer { + public Code1XXResponse1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + SealedMediaType mediaType = content.get(contentType); + if (mediaType == null) { + throw new RuntimeException("Invalid contentType was received back from the server that does not exist in the openapi document"); + } + if (mediaType instanceof ApplicationjsonMediaType thisMediaType) { + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } + throw new RuntimeException("contentType="+contentType+" returned by the server is unknown and does not exist in the openapi document"); + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/Code200Response.java new file mode 100644 index 00000000000..4776aca71e2 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/Code200Response.java @@ -0,0 +1,54 @@ +package org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses.code200response.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpHeaders; + +public class Code200Response { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} + public record ApplicationjsonResponseBody(ApplicationjsonSchema.AnyTypeJsonSchema1Boxed body) implements SealedResponseBody { } + + public static class Code200Response1 extends ResponseDeserializer { + public Code200Response1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + SealedMediaType mediaType = content.get(contentType); + if (mediaType == null) { + throw new RuntimeException("Invalid contentType was received back from the server that does not exist in the openapi document"); + } + if (mediaType instanceof ApplicationjsonMediaType thisMediaType) { + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } + throw new RuntimeException("contentType="+contentType+" returned by the server is unknown and does not exist in the openapi document"); + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/Code2XXResponse.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/Code2XXResponse.java new file mode 100644 index 00000000000..12796885fdb --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/Code2XXResponse.java @@ -0,0 +1,54 @@ +package org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses.code2xxresponse.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpHeaders; + +public class Code2XXResponse { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} + public record ApplicationjsonResponseBody(ApplicationjsonSchema.AnyTypeJsonSchema1Boxed body) implements SealedResponseBody { } + + public static class Code2XXResponse1 extends ResponseDeserializer { + public Code2XXResponse1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + SealedMediaType mediaType = content.get(contentType); + if (mediaType == null) { + throw new RuntimeException("Invalid contentType was received back from the server that does not exist in the openapi document"); + } + if (mediaType instanceof ApplicationjsonMediaType thisMediaType) { + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } + throw new RuntimeException("contentType="+contentType+" returned by the server is unknown and does not exist in the openapi document"); + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/Code3XXResponse.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/Code3XXResponse.java new file mode 100644 index 00000000000..420f21a011b --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/Code3XXResponse.java @@ -0,0 +1,54 @@ +package org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses.code3xxresponse.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpHeaders; + +public class Code3XXResponse { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} + public record ApplicationjsonResponseBody(ApplicationjsonSchema.AnyTypeJsonSchema1Boxed body) implements SealedResponseBody { } + + public static class Code3XXResponse1 extends ResponseDeserializer { + public Code3XXResponse1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + SealedMediaType mediaType = content.get(contentType); + if (mediaType == null) { + throw new RuntimeException("Invalid contentType was received back from the server that does not exist in the openapi document"); + } + if (mediaType instanceof ApplicationjsonMediaType thisMediaType) { + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } + throw new RuntimeException("contentType="+contentType+" returned by the server is unknown and does not exist in the openapi document"); + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/Code4XXResponse.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/Code4XXResponse.java new file mode 100644 index 00000000000..1d38967e4a8 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/Code4XXResponse.java @@ -0,0 +1,54 @@ +package org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses.code4xxresponse.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpHeaders; + +public class Code4XXResponse { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} + public record ApplicationjsonResponseBody(ApplicationjsonSchema.AnyTypeJsonSchema1Boxed body) implements SealedResponseBody { } + + public static class Code4XXResponse1 extends ResponseDeserializer { + public Code4XXResponse1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + SealedMediaType mediaType = content.get(contentType); + if (mediaType == null) { + throw new RuntimeException("Invalid contentType was received back from the server that does not exist in the openapi document"); + } + if (mediaType instanceof ApplicationjsonMediaType thisMediaType) { + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } + throw new RuntimeException("contentType="+contentType+" returned by the server is unknown and does not exist in the openapi document"); + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/Code5XXResponse.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/Code5XXResponse.java new file mode 100644 index 00000000000..645d93d6b86 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/Code5XXResponse.java @@ -0,0 +1,54 @@ +package org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses.code5xxresponse.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpHeaders; + +public class Code5XXResponse { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} + public record ApplicationjsonResponseBody(ApplicationjsonSchema.AnyTypeJsonSchema1Boxed body) implements SealedResponseBody { } + + public static class Code5XXResponse1 extends ResponseDeserializer { + public Code5XXResponse1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + SealedMediaType mediaType = content.get(contentType); + if (mediaType == null) { + throw new RuntimeException("Invalid contentType was received back from the server that does not exist in the openapi document"); + } + if (mediaType instanceof ApplicationjsonMediaType thisMediaType) { + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } + throw new RuntimeException("contentType="+contentType+" returned by the server is unknown and does not exist in the openapi document"); + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/response1xx/content/applicationjson/ApplicationjsonSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/code1xxresponse/content/applicationjson/ApplicationjsonSchema.java similarity index 92% rename from samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/response1xx/content/applicationjson/ApplicationjsonSchema.java rename to samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/code1xxresponse/content/applicationjson/ApplicationjsonSchema.java index 709f61b704d..bc6d5118003 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/response1xx/content/applicationjson/ApplicationjsonSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/code1xxresponse/content/applicationjson/ApplicationjsonSchema.java @@ -1,4 +1,4 @@ -package org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses.response1xx.content.applicationjson; +package org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses.code1xxresponse.content.applicationjson; import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/response200/content/applicationjson/ApplicationjsonSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.java similarity index 92% rename from samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/response200/content/applicationjson/ApplicationjsonSchema.java rename to samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.java index 46fd0782efb..7e12b7b922a 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/response200/content/applicationjson/ApplicationjsonSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.java @@ -1,4 +1,4 @@ -package org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses.response200.content.applicationjson; +package org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses.code200response.content.applicationjson; import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/response2xx/content/applicationjson/ApplicationjsonSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/code2xxresponse/content/applicationjson/ApplicationjsonSchema.java similarity index 92% rename from samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/response2xx/content/applicationjson/ApplicationjsonSchema.java rename to samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/code2xxresponse/content/applicationjson/ApplicationjsonSchema.java index ecd3163b3c7..a5d19b2fa85 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/response2xx/content/applicationjson/ApplicationjsonSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/code2xxresponse/content/applicationjson/ApplicationjsonSchema.java @@ -1,4 +1,4 @@ -package org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses.response2xx.content.applicationjson; +package org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses.code2xxresponse.content.applicationjson; import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/response3xx/content/applicationjson/ApplicationjsonSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/code3xxresponse/content/applicationjson/ApplicationjsonSchema.java similarity index 92% rename from samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/response3xx/content/applicationjson/ApplicationjsonSchema.java rename to samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/code3xxresponse/content/applicationjson/ApplicationjsonSchema.java index f57172c4538..3b4a18033e7 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/response3xx/content/applicationjson/ApplicationjsonSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/code3xxresponse/content/applicationjson/ApplicationjsonSchema.java @@ -1,4 +1,4 @@ -package org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses.response3xx.content.applicationjson; +package org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses.code3xxresponse.content.applicationjson; import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/code4xxresponse/content/applicationjson/ApplicationjsonSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/code4xxresponse/content/applicationjson/ApplicationjsonSchema.java new file mode 100644 index 00000000000..346bbf338f9 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/code4xxresponse/content/applicationjson/ApplicationjsonSchema.java @@ -0,0 +1,19 @@ +package org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses.code4xxresponse.content.applicationjson; +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; + +public class ApplicationjsonSchema extends AnyTypeJsonSchema { + // nest classes so all schemas and input/output classes can be public + + + public static class ApplicationjsonSchema1 extends AnyTypeJsonSchema.AnyTypeJsonSchema1 { + private static @Nullable ApplicationjsonSchema1 instance = null; + public static ApplicationjsonSchema1 getInstance() { + if (instance == null) { + instance = new ApplicationjsonSchema1(); + } + return instance; + } + } + +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/code5xxresponse/content/applicationjson/ApplicationjsonSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/code5xxresponse/content/applicationjson/ApplicationjsonSchema.java new file mode 100644 index 00000000000..6b9394e4858 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/code5xxresponse/content/applicationjson/ApplicationjsonSchema.java @@ -0,0 +1,19 @@ +package org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses.code5xxresponse.content.applicationjson; +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; + +public class ApplicationjsonSchema extends AnyTypeJsonSchema { + // nest classes so all schemas and input/output classes can be public + + + public static class ApplicationjsonSchema1 extends AnyTypeJsonSchema.AnyTypeJsonSchema1 { + private static @Nullable ApplicationjsonSchema1 instance = null; + public static ApplicationjsonSchema1 getInstance() { + if (instance == null) { + instance = new ApplicationjsonSchema1(); + } + return instance; + } + } + +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/response4xx/content/applicationjson/ApplicationjsonSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/response4xx/content/applicationjson/ApplicationjsonSchema.java deleted file mode 100644 index 5104a0858a3..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/response4xx/content/applicationjson/ApplicationjsonSchema.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses.response4xx.content.applicationjson; -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; - -public class ApplicationjsonSchema extends AnyTypeJsonSchema { - // nest classes so all schemas and input/output classes can be public - - - public static class ApplicationjsonSchema1 extends AnyTypeJsonSchema.AnyTypeJsonSchema1 { - private static @Nullable ApplicationjsonSchema1 instance = null; - public static ApplicationjsonSchema1 getInstance() { - if (instance == null) { - instance = new ApplicationjsonSchema1(); - } - return instance; - } - } - -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/response5xx/content/applicationjson/ApplicationjsonSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/response5xx/content/applicationjson/ApplicationjsonSchema.java deleted file mode 100644 index e5b1fafe997..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/response5xx/content/applicationjson/ApplicationjsonSchema.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses.response5xx.content.applicationjson; -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; - -public class ApplicationjsonSchema extends AnyTypeJsonSchema { - // nest classes so all schemas and input/output classes can be public - - - public static class ApplicationjsonSchema1 extends AnyTypeJsonSchema.AnyTypeJsonSchema1 { - private static @Nullable ApplicationjsonSchema1 instance = null; - public static ApplicationjsonSchema1 getInstance() { - if (instance == null) { - instance = new ApplicationjsonSchema1(); - } - return instance; - } - } - -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/foo/get/responses/CodedefaultResponse.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/foo/get/responses/CodedefaultResponse.java new file mode 100644 index 00000000000..4cb012e1f53 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/foo/get/responses/CodedefaultResponse.java @@ -0,0 +1,54 @@ +package org.openapijsonschematools.client.paths.foo.get.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.foo.get.responses.codedefaultresponse.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpHeaders; + +public class CodedefaultResponse { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} + public record ApplicationjsonResponseBody(ApplicationjsonSchema.ApplicationjsonSchema1Boxed body) implements SealedResponseBody { } + + public static class CodedefaultResponse1 extends ResponseDeserializer { + public CodedefaultResponse1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + SealedMediaType mediaType = content.get(contentType); + if (mediaType == null) { + throw new RuntimeException("Invalid contentType was received back from the server that does not exist in the openapi document"); + } + if (mediaType instanceof ApplicationjsonMediaType thisMediaType) { + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } + throw new RuntimeException("contentType="+contentType+" returned by the server is unknown and does not exist in the openapi document"); + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/foo/get/responses/responsedefault/content/applicationjson/ApplicationjsonSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/foo/get/responses/codedefaultresponse/content/applicationjson/ApplicationjsonSchema.java similarity index 88% rename from samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/foo/get/responses/responsedefault/content/applicationjson/ApplicationjsonSchema.java rename to samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/foo/get/responses/codedefaultresponse/content/applicationjson/ApplicationjsonSchema.java index 6c6baa8bd0e..8e89dece1b4 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/foo/get/responses/responsedefault/content/applicationjson/ApplicationjsonSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/foo/get/responses/codedefaultresponse/content/applicationjson/ApplicationjsonSchema.java @@ -1,4 +1,4 @@ -package org.openapijsonschematools.client.paths.foo.get.responses.responsedefault.content.applicationjson; +package org.openapijsonschematools.client.paths.foo.get.responses.codedefaultresponse.content.applicationjson; import java.util.ArrayList; import java.util.HashSet; import java.util.LinkedHashMap; @@ -85,23 +85,19 @@ public ApplicationjsonSchemaMapBuilder getBuilderAfterAdditionalProperty(Map { + public static class ApplicationjsonSchema1 extends JsonSchema implements MapSchemaValidator { private static @Nullable ApplicationjsonSchema1 instance = null; protected ApplicationjsonSchema1() { @@ -131,11 +127,11 @@ public ApplicationjsonSchemaMap getNewInstance(Map arg, List pathT List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -172,6 +168,13 @@ public ApplicationjsonSchemaMap validate(Map arg, SchemaConfiguration conf public ApplicationjsonSchema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ApplicationjsonSchema1BoxedMap(validate(arg, configuration)); } + @Override + public ApplicationjsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/foo/get/servers/server1/Variables.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/foo/get/servers/server1/Variables.java index 6b1a5f90595..58d5f36188c 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/foo/get/servers/server1/Variables.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/foo/get/servers/server1/Variables.java @@ -59,24 +59,20 @@ public String value() { } - public static abstract sealed class VersionBoxed permits VersionBoxedString { - public abstract @Nullable Object data(); + public sealed interface VersionBoxed permits VersionBoxedString { + @Nullable Object getData(); } - public static final class VersionBoxedString extends VersionBoxed { - public final String data; - private VersionBoxedString(String data) { - this.data = data; - } + public record VersionBoxedString(String data) implements VersionBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Version extends JsonSchema implements StringSchemaValidator, StringEnumValidator, DefaultValueMethod { + public static class Version extends JsonSchema implements StringSchemaValidator, StringEnumValidator, DefaultValueMethod { private static @Nullable Version instance = null; protected Version() { @@ -139,6 +135,13 @@ public String defaultValue() { public VersionBoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new VersionBoxedString(validate(arg, configuration)); } + @Override + public VersionBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class VariablesMap extends FrozenMap { @@ -205,23 +208,19 @@ public VariablesMap0Builder getBuilderAfterVersion(Map instance) } - public static abstract sealed class Variables1Boxed permits Variables1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Variables1Boxed permits Variables1BoxedMap { + @Nullable Object getData(); } - public static final class Variables1BoxedMap extends Variables1Boxed { - public final VariablesMap data; - private Variables1BoxedMap(VariablesMap data) { - this.data = data; - } + public record Variables1BoxedMap(VariablesMap data) implements Variables1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Variables1 extends JsonSchema implements MapSchemaValidator { + public static class Variables1 extends JsonSchema implements MapSchemaValidator { private static @Nullable Variables1 instance = null; protected Variables1() { @@ -255,11 +254,11 @@ public VariablesMap getNewInstance(Map arg, List pathToItem, PathT List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof String)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -299,6 +298,13 @@ public VariablesMap validate(Map arg, SchemaConfiguration configuration) t public Variables1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Variables1BoxedMap(validate(arg, configuration)); } + @Override + public Variables1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/post/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/post/responses/Code200Response.java new file mode 100644 index 00000000000..77a882b268d --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/post/responses/Code200Response.java @@ -0,0 +1,7 @@ +package org.openapijsonschematools.client.paths.pet.post.responses; + +import org.openapijsonschematools.client.components.responses.SuccessDescriptionOnly; + +public class Code200Response extends SuccessDescriptionOnly { + public static class Code200Response1 extends SuccessDescriptionOnly1 {} +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/post/responses/Code405Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/post/responses/Code405Response.java new file mode 100644 index 00000000000..28b861d4339 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/post/responses/Code405Response.java @@ -0,0 +1,30 @@ +package org.openapijsonschematools.client.paths.pet.post.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.schemas.validation.MapUtils; + +import java.util.Map; +import java.net.http.HttpHeaders; + +public class Code405Response { + + public static class Code405Response1 extends ResponseDeserializer { + public Code405Response1() { + super( + MapUtils.makeMap( + ) + ); + } + + @Override + protected Void getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + return null; + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/put/responses/Code400Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/put/responses/Code400Response.java new file mode 100644 index 00000000000..43a665f0c19 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/put/responses/Code400Response.java @@ -0,0 +1,30 @@ +package org.openapijsonschematools.client.paths.pet.put.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.schemas.validation.MapUtils; + +import java.util.Map; +import java.net.http.HttpHeaders; + +public class Code400Response { + + public static class Code400Response1 extends ResponseDeserializer { + public Code400Response1() { + super( + MapUtils.makeMap( + ) + ); + } + + @Override + protected Void getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + return null; + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/put/responses/Code404Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/put/responses/Code404Response.java new file mode 100644 index 00000000000..c98a92007c7 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/put/responses/Code404Response.java @@ -0,0 +1,30 @@ +package org.openapijsonschematools.client.paths.pet.put.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.schemas.validation.MapUtils; + +import java.util.Map; +import java.net.http.HttpHeaders; + +public class Code404Response { + + public static class Code404Response1 extends ResponseDeserializer { + public Code404Response1() { + super( + MapUtils.makeMap( + ) + ); + } + + @Override + protected Void getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + return null; + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/put/responses/Code405Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/put/responses/Code405Response.java new file mode 100644 index 00000000000..ea308bdc6b2 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/put/responses/Code405Response.java @@ -0,0 +1,30 @@ +package org.openapijsonschematools.client.paths.pet.put.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.schemas.validation.MapUtils; + +import java.util.Map; +import java.net.http.HttpHeaders; + +public class Code405Response { + + public static class Code405Response1 extends ResponseDeserializer { + public Code405Response1() { + super( + MapUtils.makeMap( + ) + ); + } + + @Override + protected Void getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + return null; + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/get/QueryParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/get/QueryParameters.java index a5c9e3e092a..7ce798858e4 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/get/QueryParameters.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/get/QueryParameters.java @@ -101,23 +101,19 @@ public QueryParametersMap0Builder getBuilderAfterStatus(Map } - public static abstract sealed class QueryParameters1Boxed permits QueryParameters1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface QueryParameters1Boxed permits QueryParameters1BoxedMap { + @Nullable Object getData(); } - public static final class QueryParameters1BoxedMap extends QueryParameters1Boxed { - public final QueryParametersMap data; - private QueryParameters1BoxedMap(QueryParametersMap data) { - this.data = data; - } + public record QueryParameters1BoxedMap(QueryParametersMap data) implements QueryParameters1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class QueryParameters1 extends JsonSchema implements MapSchemaValidator { + public static class QueryParameters1 extends JsonSchema implements MapSchemaValidator { private static @Nullable QueryParameters1 instance = null; protected QueryParameters1() { @@ -151,11 +147,11 @@ public QueryParametersMap getNewInstance(Map arg, List pathToItem, List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Schema0.SchemaList0)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -195,6 +191,13 @@ public QueryParametersMap validate(Map arg, SchemaConfiguration configurat public QueryParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new QueryParameters1BoxedMap(validate(arg, configuration)); } + @Override + public QueryParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/get/parameters/parameter0/Schema0.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/get/parameters/parameter0/Schema0.java index d35e2ff93e5..5594071aee6 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/get/parameters/parameter0/Schema0.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/get/parameters/parameter0/Schema0.java @@ -41,24 +41,20 @@ public String value() { } - public static abstract sealed class Items0Boxed permits Items0BoxedString { - public abstract @Nullable Object data(); + public sealed interface Items0Boxed permits Items0BoxedString { + @Nullable Object getData(); } - public static final class Items0BoxedString extends Items0Boxed { - public final String data; - private Items0BoxedString(String data) { - this.data = data; - } + public record Items0BoxedString(String data) implements Items0Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Items0 extends JsonSchema implements StringSchemaValidator, StringEnumValidator, DefaultValueMethod { + public static class Items0 extends JsonSchema implements StringSchemaValidator, StringEnumValidator, DefaultValueMethod { private static @Nullable Items0 instance = null; protected Items0() { @@ -122,6 +118,13 @@ public String defaultValue() { public Items0BoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Items0BoxedString(validate(arg, configuration)); } + @Override + public Items0Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class SchemaList0 extends FrozenList { @@ -161,24 +164,20 @@ public List build() { } - public static abstract sealed class Schema01Boxed permits Schema01BoxedList { - public abstract @Nullable Object data(); + public sealed interface Schema01Boxed permits Schema01BoxedList { + @Nullable Object getData(); } - public static final class Schema01BoxedList extends Schema01Boxed { - public final SchemaList0 data; - private Schema01BoxedList(SchemaList0 data) { - this.data = data; - } + public record Schema01BoxedList(SchemaList0 data) implements Schema01Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema01 extends JsonSchema implements ListSchemaValidator { + public static class Schema01 extends JsonSchema implements ListSchemaValidator { private static @Nullable Schema01 instance = null; protected Schema01() { @@ -202,11 +201,11 @@ public SchemaList0 getNewInstance(List arg, List pathToItem, PathToSc for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof String)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -246,5 +245,12 @@ public SchemaList0 validate(List arg, SchemaConfiguration configuration) thro public Schema01BoxedList validateAndBox(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema01BoxedList(validate(arg, configuration)); } + @Override + public Schema01Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/get/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/get/responses/Code200Response.java new file mode 100644 index 00000000000..0bfcce006b9 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/get/responses/Code200Response.java @@ -0,0 +1,7 @@ +package org.openapijsonschematools.client.paths.petfindbystatus.get.responses; + +import org.openapijsonschematools.client.components.responses.SuccessfulXmlAndJsonArrayOfPet; + +public class Code200Response extends SuccessfulXmlAndJsonArrayOfPet { + public static class Code200Response1 extends SuccessfulXmlAndJsonArrayOfPet1 {} +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/get/responses/Code400Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/get/responses/Code400Response.java new file mode 100644 index 00000000000..789af3ed96f --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/get/responses/Code400Response.java @@ -0,0 +1,30 @@ +package org.openapijsonschematools.client.paths.petfindbystatus.get.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.schemas.validation.MapUtils; + +import java.util.Map; +import java.net.http.HttpHeaders; + +public class Code400Response { + + public static class Code400Response1 extends ResponseDeserializer { + public Code400Response1() { + super( + MapUtils.makeMap( + ) + ); + } + + @Override + protected Void getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + return null; + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/servers/server1/Variables.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/servers/server1/Variables.java index 2efe9b4bf04..e622b7ac02a 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/servers/server1/Variables.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/servers/server1/Variables.java @@ -59,24 +59,20 @@ public String value() { } - public static abstract sealed class VersionBoxed permits VersionBoxedString { - public abstract @Nullable Object data(); + public sealed interface VersionBoxed permits VersionBoxedString { + @Nullable Object getData(); } - public static final class VersionBoxedString extends VersionBoxed { - public final String data; - private VersionBoxedString(String data) { - this.data = data; - } + public record VersionBoxedString(String data) implements VersionBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Version extends JsonSchema implements StringSchemaValidator, StringEnumValidator, DefaultValueMethod { + public static class Version extends JsonSchema implements StringSchemaValidator, StringEnumValidator, DefaultValueMethod { private static @Nullable Version instance = null; protected Version() { @@ -139,6 +135,13 @@ public String defaultValue() { public VersionBoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new VersionBoxedString(validate(arg, configuration)); } + @Override + public VersionBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class VariablesMap extends FrozenMap { @@ -205,23 +208,19 @@ public VariablesMap0Builder getBuilderAfterVersion(Map instance) } - public static abstract sealed class Variables1Boxed permits Variables1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Variables1Boxed permits Variables1BoxedMap { + @Nullable Object getData(); } - public static final class Variables1BoxedMap extends Variables1Boxed { - public final VariablesMap data; - private Variables1BoxedMap(VariablesMap data) { - this.data = data; - } + public record Variables1BoxedMap(VariablesMap data) implements Variables1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Variables1 extends JsonSchema implements MapSchemaValidator { + public static class Variables1 extends JsonSchema implements MapSchemaValidator { private static @Nullable Variables1 instance = null; protected Variables1() { @@ -255,11 +254,11 @@ public VariablesMap getNewInstance(Map arg, List pathToItem, PathT List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof String)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -299,6 +298,13 @@ public VariablesMap validate(Map arg, SchemaConfiguration configuration) t public Variables1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Variables1BoxedMap(validate(arg, configuration)); } + @Override + public Variables1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbytags/get/QueryParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbytags/get/QueryParameters.java index ff64f7038e4..c4ef93d3f01 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbytags/get/QueryParameters.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbytags/get/QueryParameters.java @@ -101,23 +101,19 @@ public QueryParametersMap0Builder getBuilderAfterTags(Map> } - public static abstract sealed class QueryParameters1Boxed permits QueryParameters1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface QueryParameters1Boxed permits QueryParameters1BoxedMap { + @Nullable Object getData(); } - public static final class QueryParameters1BoxedMap extends QueryParameters1Boxed { - public final QueryParametersMap data; - private QueryParameters1BoxedMap(QueryParametersMap data) { - this.data = data; - } + public record QueryParameters1BoxedMap(QueryParametersMap data) implements QueryParameters1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class QueryParameters1 extends JsonSchema implements MapSchemaValidator { + public static class QueryParameters1 extends JsonSchema implements MapSchemaValidator { private static @Nullable QueryParameters1 instance = null; protected QueryParameters1() { @@ -151,11 +147,11 @@ public QueryParametersMap getNewInstance(Map arg, List pathToItem, List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Schema0.SchemaList0)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -195,6 +191,13 @@ public QueryParametersMap validate(Map arg, SchemaConfiguration configurat public QueryParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new QueryParameters1BoxedMap(validate(arg, configuration)); } + @Override + public QueryParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbytags/get/parameters/parameter0/Schema0.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbytags/get/parameters/parameter0/Schema0.java index 28f0533af08..1660a363a63 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbytags/get/parameters/parameter0/Schema0.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbytags/get/parameters/parameter0/Schema0.java @@ -66,24 +66,20 @@ public List build() { } - public static abstract sealed class Schema01Boxed permits Schema01BoxedList { - public abstract @Nullable Object data(); + public sealed interface Schema01Boxed permits Schema01BoxedList { + @Nullable Object getData(); } - public static final class Schema01BoxedList extends Schema01Boxed { - public final SchemaList0 data; - private Schema01BoxedList(SchemaList0 data) { - this.data = data; - } + public record Schema01BoxedList(SchemaList0 data) implements Schema01Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema01 extends JsonSchema implements ListSchemaValidator { + public static class Schema01 extends JsonSchema implements ListSchemaValidator { private static @Nullable Schema01 instance = null; protected Schema01() { @@ -107,11 +103,11 @@ public SchemaList0 getNewInstance(List arg, List pathToItem, PathToSc for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(itemInstance instanceof String)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -151,5 +147,12 @@ public SchemaList0 validate(List arg, SchemaConfiguration configuration) thro public Schema01BoxedList validateAndBox(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema01BoxedList(validate(arg, configuration)); } + @Override + public Schema01Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbytags/get/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbytags/get/responses/Code200Response.java new file mode 100644 index 00000000000..ab2690f07ef --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbytags/get/responses/Code200Response.java @@ -0,0 +1,7 @@ +package org.openapijsonschematools.client.paths.petfindbytags.get.responses; + +import org.openapijsonschematools.client.components.responses.RefSuccessfulXmlAndJsonArrayOfPet; + +public class Code200Response extends RefSuccessfulXmlAndJsonArrayOfPet { + public static class Code200Response1 extends RefSuccessfulXmlAndJsonArrayOfPet1 {} +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbytags/get/responses/Code400Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbytags/get/responses/Code400Response.java new file mode 100644 index 00000000000..e1e47e9b91e --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbytags/get/responses/Code400Response.java @@ -0,0 +1,30 @@ +package org.openapijsonschematools.client.paths.petfindbytags.get.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.schemas.validation.MapUtils; + +import java.util.Map; +import java.net.http.HttpHeaders; + +public class Code400Response { + + public static class Code400Response1 extends ResponseDeserializer { + public Code400Response1() { + super( + MapUtils.makeMap( + ) + ); + } + + @Override + protected Void getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + return null; + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/delete/HeaderParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/delete/HeaderParameters.java index ddfc02fcaf8..e35183de207 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/delete/HeaderParameters.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/delete/HeaderParameters.java @@ -93,23 +93,19 @@ public HeaderParametersMapBuilder getBuilderAfterApiKey(Map inst } - public static abstract sealed class HeaderParameters1Boxed permits HeaderParameters1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface HeaderParameters1Boxed permits HeaderParameters1BoxedMap { + @Nullable Object getData(); } - public static final class HeaderParameters1BoxedMap extends HeaderParameters1Boxed { - public final HeaderParametersMap data; - private HeaderParameters1BoxedMap(HeaderParametersMap data) { - this.data = data; - } + public record HeaderParameters1BoxedMap(HeaderParametersMap data) implements HeaderParameters1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class HeaderParameters1 extends JsonSchema implements MapSchemaValidator { + public static class HeaderParameters1 extends JsonSchema implements MapSchemaValidator { private static @Nullable HeaderParameters1 instance = null; protected HeaderParameters1() { @@ -140,11 +136,11 @@ public HeaderParametersMap getNewInstance(Map arg, List pathToItem List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof String)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -184,6 +180,13 @@ public HeaderParametersMap validate(Map arg, SchemaConfiguration configura public HeaderParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new HeaderParameters1BoxedMap(validate(arg, configuration)); } + @Override + public HeaderParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/delete/PathParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/delete/PathParameters.java index a1779cef068..59fe1814cc8 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/delete/PathParameters.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/delete/PathParameters.java @@ -118,23 +118,19 @@ public PathParametersMap0Builder getBuilderAfterPetId(Map instan } - public static abstract sealed class PathParameters1Boxed permits PathParameters1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface PathParameters1Boxed permits PathParameters1BoxedMap { + @Nullable Object getData(); } - public static final class PathParameters1BoxedMap extends PathParameters1Boxed { - public final PathParametersMap data; - private PathParameters1BoxedMap(PathParametersMap data) { - this.data = data; - } + public record PathParameters1BoxedMap(PathParametersMap data) implements PathParameters1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class PathParameters1 extends JsonSchema implements MapSchemaValidator { + public static class PathParameters1 extends JsonSchema implements MapSchemaValidator { private static @Nullable PathParameters1 instance = null; protected PathParameters1() { @@ -168,11 +164,11 @@ public PathParametersMap getNewInstance(Map arg, List pathToItem, List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Number)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -212,6 +208,13 @@ public PathParametersMap validate(Map arg, SchemaConfiguration configurati public PathParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new PathParameters1BoxedMap(validate(arg, configuration)); } + @Override + public PathParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/delete/responses/Code400Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/delete/responses/Code400Response.java new file mode 100644 index 00000000000..2fcdf10dd22 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/delete/responses/Code400Response.java @@ -0,0 +1,30 @@ +package org.openapijsonschematools.client.paths.petpetid.delete.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.schemas.validation.MapUtils; + +import java.util.Map; +import java.net.http.HttpHeaders; + +public class Code400Response { + + public static class Code400Response1 extends ResponseDeserializer { + public Code400Response1() { + super( + MapUtils.makeMap( + ) + ); + } + + @Override + protected Void getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + return null; + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/get/PathParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/get/PathParameters.java index 996d86639b4..d6dc72541d6 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/get/PathParameters.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/get/PathParameters.java @@ -118,23 +118,19 @@ public PathParametersMap0Builder getBuilderAfterPetId(Map instan } - public static abstract sealed class PathParameters1Boxed permits PathParameters1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface PathParameters1Boxed permits PathParameters1BoxedMap { + @Nullable Object getData(); } - public static final class PathParameters1BoxedMap extends PathParameters1Boxed { - public final PathParametersMap data; - private PathParameters1BoxedMap(PathParametersMap data) { - this.data = data; - } + public record PathParameters1BoxedMap(PathParametersMap data) implements PathParameters1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class PathParameters1 extends JsonSchema implements MapSchemaValidator { + public static class PathParameters1 extends JsonSchema implements MapSchemaValidator { private static @Nullable PathParameters1 instance = null; protected PathParameters1() { @@ -168,11 +164,11 @@ public PathParametersMap getNewInstance(Map arg, List pathToItem, List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Number)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -212,6 +208,13 @@ public PathParametersMap validate(Map arg, SchemaConfiguration configurati public PathParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new PathParameters1BoxedMap(validate(arg, configuration)); } + @Override + public PathParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/get/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/get/responses/Code200Response.java new file mode 100644 index 00000000000..41cbf8b5a5c --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/get/responses/Code200Response.java @@ -0,0 +1,70 @@ +package org.openapijsonschematools.client.paths.petpetid.get.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.petpetid.get.responses.code200response.content.applicationxml.ApplicationxmlSchema; +import org.openapijsonschematools.client.paths.petpetid.get.responses.code200response.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpHeaders; + +public class Code200Response { + public sealed interface SealedMediaType permits ApplicationxmlMediaType, ApplicationjsonMediaType {} + + public record ApplicationxmlMediaType(ApplicationxmlSchema.ApplicationxmlSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationxmlMediaType() { + this(ApplicationxmlSchema.ApplicationxmlSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationxmlResponseBody, ApplicationjsonResponseBody {} + public record ApplicationxmlResponseBody(ApplicationxmlSchema.Pet1Boxed body) implements SealedResponseBody { } + public record ApplicationjsonResponseBody(ApplicationjsonSchema.Pet1Boxed body) implements SealedResponseBody { } + + public static class Code200Response1 extends ResponseDeserializer { + public Code200Response1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/xml", new ApplicationxmlMediaType()), + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + SealedMediaType mediaType = content.get(contentType); + if (mediaType == null) { + throw new RuntimeException("Invalid contentType was received back from the server that does not exist in the openapi document"); + } + if (mediaType instanceof ApplicationxmlMediaType thisMediaType) { + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationxmlResponseBody(deserializedBody); + } else if (mediaType instanceof ApplicationjsonMediaType thisMediaType) { + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } + throw new RuntimeException("contentType="+contentType+" returned by the server is unknown and does not exist in the openapi document"); + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/get/responses/Code400Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/get/responses/Code400Response.java new file mode 100644 index 00000000000..5d2a50f0154 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/get/responses/Code400Response.java @@ -0,0 +1,30 @@ +package org.openapijsonschematools.client.paths.petpetid.get.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.schemas.validation.MapUtils; + +import java.util.Map; +import java.net.http.HttpHeaders; + +public class Code400Response { + + public static class Code400Response1 extends ResponseDeserializer { + public Code400Response1() { + super( + MapUtils.makeMap( + ) + ); + } + + @Override + protected Void getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + return null; + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/get/responses/Code404Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/get/responses/Code404Response.java new file mode 100644 index 00000000000..0797e7c8fa9 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/get/responses/Code404Response.java @@ -0,0 +1,30 @@ +package org.openapijsonschematools.client.paths.petpetid.get.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.schemas.validation.MapUtils; + +import java.util.Map; +import java.net.http.HttpHeaders; + +public class Code404Response { + + public static class Code404Response1 extends ResponseDeserializer { + public Code404Response1() { + super( + MapUtils.makeMap( + ) + ); + } + + @Override + protected Void getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + return null; + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/get/responses/response200/content/applicationjson/ApplicationjsonSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.java similarity index 93% rename from samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/get/responses/response200/content/applicationjson/ApplicationjsonSchema.java rename to samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.java index 0fdd18baa36..1409b9ae6dd 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/get/responses/response200/content/applicationjson/ApplicationjsonSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.java @@ -1,4 +1,4 @@ -package org.openapijsonschematools.client.paths.petpetid.get.responses.response200.content.applicationjson; +package org.openapijsonschematools.client.paths.petpetid.get.responses.code200response.content.applicationjson; import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.components.schemas.Pet; diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/get/responses/response200/content/applicationxml/ApplicationxmlSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/get/responses/code200response/content/applicationxml/ApplicationxmlSchema.java similarity index 92% rename from samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/get/responses/response200/content/applicationxml/ApplicationxmlSchema.java rename to samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/get/responses/code200response/content/applicationxml/ApplicationxmlSchema.java index 61e624f5cf6..2c49b59c0e5 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/get/responses/response200/content/applicationxml/ApplicationxmlSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/get/responses/code200response/content/applicationxml/ApplicationxmlSchema.java @@ -1,4 +1,4 @@ -package org.openapijsonschematools.client.paths.petpetid.get.responses.response200.content.applicationxml; +package org.openapijsonschematools.client.paths.petpetid.get.responses.code200response.content.applicationxml; import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.components.schemas.Pet; diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/post/PathParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/post/PathParameters.java index 6a66cae2b52..8b31aa07e75 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/post/PathParameters.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/post/PathParameters.java @@ -118,23 +118,19 @@ public PathParametersMap0Builder getBuilderAfterPetId(Map instan } - public static abstract sealed class PathParameters1Boxed permits PathParameters1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface PathParameters1Boxed permits PathParameters1BoxedMap { + @Nullable Object getData(); } - public static final class PathParameters1BoxedMap extends PathParameters1Boxed { - public final PathParametersMap data; - private PathParameters1BoxedMap(PathParametersMap data) { - this.data = data; - } + public record PathParameters1BoxedMap(PathParametersMap data) implements PathParameters1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class PathParameters1 extends JsonSchema implements MapSchemaValidator { + public static class PathParameters1 extends JsonSchema implements MapSchemaValidator { private static @Nullable PathParameters1 instance = null; protected PathParameters1() { @@ -168,11 +164,11 @@ public PathParametersMap getNewInstance(Map arg, List pathToItem, List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Number)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -212,6 +208,13 @@ public PathParametersMap validate(Map arg, SchemaConfiguration configurati public PathParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new PathParameters1BoxedMap(validate(arg, configuration)); } + @Override + public PathParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/post/RequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/post/RequestBody.java index 04f5f296b2a..bcfe59527bb 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/post/RequestBody.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/post/RequestBody.java @@ -6,22 +6,27 @@ import org.openapijsonschematools.client.requestbody.RequestBodySerializer; import org.openapijsonschematools.client.requestbody.GenericRequestBody; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; import org.openapijsonschematools.client.mediatype.MediaType; import org.openapijsonschematools.client.paths.petpetid.post.requestbody.content.applicationxwwwformurlencoded.ApplicationxwwwformurlencodedSchema; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; import java.util.AbstractMap; import java.util.Map; public class RequestBody { + public sealed interface SealedMediaType permits ApplicationxwwwformurlencodedMediaType {} - public static class ApplicationxwwwformurlencodedMediaType extends MediaType { + public record ApplicationxwwwformurlencodedMediaType(ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1 schema) implements SealedMediaType, MediaType { public ApplicationxwwwformurlencodedMediaType() { - super(ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1.getInstance()); + this(ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; } } - public static class RequestBody1 extends RequestBodySerializer { + public static class RequestBody1 extends RequestBodySerializer { public RequestBody1() { super( Map.ofEntries( @@ -33,26 +38,15 @@ public RequestBody1() { public SerializedRequestBody serialize(SealedRequestBody requestBody) { ApplicationxwwwformurlencodedRequestBody requestBody0 = (ApplicationxwwwformurlencodedRequestBody) requestBody; - return serialize(requestBody0.contentType(), requestBody0.body().data()); + return serialize(requestBody0.contentType(), requestBody0.body().getData()); } } - public static abstract sealed class SealedRequestBody permits ApplicationxwwwformurlencodedRequestBody {} - public static final class ApplicationxwwwformurlencodedRequestBody extends SealedRequestBody implements GenericRequestBody { - private final String contentType; - private final ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1Boxed body; - public ApplicationxwwwformurlencodedRequestBody(ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1Boxed body) { - contentType = "application/x-www-form-urlencoded"; - this.body = body; - } + public sealed interface SealedRequestBody permits ApplicationxwwwformurlencodedRequestBody {} + public record ApplicationxwwwformurlencodedRequestBody(ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1Boxed body) implements SealedRequestBody, GenericRequestBody { @Override public String contentType() { - return contentType; - } - - @Override - public ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1Boxed body() { - return body; + return "application/x-www-form-urlencoded"; } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/post/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/post/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.java index 0a75c293704..0d9bbc0816a 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/post/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/post/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.java @@ -143,23 +143,19 @@ public ApplicationxwwwformurlencodedSchemaMapBuilder getBuilderAfterAdditionalPr } - public static abstract sealed class ApplicationxwwwformurlencodedSchema1Boxed permits ApplicationxwwwformurlencodedSchema1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface ApplicationxwwwformurlencodedSchema1Boxed permits ApplicationxwwwformurlencodedSchema1BoxedMap { + @Nullable Object getData(); } - public static final class ApplicationxwwwformurlencodedSchema1BoxedMap extends ApplicationxwwwformurlencodedSchema1Boxed { - public final ApplicationxwwwformurlencodedSchemaMap data; - private ApplicationxwwwformurlencodedSchema1BoxedMap(ApplicationxwwwformurlencodedSchemaMap data) { - this.data = data; - } + public record ApplicationxwwwformurlencodedSchema1BoxedMap(ApplicationxwwwformurlencodedSchemaMap data) implements ApplicationxwwwformurlencodedSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ApplicationxwwwformurlencodedSchema1 extends JsonSchema implements MapSchemaValidator { + public static class ApplicationxwwwformurlencodedSchema1 extends JsonSchema implements MapSchemaValidator { private static @Nullable ApplicationxwwwformurlencodedSchema1 instance = null; protected ApplicationxwwwformurlencodedSchema1() { @@ -190,11 +186,11 @@ public ApplicationxwwwformurlencodedSchemaMap getNewInstance(Map arg, List List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -231,6 +227,13 @@ public ApplicationxwwwformurlencodedSchemaMap validate(Map arg, SchemaConf public ApplicationxwwwformurlencodedSchema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ApplicationxwwwformurlencodedSchema1BoxedMap(validate(arg, configuration)); } + @Override + public ApplicationxwwwformurlencodedSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/post/responses/Code405Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/post/responses/Code405Response.java new file mode 100644 index 00000000000..e4d93dc02b9 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/post/responses/Code405Response.java @@ -0,0 +1,30 @@ +package org.openapijsonschematools.client.paths.petpetid.post.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.schemas.validation.MapUtils; + +import java.util.Map; +import java.net.http.HttpHeaders; + +public class Code405Response { + + public static class Code405Response1 extends ResponseDeserializer { + public Code405Response1() { + super( + MapUtils.makeMap( + ) + ); + } + + @Override + protected Void getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + return null; + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetiduploadimage/post/PathParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetiduploadimage/post/PathParameters.java index 77c69fc2f6a..8621fb63da8 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetiduploadimage/post/PathParameters.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetiduploadimage/post/PathParameters.java @@ -118,23 +118,19 @@ public PathParametersMap0Builder getBuilderAfterPetId(Map instan } - public static abstract sealed class PathParameters1Boxed permits PathParameters1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface PathParameters1Boxed permits PathParameters1BoxedMap { + @Nullable Object getData(); } - public static final class PathParameters1BoxedMap extends PathParameters1Boxed { - public final PathParametersMap data; - private PathParameters1BoxedMap(PathParametersMap data) { - this.data = data; - } + public record PathParameters1BoxedMap(PathParametersMap data) implements PathParameters1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class PathParameters1 extends JsonSchema implements MapSchemaValidator { + public static class PathParameters1 extends JsonSchema implements MapSchemaValidator { private static @Nullable PathParameters1 instance = null; protected PathParameters1() { @@ -168,11 +164,11 @@ public PathParametersMap getNewInstance(Map arg, List pathToItem, List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Number)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -212,6 +208,13 @@ public PathParametersMap validate(Map arg, SchemaConfiguration configurati public PathParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new PathParameters1BoxedMap(validate(arg, configuration)); } + @Override + public PathParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetiduploadimage/post/RequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetiduploadimage/post/RequestBody.java index 880f1b7db53..8fd7c0f6302 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetiduploadimage/post/RequestBody.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetiduploadimage/post/RequestBody.java @@ -6,22 +6,27 @@ import org.openapijsonschematools.client.requestbody.RequestBodySerializer; import org.openapijsonschematools.client.requestbody.GenericRequestBody; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; import org.openapijsonschematools.client.mediatype.MediaType; import org.openapijsonschematools.client.paths.petpetiduploadimage.post.requestbody.content.multipartformdata.MultipartformdataSchema; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; import java.util.AbstractMap; import java.util.Map; public class RequestBody { + public sealed interface SealedMediaType permits MultipartformdataMediaType {} - public static class MultipartformdataMediaType extends MediaType { + public record MultipartformdataMediaType(MultipartformdataSchema.MultipartformdataSchema1 schema) implements SealedMediaType, MediaType { public MultipartformdataMediaType() { - super(MultipartformdataSchema.MultipartformdataSchema1.getInstance()); + this(MultipartformdataSchema.MultipartformdataSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; } } - public static class RequestBody1 extends RequestBodySerializer { + public static class RequestBody1 extends RequestBodySerializer { public RequestBody1() { super( Map.ofEntries( @@ -33,26 +38,15 @@ public RequestBody1() { public SerializedRequestBody serialize(SealedRequestBody requestBody) { MultipartformdataRequestBody requestBody0 = (MultipartformdataRequestBody) requestBody; - return serialize(requestBody0.contentType(), requestBody0.body().data()); + return serialize(requestBody0.contentType(), requestBody0.body().getData()); } } - public static abstract sealed class SealedRequestBody permits MultipartformdataRequestBody {} - public static final class MultipartformdataRequestBody extends SealedRequestBody implements GenericRequestBody { - private final String contentType; - private final MultipartformdataSchema.MultipartformdataSchema1Boxed body; - public MultipartformdataRequestBody(MultipartformdataSchema.MultipartformdataSchema1Boxed body) { - contentType = "multipart/form-data"; - this.body = body; - } + public sealed interface SealedRequestBody permits MultipartformdataRequestBody {} + public record MultipartformdataRequestBody(MultipartformdataSchema.MultipartformdataSchema1Boxed body) implements SealedRequestBody, GenericRequestBody { @Override public String contentType() { - return contentType; - } - - @Override - public MultipartformdataSchema.MultipartformdataSchema1Boxed body() { - return body; + return "multipart/form-data"; } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetiduploadimage/post/requestbody/content/multipartformdata/MultipartformdataSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetiduploadimage/post/requestbody/content/multipartformdata/MultipartformdataSchema.java index 5a8543bc019..f809a516e10 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetiduploadimage/post/requestbody/content/multipartformdata/MultipartformdataSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetiduploadimage/post/requestbody/content/multipartformdata/MultipartformdataSchema.java @@ -144,23 +144,19 @@ public MultipartformdataSchemaMapBuilder getBuilderAfterAdditionalProperty(Map { + public static class MultipartformdataSchema1 extends JsonSchema implements MapSchemaValidator { private static @Nullable MultipartformdataSchema1 instance = null; protected MultipartformdataSchema1() { @@ -191,11 +187,11 @@ public MultipartformdataSchemaMap getNewInstance(Map arg, List pat List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -232,6 +228,13 @@ public MultipartformdataSchemaMap validate(Map arg, SchemaConfiguration co public MultipartformdataSchema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new MultipartformdataSchema1BoxedMap(validate(arg, configuration)); } + @Override + public MultipartformdataSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetiduploadimage/post/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetiduploadimage/post/responses/Code200Response.java new file mode 100644 index 00000000000..593e5a8bd71 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetiduploadimage/post/responses/Code200Response.java @@ -0,0 +1,7 @@ +package org.openapijsonschematools.client.paths.petpetiduploadimage.post.responses; + +import org.openapijsonschematools.client.components.responses.SuccessWithJsonApiResponse; + +public class Code200Response extends SuccessWithJsonApiResponse { + public static class Code200Response1 extends SuccessWithJsonApiResponse1 {} +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/solidus/get/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/solidus/get/responses/Code200Response.java new file mode 100644 index 00000000000..cc3db94ea0f --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/solidus/get/responses/Code200Response.java @@ -0,0 +1,7 @@ +package org.openapijsonschematools.client.paths.solidus.get.responses; + +import org.openapijsonschematools.client.components.responses.SuccessDescriptionOnly; + +public class Code200Response extends SuccessDescriptionOnly { + public static class Code200Response1 extends SuccessDescriptionOnly1 {} +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeinventory/get/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeinventory/get/responses/Code200Response.java new file mode 100644 index 00000000000..0dcc3b8d63f --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeinventory/get/responses/Code200Response.java @@ -0,0 +1,7 @@ +package org.openapijsonschematools.client.paths.storeinventory.get.responses; + +import org.openapijsonschematools.client.components.responses.SuccessInlineContentAndHeader; + +public class Code200Response extends SuccessInlineContentAndHeader { + public static class Code200Response1 extends SuccessInlineContentAndHeader1 {} +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorder/post/RequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorder/post/RequestBody.java index 067ce062220..fa09117b1c6 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorder/post/RequestBody.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorder/post/RequestBody.java @@ -6,22 +6,27 @@ import org.openapijsonschematools.client.requestbody.RequestBodySerializer; import org.openapijsonschematools.client.requestbody.GenericRequestBody; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; import org.openapijsonschematools.client.mediatype.MediaType; import org.openapijsonschematools.client.paths.storeorder.post.requestbody.content.applicationjson.ApplicationjsonSchema; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; import java.util.AbstractMap; import java.util.Map; public class RequestBody { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} - public static class ApplicationjsonMediaType extends MediaType { + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { public ApplicationjsonMediaType() { - super(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; } } - public static class RequestBody1 extends RequestBodySerializer { + public static class RequestBody1 extends RequestBodySerializer { public RequestBody1() { super( Map.ofEntries( @@ -33,26 +38,15 @@ public RequestBody1() { public SerializedRequestBody serialize(SealedRequestBody requestBody) { ApplicationjsonRequestBody requestBody0 = (ApplicationjsonRequestBody) requestBody; - return serialize(requestBody0.contentType(), requestBody0.body().data()); + return serialize(requestBody0.contentType(), requestBody0.body().getData()); } } - public static abstract sealed class SealedRequestBody permits ApplicationjsonRequestBody {} - public static final class ApplicationjsonRequestBody extends SealedRequestBody implements GenericRequestBody { - private final String contentType; - private final ApplicationjsonSchema.Order1Boxed body; - public ApplicationjsonRequestBody(ApplicationjsonSchema.Order1Boxed body) { - contentType = "application/json"; - this.body = body; - } + public sealed interface SealedRequestBody permits ApplicationjsonRequestBody {} + public record ApplicationjsonRequestBody(ApplicationjsonSchema.Order1Boxed body) implements SealedRequestBody, GenericRequestBody { @Override public String contentType() { - return contentType; - } - - @Override - public ApplicationjsonSchema.Order1Boxed body() { - return body; + return "application/json"; } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorder/post/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorder/post/responses/Code200Response.java new file mode 100644 index 00000000000..806ee8b6867 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorder/post/responses/Code200Response.java @@ -0,0 +1,70 @@ +package org.openapijsonschematools.client.paths.storeorder.post.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.storeorder.post.responses.code200response.content.applicationxml.ApplicationxmlSchema; +import org.openapijsonschematools.client.paths.storeorder.post.responses.code200response.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpHeaders; + +public class Code200Response { + public sealed interface SealedMediaType permits ApplicationxmlMediaType, ApplicationjsonMediaType {} + + public record ApplicationxmlMediaType(ApplicationxmlSchema.ApplicationxmlSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationxmlMediaType() { + this(ApplicationxmlSchema.ApplicationxmlSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationxmlResponseBody, ApplicationjsonResponseBody {} + public record ApplicationxmlResponseBody(ApplicationxmlSchema.Order1Boxed body) implements SealedResponseBody { } + public record ApplicationjsonResponseBody(ApplicationjsonSchema.Order1Boxed body) implements SealedResponseBody { } + + public static class Code200Response1 extends ResponseDeserializer { + public Code200Response1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/xml", new ApplicationxmlMediaType()), + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + SealedMediaType mediaType = content.get(contentType); + if (mediaType == null) { + throw new RuntimeException("Invalid contentType was received back from the server that does not exist in the openapi document"); + } + if (mediaType instanceof ApplicationxmlMediaType thisMediaType) { + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationxmlResponseBody(deserializedBody); + } else if (mediaType instanceof ApplicationjsonMediaType thisMediaType) { + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } + throw new RuntimeException("contentType="+contentType+" returned by the server is unknown and does not exist in the openapi document"); + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorder/post/responses/Code400Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorder/post/responses/Code400Response.java new file mode 100644 index 00000000000..b018f2a8d55 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorder/post/responses/Code400Response.java @@ -0,0 +1,30 @@ +package org.openapijsonschematools.client.paths.storeorder.post.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.schemas.validation.MapUtils; + +import java.util.Map; +import java.net.http.HttpHeaders; + +public class Code400Response { + + public static class Code400Response1 extends ResponseDeserializer { + public Code400Response1() { + super( + MapUtils.makeMap( + ) + ); + } + + @Override + protected Void getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + return null; + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorder/post/responses/response200/content/applicationjson/ApplicationjsonSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorder/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java similarity index 92% rename from samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorder/post/responses/response200/content/applicationjson/ApplicationjsonSchema.java rename to samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorder/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java index 0f27bef136b..c7b1d3035af 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorder/post/responses/response200/content/applicationjson/ApplicationjsonSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorder/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java @@ -1,4 +1,4 @@ -package org.openapijsonschematools.client.paths.storeorder.post.responses.response200.content.applicationjson; +package org.openapijsonschematools.client.paths.storeorder.post.responses.code200response.content.applicationjson; import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.components.schemas.Order; diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorder/post/responses/response200/content/applicationxml/ApplicationxmlSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorder/post/responses/code200response/content/applicationxml/ApplicationxmlSchema.java similarity index 92% rename from samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorder/post/responses/response200/content/applicationxml/ApplicationxmlSchema.java rename to samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorder/post/responses/code200response/content/applicationxml/ApplicationxmlSchema.java index 257ec58e862..d0a1692555b 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorder/post/responses/response200/content/applicationxml/ApplicationxmlSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorder/post/responses/code200response/content/applicationxml/ApplicationxmlSchema.java @@ -1,4 +1,4 @@ -package org.openapijsonschematools.client.paths.storeorder.post.responses.response200.content.applicationxml; +package org.openapijsonschematools.client.paths.storeorder.post.responses.code200response.content.applicationxml; import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.components.schemas.Order; diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/delete/PathParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/delete/PathParameters.java index 8a7e6c22029..52aaca5fe26 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/delete/PathParameters.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/delete/PathParameters.java @@ -100,23 +100,19 @@ public PathParametersMap0Builder getBuilderAfterOrderId(Map inst } - public static abstract sealed class PathParameters1Boxed permits PathParameters1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface PathParameters1Boxed permits PathParameters1BoxedMap { + @Nullable Object getData(); } - public static final class PathParameters1BoxedMap extends PathParameters1Boxed { - public final PathParametersMap data; - private PathParameters1BoxedMap(PathParametersMap data) { - this.data = data; - } + public record PathParameters1BoxedMap(PathParametersMap data) implements PathParameters1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class PathParameters1 extends JsonSchema implements MapSchemaValidator { + public static class PathParameters1 extends JsonSchema implements MapSchemaValidator { private static @Nullable PathParameters1 instance = null; protected PathParameters1() { @@ -150,11 +146,11 @@ public PathParametersMap getNewInstance(Map arg, List pathToItem, List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof String)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -194,6 +190,13 @@ public PathParametersMap validate(Map arg, SchemaConfiguration configurati public PathParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new PathParameters1BoxedMap(validate(arg, configuration)); } + @Override + public PathParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/delete/responses/Code400Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/delete/responses/Code400Response.java new file mode 100644 index 00000000000..3b69947b889 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/delete/responses/Code400Response.java @@ -0,0 +1,30 @@ +package org.openapijsonschematools.client.paths.storeorderorderid.delete.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.schemas.validation.MapUtils; + +import java.util.Map; +import java.net.http.HttpHeaders; + +public class Code400Response { + + public static class Code400Response1 extends ResponseDeserializer { + public Code400Response1() { + super( + MapUtils.makeMap( + ) + ); + } + + @Override + protected Void getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + return null; + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/delete/responses/Code404Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/delete/responses/Code404Response.java new file mode 100644 index 00000000000..6043fb706e6 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/delete/responses/Code404Response.java @@ -0,0 +1,30 @@ +package org.openapijsonschematools.client.paths.storeorderorderid.delete.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.schemas.validation.MapUtils; + +import java.util.Map; +import java.net.http.HttpHeaders; + +public class Code404Response { + + public static class Code404Response1 extends ResponseDeserializer { + public Code404Response1() { + super( + MapUtils.makeMap( + ) + ); + } + + @Override + protected Void getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + return null; + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/PathParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/PathParameters.java index ce7a63a97bd..d52c74e5c24 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/PathParameters.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/PathParameters.java @@ -118,23 +118,19 @@ public PathParametersMap0Builder getBuilderAfterOrderId(Map inst } - public static abstract sealed class PathParameters1Boxed permits PathParameters1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface PathParameters1Boxed permits PathParameters1BoxedMap { + @Nullable Object getData(); } - public static final class PathParameters1BoxedMap extends PathParameters1Boxed { - public final PathParametersMap data; - private PathParameters1BoxedMap(PathParametersMap data) { - this.data = data; - } + public record PathParameters1BoxedMap(PathParametersMap data) implements PathParameters1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class PathParameters1 extends JsonSchema implements MapSchemaValidator { + public static class PathParameters1 extends JsonSchema implements MapSchemaValidator { private static @Nullable PathParameters1 instance = null; protected PathParameters1() { @@ -168,11 +164,11 @@ public PathParametersMap getNewInstance(Map arg, List pathToItem, List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof Number)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -212,6 +208,13 @@ public PathParametersMap validate(Map arg, SchemaConfiguration configurati public PathParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new PathParameters1BoxedMap(validate(arg, configuration)); } + @Override + public PathParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/parameters/parameter0/Schema0.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/parameters/parameter0/Schema0.java index 8854c892b6b..44fca5e5ac4 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/parameters/parameter0/Schema0.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/parameters/parameter0/Schema0.java @@ -19,24 +19,20 @@ public class Schema0 { // nest classes so all schemas and input/output classes can be public - public static abstract sealed class Schema01Boxed permits Schema01BoxedNumber { - public abstract @Nullable Object data(); + public sealed interface Schema01Boxed permits Schema01BoxedNumber { + @Nullable Object getData(); } - public static final class Schema01BoxedNumber extends Schema01Boxed { - public final Number data; - private Schema01BoxedNumber(Number data) { - this.data = data; - } + public record Schema01BoxedNumber(Number data) implements Schema01Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Schema01 extends JsonSchema implements NumberSchemaValidator { + public static class Schema01 extends JsonSchema implements NumberSchemaValidator { private static @Nullable Schema01 instance = null; protected Schema01() { @@ -105,5 +101,12 @@ public double validate(double arg, SchemaConfiguration configuration) throws Val public Schema01BoxedNumber validateAndBox(Number arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Schema01BoxedNumber(validate(arg, configuration)); } + @Override + public Schema01Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/responses/Code200Response.java new file mode 100644 index 00000000000..ddacd91e6b8 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/responses/Code200Response.java @@ -0,0 +1,70 @@ +package org.openapijsonschematools.client.paths.storeorderorderid.get.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.storeorderorderid.get.responses.code200response.content.applicationxml.ApplicationxmlSchema; +import org.openapijsonschematools.client.paths.storeorderorderid.get.responses.code200response.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpHeaders; + +public class Code200Response { + public sealed interface SealedMediaType permits ApplicationxmlMediaType, ApplicationjsonMediaType {} + + public record ApplicationxmlMediaType(ApplicationxmlSchema.ApplicationxmlSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationxmlMediaType() { + this(ApplicationxmlSchema.ApplicationxmlSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationxmlResponseBody, ApplicationjsonResponseBody {} + public record ApplicationxmlResponseBody(ApplicationxmlSchema.Order1Boxed body) implements SealedResponseBody { } + public record ApplicationjsonResponseBody(ApplicationjsonSchema.Order1Boxed body) implements SealedResponseBody { } + + public static class Code200Response1 extends ResponseDeserializer { + public Code200Response1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/xml", new ApplicationxmlMediaType()), + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + SealedMediaType mediaType = content.get(contentType); + if (mediaType == null) { + throw new RuntimeException("Invalid contentType was received back from the server that does not exist in the openapi document"); + } + if (mediaType instanceof ApplicationxmlMediaType thisMediaType) { + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationxmlResponseBody(deserializedBody); + } else if (mediaType instanceof ApplicationjsonMediaType thisMediaType) { + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } + throw new RuntimeException("contentType="+contentType+" returned by the server is unknown and does not exist in the openapi document"); + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/responses/Code400Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/responses/Code400Response.java new file mode 100644 index 00000000000..a0d64766ab5 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/responses/Code400Response.java @@ -0,0 +1,30 @@ +package org.openapijsonschematools.client.paths.storeorderorderid.get.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.schemas.validation.MapUtils; + +import java.util.Map; +import java.net.http.HttpHeaders; + +public class Code400Response { + + public static class Code400Response1 extends ResponseDeserializer { + public Code400Response1() { + super( + MapUtils.makeMap( + ) + ); + } + + @Override + protected Void getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + return null; + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/responses/Code404Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/responses/Code404Response.java new file mode 100644 index 00000000000..9a3b4607c8f --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/responses/Code404Response.java @@ -0,0 +1,30 @@ +package org.openapijsonschematools.client.paths.storeorderorderid.get.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.schemas.validation.MapUtils; + +import java.util.Map; +import java.net.http.HttpHeaders; + +public class Code404Response { + + public static class Code404Response1 extends ResponseDeserializer { + public Code404Response1() { + super( + MapUtils.makeMap( + ) + ); + } + + @Override + protected Void getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + return null; + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/responses/response200/content/applicationjson/ApplicationjsonSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.java similarity index 91% rename from samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/responses/response200/content/applicationjson/ApplicationjsonSchema.java rename to samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.java index f2cbf3c93c6..b1b2c0183b4 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/responses/response200/content/applicationjson/ApplicationjsonSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.java @@ -1,4 +1,4 @@ -package org.openapijsonschematools.client.paths.storeorderorderid.get.responses.response200.content.applicationjson; +package org.openapijsonschematools.client.paths.storeorderorderid.get.responses.code200response.content.applicationjson; import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.components.schemas.Order; diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/responses/response200/content/applicationxml/ApplicationxmlSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/responses/code200response/content/applicationxml/ApplicationxmlSchema.java similarity index 91% rename from samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/responses/response200/content/applicationxml/ApplicationxmlSchema.java rename to samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/responses/code200response/content/applicationxml/ApplicationxmlSchema.java index 0dbbb6fe513..91ca54812cd 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/responses/response200/content/applicationxml/ApplicationxmlSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/responses/code200response/content/applicationxml/ApplicationxmlSchema.java @@ -1,4 +1,4 @@ -package org.openapijsonschematools.client.paths.storeorderorderid.get.responses.response200.content.applicationxml; +package org.openapijsonschematools.client.paths.storeorderorderid.get.responses.code200response.content.applicationxml; import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.components.schemas.Order; diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/user/post/RequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/user/post/RequestBody.java index 4391f619118..9db899fe59e 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/user/post/RequestBody.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/user/post/RequestBody.java @@ -6,22 +6,27 @@ import org.openapijsonschematools.client.requestbody.RequestBodySerializer; import org.openapijsonschematools.client.requestbody.GenericRequestBody; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; import org.openapijsonschematools.client.mediatype.MediaType; import org.openapijsonschematools.client.paths.user.post.requestbody.content.applicationjson.ApplicationjsonSchema; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; import java.util.AbstractMap; import java.util.Map; public class RequestBody { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} - public static class ApplicationjsonMediaType extends MediaType { + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { public ApplicationjsonMediaType() { - super(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; } } - public static class RequestBody1 extends RequestBodySerializer { + public static class RequestBody1 extends RequestBodySerializer { public RequestBody1() { super( Map.ofEntries( @@ -33,26 +38,15 @@ public RequestBody1() { public SerializedRequestBody serialize(SealedRequestBody requestBody) { ApplicationjsonRequestBody requestBody0 = (ApplicationjsonRequestBody) requestBody; - return serialize(requestBody0.contentType(), requestBody0.body().data()); + return serialize(requestBody0.contentType(), requestBody0.body().getData()); } } - public static abstract sealed class SealedRequestBody permits ApplicationjsonRequestBody {} - public static final class ApplicationjsonRequestBody extends SealedRequestBody implements GenericRequestBody { - private final String contentType; - private final ApplicationjsonSchema.User1Boxed body; - public ApplicationjsonRequestBody(ApplicationjsonSchema.User1Boxed body) { - contentType = "application/json"; - this.body = body; - } + public sealed interface SealedRequestBody permits ApplicationjsonRequestBody {} + public record ApplicationjsonRequestBody(ApplicationjsonSchema.User1Boxed body) implements SealedRequestBody, GenericRequestBody { @Override public String contentType() { - return contentType; - } - - @Override - public ApplicationjsonSchema.User1Boxed body() { - return body; + return "application/json"; } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/user/post/responses/CodedefaultResponse.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/user/post/responses/CodedefaultResponse.java new file mode 100644 index 00000000000..2804bfc1dcb --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/user/post/responses/CodedefaultResponse.java @@ -0,0 +1,30 @@ +package org.openapijsonschematools.client.paths.user.post.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.schemas.validation.MapUtils; + +import java.util.Map; +import java.net.http.HttpHeaders; + +public class CodedefaultResponse { + + public static class CodedefaultResponse1 extends ResponseDeserializer { + public CodedefaultResponse1() { + super( + MapUtils.makeMap( + ) + ); + } + + @Override + protected Void getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + return null; + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/usercreatewitharray/post/responses/CodedefaultResponse.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/usercreatewitharray/post/responses/CodedefaultResponse.java new file mode 100644 index 00000000000..12a36ad0d11 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/usercreatewitharray/post/responses/CodedefaultResponse.java @@ -0,0 +1,30 @@ +package org.openapijsonschematools.client.paths.usercreatewitharray.post.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.schemas.validation.MapUtils; + +import java.util.Map; +import java.net.http.HttpHeaders; + +public class CodedefaultResponse { + + public static class CodedefaultResponse1 extends ResponseDeserializer { + public CodedefaultResponse1() { + super( + MapUtils.makeMap( + ) + ); + } + + @Override + protected Void getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + return null; + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/usercreatewithlist/post/responses/CodedefaultResponse.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/usercreatewithlist/post/responses/CodedefaultResponse.java new file mode 100644 index 00000000000..8764ab19081 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/usercreatewithlist/post/responses/CodedefaultResponse.java @@ -0,0 +1,30 @@ +package org.openapijsonschematools.client.paths.usercreatewithlist.post.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.schemas.validation.MapUtils; + +import java.util.Map; +import java.net.http.HttpHeaders; + +public class CodedefaultResponse { + + public static class CodedefaultResponse1 extends ResponseDeserializer { + public CodedefaultResponse1() { + super( + MapUtils.makeMap( + ) + ); + } + + @Override + protected Void getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + return null; + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/get/QueryParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/get/QueryParameters.java index 7e32294aabf..8c5b619443c 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/get/QueryParameters.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/get/QueryParameters.java @@ -155,23 +155,19 @@ public QueryParametersMap10Builder getBuilderAfterUsername(Map { + public static class QueryParameters1 extends JsonSchema implements MapSchemaValidator { private static @Nullable QueryParameters1 instance = null; protected QueryParameters1() { @@ -207,11 +203,11 @@ public QueryParametersMap getNewInstance(Map arg, List pathToItem, List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -248,6 +244,13 @@ public QueryParametersMap validate(Map arg, SchemaConfiguration configurat public QueryParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new QueryParameters1BoxedMap(validate(arg, configuration)); } + @Override + public QueryParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/Code200Response.java new file mode 100644 index 00000000000..34e312d269a --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/Code200Response.java @@ -0,0 +1,70 @@ +package org.openapijsonschematools.client.paths.userlogin.get.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.userlogin.get.responses.code200response.content.applicationxml.ApplicationxmlSchema; +import org.openapijsonschematools.client.paths.userlogin.get.responses.code200response.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpHeaders; + +public class Code200Response { + public sealed interface SealedMediaType permits ApplicationxmlMediaType, ApplicationjsonMediaType {} + + public record ApplicationxmlMediaType(ApplicationxmlSchema.ApplicationxmlSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationxmlMediaType() { + this(ApplicationxmlSchema.ApplicationxmlSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationxmlResponseBody, ApplicationjsonResponseBody {} + public record ApplicationxmlResponseBody(ApplicationxmlSchema.StringJsonSchema1Boxed body) implements SealedResponseBody { } + public record ApplicationjsonResponseBody(ApplicationjsonSchema.StringJsonSchema1Boxed body) implements SealedResponseBody { } + + public static class Code200Response1 extends ResponseDeserializer { + public Code200Response1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/xml", new ApplicationxmlMediaType()), + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + SealedMediaType mediaType = content.get(contentType); + if (mediaType == null) { + throw new RuntimeException("Invalid contentType was received back from the server that does not exist in the openapi document"); + } + if (mediaType instanceof ApplicationxmlMediaType thisMediaType) { + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationxmlResponseBody(deserializedBody); + } else if (mediaType instanceof ApplicationjsonMediaType thisMediaType) { + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } + throw new RuntimeException("contentType="+contentType+" returned by the server is unknown and does not exist in the openapi document"); + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/Code400Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/Code400Response.java new file mode 100644 index 00000000000..80856aa6119 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/Code400Response.java @@ -0,0 +1,30 @@ +package org.openapijsonschematools.client.paths.userlogin.get.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.schemas.validation.MapUtils; + +import java.util.Map; +import java.net.http.HttpHeaders; + +public class Code400Response { + + public static class Code400Response1 extends ResponseDeserializer { + public Code400Response1() { + super( + MapUtils.makeMap( + ) + ); + } + + @Override + protected Void getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + return null; + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/response200/Headers.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/code200response/Headers.java similarity index 93% rename from samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/response200/Headers.java rename to samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/code200response/Headers.java index 6712dad86fe..00292572e1a 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/response200/Headers.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/code200response/Headers.java @@ -1,4 +1,4 @@ -package org.openapijsonschematools.client.paths.userlogin.get.responses.response200; +package org.openapijsonschematools.client.paths.userlogin.get.responses.code200response; import java.util.ArrayList; import java.util.HashSet; import java.util.LinkedHashMap; @@ -16,8 +16,8 @@ import org.openapijsonschematools.client.exceptions.InvalidTypeException; import org.openapijsonschematools.client.exceptions.UnsetPropertyException; import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.paths.userlogin.get.responses.response200.headers.xexpiresafter.XExpiresAfterSchema; -import org.openapijsonschematools.client.paths.userlogin.get.responses.response200.headers.xratelimit.content.applicationjson.XRateLimitSchema; +import org.openapijsonschematools.client.paths.userlogin.get.responses.code200response.headers.xexpiresafter.XExpiresAfterSchema; +import org.openapijsonschematools.client.paths.userlogin.get.responses.code200response.headers.xratelimit.content.applicationjson.XRateLimitSchema; import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; import org.openapijsonschematools.client.schemas.GenericBuilder; import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema; @@ -285,23 +285,19 @@ public HeadersMap110Builder getBuilderAfterRefcontentschemaheader(Map { + public static class Headers1 extends JsonSchema implements MapSchemaValidator { private static @Nullable Headers1 instance = null; protected Headers1() { @@ -341,11 +337,11 @@ public HeadersMap getNewInstance(Map arg, List pathToItem, PathToS List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, propertyInstance); } @@ -382,6 +378,13 @@ public HeadersMap validate(Map arg, SchemaConfiguration configuration) thr public Headers1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Headers1BoxedMap(validate(arg, configuration)); } + @Override + public Headers1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/response200/content/applicationjson/ApplicationjsonSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.java similarity index 93% rename from samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/response200/content/applicationjson/ApplicationjsonSchema.java rename to samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.java index 6611ee831f7..93f4ea3148c 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/response200/content/applicationjson/ApplicationjsonSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.java @@ -1,4 +1,4 @@ -package org.openapijsonschematools.client.paths.userlogin.get.responses.response200.content.applicationjson; +package org.openapijsonschematools.client.paths.userlogin.get.responses.code200response.content.applicationjson; import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.schemas.StringJsonSchema; diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/response200/content/applicationxml/ApplicationxmlSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/code200response/content/applicationxml/ApplicationxmlSchema.java similarity index 93% rename from samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/response200/content/applicationxml/ApplicationxmlSchema.java rename to samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/code200response/content/applicationxml/ApplicationxmlSchema.java index b95e5cb8847..557f1fbe8d1 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/response200/content/applicationxml/ApplicationxmlSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/code200response/content/applicationxml/ApplicationxmlSchema.java @@ -1,4 +1,4 @@ -package org.openapijsonschematools.client.paths.userlogin.get.responses.response200.content.applicationxml; +package org.openapijsonschematools.client.paths.userlogin.get.responses.code200response.content.applicationxml; import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.schemas.StringJsonSchema; diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/response200/headers/xexpiresafter/XExpiresAfterSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/code200response/headers/xexpiresafter/XExpiresAfterSchema.java similarity index 93% rename from samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/response200/headers/xexpiresafter/XExpiresAfterSchema.java rename to samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/code200response/headers/xexpiresafter/XExpiresAfterSchema.java index 654c1d53c4b..13ec38f4440 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/response200/headers/xexpiresafter/XExpiresAfterSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/code200response/headers/xexpiresafter/XExpiresAfterSchema.java @@ -1,4 +1,4 @@ -package org.openapijsonschematools.client.paths.userlogin.get.responses.response200.headers.xexpiresafter; +package org.openapijsonschematools.client.paths.userlogin.get.responses.code200response.headers.xexpiresafter; import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.schemas.DateTimeJsonSchema; diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/response200/headers/xratelimit/content/applicationjson/XRateLimitSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/code200response/headers/xratelimit/content/applicationjson/XRateLimitSchema.java similarity index 91% rename from samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/response200/headers/xratelimit/content/applicationjson/XRateLimitSchema.java rename to samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/code200response/headers/xratelimit/content/applicationjson/XRateLimitSchema.java index 048f92f8f9f..9ce160e834c 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/response200/headers/xratelimit/content/applicationjson/XRateLimitSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/code200response/headers/xratelimit/content/applicationjson/XRateLimitSchema.java @@ -1,4 +1,4 @@ -package org.openapijsonschematools.client.paths.userlogin.get.responses.response200.headers.xratelimit.content.applicationjson; +package org.openapijsonschematools.client.paths.userlogin.get.responses.code200response.headers.xratelimit.content.applicationjson; import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.schemas.Int32JsonSchema; diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogout/get/responses/CodedefaultResponse.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogout/get/responses/CodedefaultResponse.java new file mode 100644 index 00000000000..827132f3fd6 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogout/get/responses/CodedefaultResponse.java @@ -0,0 +1,7 @@ +package org.openapijsonschematools.client.paths.userlogout.get.responses; + +import org.openapijsonschematools.client.components.responses.RefSuccessDescriptionOnly; + +public class CodedefaultResponse extends RefSuccessDescriptionOnly { + public static class CodedefaultResponse1 extends RefSuccessDescriptionOnly1 {} +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/delete/PathParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/delete/PathParameters.java index 0c963972446..a8d9f3c2972 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/delete/PathParameters.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/delete/PathParameters.java @@ -100,23 +100,19 @@ public PathParametersMap0Builder getBuilderAfterUsername(Map ins } - public static abstract sealed class PathParameters1Boxed permits PathParameters1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface PathParameters1Boxed permits PathParameters1BoxedMap { + @Nullable Object getData(); } - public static final class PathParameters1BoxedMap extends PathParameters1Boxed { - public final PathParametersMap data; - private PathParameters1BoxedMap(PathParametersMap data) { - this.data = data; - } + public record PathParameters1BoxedMap(PathParametersMap data) implements PathParameters1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class PathParameters1 extends JsonSchema implements MapSchemaValidator { + public static class PathParameters1 extends JsonSchema implements MapSchemaValidator { private static @Nullable PathParameters1 instance = null; protected PathParameters1() { @@ -150,11 +146,11 @@ public PathParametersMap getNewInstance(Map arg, List pathToItem, List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof String)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -194,6 +190,13 @@ public PathParametersMap validate(Map arg, SchemaConfiguration configurati public PathParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new PathParameters1BoxedMap(validate(arg, configuration)); } + @Override + public PathParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/delete/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/delete/responses/Code200Response.java new file mode 100644 index 00000000000..3dc59f474c4 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/delete/responses/Code200Response.java @@ -0,0 +1,7 @@ +package org.openapijsonschematools.client.paths.userusername.delete.responses; + +import org.openapijsonschematools.client.components.responses.SuccessDescriptionOnly; + +public class Code200Response extends SuccessDescriptionOnly { + public static class Code200Response1 extends SuccessDescriptionOnly1 {} +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/delete/responses/Code404Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/delete/responses/Code404Response.java new file mode 100644 index 00000000000..cdca3621219 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/delete/responses/Code404Response.java @@ -0,0 +1,30 @@ +package org.openapijsonschematools.client.paths.userusername.delete.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.schemas.validation.MapUtils; + +import java.util.Map; +import java.net.http.HttpHeaders; + +public class Code404Response { + + public static class Code404Response1 extends ResponseDeserializer { + public Code404Response1() { + super( + MapUtils.makeMap( + ) + ); + } + + @Override + protected Void getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + return null; + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/get/PathParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/get/PathParameters.java index cddaad784cd..084596e13a7 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/get/PathParameters.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/get/PathParameters.java @@ -100,23 +100,19 @@ public PathParametersMap0Builder getBuilderAfterUsername(Map ins } - public static abstract sealed class PathParameters1Boxed permits PathParameters1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface PathParameters1Boxed permits PathParameters1BoxedMap { + @Nullable Object getData(); } - public static final class PathParameters1BoxedMap extends PathParameters1Boxed { - public final PathParametersMap data; - private PathParameters1BoxedMap(PathParametersMap data) { - this.data = data; - } + public record PathParameters1BoxedMap(PathParametersMap data) implements PathParameters1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class PathParameters1 extends JsonSchema implements MapSchemaValidator { + public static class PathParameters1 extends JsonSchema implements MapSchemaValidator { private static @Nullable PathParameters1 instance = null; protected PathParameters1() { @@ -150,11 +146,11 @@ public PathParametersMap getNewInstance(Map arg, List pathToItem, List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof String)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -194,6 +190,13 @@ public PathParametersMap validate(Map arg, SchemaConfiguration configurati public PathParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new PathParameters1BoxedMap(validate(arg, configuration)); } + @Override + public PathParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/get/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/get/responses/Code200Response.java new file mode 100644 index 00000000000..bae41243287 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/get/responses/Code200Response.java @@ -0,0 +1,70 @@ +package org.openapijsonschematools.client.paths.userusername.get.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.userusername.get.responses.code200response.content.applicationxml.ApplicationxmlSchema; +import org.openapijsonschematools.client.paths.userusername.get.responses.code200response.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpHeaders; + +public class Code200Response { + public sealed interface SealedMediaType permits ApplicationxmlMediaType, ApplicationjsonMediaType {} + + public record ApplicationxmlMediaType(ApplicationxmlSchema.ApplicationxmlSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationxmlMediaType() { + this(ApplicationxmlSchema.ApplicationxmlSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationxmlResponseBody, ApplicationjsonResponseBody {} + public record ApplicationxmlResponseBody(ApplicationxmlSchema.User1Boxed body) implements SealedResponseBody { } + public record ApplicationjsonResponseBody(ApplicationjsonSchema.User1Boxed body) implements SealedResponseBody { } + + public static class Code200Response1 extends ResponseDeserializer { + public Code200Response1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/xml", new ApplicationxmlMediaType()), + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + SealedMediaType mediaType = content.get(contentType); + if (mediaType == null) { + throw new RuntimeException("Invalid contentType was received back from the server that does not exist in the openapi document"); + } + if (mediaType instanceof ApplicationxmlMediaType thisMediaType) { + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationxmlResponseBody(deserializedBody); + } else if (mediaType instanceof ApplicationjsonMediaType thisMediaType) { + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } + throw new RuntimeException("contentType="+contentType+" returned by the server is unknown and does not exist in the openapi document"); + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/get/responses/Code400Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/get/responses/Code400Response.java new file mode 100644 index 00000000000..1bba2220853 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/get/responses/Code400Response.java @@ -0,0 +1,30 @@ +package org.openapijsonschematools.client.paths.userusername.get.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.schemas.validation.MapUtils; + +import java.util.Map; +import java.net.http.HttpHeaders; + +public class Code400Response { + + public static class Code400Response1 extends ResponseDeserializer { + public Code400Response1() { + super( + MapUtils.makeMap( + ) + ); + } + + @Override + protected Void getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + return null; + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/get/responses/Code404Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/get/responses/Code404Response.java new file mode 100644 index 00000000000..511b4b8c0e4 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/get/responses/Code404Response.java @@ -0,0 +1,30 @@ +package org.openapijsonschematools.client.paths.userusername.get.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.schemas.validation.MapUtils; + +import java.util.Map; +import java.net.http.HttpHeaders; + +public class Code404Response { + + public static class Code404Response1 extends ResponseDeserializer { + public Code404Response1() { + super( + MapUtils.makeMap( + ) + ); + } + + @Override + protected Void getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + return null; + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/get/responses/response200/content/applicationjson/ApplicationjsonSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.java similarity index 92% rename from samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/get/responses/response200/content/applicationjson/ApplicationjsonSchema.java rename to samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.java index 897db39b646..910120ee863 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/get/responses/response200/content/applicationjson/ApplicationjsonSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.java @@ -1,4 +1,4 @@ -package org.openapijsonschematools.client.paths.userusername.get.responses.response200.content.applicationjson; +package org.openapijsonschematools.client.paths.userusername.get.responses.code200response.content.applicationjson; import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.components.schemas.User; diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/get/responses/response200/content/applicationxml/ApplicationxmlSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/get/responses/code200response/content/applicationxml/ApplicationxmlSchema.java similarity index 92% rename from samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/get/responses/response200/content/applicationxml/ApplicationxmlSchema.java rename to samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/get/responses/code200response/content/applicationxml/ApplicationxmlSchema.java index 1cfc713d97a..0d8e9cf0d9a 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/get/responses/response200/content/applicationxml/ApplicationxmlSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/get/responses/code200response/content/applicationxml/ApplicationxmlSchema.java @@ -1,4 +1,4 @@ -package org.openapijsonschematools.client.paths.userusername.get.responses.response200.content.applicationxml; +package org.openapijsonschematools.client.paths.userusername.get.responses.code200response.content.applicationxml; import org.checkerframework.checker.nullness.qual.Nullable; import org.openapijsonschematools.client.components.schemas.User; diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/put/PathParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/put/PathParameters.java index f215c8e51f0..96b11df0969 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/put/PathParameters.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/put/PathParameters.java @@ -100,23 +100,19 @@ public PathParametersMap0Builder getBuilderAfterUsername(Map ins } - public static abstract sealed class PathParameters1Boxed permits PathParameters1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface PathParameters1Boxed permits PathParameters1BoxedMap { + @Nullable Object getData(); } - public static final class PathParameters1BoxedMap extends PathParameters1Boxed { - public final PathParametersMap data; - private PathParameters1BoxedMap(PathParametersMap data) { - this.data = data; - } + public record PathParameters1BoxedMap(PathParametersMap data) implements PathParameters1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class PathParameters1 extends JsonSchema implements MapSchemaValidator { + public static class PathParameters1 extends JsonSchema implements MapSchemaValidator { private static @Nullable PathParameters1 instance = null; protected PathParameters1() { @@ -150,11 +146,11 @@ public PathParametersMap getNewInstance(Map arg, List pathToItem, List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof String)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -194,6 +190,13 @@ public PathParametersMap validate(Map arg, SchemaConfiguration configurati public PathParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new PathParameters1BoxedMap(validate(arg, configuration)); } + @Override + public PathParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/put/RequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/put/RequestBody.java index 26409d872b6..22d0e1f9007 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/put/RequestBody.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/put/RequestBody.java @@ -6,22 +6,27 @@ import org.openapijsonschematools.client.requestbody.RequestBodySerializer; import org.openapijsonschematools.client.requestbody.GenericRequestBody; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; import org.openapijsonschematools.client.mediatype.MediaType; import org.openapijsonschematools.client.paths.userusername.put.requestbody.content.applicationjson.ApplicationjsonSchema; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; import java.util.AbstractMap; import java.util.Map; public class RequestBody { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} - public static class ApplicationjsonMediaType extends MediaType { + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { public ApplicationjsonMediaType() { - super(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; } } - public static class RequestBody1 extends RequestBodySerializer { + public static class RequestBody1 extends RequestBodySerializer { public RequestBody1() { super( Map.ofEntries( @@ -33,26 +38,15 @@ public RequestBody1() { public SerializedRequestBody serialize(SealedRequestBody requestBody) { ApplicationjsonRequestBody requestBody0 = (ApplicationjsonRequestBody) requestBody; - return serialize(requestBody0.contentType(), requestBody0.body().data()); + return serialize(requestBody0.contentType(), requestBody0.body().getData()); } } - public static abstract sealed class SealedRequestBody permits ApplicationjsonRequestBody {} - public static final class ApplicationjsonRequestBody extends SealedRequestBody implements GenericRequestBody { - private final String contentType; - private final ApplicationjsonSchema.User1Boxed body; - public ApplicationjsonRequestBody(ApplicationjsonSchema.User1Boxed body) { - contentType = "application/json"; - this.body = body; - } + public sealed interface SealedRequestBody permits ApplicationjsonRequestBody {} + public record ApplicationjsonRequestBody(ApplicationjsonSchema.User1Boxed body) implements SealedRequestBody, GenericRequestBody { @Override public String contentType() { - return contentType; - } - - @Override - public ApplicationjsonSchema.User1Boxed body() { - return body; + return "application/json"; } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/put/responses/Code400Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/put/responses/Code400Response.java new file mode 100644 index 00000000000..7997bf717b2 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/put/responses/Code400Response.java @@ -0,0 +1,30 @@ +package org.openapijsonschematools.client.paths.userusername.put.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.schemas.validation.MapUtils; + +import java.util.Map; +import java.net.http.HttpHeaders; + +public class Code400Response { + + public static class Code400Response1 extends ResponseDeserializer { + public Code400Response1() { + super( + MapUtils.makeMap( + ) + ); + } + + @Override + protected Void getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + return null; + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/put/responses/Code404Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/put/responses/Code404Response.java new file mode 100644 index 00000000000..b3ac1cfe936 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/put/responses/Code404Response.java @@ -0,0 +1,30 @@ +package org.openapijsonschematools.client.paths.userusername.put.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.schemas.validation.MapUtils; + +import java.util.Map; +import java.net.http.HttpHeaders; + +public class Code404Response { + + public static class Code404Response1 extends ResponseDeserializer { + public Code404Response1() { + super( + MapUtils.makeMap( + ) + ); + } + + @Override + protected Void getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + return null; + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/requestbody/RequestBodySerializer.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/requestbody/RequestBodySerializer.java index 3fdbcdbfde4..e221acb164a 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/requestbody/RequestBodySerializer.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/requestbody/RequestBodySerializer.java @@ -1,28 +1,32 @@ package org.openapijsonschematools.client.requestbody; -import org.openapijsonschematools.client.mediatype.MediaType; - import java.net.http.HttpRequest; import org.checkerframework.checker.nullness.qual.Nullable; import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.ToNumberPolicy; +import org.openapijsonschematools.client.schemas.validation.JsonSchema; import java.util.Map; import java.util.regex.Pattern; -public abstract class RequestBodySerializer { +public abstract class RequestBodySerializer { /* * Describes a single request body * content: contentType to MediaType schema info */ - public final Map> content; + public final Map content; public final boolean required; private static final Pattern jsonContentTypePattern = Pattern.compile( "application/[^+]*[+]?(json);?.*" ); - private static final Gson gson = new Gson(); + private static final Gson gson = new GsonBuilder() + .setObjectToNumberStrategy(ToNumberPolicy.LONG_OR_DOUBLE) + .setNumberToNumberStrategy(ToNumberPolicy.LONG_OR_DOUBLE) + .create(); private static final String textPlainContentType = "text/plain"; - public RequestBodySerializer(Map> content, boolean required) { + public RequestBodySerializer(Map content, boolean required) { this.content = content; this.required = required; } @@ -31,8 +35,13 @@ protected static boolean contentTypeIsJson(String contentType) { return jsonContentTypePattern.matcher(contentType).find(); } + @SuppressWarnings("nullness") + private String toJson(@Nullable Object body) { + return gson.toJson(body); + } + private SerializedRequestBody serializeJson(String contentType, @Nullable Object body) { - String jsonText = gson.toJson(body); + String jsonText = toJson(body); return new SerializedRequestBody(contentType, HttpRequest.BodyPublishers.ofString(jsonText)); } @@ -40,7 +49,7 @@ private SerializedRequestBody serializeTextPlain(String contentType, @Nullable O if (body instanceof String stringBody) { return new SerializedRequestBody(contentType, HttpRequest.BodyPublishers.ofString(stringBody)); } - throw new RuntimeException("Invalid non-string data type of "+body.getClass().getName()+" for text/plain body serialization"); + throw new RuntimeException("Invalid non-string data type of "+JsonSchema.getClass(body)+" for text/plain body serialization"); } protected SerializedRequestBody serialize(String contentType, @Nullable Object body) { diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/response/ApiResponse.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/response/ApiResponse.java new file mode 100644 index 00000000000..dab55e0f2da --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/response/ApiResponse.java @@ -0,0 +1,9 @@ +package org.openapijsonschematools.client.response; + +import java.net.http.HttpResponse; + +public interface ApiResponse { + HttpResponse response(); + SealedBodyOutputClass body(); + HeaderOutputClass headers(); +} \ No newline at end of file diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/response/DeserializedApiResponse.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/response/DeserializedApiResponse.java new file mode 100644 index 00000000000..1e88d82646c --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/response/DeserializedApiResponse.java @@ -0,0 +1,8 @@ +package org.openapijsonschematools.client.response; + +import java.net.http.HttpResponse; + +public record DeserializedApiResponse(HttpResponse response, + SealedBodyOutputClass body, + HeaderOutputClass headers) implements ApiResponse { +} \ No newline at end of file diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/response/ResponseDeserializer.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/response/ResponseDeserializer.java new file mode 100644 index 00000000000..766af80f088 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/response/ResponseDeserializer.java @@ -0,0 +1,83 @@ +package org.openapijsonschematools.client.response; + +import java.net.http.HttpHeaders; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.Map; +import java.util.Optional; +import java.util.regex.Pattern; + +import org.checkerframework.checker.nullness.qual.Nullable; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.ToNumberPolicy; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.schemas.validation.JsonSchema; + +public abstract class ResponseDeserializer { + public final Map content; + public final @Nullable Map headers; // todo change the value to header + private static final Pattern jsonContentTypePattern = Pattern.compile( + "application/[^+]*[+]?(json);?.*" + ); + private static final Gson gson = new GsonBuilder() + .setObjectToNumberStrategy(ToNumberPolicy.LONG_OR_DOUBLE) + .setNumberToNumberStrategy(ToNumberPolicy.LONG_OR_DOUBLE) + .create(); + protected static final String textPlainContentType = "text/plain"; + + public ResponseDeserializer(Map content) { + this.content = content; + this.headers = null; + } + + protected abstract SealedBodyClass getBody(String contentType, byte[] body, SchemaConfiguration configuration); + protected abstract HeaderClass getHeaders(HttpHeaders headers); + + protected @Nullable Object deserializeJson(byte[] body) { + String bodyStr = new String(body, StandardCharsets.UTF_8); + return gson.fromJson(bodyStr, Object.class); + } + + protected String deserializeTextPlain(byte[] body) { + return new String(body, StandardCharsets.UTF_8); + } + + protected static boolean contentTypeIsJson(String contentType) { + return jsonContentTypePattern.matcher(contentType).find(); + } + + protected static boolean contentTypeIsTextPlain(String contentType) { + return textPlainContentType.equals(contentType); + } + + protected T deserializeBody(String contentType, byte[] body, JsonSchema schema, SchemaConfiguration configuration) { + if (contentTypeIsJson(contentType)) { + @Nullable Object bodyData = deserializeJson(body); + return schema.validateAndBox(bodyData, configuration); + } else if (contentTypeIsTextPlain(contentType)) { + String bodyData = deserializeTextPlain(body); + return schema.validateAndBox(bodyData, configuration); + } + throw new RuntimeException("Deserialization for contentType="+contentType+" has not yet been implemented."); + } + + public ApiResponse deserialize(HttpResponse response, SchemaConfiguration configuration) { + Optional contentTypeInfo = response.headers().firstValue("Content-Type"); + if (contentTypeInfo.isEmpty()) { + throw new RuntimeException("Invalid response returned, Content-Type header is missing and it must be included"); + } + String contentType = contentTypeInfo.get(); + if (content != null && !content.containsKey(contentType)) { + throw new RuntimeException( + "Invalid contentType returned. contentType="+contentType+" was returned "+ + "when only "+content.keySet()+" are defined for statusCode="+response.statusCode() + ); + } + byte[] bodyBytes = response.body(); + SealedBodyClass body = getBody(contentType, bodyBytes, configuration); + HeaderClass headers = getHeaders(response.headers()); + return new DeserializedApiResponse<>(response, body, headers); + } +} \ No newline at end of file diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/AnyTypeJsonSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/AnyTypeJsonSchema.java index ee6800e54ad..0ffcae114bd 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/AnyTypeJsonSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/AnyTypeJsonSchema.java @@ -31,71 +31,47 @@ import java.util.UUID; public class AnyTypeJsonSchema { - public static abstract sealed class AnyTypeJsonSchema1Boxed permits AnyTypeJsonSchema1BoxedVoid, AnyTypeJsonSchema1BoxedBoolean, AnyTypeJsonSchema1BoxedNumber, AnyTypeJsonSchema1BoxedString, AnyTypeJsonSchema1BoxedList, AnyTypeJsonSchema1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface AnyTypeJsonSchema1Boxed permits AnyTypeJsonSchema1BoxedVoid, AnyTypeJsonSchema1BoxedBoolean, AnyTypeJsonSchema1BoxedNumber, AnyTypeJsonSchema1BoxedString, AnyTypeJsonSchema1BoxedList, AnyTypeJsonSchema1BoxedMap { + @Nullable Object getData(); } - public static final class AnyTypeJsonSchema1BoxedVoid extends AnyTypeJsonSchema1Boxed { - public final Void data; - private AnyTypeJsonSchema1BoxedVoid(Void data) { - this.data = data; - } + public record AnyTypeJsonSchema1BoxedVoid(Void data) implements AnyTypeJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AnyTypeJsonSchema1BoxedBoolean extends AnyTypeJsonSchema1Boxed { - public final boolean data; - private AnyTypeJsonSchema1BoxedBoolean(boolean data) { - this.data = data; - } + public record AnyTypeJsonSchema1BoxedBoolean(boolean data) implements AnyTypeJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AnyTypeJsonSchema1BoxedNumber extends AnyTypeJsonSchema1Boxed { - public final Number data; - private AnyTypeJsonSchema1BoxedNumber(Number data) { - this.data = data; - } + public record AnyTypeJsonSchema1BoxedNumber(Number data) implements AnyTypeJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AnyTypeJsonSchema1BoxedString extends AnyTypeJsonSchema1Boxed { - public final String data; - private AnyTypeJsonSchema1BoxedString(String data) { - this.data = data; - } + public record AnyTypeJsonSchema1BoxedString(String data) implements AnyTypeJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AnyTypeJsonSchema1BoxedList extends AnyTypeJsonSchema1Boxed { - public final FrozenList<@Nullable Object> data; - private AnyTypeJsonSchema1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record AnyTypeJsonSchema1BoxedList(FrozenList<@Nullable Object> data) implements AnyTypeJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AnyTypeJsonSchema1BoxedMap extends AnyTypeJsonSchema1Boxed { - public final FrozenMap<@Nullable Object> data; - private AnyTypeJsonSchema1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record AnyTypeJsonSchema1BoxedMap(FrozenMap<@Nullable Object> data) implements AnyTypeJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class AnyTypeJsonSchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, AnyTypeJsonSchema1BoxedList>, MapSchemaValidator, AnyTypeJsonSchema1BoxedMap> { + public static class AnyTypeJsonSchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, AnyTypeJsonSchema1BoxedList>, MapSchemaValidator, AnyTypeJsonSchema1BoxedMap> { private static @Nullable AnyTypeJsonSchema1 instance = null; protected AnyTypeJsonSchema1() { @@ -192,11 +168,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object castItem = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; @@ -227,11 +203,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object castValue = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } @@ -291,25 +267,50 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public AnyTypeJsonSchema1BoxedVoid validateAndBox(Void arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new AnyTypeJsonSchema1BoxedVoid(validate(arg, configuration)); } + @Override public AnyTypeJsonSchema1BoxedBoolean validateAndBox(boolean arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new AnyTypeJsonSchema1BoxedBoolean(validate(arg, configuration)); } + @Override public AnyTypeJsonSchema1BoxedNumber validateAndBox(Number arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new AnyTypeJsonSchema1BoxedNumber(validate(arg, configuration)); } + @Override public AnyTypeJsonSchema1BoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new AnyTypeJsonSchema1BoxedString(validate(arg, configuration)); } + @Override public AnyTypeJsonSchema1BoxedList validateAndBox(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new AnyTypeJsonSchema1BoxedList(validate(arg, configuration)); } + @Override public AnyTypeJsonSchema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new AnyTypeJsonSchema1BoxedMap(validate(arg, configuration)); } + + @Override + public AnyTypeJsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } \ No newline at end of file diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/BooleanJsonSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/BooleanJsonSchema.java index 9cb93203682..2cceae9d49f 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/BooleanJsonSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/BooleanJsonSchema.java @@ -18,20 +18,16 @@ import java.util.Set; public class BooleanJsonSchema { - public static abstract sealed class BooleanJsonSchema1Boxed permits BooleanJsonSchema1BoxedBoolean { - public abstract @Nullable Object data(); + public sealed interface BooleanJsonSchema1Boxed permits BooleanJsonSchema1BoxedBoolean { + @Nullable Object getData(); } - public static final class BooleanJsonSchema1BoxedBoolean extends BooleanJsonSchema1Boxed { - public final boolean data; - private BooleanJsonSchema1BoxedBoolean(boolean data) { - this.data = data; - } + public record BooleanJsonSchema1BoxedBoolean(boolean data) implements BooleanJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class BooleanJsonSchema1 extends JsonSchema implements BooleanSchemaValidator { + public static class BooleanJsonSchema1 extends JsonSchema implements BooleanSchemaValidator { private static @Nullable BooleanJsonSchema1 instance = null; protected BooleanJsonSchema1() { @@ -80,5 +76,14 @@ public boolean validate(boolean arg, SchemaConfiguration configuration) throws V public BooleanJsonSchema1BoxedBoolean validateAndBox(boolean arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new BooleanJsonSchema1BoxedBoolean(validate(arg, configuration)); } + + @Override + public BooleanJsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } \ No newline at end of file diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/DateJsonSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/DateJsonSchema.java index 48da817d9b1..15b5ca67f26 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/DateJsonSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/DateJsonSchema.java @@ -19,21 +19,17 @@ import java.util.Set; public class DateJsonSchema { - public static abstract sealed class DateJsonSchema1Boxed permits DateJsonSchema1BoxedString { - public abstract @Nullable Object data(); + public sealed interface DateJsonSchema1Boxed permits DateJsonSchema1BoxedString { + @Nullable Object getData(); } - public static final class DateJsonSchema1BoxedString extends DateJsonSchema1Boxed { - public final String data; - private DateJsonSchema1BoxedString(String data) { - this.data = data; - } + public record DateJsonSchema1BoxedString(String data) implements DateJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class DateJsonSchema1 extends JsonSchema implements StringSchemaValidator { + public static class DateJsonSchema1 extends JsonSchema implements StringSchemaValidator { private static @Nullable DateJsonSchema1 instance = null; protected DateJsonSchema1() { @@ -87,5 +83,13 @@ public String validate(LocalDate arg, SchemaConfiguration configuration) throws public DateJsonSchema1BoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new DateJsonSchema1BoxedString(validate(arg, configuration)); } + + @Override + public DateJsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } \ No newline at end of file diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/DateTimeJsonSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/DateTimeJsonSchema.java index 9e048ab2c07..e695f3c2ac9 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/DateTimeJsonSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/DateTimeJsonSchema.java @@ -19,21 +19,17 @@ import java.util.Set; public class DateTimeJsonSchema { - public static abstract sealed class DateTimeJsonSchema1Boxed permits DateTimeJsonSchema1BoxedString { - public abstract @Nullable Object data(); + public sealed interface DateTimeJsonSchema1Boxed permits DateTimeJsonSchema1BoxedString { + @Nullable Object getData(); } - public static final class DateTimeJsonSchema1BoxedString extends DateTimeJsonSchema1Boxed { - public final String data; - private DateTimeJsonSchema1BoxedString(String data) { - this.data = data; - } + public record DateTimeJsonSchema1BoxedString(String data) implements DateTimeJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class DateTimeJsonSchema1 extends JsonSchema implements StringSchemaValidator { + public static class DateTimeJsonSchema1 extends JsonSchema implements StringSchemaValidator { private static @Nullable DateTimeJsonSchema1 instance = null; protected DateTimeJsonSchema1() { @@ -87,5 +83,13 @@ public String validate(ZonedDateTime arg, SchemaConfiguration configuration) thr public DateTimeJsonSchema1BoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new DateTimeJsonSchema1BoxedString(validate(arg, configuration)); } + + @Override + public DateTimeJsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } \ No newline at end of file diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/DecimalJsonSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/DecimalJsonSchema.java index af820a6b251..f961e94f802 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/DecimalJsonSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/DecimalJsonSchema.java @@ -18,21 +18,17 @@ import java.util.Set; public class DecimalJsonSchema { - public static abstract sealed class DecimalJsonSchema1Boxed permits DecimalJsonSchema1BoxedString { - public abstract @Nullable Object data(); + public sealed interface DecimalJsonSchema1Boxed permits DecimalJsonSchema1BoxedString { + @Nullable Object getData(); } - public static final class DecimalJsonSchema1BoxedString extends DecimalJsonSchema1Boxed { - public final String data; - private DecimalJsonSchema1BoxedString(String data) { - this.data = data; - } + public record DecimalJsonSchema1BoxedString(String data) implements DecimalJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class DecimalJsonSchema1 extends JsonSchema implements StringSchemaValidator { + public static class DecimalJsonSchema1 extends JsonSchema implements StringSchemaValidator { private static @Nullable DecimalJsonSchema1 instance = null; protected DecimalJsonSchema1() { @@ -80,5 +76,13 @@ public String validate(String arg, SchemaConfiguration configuration) throws Val public DecimalJsonSchema1BoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new DecimalJsonSchema1BoxedString(validate(arg, configuration)); } + + @Override + public DecimalJsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } \ No newline at end of file diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/DoubleJsonSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/DoubleJsonSchema.java index 8219f3ca213..56f7894f670 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/DoubleJsonSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/DoubleJsonSchema.java @@ -18,21 +18,17 @@ import java.util.Set; public class DoubleJsonSchema { - public static abstract sealed class DoubleJsonSchema1Boxed permits DoubleJsonSchema1BoxedNumber { - public abstract @Nullable Object data(); + public sealed interface DoubleJsonSchema1Boxed permits DoubleJsonSchema1BoxedNumber { + @Nullable Object getData(); } - public static final class DoubleJsonSchema1BoxedNumber extends DoubleJsonSchema1Boxed { - public final Number data; - private DoubleJsonSchema1BoxedNumber(Number data) { - this.data = data; - } + public record DoubleJsonSchema1BoxedNumber(Number data) implements DoubleJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class DoubleJsonSchema1 extends JsonSchema implements NumberSchemaValidator { + public static class DoubleJsonSchema1 extends JsonSchema implements NumberSchemaValidator { private static @Nullable DoubleJsonSchema1 instance = null; protected DoubleJsonSchema1() { @@ -84,5 +80,13 @@ public double validate(double arg, SchemaConfiguration configuration) { public DoubleJsonSchema1BoxedNumber validateAndBox(Number arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new DoubleJsonSchema1BoxedNumber(validate(arg, configuration)); } + + @Override + public DoubleJsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } \ No newline at end of file diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/FloatJsonSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/FloatJsonSchema.java index 42e3806e845..65221627b46 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/FloatJsonSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/FloatJsonSchema.java @@ -18,21 +18,17 @@ import java.util.Set; public class FloatJsonSchema { - public static abstract sealed class FloatJsonSchema1Boxed permits FloatJsonSchema1BoxedNumber { - public abstract @Nullable Object data(); + public sealed interface FloatJsonSchema1Boxed permits FloatJsonSchema1BoxedNumber { + @Nullable Object getData(); } - public static final class FloatJsonSchema1BoxedNumber extends FloatJsonSchema1Boxed { - public final Number data; - private FloatJsonSchema1BoxedNumber(Number data) { - this.data = data; - } + public record FloatJsonSchema1BoxedNumber(Number data) implements FloatJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class FloatJsonSchema1 extends JsonSchema implements NumberSchemaValidator { + public static class FloatJsonSchema1 extends JsonSchema implements NumberSchemaValidator { private static @Nullable FloatJsonSchema1 instance = null; protected FloatJsonSchema1() { @@ -84,5 +80,13 @@ public float validate(float arg, SchemaConfiguration configuration) { public FloatJsonSchema1BoxedNumber validateAndBox(Number arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new FloatJsonSchema1BoxedNumber(validate(arg, configuration)); } + + @Override + public FloatJsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/Int32JsonSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/Int32JsonSchema.java index c9ae84e53f4..836fa1db724 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/Int32JsonSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/Int32JsonSchema.java @@ -18,21 +18,17 @@ import java.util.Set; public class Int32JsonSchema { - public static abstract sealed class Int32JsonSchema1Boxed permits Int32JsonSchema1BoxedNumber { - public abstract @Nullable Object data(); + public sealed interface Int32JsonSchema1Boxed permits Int32JsonSchema1BoxedNumber { + @Nullable Object getData(); } - public static final class Int32JsonSchema1BoxedNumber extends Int32JsonSchema1Boxed { - public final Number data; - private Int32JsonSchema1BoxedNumber(Number data) { - this.data = data; - } + public record Int32JsonSchema1BoxedNumber(Number data) implements Int32JsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Int32JsonSchema1 extends JsonSchema implements NumberSchemaValidator { + public static class Int32JsonSchema1 extends JsonSchema implements NumberSchemaValidator { private static @Nullable Int32JsonSchema1 instance = null; protected Int32JsonSchema1() { @@ -91,5 +87,13 @@ public float validate(float arg, SchemaConfiguration configuration) throws Valid public Int32JsonSchema1BoxedNumber validateAndBox(Number arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Int32JsonSchema1BoxedNumber(validate(arg, configuration)); } + + @Override + public Int32JsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } \ No newline at end of file diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/Int64JsonSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/Int64JsonSchema.java index e74999992ef..da3f9d8d5f7 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/Int64JsonSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/Int64JsonSchema.java @@ -18,21 +18,17 @@ import java.util.Set; public class Int64JsonSchema { - public static abstract sealed class Int64JsonSchema1Boxed permits Int64JsonSchema1BoxedNumber { - public abstract @Nullable Object data(); + public sealed interface Int64JsonSchema1Boxed permits Int64JsonSchema1BoxedNumber { + @Nullable Object getData(); } - public static final class Int64JsonSchema1BoxedNumber extends Int64JsonSchema1Boxed { - public final Number data; - private Int64JsonSchema1BoxedNumber(Number data) { - this.data = data; - } + public record Int64JsonSchema1BoxedNumber(Number data) implements Int64JsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Int64JsonSchema1 extends JsonSchema implements NumberSchemaValidator { + public static class Int64JsonSchema1 extends JsonSchema implements NumberSchemaValidator { private static @Nullable Int64JsonSchema1 instance = null; protected Int64JsonSchema1() { @@ -101,5 +97,13 @@ public double validate(double arg, SchemaConfiguration configuration) throws Val public Int64JsonSchema1BoxedNumber validateAndBox(Number arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Int64JsonSchema1BoxedNumber(validate(arg, configuration)); } + + @Override + public Int64JsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } \ No newline at end of file diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/IntJsonSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/IntJsonSchema.java index 42568a55f34..6205c5b4380 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/IntJsonSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/IntJsonSchema.java @@ -18,21 +18,17 @@ import java.util.Set; public class IntJsonSchema { - public static abstract sealed class IntJsonSchema1Boxed permits IntJsonSchema1BoxedNumber { - public abstract @Nullable Object data(); + public sealed interface IntJsonSchema1Boxed permits IntJsonSchema1BoxedNumber { + @Nullable Object getData(); } - public static final class IntJsonSchema1BoxedNumber extends IntJsonSchema1Boxed { - public final Number data; - private IntJsonSchema1BoxedNumber(Number data) { - this.data = data; - } + public record IntJsonSchema1BoxedNumber(Number data) implements IntJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class IntJsonSchema1 extends JsonSchema implements NumberSchemaValidator { + public static class IntJsonSchema1 extends JsonSchema implements NumberSchemaValidator { private static @Nullable IntJsonSchema1 instance = null; protected IntJsonSchema1() { @@ -101,5 +97,13 @@ public double validate(double arg, SchemaConfiguration configuration) throws Val public IntJsonSchema1BoxedNumber validateAndBox(Number arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new IntJsonSchema1BoxedNumber(validate(arg, configuration)); } + + @Override + public IntJsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } \ No newline at end of file diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/ListJsonSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/ListJsonSchema.java index 855e63d6573..7ebb3106467 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/ListJsonSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/ListJsonSchema.java @@ -21,21 +21,17 @@ import java.util.Set; public class ListJsonSchema { - public static abstract sealed class ListJsonSchema1Boxed permits ListJsonSchema1BoxedList { - public abstract @Nullable Object data(); + public sealed interface ListJsonSchema1Boxed permits ListJsonSchema1BoxedList { + @Nullable Object getData(); } - public static final class ListJsonSchema1BoxedList extends ListJsonSchema1Boxed { - public final FrozenList<@Nullable Object> data; - private ListJsonSchema1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record ListJsonSchema1BoxedList(FrozenList<@Nullable Object> data) implements ListJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ListJsonSchema1 extends JsonSchema implements ListSchemaValidator, ListJsonSchema1BoxedList> { + public static class ListJsonSchema1 extends JsonSchema implements ListSchemaValidator, ListJsonSchema1BoxedList> { private static @Nullable ListJsonSchema1 instance = null; protected ListJsonSchema1() { @@ -58,11 +54,11 @@ public static ListJsonSchema1 getInstance() { for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object castItem = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; @@ -101,5 +97,13 @@ public static ListJsonSchema1 getInstance() { public ListJsonSchema1BoxedList validateAndBox(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ListJsonSchema1BoxedList(validate(arg, configuration)); } + + @Override + public ListJsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/MapJsonSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/MapJsonSchema.java index 568471e3c8d..47e141dac53 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/MapJsonSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/MapJsonSchema.java @@ -22,21 +22,17 @@ import java.util.Set; public class MapJsonSchema { - public static abstract sealed class MapJsonSchema1Boxed permits MapJsonSchema1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface MapJsonSchema1Boxed permits MapJsonSchema1BoxedMap { + @Nullable Object getData(); } - public static final class MapJsonSchema1BoxedMap extends MapJsonSchema1Boxed { - public final FrozenMap<@Nullable Object> data; - private MapJsonSchema1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record MapJsonSchema1BoxedMap(FrozenMap<@Nullable Object> data) implements MapJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class MapJsonSchema1 extends JsonSchema implements MapSchemaValidator, MapJsonSchema1BoxedMap> { + public static class MapJsonSchema1 extends JsonSchema implements MapSchemaValidator, MapJsonSchema1BoxedMap> { private static @Nullable MapJsonSchema1 instance = null; protected MapJsonSchema1() { @@ -64,11 +60,11 @@ public static MapJsonSchema1 getInstance() { List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object castValue = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } @@ -105,5 +101,13 @@ public static MapJsonSchema1 getInstance() { public MapJsonSchema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new MapJsonSchema1BoxedMap(validate(arg, configuration)); } + + @Override + public MapJsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/NotAnyTypeJsonSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/NotAnyTypeJsonSchema.java index 705bb7aa6b9..de1ed91b0cd 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/NotAnyTypeJsonSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/NotAnyTypeJsonSchema.java @@ -31,71 +31,47 @@ import java.util.UUID; public class NotAnyTypeJsonSchema { - public static abstract sealed class NotAnyTypeJsonSchema1Boxed permits NotAnyTypeJsonSchema1BoxedVoid, NotAnyTypeJsonSchema1BoxedBoolean, NotAnyTypeJsonSchema1BoxedNumber, NotAnyTypeJsonSchema1BoxedString, NotAnyTypeJsonSchema1BoxedList, NotAnyTypeJsonSchema1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface NotAnyTypeJsonSchema1Boxed permits NotAnyTypeJsonSchema1BoxedVoid, NotAnyTypeJsonSchema1BoxedBoolean, NotAnyTypeJsonSchema1BoxedNumber, NotAnyTypeJsonSchema1BoxedString, NotAnyTypeJsonSchema1BoxedList, NotAnyTypeJsonSchema1BoxedMap { + @Nullable Object getData(); } - public static final class NotAnyTypeJsonSchema1BoxedVoid extends NotAnyTypeJsonSchema1Boxed { - public final Void data; - private NotAnyTypeJsonSchema1BoxedVoid(Void data) { - this.data = data; - } + public record NotAnyTypeJsonSchema1BoxedVoid(Void data) implements NotAnyTypeJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NotAnyTypeJsonSchema1BoxedBoolean extends NotAnyTypeJsonSchema1Boxed { - public final boolean data; - private NotAnyTypeJsonSchema1BoxedBoolean(boolean data) { - this.data = data; - } + public record NotAnyTypeJsonSchema1BoxedBoolean(boolean data) implements NotAnyTypeJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NotAnyTypeJsonSchema1BoxedNumber extends NotAnyTypeJsonSchema1Boxed { - public final Number data; - private NotAnyTypeJsonSchema1BoxedNumber(Number data) { - this.data = data; - } + public record NotAnyTypeJsonSchema1BoxedNumber(Number data) implements NotAnyTypeJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NotAnyTypeJsonSchema1BoxedString extends NotAnyTypeJsonSchema1Boxed { - public final String data; - private NotAnyTypeJsonSchema1BoxedString(String data) { - this.data = data; - } + public record NotAnyTypeJsonSchema1BoxedString(String data) implements NotAnyTypeJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NotAnyTypeJsonSchema1BoxedList extends NotAnyTypeJsonSchema1Boxed { - public final FrozenList<@Nullable Object> data; - private NotAnyTypeJsonSchema1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record NotAnyTypeJsonSchema1BoxedList(FrozenList<@Nullable Object> data) implements NotAnyTypeJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NotAnyTypeJsonSchema1BoxedMap extends NotAnyTypeJsonSchema1Boxed { - public final FrozenMap<@Nullable Object> data; - private NotAnyTypeJsonSchema1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record NotAnyTypeJsonSchema1BoxedMap(FrozenMap<@Nullable Object> data) implements NotAnyTypeJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class NotAnyTypeJsonSchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, NotAnyTypeJsonSchema1BoxedList>, MapSchemaValidator, NotAnyTypeJsonSchema1BoxedMap> { + public static class NotAnyTypeJsonSchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, NotAnyTypeJsonSchema1BoxedList>, MapSchemaValidator, NotAnyTypeJsonSchema1BoxedMap> { private static @Nullable NotAnyTypeJsonSchema1 instance = null; protected NotAnyTypeJsonSchema1() { @@ -194,11 +170,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object castItem = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; @@ -229,11 +205,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object castValue = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } @@ -293,25 +269,50 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public NotAnyTypeJsonSchema1BoxedVoid validateAndBox(Void arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new NotAnyTypeJsonSchema1BoxedVoid(validate(arg, configuration)); } + @Override public NotAnyTypeJsonSchema1BoxedBoolean validateAndBox(boolean arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new NotAnyTypeJsonSchema1BoxedBoolean(validate(arg, configuration)); } + @Override public NotAnyTypeJsonSchema1BoxedNumber validateAndBox(Number arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new NotAnyTypeJsonSchema1BoxedNumber(validate(arg, configuration)); } + @Override public NotAnyTypeJsonSchema1BoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new NotAnyTypeJsonSchema1BoxedString(validate(arg, configuration)); } + @Override public NotAnyTypeJsonSchema1BoxedList validateAndBox(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new NotAnyTypeJsonSchema1BoxedList(validate(arg, configuration)); } + @Override public NotAnyTypeJsonSchema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new NotAnyTypeJsonSchema1BoxedMap(validate(arg, configuration)); } + + @Override + public NotAnyTypeJsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } \ No newline at end of file diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/NullJsonSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/NullJsonSchema.java index 5882a7f23e5..d028dbf295e 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/NullJsonSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/NullJsonSchema.java @@ -18,21 +18,17 @@ import java.util.Set; public class NullJsonSchema { - public static abstract sealed class NullJsonSchema1Boxed permits NullJsonSchema1BoxedVoid { - public abstract @Nullable Object data(); + public sealed interface NullJsonSchema1Boxed permits NullJsonSchema1BoxedVoid { + @Nullable Object getData(); } - public static final class NullJsonSchema1BoxedVoid extends NullJsonSchema1Boxed { - public final Void data; - private NullJsonSchema1BoxedVoid(Void data) { - this.data = data; - } + public record NullJsonSchema1BoxedVoid(Void data) implements NullJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class NullJsonSchema1 extends JsonSchema implements NullSchemaValidator { + public static class NullJsonSchema1 extends JsonSchema implements NullSchemaValidator { private static @Nullable NullJsonSchema1 instance = null; protected NullJsonSchema1() { @@ -79,5 +75,14 @@ public Void validate(Void arg, SchemaConfiguration configuration) throws Validat public NullJsonSchema1BoxedVoid validateAndBox(Void arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new NullJsonSchema1BoxedVoid(validate(arg, configuration)); } + + @Override + public NullJsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/NumberJsonSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/NumberJsonSchema.java index 1340dcc4420..5c33b047d95 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/NumberJsonSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/NumberJsonSchema.java @@ -18,21 +18,17 @@ import java.util.Set; public class NumberJsonSchema { - public static abstract sealed class NumberJsonSchema1Boxed permits NumberJsonSchema1BoxedNumber { - public abstract @Nullable Object data(); + public sealed interface NumberJsonSchema1Boxed permits NumberJsonSchema1BoxedNumber { + @Nullable Object getData(); } - public static final class NumberJsonSchema1BoxedNumber extends NumberJsonSchema1Boxed { - public final Number data; - private NumberJsonSchema1BoxedNumber(Number data) { - this.data = data; - } + public record NumberJsonSchema1BoxedNumber(Number data) implements NumberJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class NumberJsonSchema1 extends JsonSchema implements NumberSchemaValidator { + public static class NumberJsonSchema1 extends JsonSchema implements NumberSchemaValidator { private static @Nullable NumberJsonSchema1 instance = null; protected NumberJsonSchema1() { @@ -100,5 +96,13 @@ public double validate(double arg, SchemaConfiguration configuration) { public NumberJsonSchema1BoxedNumber validateAndBox(Number arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new NumberJsonSchema1BoxedNumber(validate(arg, configuration)); } + + @Override + public NumberJsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } \ No newline at end of file diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/StringJsonSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/StringJsonSchema.java index 2cd0e21f94d..749f5faba63 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/StringJsonSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/StringJsonSchema.java @@ -21,20 +21,16 @@ import java.util.UUID; public class StringJsonSchema { - public static abstract sealed class StringJsonSchema1Boxed permits StringJsonSchema1BoxedString { - public abstract @Nullable Object data(); + public sealed interface StringJsonSchema1Boxed permits StringJsonSchema1BoxedString { + @Nullable Object getData(); } - public static final class StringJsonSchema1BoxedString extends StringJsonSchema1Boxed { - public final String data; - private StringJsonSchema1BoxedString(String data) { - this.data = data; - } + public record StringJsonSchema1BoxedString(String data) implements StringJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class StringJsonSchema1 extends JsonSchema implements StringSchemaValidator { + public static class StringJsonSchema1 extends JsonSchema implements StringSchemaValidator { private static @Nullable StringJsonSchema1 instance = null; protected StringJsonSchema1() { @@ -99,5 +95,13 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public StringJsonSchema1BoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new StringJsonSchema1BoxedString(validate(arg, configuration)); } + + @Override + public StringJsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/UuidJsonSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/UuidJsonSchema.java index 2506b53a958..c2087929db7 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/UuidJsonSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/UuidJsonSchema.java @@ -19,21 +19,17 @@ import java.util.UUID; public class UuidJsonSchema { - public static abstract sealed class UuidJsonSchema1Boxed permits UuidJsonSchema1BoxedString { - public abstract @Nullable Object data(); + public sealed interface UuidJsonSchema1Boxed permits UuidJsonSchema1BoxedString { + @Nullable Object getData(); } - public static final class UuidJsonSchema1BoxedString extends UuidJsonSchema1Boxed { - public final String data; - private UuidJsonSchema1BoxedString(String data) { - this.data = data; - } + public record UuidJsonSchema1BoxedString(String data) implements UuidJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class UuidJsonSchema1 extends JsonSchema implements StringSchemaValidator { + public static class UuidJsonSchema1 extends JsonSchema implements StringSchemaValidator { private static @Nullable UuidJsonSchema1 instance = null; protected UuidJsonSchema1() { @@ -87,5 +83,13 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public UuidJsonSchema1BoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new UuidJsonSchema1BoxedString(validate(arg, configuration)); } + + @Override + public UuidJsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } \ No newline at end of file diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/AdditionalPropertiesValidator.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/AdditionalPropertiesValidator.java index 2548452a115..64d9f476798 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/AdditionalPropertiesValidator.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/AdditionalPropertiesValidator.java @@ -43,7 +43,7 @@ public class AdditionalPropertiesValidator implements KeywordValidator { data.validationMetadata().validatedPathToSchemas(), data.validationMetadata().seenClasses() ); - JsonSchema addPropsSchema = JsonSchemaFactory.getInstance(additionalProperties); + JsonSchema addPropsSchema = JsonSchemaFactory.getInstance(additionalProperties); if (propValidationMetadata.validationRanEarlier(addPropsSchema)) { // todo add_deeper_validated_schemas continue; diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/AllOfValidator.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/AllOfValidator.java index 583017ea6b5..eb6bcf21d4a 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/AllOfValidator.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/AllOfValidator.java @@ -11,8 +11,8 @@ public class AllOfValidator implements KeywordValidator { return null; } PathToSchemasMap pathToSchemas = new PathToSchemasMap(); - for(Class allOfClass: allOf) { - JsonSchema allOfSchema = JsonSchemaFactory.getInstance(allOfClass); + for(Class> allOfClass: allOf) { + JsonSchema allOfSchema = JsonSchemaFactory.getInstance(allOfClass); PathToSchemasMap otherPathToSchemas = JsonSchema.validate(allOfSchema, data.arg(), data.validationMetadata()); pathToSchemas.update(otherPathToSchemas); } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/AnyOfValidator.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/AnyOfValidator.java index 062fa2eecdc..d466518d3fe 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/AnyOfValidator.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/AnyOfValidator.java @@ -16,8 +16,8 @@ public class AnyOfValidator implements KeywordValidator { return null; } PathToSchemasMap pathToSchemas = new PathToSchemasMap(); - List> validatedAnyOfClasses = new ArrayList<>(); - for(Class anyOfClass: anyOf) { + List>> validatedAnyOfClasses = new ArrayList<>(); + for(Class> anyOfClass: anyOf) { if (anyOfClass == data.schema().getClass()) { /* optimistically assume that schema will pass validation @@ -27,7 +27,7 @@ public class AnyOfValidator implements KeywordValidator { continue; } try { - JsonSchema anyOfSchema = JsonSchemaFactory.getInstance(anyOfClass); + JsonSchema anyOfSchema = JsonSchemaFactory.getInstance(anyOfClass); PathToSchemasMap otherPathToSchemas = JsonSchema.validate(anyOfSchema, data.arg(), data.validationMetadata()); validatedAnyOfClasses.add(anyOfClass); pathToSchemas.update(otherPathToSchemas); diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/DependentSchemasValidator.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/DependentSchemasValidator.java index 940157d3b48..e329529fe8a 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/DependentSchemasValidator.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/DependentSchemasValidator.java @@ -25,13 +25,13 @@ public class DependentSchemasValidator implements KeywordValidator { presentProperties.add((String) key); } } - for(Map.Entry> entry: dependentSchemas.entrySet()) { + for(Map.Entry>> entry: dependentSchemas.entrySet()) { String propName = entry.getKey(); if (!presentProperties.contains(propName)) { continue; } - Class dependentSchemaClass = entry.getValue(); - JsonSchema dependentSchema = JsonSchemaFactory.getInstance(dependentSchemaClass); + Class> dependentSchemaClass = entry.getValue(); + JsonSchema dependentSchema = JsonSchemaFactory.getInstance(dependentSchemaClass); PathToSchemasMap otherPathToSchemas = JsonSchema.validate(dependentSchema, mapArg, data.validationMetadata()); pathToSchemas.update(otherPathToSchemas); } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ElseValidator.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ElseValidator.java index b0ba9ecbc0a..3f50d9326c4 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ElseValidator.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ElseValidator.java @@ -22,7 +22,7 @@ public class ElseValidator implements KeywordValidator { // if validation is true return null; } - JsonSchema elseSchemaInstance = JsonSchemaFactory.getInstance(elseSchema); + JsonSchema elseSchemaInstance = JsonSchemaFactory.getInstance(elseSchema); PathToSchemasMap pathToSchemas = new PathToSchemasMap(); var elsePathToSchemas = JsonSchema.validate(elseSchemaInstance, data.arg(), data.validationMetadata()); // todo capture validation error and describe it as an else error? diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ItemsValidator.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ItemsValidator.java index 5bd194d47a9..1b03c0b3094 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ItemsValidator.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ItemsValidator.java @@ -22,7 +22,7 @@ public class ItemsValidator implements KeywordValidator { } PathToSchemasMap pathToSchemas = new PathToSchemasMap(); int minIndex = data.schema().prefixItems != null ? data.schema().prefixItems.size() : 0; - JsonSchema itemsSchema = JsonSchemaFactory.getInstance(items); + JsonSchema itemsSchema = JsonSchemaFactory.getInstance(items); for(int i = minIndex; i < listArg.size(); i++) { List itemPathToItem = new ArrayList<>(data.validationMetadata().pathToItem()); itemPathToItem.add(i); diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchema.java index 10d636e6b9d..beb7460b86c 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchema.java @@ -17,11 +17,11 @@ import java.util.UUID; import java.util.regex.Pattern; -public abstract class JsonSchema { +public abstract class JsonSchema { public final @Nullable Set> type; public final @Nullable String format; - public final @Nullable Class items; - public final @Nullable Map> properties; + public final @Nullable Class> items; + public final @Nullable Map>> properties; public final @Nullable Set required; public final @Nullable Number exclusiveMaximum; public final @Nullable Number exclusiveMinimum; @@ -34,11 +34,11 @@ public abstract class JsonSchema { public final @Nullable Number maximum; public final @Nullable Number minimum; public final @Nullable BigDecimal multipleOf; - public final @Nullable Class additionalProperties; - public final @Nullable List> allOf; - public final @Nullable List> anyOf; - public final @Nullable List> oneOf; - public final @Nullable Class not; + public final @Nullable Class> additionalProperties; + public final @Nullable List>> allOf; + public final @Nullable List>> anyOf; + public final @Nullable List>> oneOf; + public final @Nullable Class> not; public final @Nullable Boolean uniqueItems; public final @Nullable Set<@Nullable Object> enumValues; public final @Nullable Pattern pattern; @@ -46,19 +46,19 @@ public abstract class JsonSchema { public final boolean defaultValueSet; public final @Nullable Object constValue; public final boolean constValueSet; - public final @Nullable Class contains; + public final @Nullable Class> contains; public final @Nullable Integer maxContains; public final @Nullable Integer minContains; - public final @Nullable Class propertyNames; + public final @Nullable Class> propertyNames; public final @Nullable Map> dependentRequired; - public final @Nullable Map> dependentSchemas; - public final @Nullable Map> patternProperties; - public final @Nullable List> prefixItems; - public final @Nullable Class ifSchema; - public final @Nullable Class then; - public final @Nullable Class elseSchema; - public final @Nullable Class unevaluatedItems; - public final @Nullable Class unevaluatedProperties; + public final @Nullable Map>> dependentSchemas; + public final @Nullable Map>> patternProperties; + public final @Nullable List>> prefixItems; + public final @Nullable Class> ifSchema; + public final @Nullable Class> then; + public final @Nullable Class> elseSchema; + public final @Nullable Class> unevaluatedItems; + public final @Nullable Class> unevaluatedProperties; private final LinkedHashMap keywordToValidator; protected JsonSchema(JsonSchemaInfo jsonSchemaInfo) { @@ -223,6 +223,7 @@ protected JsonSchema(JsonSchemaInfo jsonSchemaInfo) { public abstract @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) throws InvalidTypeException; public abstract @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws InvalidTypeException, ValidationException; + public abstract T validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws InvalidTypeException, ValidationException; private List getContainsPathToSchemas( @Nullable Object arg, @@ -231,7 +232,7 @@ private List getContainsPathToSchemas( if (!(arg instanceof List listArg) || contains == null) { return new ArrayList<>(); } - JsonSchema containsSchema = JsonSchemaFactory.getInstance(contains); + JsonSchema containsSchema = JsonSchemaFactory.getInstance(contains); @Nullable List containsPathToSchemas = new ArrayList<>(); for(int i = 0; i < listArg.size(); i++) { PathToSchemasMap thesePathToSchemas = new PathToSchemasMap(); @@ -279,13 +280,13 @@ private PathToSchemasMap getPatternPropertiesPathToSchemas( validationMetadata.validatedPathToSchemas(), validationMetadata.seenClasses() ); - for (Map.Entry> patternPropEntry: patternProperties.entrySet()) { + for (Map.Entry>> patternPropEntry: patternProperties.entrySet()) { if (!patternPropEntry.getKey().matcher(key).find()) { continue; } - Class patternPropClass = patternPropEntry.getValue(); - JsonSchema patternPropSchema = JsonSchemaFactory.getInstance(patternPropClass); + Class> patternPropClass = patternPropEntry.getValue(); + JsonSchema patternPropSchema = JsonSchemaFactory.getInstance(patternPropClass); PathToSchemasMap otherPathToSchemas = JsonSchema.validate(patternPropSchema, entry.getValue(), propValidationMetadata); pathToSchemas.update(otherPathToSchemas); } @@ -300,7 +301,7 @@ private PathToSchemasMap getIfPathToSchemas( if (ifSchema == null) { return new PathToSchemasMap(); } - JsonSchema ifSchemaInstance = JsonSchemaFactory.getInstance(ifSchema); + JsonSchema ifSchemaInstance = JsonSchemaFactory.getInstance(ifSchema); PathToSchemasMap pathToSchemas = new PathToSchemasMap(); try { var otherPathToSchemas = JsonSchema.validate(ifSchemaInstance, arg, validationMetadata); @@ -310,7 +311,7 @@ private PathToSchemasMap getIfPathToSchemas( } public static PathToSchemasMap validate( - JsonSchema jsonSchema, + JsonSchema jsonSchema, @Nullable Object arg, ValidationMetadata validationMetadata ) throws ValidationException { @@ -361,7 +362,7 @@ public static PathToSchemasMap validate( if (!pathToSchemas.containsKey(pathToItem)) { pathToSchemas.put(validationMetadata.pathToItem(), new LinkedHashMap<>()); } - @Nullable LinkedHashMap schemas = pathToSchemas.get(pathToItem); + @Nullable LinkedHashMap, Void> schemas = pathToSchemas.get(pathToItem); if (schemas != null) { schemas.put(jsonSchema, null); } @@ -467,19 +468,19 @@ public String getNewInstance(String arg, List pathToItem, PathToSchemasM return arg; } - protected static PathToSchemasMap getPathToSchemas(JsonSchema jsonSchema, @Nullable Object arg, ValidationMetadata validationMetadata, Set> pathSet) { + protected static PathToSchemasMap getPathToSchemas(JsonSchema jsonSchema, @Nullable Object arg, ValidationMetadata validationMetadata, Set> pathSet) { PathToSchemasMap pathToSchemasMap = new PathToSchemasMap(); // todo add check of validationMetadata.validationRanEarlier(this) PathToSchemasMap otherPathToSchemas = validate(jsonSchema, arg, validationMetadata); pathToSchemasMap.update(otherPathToSchemas); for (var schemas: pathToSchemasMap.values()) { - JsonSchema firstSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema firstSchema = schemas.entrySet().iterator().next().getKey(); schemas.clear(); schemas.put(firstSchema, null); } pathSet.removeAll(pathToSchemasMap.keySet()); if (!pathSet.isEmpty()) { - LinkedHashMap unsetAnyTypeSchema = new LinkedHashMap<>(); + LinkedHashMap, Void> unsetAnyTypeSchema = new LinkedHashMap<>(); unsetAnyTypeSchema.put(UnsetAnyTypeJsonSchema.UnsetAnyTypeJsonSchema1.getInstance(), null); for (List pathToItem: pathSet) { pathToSchemasMap.put(pathToItem, unsetAnyTypeSchema); diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchemaFactory.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchemaFactory.java index 7c9b6402f2b..24729ac172d 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchemaFactory.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchemaFactory.java @@ -10,10 +10,10 @@ public class JsonSchemaFactory { - static Map, JsonSchema> classToInstance = new HashMap<>(); + static Map>, JsonSchema> classToInstance = new HashMap<>(); - public static V getInstance(Class schemaCls) { - @Nullable JsonSchema cacheInst = classToInstance.get(schemaCls); + public static > V getInstance(Class schemaCls) { + @Nullable JsonSchema cacheInst = classToInstance.get(schemaCls); if (cacheInst != null) { assert schemaCls.isInstance(cacheInst); return schemaCls.cast(cacheInst); diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchemaInfo.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchemaInfo.java index 8791c1c29ea..0a95fbbae6a 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchemaInfo.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/JsonSchemaInfo.java @@ -18,13 +18,13 @@ public JsonSchemaInfo format(String format) { this.format = format; return this; } - public @Nullable Class items = null; - public JsonSchemaInfo items(Class items) { + public @Nullable Class> items = null; + public JsonSchemaInfo items(Class> items) { this.items = items; return this; } - public @Nullable Map> properties = null; - public JsonSchemaInfo properties(Map> properties) { + public @Nullable Map>> properties = null; + public JsonSchemaInfo properties(Map>> properties) { this.properties = properties; return this; } @@ -88,28 +88,28 @@ public JsonSchemaInfo multipleOf(BigDecimal multipleOf) { this.multipleOf = multipleOf; return this; } - public @Nullable Class additionalProperties; - public JsonSchemaInfo additionalProperties(Class additionalProperties) { + public @Nullable Class> additionalProperties; + public JsonSchemaInfo additionalProperties(Class> additionalProperties) { this.additionalProperties = additionalProperties; return this; } - public @Nullable List> allOf = null; - public JsonSchemaInfo allOf(List> allOf) { + public @Nullable List>> allOf = null; + public JsonSchemaInfo allOf(List>> allOf) { this.allOf = allOf; return this; } - public @Nullable List> anyOf = null; - public JsonSchemaInfo anyOf(List> anyOf) { + public @Nullable List>> anyOf = null; + public JsonSchemaInfo anyOf(List>> anyOf) { this.anyOf = anyOf; return this; } - public @Nullable List> oneOf = null; - public JsonSchemaInfo oneOf(List> oneOf) { + public @Nullable List>> oneOf = null; + public JsonSchemaInfo oneOf(List>> oneOf) { this.oneOf = oneOf; return this; } - public @Nullable Class not = null; - public JsonSchemaInfo not(Class not) { + public @Nullable Class> not = null; + public JsonSchemaInfo not(Class> not) { this.not = not; return this; } @@ -142,8 +142,8 @@ public JsonSchemaInfo constValue(@Nullable Object constValue) { this.constValueSet = true; return this; } - public @Nullable Class contains = null; - public JsonSchemaInfo contains(Class contains) { + public @Nullable Class> contains = null; + public JsonSchemaInfo contains(Class> contains) { this.contains = contains; return this; } @@ -157,8 +157,8 @@ public JsonSchemaInfo minContains(Integer minContains) { this.minContains = minContains; return this; } - public @Nullable Class propertyNames = null; - public JsonSchemaInfo propertyNames(Class propertyNames) { + public @Nullable Class> propertyNames = null; + public JsonSchemaInfo propertyNames(Class> propertyNames) { this.propertyNames = propertyNames; return this; } @@ -167,43 +167,43 @@ public JsonSchemaInfo dependentRequired(Map> dependentRequir this.dependentRequired = dependentRequired; return this; } - public @Nullable Map> dependentSchemas = null; - public JsonSchemaInfo dependentSchemas(Map> dependentSchemas) { + public @Nullable Map>> dependentSchemas = null; + public JsonSchemaInfo dependentSchemas(Map>> dependentSchemas) { this.dependentSchemas = dependentSchemas; return this; } - public @Nullable Map> patternProperties = null; - public JsonSchemaInfo patternProperties(Map> patternProperties) { + public @Nullable Map>> patternProperties = null; + public JsonSchemaInfo patternProperties(Map>> patternProperties) { this.patternProperties = patternProperties; return this; } - public @Nullable List> prefixItems = null; - public JsonSchemaInfo prefixItems(List> prefixItems) { + public @Nullable List>> prefixItems = null; + public JsonSchemaInfo prefixItems(List>> prefixItems) { this.prefixItems = prefixItems; return this; } - public @Nullable Class ifSchema = null; - public JsonSchemaInfo ifSchema(Class ifSchema) { + public @Nullable Class> ifSchema = null; + public JsonSchemaInfo ifSchema(Class> ifSchema) { this.ifSchema = ifSchema; return this; } - public @Nullable Class then = null; - public JsonSchemaInfo then(Class then) { + public @Nullable Class> then = null; + public JsonSchemaInfo then(Class> then) { this.then = then; return this; } - public @Nullable Class elseSchema = null; - public JsonSchemaInfo elseSchema(Class elseSchema) { + public @Nullable Class> elseSchema = null; + public JsonSchemaInfo elseSchema(Class> elseSchema) { this.elseSchema = elseSchema; return this; } - public @Nullable Class unevaluatedItems = null; - public JsonSchemaInfo unevaluatedItems(Class unevaluatedItems) { + public @Nullable Class> unevaluatedItems = null; + public JsonSchemaInfo unevaluatedItems(Class> unevaluatedItems) { this.unevaluatedItems = unevaluatedItems; return this; } - public @Nullable Class unevaluatedProperties = null; - public JsonSchemaInfo unevaluatedProperties(Class unevaluatedProperties) { + public @Nullable Class> unevaluatedProperties = null; + public JsonSchemaInfo unevaluatedProperties(Class> unevaluatedProperties) { this.unevaluatedProperties = unevaluatedProperties; return this; } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/NotValidator.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/NotValidator.java index aa61be1b624..b077e2056a1 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/NotValidator.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/NotValidator.java @@ -14,7 +14,7 @@ public class NotValidator implements KeywordValidator { } PathToSchemasMap pathToSchemas; try { - JsonSchema notSchema = JsonSchemaFactory.getInstance(not); + JsonSchema notSchema = JsonSchemaFactory.getInstance(not); pathToSchemas = JsonSchema.validate(notSchema, data.arg(), data.validationMetadata()); } catch (ValidationException e) { return null; diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/OneOfValidator.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/OneOfValidator.java index f84f7796a8c..3c4f4b5a085 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/OneOfValidator.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/OneOfValidator.java @@ -16,8 +16,8 @@ public class OneOfValidator implements KeywordValidator { return null; } PathToSchemasMap pathToSchemas = new PathToSchemasMap(); - List> validatedOneOfClasses = new ArrayList<>(); - for(Class oneOfClass: oneOf) { + List>> validatedOneOfClasses = new ArrayList<>(); + for(Class> oneOfClass: oneOf) { if (oneOfClass == data.schema().getClass()) { /* optimistically assume that schema will pass validation @@ -27,7 +27,7 @@ public class OneOfValidator implements KeywordValidator { continue; } try { - JsonSchema oneOfSchema = JsonSchemaFactory.getInstance(oneOfClass); + JsonSchema oneOfSchema = JsonSchemaFactory.getInstance(oneOfClass); PathToSchemasMap otherPathToSchemas = JsonSchema.validate(oneOfSchema, data.arg(), data.validationMetadata()); validatedOneOfClasses.add(oneOfClass); pathToSchemas.update(otherPathToSchemas); diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PathToSchemasMap.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PathToSchemasMap.java index 6e199334d4c..a3ce89066a2 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PathToSchemasMap.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PathToSchemasMap.java @@ -5,12 +5,12 @@ import java.util.Map; @SuppressWarnings("serial") -public class PathToSchemasMap extends LinkedHashMap, LinkedHashMap> { +public class PathToSchemasMap extends LinkedHashMap, LinkedHashMap, Void>> { public void update(PathToSchemasMap other) { - for (Map.Entry, LinkedHashMap> entry: other.entrySet()) { + for (Map.Entry, LinkedHashMap, Void>> entry: other.entrySet()) { List pathToItem = entry.getKey(); - LinkedHashMap otherSchemas = entry.getValue(); + LinkedHashMap, Void> otherSchemas = entry.getValue(); if (containsKey(pathToItem)) { get(pathToItem).putAll(otherSchemas); } else { diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PrefixItemsValidator.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PrefixItemsValidator.java index 00e5b17607b..237bc250190 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PrefixItemsValidator.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PrefixItemsValidator.java @@ -31,7 +31,7 @@ public class PrefixItemsValidator implements KeywordValidator { data.validationMetadata().validatedPathToSchemas(), data.validationMetadata().seenClasses() ); - JsonSchema itemsSchema = JsonSchemaFactory.getInstance(prefixItems.get(i)); + JsonSchema itemsSchema = JsonSchemaFactory.getInstance(prefixItems.get(i)); PathToSchemasMap otherPathToSchemas = JsonSchema.validate(itemsSchema, listArg.get(i), itemValidationMetadata); pathToSchemas.update(otherPathToSchemas); } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PropertiesValidator.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PropertiesValidator.java index 17bccdd666a..b8ddd6fcb46 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PropertiesValidator.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PropertiesValidator.java @@ -27,7 +27,7 @@ public class PropertiesValidator implements KeywordValidator { presentProperties.add((String) key); } } - for(Map.Entry> entry: properties.entrySet()) { + for(Map.Entry>> entry: properties.entrySet()) { String propName = entry.getKey(); if (!presentProperties.contains(propName)) { continue; @@ -41,8 +41,8 @@ public class PropertiesValidator implements KeywordValidator { data.validationMetadata().validatedPathToSchemas(), data.validationMetadata().seenClasses() ); - Class propClass = entry.getValue(); - JsonSchema propSchema = JsonSchemaFactory.getInstance(propClass); + Class> propClass = entry.getValue(); + JsonSchema propSchema = JsonSchemaFactory.getInstance(propClass); if (propValidationMetadata.validationRanEarlier(propSchema)) { // todo add_deeper_validated_schemas continue; diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PropertyEntry.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PropertyEntry.java index aaaede643a0..8261eda6d49 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PropertyEntry.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PropertyEntry.java @@ -3,8 +3,8 @@ import java.util.AbstractMap; @SuppressWarnings("serial") -public class PropertyEntry extends AbstractMap.SimpleEntry> { - public PropertyEntry(String key, Class value) { +public class PropertyEntry extends AbstractMap.SimpleEntry>> { + public PropertyEntry(String key, Class> value) { super(key, value); } -} +} \ No newline at end of file diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PropertyNamesValidator.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PropertyNamesValidator.java index 55ea80b0382..087cd308b11 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PropertyNamesValidator.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/PropertyNamesValidator.java @@ -18,7 +18,7 @@ public class PropertyNamesValidator implements KeywordValidator { if (!(data.arg() instanceof Map mapArg)) { return null; } - JsonSchema propertyNamesSchema = JsonSchemaFactory.getInstance(propertyNames); + JsonSchema propertyNamesSchema = JsonSchemaFactory.getInstance(propertyNames); for (Object objKey: mapArg.keySet()) { if (objKey instanceof String key) { List propPathToItem = new ArrayList<>(data.validationMetadata().pathToItem()); diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ThenValidator.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ThenValidator.java index ad97e0e554e..bf599bc812f 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ThenValidator.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ThenValidator.java @@ -22,7 +22,7 @@ public class ThenValidator implements KeywordValidator { // if validation is false return null; } - JsonSchema thenSchema = JsonSchemaFactory.getInstance(then); + JsonSchema thenSchema = JsonSchemaFactory.getInstance(then); PathToSchemasMap pathToSchemas = new PathToSchemasMap(); var thenPathToSchemas = JsonSchema.validate(thenSchema, data.arg(), data.validationMetadata()); // todo capture validation error and describe it as an then error? diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UnevaluatedItemsValidator.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UnevaluatedItemsValidator.java index cfb88550525..8903d0b19a7 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UnevaluatedItemsValidator.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UnevaluatedItemsValidator.java @@ -26,7 +26,7 @@ public class UnevaluatedItemsValidator implements KeywordValidator { } PathToSchemasMap pathToSchemas = new PathToSchemasMap(); int minIndex = data.schema().prefixItems != null ? data.schema().prefixItems.size() : 0; - JsonSchema unevaluatedItemsSchema = JsonSchemaFactory.getInstance(unevaluatedItems); + JsonSchema unevaluatedItemsSchema = JsonSchemaFactory.getInstance(unevaluatedItems); for(int i = minIndex; i < listArg.size(); i++) { List itemPathToItem = new ArrayList<>(data.validationMetadata().pathToItem()); itemPathToItem.add(i); diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UnevaluatedPropertiesValidator.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UnevaluatedPropertiesValidator.java index abc7f7e86f9..344c0cfab1b 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UnevaluatedPropertiesValidator.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UnevaluatedPropertiesValidator.java @@ -24,7 +24,7 @@ public class UnevaluatedPropertiesValidator implements KeywordValidator { return null; } PathToSchemasMap pathToSchemas = new PathToSchemasMap(); - JsonSchema unevaluatedPropertiesSchema = JsonSchemaFactory.getInstance(unevaluatedProperties); + JsonSchema unevaluatedPropertiesSchema = JsonSchemaFactory.getInstance(unevaluatedProperties); for(Map.Entry entry: mapArg.entrySet()) { if (!(entry.getKey() instanceof String propName)) { throw new InvalidTypeException("Map keys must be strings"); diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UnsetAnyTypeJsonSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UnsetAnyTypeJsonSchema.java index 90b9e3b1870..1c23a427dd0 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UnsetAnyTypeJsonSchema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/UnsetAnyTypeJsonSchema.java @@ -19,70 +19,46 @@ import java.util.UUID; public class UnsetAnyTypeJsonSchema { - public static abstract sealed class UnsetAnyTypeJsonSchema1Boxed permits UnsetAnyTypeJsonSchema1BoxedVoid, UnsetAnyTypeJsonSchema1BoxedBoolean, UnsetAnyTypeJsonSchema1BoxedNumber, UnsetAnyTypeJsonSchema1BoxedString, UnsetAnyTypeJsonSchema1BoxedList, UnsetAnyTypeJsonSchema1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface UnsetAnyTypeJsonSchema1Boxed permits UnsetAnyTypeJsonSchema1BoxedVoid, UnsetAnyTypeJsonSchema1BoxedBoolean, UnsetAnyTypeJsonSchema1BoxedNumber, UnsetAnyTypeJsonSchema1BoxedString, UnsetAnyTypeJsonSchema1BoxedList, UnsetAnyTypeJsonSchema1BoxedMap { + @Nullable Object getData(); } - public static final class UnsetAnyTypeJsonSchema1BoxedVoid extends UnsetAnyTypeJsonSchema1Boxed { - public final Void data; - private UnsetAnyTypeJsonSchema1BoxedVoid(Void data) { - this.data = data; - } + public record UnsetAnyTypeJsonSchema1BoxedVoid(Void data) implements UnsetAnyTypeJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UnsetAnyTypeJsonSchema1BoxedBoolean extends UnsetAnyTypeJsonSchema1Boxed { - public final boolean data; - private UnsetAnyTypeJsonSchema1BoxedBoolean(boolean data) { - this.data = data; - } + public record UnsetAnyTypeJsonSchema1BoxedBoolean(boolean data) implements UnsetAnyTypeJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UnsetAnyTypeJsonSchema1BoxedNumber extends UnsetAnyTypeJsonSchema1Boxed { - public final Number data; - private UnsetAnyTypeJsonSchema1BoxedNumber(Number data) { - this.data = data; - } + public record UnsetAnyTypeJsonSchema1BoxedNumber(Number data) implements UnsetAnyTypeJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UnsetAnyTypeJsonSchema1BoxedString extends UnsetAnyTypeJsonSchema1Boxed { - public final String data; - private UnsetAnyTypeJsonSchema1BoxedString(String data) { - this.data = data; - } + public record UnsetAnyTypeJsonSchema1BoxedString(String data) implements UnsetAnyTypeJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UnsetAnyTypeJsonSchema1BoxedList extends UnsetAnyTypeJsonSchema1Boxed { - public final FrozenList<@Nullable Object> data; - private UnsetAnyTypeJsonSchema1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record UnsetAnyTypeJsonSchema1BoxedList(FrozenList<@Nullable Object> data) implements UnsetAnyTypeJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UnsetAnyTypeJsonSchema1BoxedMap extends UnsetAnyTypeJsonSchema1Boxed { - public final FrozenMap<@Nullable Object> data; - private UnsetAnyTypeJsonSchema1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record UnsetAnyTypeJsonSchema1BoxedMap(FrozenMap<@Nullable Object> data) implements UnsetAnyTypeJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class UnsetAnyTypeJsonSchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, UnsetAnyTypeJsonSchema1BoxedList>, MapSchemaValidator, UnsetAnyTypeJsonSchema1BoxedMap> { + public static class UnsetAnyTypeJsonSchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, UnsetAnyTypeJsonSchema1BoxedList>, MapSchemaValidator, UnsetAnyTypeJsonSchema1BoxedMap> { private static @Nullable UnsetAnyTypeJsonSchema1 instance = null; protected UnsetAnyTypeJsonSchema1() { @@ -179,11 +155,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object castItem = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; @@ -214,11 +190,11 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object castValue = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } @@ -278,25 +254,50 @@ public String validate(UUID arg, SchemaConfiguration configuration) throws Valid public UnsetAnyTypeJsonSchema1BoxedVoid validateAndBox(Void arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new UnsetAnyTypeJsonSchema1BoxedVoid(validate(arg, configuration)); } + @Override public UnsetAnyTypeJsonSchema1BoxedBoolean validateAndBox(boolean arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new UnsetAnyTypeJsonSchema1BoxedBoolean(validate(arg, configuration)); } + @Override public UnsetAnyTypeJsonSchema1BoxedNumber validateAndBox(Number arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new UnsetAnyTypeJsonSchema1BoxedNumber(validate(arg, configuration)); } + @Override public UnsetAnyTypeJsonSchema1BoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new UnsetAnyTypeJsonSchema1BoxedString(validate(arg, configuration)); } + @Override public UnsetAnyTypeJsonSchema1BoxedList validateAndBox(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new UnsetAnyTypeJsonSchema1BoxedList(validate(arg, configuration)); } + @Override public UnsetAnyTypeJsonSchema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new UnsetAnyTypeJsonSchema1BoxedMap(validate(arg, configuration)); } + + @Override + public UnsetAnyTypeJsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } \ No newline at end of file diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ValidationData.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ValidationData.java index d5c4f5de75a..1563757d83a 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ValidationData.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ValidationData.java @@ -5,7 +5,7 @@ import java.util.List; public record ValidationData( - JsonSchema schema, + JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata, @Nullable List containsPathToSchemas, @@ -14,7 +14,7 @@ public record ValidationData( @Nullable PathToSchemasMap knownPathToSchemas ) { public ValidationData( - JsonSchema schema, + JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata ) { diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ValidationMetadata.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ValidationMetadata.java index 8d83f3b6207..9756257f507 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ValidationMetadata.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/schemas/validation/ValidationMetadata.java @@ -13,8 +13,8 @@ public record ValidationMetadata( Set> seenClasses ) { - public boolean validationRanEarlier(JsonSchema schema) { - @Nullable Map validatedSchemas = validatedPathToSchemas.get(pathToItem); + public boolean validationRanEarlier(JsonSchema schema) { + @Nullable Map, Void> validatedSchemas = validatedPathToSchemas.get(pathToItem); if (validatedSchemas != null && validatedSchemas.containsKey(schema)) { return true; } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/servers/server0/Variables.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/servers/server0/Variables.java index 80b3d1b4dc3..12c3a68ffb0 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/servers/server0/Variables.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/servers/server0/Variables.java @@ -60,24 +60,20 @@ public String value() { } - public static abstract sealed class ServerBoxed permits ServerBoxedString { - public abstract @Nullable Object data(); + public sealed interface ServerBoxed permits ServerBoxedString { + @Nullable Object getData(); } - public static final class ServerBoxedString extends ServerBoxed { - public final String data; - private ServerBoxedString(String data) { - this.data = data; - } + public record ServerBoxedString(String data) implements ServerBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Server extends JsonSchema implements StringSchemaValidator, StringEnumValidator, DefaultValueMethod { + public static class Server extends JsonSchema implements StringSchemaValidator, StringEnumValidator, DefaultValueMethod { private static @Nullable Server instance = null; protected Server() { @@ -141,6 +137,13 @@ public String defaultValue() { public ServerBoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ServerBoxedString(validate(arg, configuration)); } + @Override + public ServerBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public enum StringPortEnums implements StringValueMethod { POSITIVE_80("80"), @@ -156,24 +159,20 @@ public String value() { } - public static abstract sealed class PortBoxed permits PortBoxedString { - public abstract @Nullable Object data(); + public sealed interface PortBoxed permits PortBoxedString { + @Nullable Object getData(); } - public static final class PortBoxedString extends PortBoxed { - public final String data; - private PortBoxedString(String data) { - this.data = data; - } + public record PortBoxedString(String data) implements PortBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Port extends JsonSchema implements StringSchemaValidator, StringEnumValidator, DefaultValueMethod { + public static class Port extends JsonSchema implements StringSchemaValidator, StringEnumValidator, DefaultValueMethod { private static @Nullable Port instance = null; protected Port() { @@ -236,6 +235,13 @@ public String defaultValue() { public PortBoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new PortBoxedString(validate(arg, configuration)); } + @Override + public PortBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class VariablesMap extends FrozenMap { @@ -362,23 +368,19 @@ public VariablesMap10Builder getBuilderAfterServer(Map instance) } - public static abstract sealed class Variables1Boxed permits Variables1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Variables1Boxed permits Variables1BoxedMap { + @Nullable Object getData(); } - public static final class Variables1BoxedMap extends Variables1Boxed { - public final VariablesMap data; - private Variables1BoxedMap(VariablesMap data) { - this.data = data; - } + public record Variables1BoxedMap(VariablesMap data) implements Variables1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Variables1 extends JsonSchema implements MapSchemaValidator { + public static class Variables1 extends JsonSchema implements MapSchemaValidator { private static @Nullable Variables1 instance = null; protected Variables1() { @@ -414,11 +416,11 @@ public VariablesMap getNewInstance(Map arg, List pathToItem, PathT List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof String)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -458,6 +460,13 @@ public VariablesMap validate(Map arg, SchemaConfiguration configuration) t public Variables1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Variables1BoxedMap(validate(arg, configuration)); } + @Override + public Variables1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/servers/server1/Variables.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/servers/server1/Variables.java index 9168b09f84d..1ecc7a5cb8e 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/servers/server1/Variables.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/servers/server1/Variables.java @@ -59,24 +59,20 @@ public String value() { } - public static abstract sealed class VersionBoxed permits VersionBoxedString { - public abstract @Nullable Object data(); + public sealed interface VersionBoxed permits VersionBoxedString { + @Nullable Object getData(); } - public static final class VersionBoxedString extends VersionBoxed { - public final String data; - private VersionBoxedString(String data) { - this.data = data; - } + public record VersionBoxedString(String data) implements VersionBoxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Version extends JsonSchema implements StringSchemaValidator, StringEnumValidator, DefaultValueMethod { + public static class Version extends JsonSchema implements StringSchemaValidator, StringEnumValidator, DefaultValueMethod { private static @Nullable Version instance = null; protected Version() { @@ -139,6 +135,13 @@ public String defaultValue() { public VersionBoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new VersionBoxedString(validate(arg, configuration)); } + @Override + public VersionBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class VariablesMap extends FrozenMap { @@ -205,23 +208,19 @@ public VariablesMap0Builder getBuilderAfterVersion(Map instance) } - public static abstract sealed class Variables1Boxed permits Variables1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface Variables1Boxed permits Variables1BoxedMap { + @Nullable Object getData(); } - public static final class Variables1BoxedMap extends Variables1Boxed { - public final VariablesMap data; - private Variables1BoxedMap(VariablesMap data) { - this.data = data; - } + public record Variables1BoxedMap(VariablesMap data) implements Variables1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Variables1 extends JsonSchema implements MapSchemaValidator { + public static class Variables1 extends JsonSchema implements MapSchemaValidator { private static @Nullable Variables1 instance = null; protected Variables1() { @@ -255,11 +254,11 @@ public VariablesMap getNewInstance(Map arg, List pathToItem, PathT List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(propertyInstance instanceof String)) { throw new InvalidTypeException("Invalid instantiated value"); @@ -299,6 +298,13 @@ public VariablesMap validate(Map arg, SchemaConfiguration configuration) t public Variables1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Variables1BoxedMap(validate(arg, configuration)); } + @Override + public Variables1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/samples/client/petstore/java/src/test/java/org/openapijsonschematools/client/requestbody/RequestBodySerializerTest.java b/samples/client/petstore/java/src/test/java/org/openapijsonschematools/client/requestbody/RequestBodySerializerTest.java index 0c618ead730..250d1e0f530 100644 --- a/samples/client/petstore/java/src/test/java/org/openapijsonschematools/client/requestbody/RequestBodySerializerTest.java +++ b/samples/client/petstore/java/src/test/java/org/openapijsonschematools/client/requestbody/RequestBodySerializerTest.java @@ -2,7 +2,8 @@ import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.schemas.MapJsonSchema; +import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.StringJsonSchema; import org.checkerframework.checker.nullness.qual.Nullable; import org.junit.Assert; @@ -11,73 +12,59 @@ import java.net.http.HttpResponse; import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; +import java.util.AbstractMap; import java.util.List; import java.util.Map; import java.util.concurrent.Flow; public final class RequestBodySerializerTest { + public sealed interface SealedMediaType permits ApplicationjsonMediaType, TextplainMediaType {} + public record ApplicationjsonMediaType(AnyTypeJsonSchema.AnyTypeJsonSchema1 schema) implements SealedMediaType {} + public record TextplainMediaType(StringJsonSchema.StringJsonSchema1 schema) implements SealedMediaType {} - public static abstract sealed class SealedRequestBody permits ApplicationjsonRequestBody, TextplainRequestBody {} - public static final class ApplicationjsonRequestBody extends SealedRequestBody implements GenericRequestBody<@Nullable Object> { - private final String contentType; - private final @Nullable Object body; - public ApplicationjsonRequestBody(@Nullable Object body) { - contentType = "application/json"; - this.body = body; - } + public sealed interface SealedRequestBody permits ApplicationjsonRequestBody, TextplainRequestBody {} + public record ApplicationjsonRequestBody(AnyTypeJsonSchema.AnyTypeJsonSchema1Boxed body) implements SealedRequestBody, GenericRequestBody<@Nullable Object> { @Override public String contentType() { - return contentType; - } - - @Override - public @Nullable Object body() { - return body; + return "application/json"; } } - public static final class TextplainRequestBody extends SealedRequestBody implements GenericRequestBody<@Nullable Object> { - private final String contentType; - private final @Nullable Object body; - public TextplainRequestBody(@Nullable Object body) { - contentType = "text/plain"; - this.body = body; - } + public record TextplainRequestBody(StringJsonSchema.StringJsonSchema1Boxed body) implements SealedRequestBody, GenericRequestBody<@Nullable Object> { @Override public String contentType() { - return contentType; - } - - @Override - public @Nullable Object body() { - return body; + return "text/plain"; } } - public static class MyRequestBodySerializer extends RequestBodySerializer { + public static class MyRequestBodySerializer extends RequestBodySerializer { public MyRequestBodySerializer() { - super(Map.of(), true); + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType(AnyTypeJsonSchema.AnyTypeJsonSchema1.getInstance())), + new AbstractMap.SimpleEntry<>("text/plain", new TextplainMediaType(StringJsonSchema.StringJsonSchema1.getInstance())) + ), + true); } public SerializedRequestBody serialize(SealedRequestBody requestBody) { if (requestBody instanceof ApplicationjsonRequestBody requestBody0) { - return serialize(requestBody0.contentType(), requestBody0.body()); + return serialize(requestBody0.contentType(), requestBody0.body().getData()); } else { TextplainRequestBody requestBody1 = (TextplainRequestBody) requestBody; - return serialize(requestBody1.contentType(), requestBody1.body()); + return serialize(requestBody1.contentType(), requestBody1.body().getData()); } } } @Test public void testContentTypeIsJson() { - var serializer = new MyRequestBodySerializer(); - Assert.assertTrue(serializer.contentTypeIsJson("application/json")); - Assert.assertTrue(serializer.contentTypeIsJson("application/json; charset=UTF-8")); - Assert.assertTrue(serializer.contentTypeIsJson("application/json-patch+json")); - Assert.assertTrue(serializer.contentTypeIsJson("application/geo+json")); + Assert.assertTrue(RequestBodySerializer.contentTypeIsJson("application/json")); + Assert.assertTrue(RequestBodySerializer.contentTypeIsJson("application/json; charset=UTF-8")); + Assert.assertTrue(RequestBodySerializer.contentTypeIsJson("application/json-patch+json")); + Assert.assertTrue(RequestBodySerializer.contentTypeIsJson("application/geo+json")); - Assert.assertFalse(serializer.contentTypeIsJson("application/octet-stream")); - Assert.assertFalse(serializer.contentTypeIsJson("text/plain")); + Assert.assertFalse(RequestBodySerializer.contentTypeIsJson("application/octet-stream")); + Assert.assertFalse(RequestBodySerializer.contentTypeIsJson("text/plain")); } static final class StringSubscriber implements Flow.Subscriber { @@ -101,63 +88,91 @@ private String getJsonBody(SerializedRequestBody requestBody) { var bodySubscriber = HttpResponse.BodySubscribers.ofString(StandardCharsets.UTF_8); var flowSubscriber = new StringSubscriber(bodySubscriber); requestBody.bodyPublisher.subscribe(flowSubscriber); - return bodySubscriber.getBody().toCompletableFuture().join(); } @Test public void testSerializeApplicationJson() { + SchemaConfiguration configuration = new SchemaConfiguration(JsonSchemaKeywordFlags.ofNone()); var serializer = new MyRequestBodySerializer(); String jsonBody; - SerializedRequestBody requestBody = serializer.serialize(new ApplicationjsonRequestBody(1)); + SerializedRequestBody requestBody = serializer.serialize( + new ApplicationjsonRequestBody( + AnyTypeJsonSchema.AnyTypeJsonSchema1.getInstance().validateAndBox(1, configuration) + ) + ); Assert.assertEquals("application/json", requestBody.contentType); jsonBody = getJsonBody(requestBody); Assert.assertEquals(jsonBody, "1"); - requestBody = serializer.serialize(new ApplicationjsonRequestBody(3.14)); + requestBody = serializer.serialize( + new ApplicationjsonRequestBody( + AnyTypeJsonSchema.AnyTypeJsonSchema1.getInstance().validateAndBox(3.14, configuration) + ) + ); jsonBody = getJsonBody(requestBody); Assert.assertEquals(jsonBody, "3.14"); - requestBody = serializer.serialize(new ApplicationjsonRequestBody(null)); + requestBody = serializer.serialize( + new ApplicationjsonRequestBody( + AnyTypeJsonSchema.AnyTypeJsonSchema1.getInstance().validateAndBox((Void) null, configuration) + ) + ); jsonBody = getJsonBody(requestBody); Assert.assertEquals(jsonBody, "null"); - requestBody = serializer.serialize(new ApplicationjsonRequestBody(true)); + requestBody = serializer.serialize( + new ApplicationjsonRequestBody( + AnyTypeJsonSchema.AnyTypeJsonSchema1.getInstance().validateAndBox(true, configuration) + ) + ); jsonBody = getJsonBody(requestBody); Assert.assertEquals(jsonBody, "true"); - requestBody = serializer.serialize(new ApplicationjsonRequestBody(false)); + requestBody = serializer.serialize( + new ApplicationjsonRequestBody( + AnyTypeJsonSchema.AnyTypeJsonSchema1.getInstance().validateAndBox(false, configuration) + ) + ); jsonBody = getJsonBody(requestBody); Assert.assertEquals(jsonBody, "false"); - - requestBody = serializer.serialize(new ApplicationjsonRequestBody(List.of())); + requestBody = serializer.serialize( + new ApplicationjsonRequestBody( + AnyTypeJsonSchema.AnyTypeJsonSchema1.getInstance().validateAndBox(List.of(), configuration) + ) + ); jsonBody = getJsonBody(requestBody); Assert.assertEquals(jsonBody, "[]"); - requestBody = serializer.serialize(new ApplicationjsonRequestBody(Map.of())); + requestBody = serializer.serialize( + new ApplicationjsonRequestBody( + AnyTypeJsonSchema.AnyTypeJsonSchema1.getInstance().validateAndBox(Map.of(), configuration) + ) + ); jsonBody = getJsonBody(requestBody); Assert.assertEquals(jsonBody, "{}"); - SchemaConfiguration configuration = new SchemaConfiguration(JsonSchemaKeywordFlags.ofNone()); - MapJsonSchema.MapJsonSchema1 mapJsonSchema = MapJsonSchema.MapJsonSchema1.getInstance(); - var frozenMap = mapJsonSchema.validate(Map.of("k1", "v1", "k2", "v2"), configuration); - requestBody = serializer.serialize(new ApplicationjsonRequestBody(frozenMap)); + requestBody = serializer.serialize( + new ApplicationjsonRequestBody( + AnyTypeJsonSchema.AnyTypeJsonSchema1.getInstance().validateAndBox(Map.of("k1", "v1", "k2", "v2"), configuration) + ) + ); jsonBody = getJsonBody(requestBody); Assert.assertEquals(jsonBody, "{\"k2\":\"v2\",\"k1\":\"v1\"}"); } @Test public void testSerializeTextPlain() { + SchemaConfiguration configuration = new SchemaConfiguration(JsonSchemaKeywordFlags.ofNone()); var serializer = new MyRequestBodySerializer(); - SerializedRequestBody requestBody = serializer.serialize(new TextplainRequestBody("a")); + SerializedRequestBody requestBody = serializer.serialize( + new TextplainRequestBody( + StringJsonSchema.StringJsonSchema1.getInstance().validateAndBox("a", configuration) + ) + ); Assert.assertEquals("text/plain", requestBody.contentType); String textBody = getJsonBody(requestBody); Assert.assertEquals(textBody, "a"); - - Assert.assertThrows( - RuntimeException.class, - () -> serializer.serialize(new TextplainRequestBody(null)) - ); } } \ No newline at end of file diff --git a/samples/client/petstore/java/src/test/java/org/openapijsonschematools/client/response/ResponseDeserializerTest.java b/samples/client/petstore/java/src/test/java/org/openapijsonschematools/client/response/ResponseDeserializerTest.java new file mode 100644 index 00000000000..50795dc89a9 --- /dev/null +++ b/samples/client/petstore/java/src/test/java/org/openapijsonschematools/client/response/ResponseDeserializerTest.java @@ -0,0 +1,255 @@ +package org.openapijsonschematools.client.response; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.ToNumberPolicy; +import org.checkerframework.checker.nullness.qual.Nullable; +import org.junit.Assert; +import org.junit.Test; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.StringJsonSchema; + +import javax.net.ssl.SSLSession; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpHeaders; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.function.BiPredicate; + +public class ResponseDeserializerTest { + private static final Gson gson = new GsonBuilder() + .setObjectToNumberStrategy(ToNumberPolicy.LONG_OR_DOUBLE) + .setNumberToNumberStrategy(ToNumberPolicy.LONG_OR_DOUBLE) + .create(); + public sealed interface SealedResponseBody permits ApplicationjsonBody, TextplainBody { } + + public record ApplicationjsonBody(AnyTypeJsonSchema.AnyTypeJsonSchema1Boxed body) implements SealedResponseBody { } + + public record TextplainBody(StringJsonSchema.StringJsonSchema1Boxed body) implements SealedResponseBody {} + + public sealed interface SealedMediaType permits ApplicationjsonMediatype, TextplainMediatype { } + + public record ApplicationjsonMediatype(AnyTypeJsonSchema.AnyTypeJsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediatype() { + this(AnyTypeJsonSchema.AnyTypeJsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + + public record TextplainMediatype(StringJsonSchema.StringJsonSchema1 schema) implements SealedMediaType, MediaType { + public TextplainMediatype() { + this(StringJsonSchema.StringJsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + + public static class MyResponseDeserializer extends ResponseDeserializer { + + public MyResponseDeserializer() { + super(Map.of("application/json", new ApplicationjsonMediatype(), "text/plain", new TextplainMediatype())); + } + + @Override + protected SealedResponseBody getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + SealedMediaType mediaType = content.get(contentType); + if (mediaType == null) { + throw new RuntimeException("Invalid contentType was received back from the server that does not exist in the openapi document"); + } + if (mediaType instanceof ApplicationjsonMediatype thisMediaType) { + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonBody(deserializedBody); + } else { + TextplainMediatype thisMediaType = (TextplainMediatype) mediaType; + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new TextplainBody(deserializedBody); + } + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } + + public static class BytesHttpResponse implements HttpResponse { + private final byte[] body; + private final HttpHeaders headers; + private final HttpRequest request; + private final URI uri; + private final HttpClient.Version version; + public BytesHttpResponse(byte[] body, String contentType) { + this.body = body; + BiPredicate headerFilter = (key, val) -> true; + headers = HttpHeaders.of(Map.of("Content-Type", List.of(contentType)), headerFilter); + uri = URI.create("https://abc.com/"); + request = HttpRequest.newBuilder().uri(uri).build(); + version = HttpClient.Version.HTTP_2; + } + + @Override + public int statusCode() { + return 202; + } + + @Override + public HttpRequest request() { + return request; + } + + @Override + public Optional> previousResponse() { + return Optional.empty(); + } + + @Override + public HttpHeaders headers() { + return headers; + } + + @Override + public byte[] body() { + return body; + } + + @Override + public Optional sslSession() { + return Optional.empty(); + } + + @Override + public URI uri() { + return uri; + } + + @Override + public HttpClient.Version version() { + return version; + } + } + + @SuppressWarnings("nullness") + private String toJson(@Nullable Object body) { + return gson.toJson(body); + } + + @SuppressWarnings("nullness") + private void assertNull(@Nullable Object object) { + Assert.assertNull(object); + } + + @Test + public void testDeserializeApplicationJsonNull() { + var deserializer = new MyResponseDeserializer(); + byte[] bodyBytes = toJson(null).getBytes(StandardCharsets.UTF_8); + BytesHttpResponse response = new BytesHttpResponse(bodyBytes, "application/json"); + SchemaConfiguration configuration = new SchemaConfiguration(JsonSchemaKeywordFlags.ofNone()); + ApiResponse apiResponse = deserializer.deserialize(response, configuration); + Assert.assertEquals(response, apiResponse.response()); + if (!(apiResponse.body() instanceof ApplicationjsonBody jsonBody)) { + throw new RuntimeException("body must be type ApplicationjsonBody"); + } + if (!(jsonBody.body() instanceof AnyTypeJsonSchema.AnyTypeJsonSchema1BoxedVoid boxedVoid)) { + throw new RuntimeException("body must be type AnyTypeJsonSchema1BoxedVoid"); + } + assertNull(boxedVoid.data()); + } + + @Test + public void testDeserializeApplicationJsonTrue() { + var deserializer = new MyResponseDeserializer(); + byte[] bodyBytes = toJson(true).getBytes(StandardCharsets.UTF_8); + BytesHttpResponse response = new BytesHttpResponse(bodyBytes, "application/json"); + SchemaConfiguration configuration = new SchemaConfiguration(JsonSchemaKeywordFlags.ofNone()); + ApiResponse apiResponse = deserializer.deserialize(response, configuration); + Assert.assertEquals(response, apiResponse.response()); + if (!(apiResponse.body() instanceof ApplicationjsonBody jsonBody)) { + throw new RuntimeException("body must be type ApplicationjsonBody"); + } + if (!(jsonBody.body() instanceof AnyTypeJsonSchema.AnyTypeJsonSchema1BoxedBoolean boxedBoolean)) { + throw new RuntimeException("body must be type AnyTypeJsonSchema1BoxedBoolean"); + } + Assert.assertTrue(boxedBoolean.data()); + } + + @Test + public void testDeserializeApplicationJsonFalse() { + var deserializer = new MyResponseDeserializer(); + byte[] bodyBytes = toJson(false).getBytes(StandardCharsets.UTF_8); + BytesHttpResponse response = new BytesHttpResponse(bodyBytes, "application/json"); + SchemaConfiguration configuration = new SchemaConfiguration(JsonSchemaKeywordFlags.ofNone()); + ApiResponse apiResponse = deserializer.deserialize(response, configuration); + Assert.assertEquals(response, apiResponse.response()); + if (!(apiResponse.body() instanceof ApplicationjsonBody jsonBody)) { + throw new RuntimeException("body must be type ApplicationjsonBody"); + } + if (!(jsonBody.body() instanceof AnyTypeJsonSchema.AnyTypeJsonSchema1BoxedBoolean boxedBoolean)) { + throw new RuntimeException("body must be type AnyTypeJsonSchema1BoxedBoolean"); + } + Assert.assertFalse(boxedBoolean.data()); + } + + @Test + public void testDeserializeApplicationJsonInt() { + var deserializer = new MyResponseDeserializer(); + byte[] bodyBytes = toJson(1).getBytes(StandardCharsets.UTF_8); + BytesHttpResponse response = new BytesHttpResponse(bodyBytes, "application/json"); + SchemaConfiguration configuration = new SchemaConfiguration(JsonSchemaKeywordFlags.ofNone()); + ApiResponse apiResponse = deserializer.deserialize(response, configuration); + Assert.assertEquals(response, apiResponse.response()); + if (!(apiResponse.body() instanceof ApplicationjsonBody jsonBody)) { + throw new RuntimeException("body must be type ApplicationjsonBody"); + } + if (!(jsonBody.body() instanceof AnyTypeJsonSchema.AnyTypeJsonSchema1BoxedNumber boxedNumber)) { + throw new RuntimeException("body must be type AnyTypeJsonSchema1BoxedNumber"); + } + Assert.assertEquals(boxedNumber.data(), 1L); + } + + @Test + public void testDeserializeApplicationJsonFloat() { + var deserializer = new MyResponseDeserializer(); + byte[] bodyBytes = toJson(3.14).getBytes(StandardCharsets.UTF_8); + BytesHttpResponse response = new BytesHttpResponse(bodyBytes, "application/json"); + SchemaConfiguration configuration = new SchemaConfiguration(JsonSchemaKeywordFlags.ofNone()); + ApiResponse apiResponse = deserializer.deserialize(response, configuration); + Assert.assertEquals(response, apiResponse.response()); + if (!(apiResponse.body() instanceof ApplicationjsonBody jsonBody)) { + throw new RuntimeException("body must be type ApplicationjsonBody"); + } + if (!(jsonBody.body() instanceof AnyTypeJsonSchema.AnyTypeJsonSchema1BoxedNumber boxedNumber)) { + throw new RuntimeException("body must be type AnyTypeJsonSchema1BoxedNumber"); + } + Assert.assertEquals(boxedNumber.data(), 3.14); + } + + @Test + public void testDeserializeApplicationJsonString() { + var deserializer = new MyResponseDeserializer(); + byte[] bodyBytes = toJson("a").getBytes(StandardCharsets.UTF_8); + BytesHttpResponse response = new BytesHttpResponse(bodyBytes, "application/json"); + SchemaConfiguration configuration = new SchemaConfiguration(JsonSchemaKeywordFlags.ofNone()); + ApiResponse apiResponse = deserializer.deserialize(response, configuration); + Assert.assertEquals(response, apiResponse.response()); + if (!(apiResponse.body() instanceof ApplicationjsonBody jsonBody)) { + throw new RuntimeException("body must be type ApplicationjsonBody"); + } + if (!(jsonBody.body() instanceof AnyTypeJsonSchema.AnyTypeJsonSchema1BoxedString boxedString)) { + throw new RuntimeException("body must be type AnyTypeJsonSchema1BoxedString"); + } + Assert.assertEquals(boxedString.data(), "a"); + } +} \ No newline at end of file diff --git a/samples/client/petstore/java/src/test/java/org/openapijsonschematools/client/schemas/ArrayTypeSchemaTest.java b/samples/client/petstore/java/src/test/java/org/openapijsonschematools/client/schemas/ArrayTypeSchemaTest.java index a5cb7cd0519..42dfcabf0d0 100644 --- a/samples/client/petstore/java/src/test/java/org/openapijsonschematools/client/schemas/ArrayTypeSchemaTest.java +++ b/samples/client/petstore/java/src/test/java/org/openapijsonschematools/client/schemas/ArrayTypeSchemaTest.java @@ -31,16 +31,12 @@ public class ArrayTypeSchemaTest { new LinkedHashSet<>() ); - public static abstract sealed class ArrayWithItemsSchemaBoxed permits ArrayWithItemsSchemaBoxedList { + public sealed interface ArrayWithItemsSchemaBoxed permits ArrayWithItemsSchemaBoxedList { } - public static final class ArrayWithItemsSchemaBoxedList extends ArrayWithItemsSchemaBoxed { - public final FrozenList data; - private ArrayWithItemsSchemaBoxedList(FrozenList data) { - this.data = data; - } + public record ArrayWithItemsSchemaBoxedList(FrozenList data) implements ArrayWithItemsSchemaBoxed { } - public static class ArrayWithItemsSchema extends JsonSchema implements ListSchemaValidator, ArrayWithItemsSchemaBoxedList> { + public static class ArrayWithItemsSchema extends JsonSchema implements ListSchemaValidator, ArrayWithItemsSchemaBoxedList> { public ArrayWithItemsSchema() { super(new JsonSchemaInfo() .type(Set.of(List.class)) @@ -55,11 +51,11 @@ public FrozenList getNewInstance(List arg, List pathToItem, P for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object castItem = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(castItem instanceof String)) { throw new InvalidTypeException("Instantiated type of item is invalid"); @@ -100,6 +96,14 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); } + + @Override + public ArrayWithItemsSchemaBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws InvalidTypeException, ValidationException { + if (arg instanceof List listArg) { + return new ArrayWithItemsSchemaBoxedList(validate(listArg, configuration)); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class ArrayWithOutputClsSchemaList extends FrozenList { @@ -112,15 +116,11 @@ public static ArrayWithOutputClsSchemaList of(List arg, SchemaConfigurat } } - public static abstract sealed class ArrayWithOutputClsSchemaBoxed permits ArrayWithOutputClsSchemaBoxedList { + public sealed interface ArrayWithOutputClsSchemaBoxed permits ArrayWithOutputClsSchemaBoxedList { } - public static final class ArrayWithOutputClsSchemaBoxedList extends ArrayWithOutputClsSchemaBoxed { - public final ArrayWithOutputClsSchemaList data; - private ArrayWithOutputClsSchemaBoxedList(ArrayWithOutputClsSchemaList data) { - this.data = data; - } + public record ArrayWithOutputClsSchemaBoxedList(ArrayWithOutputClsSchemaList data) implements ArrayWithOutputClsSchemaBoxed { } - public static class ArrayWithOutputClsSchema extends JsonSchema implements ListSchemaValidator { + public static class ArrayWithOutputClsSchema extends JsonSchema implements ListSchemaValidator { public ArrayWithOutputClsSchema() { super(new JsonSchemaInfo() .type(Set.of(List.class)) @@ -136,11 +136,11 @@ public ArrayWithOutputClsSchemaList getNewInstance(List arg, List pat for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object castItem = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(castItem instanceof String)) { throw new InvalidTypeException("Instantiated type of item is invalid"); @@ -182,6 +182,14 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); } + + @Override + public ArrayWithOutputClsSchemaBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws InvalidTypeException, ValidationException { + if (arg instanceof List listArg) { + return new ArrayWithOutputClsSchemaBoxedList(validate(listArg, configuration)); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } @Test diff --git a/samples/client/petstore/java/src/test/java/org/openapijsonschematools/client/schemas/ObjectTypeSchemaTest.java b/samples/client/petstore/java/src/test/java/org/openapijsonschematools/client/schemas/ObjectTypeSchemaTest.java index acd412b00d1..02729b0f046 100644 --- a/samples/client/petstore/java/src/test/java/org/openapijsonschematools/client/schemas/ObjectTypeSchemaTest.java +++ b/samples/client/petstore/java/src/test/java/org/openapijsonschematools/client/schemas/ObjectTypeSchemaTest.java @@ -33,15 +33,11 @@ public class ObjectTypeSchemaTest { new LinkedHashSet<>() ); - public static abstract sealed class ObjectWithPropsSchemaBoxed permits ObjectWithPropsSchemaBoxedMap { + public sealed interface ObjectWithPropsSchemaBoxed permits ObjectWithPropsSchemaBoxedMap { } - public static final class ObjectWithPropsSchemaBoxedMap extends ObjectWithPropsSchemaBoxed { - public final FrozenMap<@Nullable Object> data; - private ObjectWithPropsSchemaBoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record ObjectWithPropsSchemaBoxedMap(FrozenMap<@Nullable Object> data) implements ObjectWithPropsSchemaBoxed { } - public static class ObjectWithPropsSchema extends JsonSchema implements MapSchemaValidator, ObjectWithPropsSchemaBoxedMap> { + public static class ObjectWithPropsSchema extends JsonSchema implements MapSchemaValidator, ObjectWithPropsSchemaBoxedMap> { private static @Nullable ObjectWithPropsSchema instance = null; private ObjectWithPropsSchema() { super(new JsonSchemaInfo() @@ -72,11 +68,11 @@ public static ObjectWithPropsSchema getInstance() { List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object castValue = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } @@ -113,18 +109,22 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); } + + @Override + public ObjectWithPropsSchemaBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws InvalidTypeException, ValidationException { + if (arg instanceof Map mapArg) { + return new ObjectWithPropsSchemaBoxedMap(validate(mapArg, configuration)); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class ObjectWithAddpropsSchemaBoxed permits ObjectWithAddpropsSchemaBoxedMap { + public sealed interface ObjectWithAddpropsSchemaBoxed permits ObjectWithAddpropsSchemaBoxedMap { } - public static final class ObjectWithAddpropsSchemaBoxedMap extends ObjectWithAddpropsSchemaBoxed { - public final FrozenMap data; - private ObjectWithAddpropsSchemaBoxedMap(FrozenMap data) { - this.data = data; - } + public record ObjectWithAddpropsSchemaBoxedMap(FrozenMap data) implements ObjectWithAddpropsSchemaBoxed { } - public static class ObjectWithAddpropsSchema extends JsonSchema implements MapSchemaValidator, ObjectWithAddpropsSchemaBoxedMap> { + public static class ObjectWithAddpropsSchema extends JsonSchema implements MapSchemaValidator, ObjectWithAddpropsSchemaBoxedMap> { private static @Nullable ObjectWithAddpropsSchema instance = null; private ObjectWithAddpropsSchema() { super(new JsonSchemaInfo() @@ -152,11 +152,11 @@ public FrozenMap getNewInstance(Map arg, List pathToItem, List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object castValue = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(castValue instanceof String)) { throw new InvalidTypeException("Invalid type for property value"); @@ -189,6 +189,14 @@ public ObjectWithAddpropsSchemaBoxedMap validateAndBox(Map arg, SchemaConf throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); } + @Override + public ObjectWithAddpropsSchemaBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws InvalidTypeException, ValidationException { + if (arg instanceof Map mapArg) { + return new ObjectWithAddpropsSchemaBoxedMap(validate(mapArg, configuration)); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + @Override public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof Map) { @@ -198,15 +206,11 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } } - public static abstract sealed class ObjectWithPropsAndAddpropsSchemaBoxed permits ObjectWithPropsAndAddpropsSchemaBoxedMap { + public sealed interface ObjectWithPropsAndAddpropsSchemaBoxed permits ObjectWithPropsAndAddpropsSchemaBoxedMap { } - public static final class ObjectWithPropsAndAddpropsSchemaBoxedMap extends ObjectWithPropsAndAddpropsSchemaBoxed { - public final FrozenMap<@Nullable Object> data; - private ObjectWithPropsAndAddpropsSchemaBoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record ObjectWithPropsAndAddpropsSchemaBoxedMap(FrozenMap<@Nullable Object> data) implements ObjectWithPropsAndAddpropsSchemaBoxed { } - public static class ObjectWithPropsAndAddpropsSchema extends JsonSchema implements MapSchemaValidator, ObjectWithPropsAndAddpropsSchemaBoxedMap> { + public static class ObjectWithPropsAndAddpropsSchema extends JsonSchema implements MapSchemaValidator, ObjectWithPropsAndAddpropsSchemaBoxedMap> { private static @Nullable ObjectWithPropsAndAddpropsSchema instance = null; private ObjectWithPropsAndAddpropsSchema() { super(new JsonSchemaInfo() @@ -237,11 +241,11 @@ public static ObjectWithPropsAndAddpropsSchema getInstance() { List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object castValue = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } @@ -271,6 +275,14 @@ public ObjectWithPropsAndAddpropsSchemaBoxedMap validateAndBox(Map arg, Sc throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); } + @Override + public ObjectWithPropsAndAddpropsSchemaBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws InvalidTypeException, ValidationException { + if (arg instanceof Map mapArg) { + return new ObjectWithPropsAndAddpropsSchemaBoxedMap(validate(mapArg, configuration)); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + @Override public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof Map) { @@ -290,15 +302,11 @@ public static ObjectWithOutputTypeSchemaMap of(Map arg, SchemaCo } } - public static abstract sealed class ObjectWithOutputTypeSchemaBoxed permits ObjectWithOutputTypeSchemaBoxedMap { + public sealed interface ObjectWithOutputTypeSchemaBoxed permits ObjectWithOutputTypeSchemaBoxedMap { } - public static final class ObjectWithOutputTypeSchemaBoxedMap extends ObjectWithOutputTypeSchemaBoxed { - public final ObjectWithOutputTypeSchemaMap data; - private ObjectWithOutputTypeSchemaBoxedMap(ObjectWithOutputTypeSchemaMap data) { - this.data = data; - } + public record ObjectWithOutputTypeSchemaBoxedMap(ObjectWithOutputTypeSchemaMap data) implements ObjectWithOutputTypeSchemaBoxed { } - public static class ObjectWithOutputTypeSchema extends JsonSchema implements MapSchemaValidator { + public static class ObjectWithOutputTypeSchema extends JsonSchema implements MapSchemaValidator { private static @Nullable ObjectWithOutputTypeSchema instance = null; public ObjectWithOutputTypeSchema() { super(new JsonSchemaInfo() @@ -328,11 +336,11 @@ public ObjectWithOutputTypeSchemaMap getNewInstance(Map arg, List List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object castValue = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } @@ -362,6 +370,14 @@ public ObjectWithOutputTypeSchemaBoxedMap validateAndBox(Map arg, SchemaCo throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); } + @Override + public ObjectWithOutputTypeSchemaBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws InvalidTypeException, ValidationException { + if (arg instanceof Map mapArg) { + return new ObjectWithOutputTypeSchemaBoxedMap(validate(mapArg, configuration)); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + @Override public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof FrozenMap) { diff --git a/samples/client/petstore/java/src/test/java/org/openapijsonschematools/client/schemas/validation/AdditionalPropertiesValidatorTest.java b/samples/client/petstore/java/src/test/java/org/openapijsonschematools/client/schemas/validation/AdditionalPropertiesValidatorTest.java index 5bf7ee3b6b5..40a01c9983d 100644 --- a/samples/client/petstore/java/src/test/java/org/openapijsonschematools/client/schemas/validation/AdditionalPropertiesValidatorTest.java +++ b/samples/client/petstore/java/src/test/java/org/openapijsonschematools/client/schemas/validation/AdditionalPropertiesValidatorTest.java @@ -18,7 +18,10 @@ import java.util.Set; public class AdditionalPropertiesValidatorTest { - public static class ObjectWithPropsSchema extends JsonSchema { + public sealed interface ObjectWithPropsSchemaBoxed permits ObjectWithPropsSchemaBoxedMap {} + public record ObjectWithPropsSchemaBoxedMap() implements ObjectWithPropsSchemaBoxed {} + + public static class ObjectWithPropsSchema extends JsonSchema { private static @Nullable ObjectWithPropsSchema instance = null; private ObjectWithPropsSchema() { super(new JsonSchemaInfo() @@ -53,6 +56,11 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); } + + @Override + public ObjectWithPropsSchemaBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws InvalidTypeException, ValidationException { + return new ObjectWithPropsSchemaBoxedMap(); + } } @SuppressWarnings("nullness") @@ -88,7 +96,7 @@ public void testCorrectPropertySucceeds() { List expectedPathToItem = new ArrayList<>(); expectedPathToItem.add("args[0]"); expectedPathToItem.add("someAddProp"); - LinkedHashMap expectedClasses = new LinkedHashMap<>(); + LinkedHashMap, Void> expectedClasses = new LinkedHashMap<>(); StringJsonSchema.StringJsonSchema1 schema = JsonSchemaFactory.getInstance(StringJsonSchema.StringJsonSchema1.class); expectedClasses.put(schema, null); PathToSchemasMap expectedPathToSchemas = new PathToSchemasMap(); diff --git a/samples/client/petstore/java/src/test/java/org/openapijsonschematools/client/schemas/validation/ItemsValidatorTest.java b/samples/client/petstore/java/src/test/java/org/openapijsonschematools/client/schemas/validation/ItemsValidatorTest.java index f9f01dcb28a..e0e4a0c859e 100644 --- a/samples/client/petstore/java/src/test/java/org/openapijsonschematools/client/schemas/validation/ItemsValidatorTest.java +++ b/samples/client/petstore/java/src/test/java/org/openapijsonschematools/client/schemas/validation/ItemsValidatorTest.java @@ -21,7 +21,10 @@ private void assertNull(@Nullable Object object) { Assert.assertNull(object); } - public static class ArrayWithItemsSchema extends JsonSchema { + public sealed interface ArrayWithItemsSchemaBoxed permits ArrayWithItemsSchemaBoxedList {} + public record ArrayWithItemsSchemaBoxedList() implements ArrayWithItemsSchemaBoxed {} + + public static class ArrayWithItemsSchema extends JsonSchema { public ArrayWithItemsSchema() { super(new JsonSchemaInfo() .type(Set.of(List.class)) @@ -44,6 +47,11 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); } + + @Override + public ArrayWithItemsSchemaBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws InvalidTypeException, ValidationException { + return new ArrayWithItemsSchemaBoxedList(); + } } @Test @@ -72,7 +80,7 @@ public void testCorrectItemsSucceeds() { List expectedPathToItem = new ArrayList<>(); expectedPathToItem.add("args[0]"); expectedPathToItem.add(0); - LinkedHashMap expectedClasses = new LinkedHashMap<>(); + LinkedHashMap, Void> expectedClasses = new LinkedHashMap<>(); StringJsonSchema.StringJsonSchema1 schema = JsonSchemaFactory.getInstance(StringJsonSchema.StringJsonSchema1.class); expectedClasses.put(schema, null); PathToSchemasMap expectedPathToSchemas = new PathToSchemasMap(); diff --git a/samples/client/petstore/java/src/test/java/org/openapijsonschematools/client/schemas/validation/JsonSchemaTest.java b/samples/client/petstore/java/src/test/java/org/openapijsonschematools/client/schemas/validation/JsonSchemaTest.java index 525222b9ad7..8a14df7edd6 100644 --- a/samples/client/petstore/java/src/test/java/org/openapijsonschematools/client/schemas/validation/JsonSchemaTest.java +++ b/samples/client/petstore/java/src/test/java/org/openapijsonschematools/client/schemas/validation/JsonSchemaTest.java @@ -13,39 +13,49 @@ import java.util.List; import java.util.Set; -class SomeSchema extends JsonSchema { - private static @Nullable SomeSchema instance = null; - protected SomeSchema() { - super(new JsonSchemaInfo() - .type(Set.of(String.class)) - ); - } +sealed interface SomeSchemaBoxed permits SomeSchemaBoxedString {} +record SomeSchemaBoxedString() implements SomeSchemaBoxed {} + +public class JsonSchemaTest { + sealed interface SomeSchemaBoxed permits SomeSchemaBoxedString {} + record SomeSchemaBoxedString() implements SomeSchemaBoxed {} - public static SomeSchema getInstance() { - if (instance == null) { - instance = new SomeSchema(); + static class SomeSchema extends JsonSchema { + private static @Nullable SomeSchema instance = null; + protected SomeSchema() { + super(new JsonSchemaInfo() + .type(Set.of(String.class)) + ); } - return instance; - } - @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { - if (arg instanceof String) { - return arg; + public static SomeSchema getInstance() { + if (instance == null) { + instance = new SomeSchema(); + } + return instance; } - throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); - } - @Override - public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws InvalidTypeException, ValidationException { - if (arg instanceof String) { - return arg; + @Override + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + if (arg instanceof String) { + return arg; + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } - throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } -} -public class JsonSchemaTest { + @Override + public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws InvalidTypeException, ValidationException { + if (arg instanceof String) { + return arg; + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + + @Override + public SomeSchemaBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws InvalidTypeException, ValidationException { + return new SomeSchemaBoxedString(); + } + } @Test public void testValidateSucceeds() { @@ -63,7 +73,7 @@ public void testValidateSucceeds() { validationMetadata ); PathToSchemasMap expectedPathToSchemas = new PathToSchemasMap(); - LinkedHashMap validatedClasses = new LinkedHashMap<>(); + LinkedHashMap, Void> validatedClasses = new LinkedHashMap<>(); validatedClasses.put(schema, null); expectedPathToSchemas.put(pathToItem, validatedClasses); Assert.assertEquals(pathToSchemas, expectedPathToSchemas); diff --git a/samples/client/petstore/java/src/test/java/org/openapijsonschematools/client/schemas/validation/PropertiesValidatorTest.java b/samples/client/petstore/java/src/test/java/org/openapijsonschematools/client/schemas/validation/PropertiesValidatorTest.java index 5a6edbe7299..492f45af0c7 100644 --- a/samples/client/petstore/java/src/test/java/org/openapijsonschematools/client/schemas/validation/PropertiesValidatorTest.java +++ b/samples/client/petstore/java/src/test/java/org/openapijsonschematools/client/schemas/validation/PropertiesValidatorTest.java @@ -17,7 +17,10 @@ import java.util.Set; public class PropertiesValidatorTest { - public static class ObjectWithPropsSchema extends JsonSchema { + public sealed interface ObjectWithPropsSchemaBoxed permits ObjectWithPropsSchemaBoxedMap {} + public record ObjectWithPropsSchemaBoxedMap() implements ObjectWithPropsSchemaBoxed {} + + public static class ObjectWithPropsSchema extends JsonSchema { private ObjectWithPropsSchema() { super(new JsonSchemaInfo() .type(Set.of(Map.class)) @@ -43,6 +46,11 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); } + + @Override + public ObjectWithPropsSchemaBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws InvalidTypeException, ValidationException { + return new ObjectWithPropsSchemaBoxedMap(); + } } @SuppressWarnings("nullness") @@ -76,7 +84,7 @@ public void testCorrectPropertySucceeds() { List expectedPathToItem = new ArrayList<>(); expectedPathToItem.add("args[0]"); expectedPathToItem.add("someString"); - LinkedHashMap expectedClasses = new LinkedHashMap<>(); + LinkedHashMap, Void> expectedClasses = new LinkedHashMap<>(); expectedClasses.put(JsonSchemaFactory.getInstance(StringJsonSchema.StringJsonSchema1.class), null); PathToSchemasMap expectedPathToSchemas = new PathToSchemasMap(); expectedPathToSchemas.put(expectedPathToItem, expectedClasses); diff --git a/samples/client/petstore/java/src/test/java/org/openapijsonschematools/client/schemas/validation/RequiredValidatorTest.java b/samples/client/petstore/java/src/test/java/org/openapijsonschematools/client/schemas/validation/RequiredValidatorTest.java index d2264b9a967..65ff030d74b 100644 --- a/samples/client/petstore/java/src/test/java/org/openapijsonschematools/client/schemas/validation/RequiredValidatorTest.java +++ b/samples/client/petstore/java/src/test/java/org/openapijsonschematools/client/schemas/validation/RequiredValidatorTest.java @@ -15,7 +15,10 @@ import java.util.Set; public class RequiredValidatorTest { - public static class ObjectWithRequiredSchema extends JsonSchema { + public sealed interface ObjectWithRequiredSchemaBoxed permits ObjectWithRequiredSchemaBoxedMap {} + public record ObjectWithRequiredSchemaBoxedMap() implements ObjectWithRequiredSchemaBoxed {} + + public static class ObjectWithRequiredSchema extends JsonSchema { private ObjectWithRequiredSchema() { super(new JsonSchemaInfo() .type(Set.of(Map.class)) @@ -39,6 +42,11 @@ public Object getNewInstance(@Nullable Object arg, List pathToItem, Path } throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); } + + @Override + public ObjectWithRequiredSchemaBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws InvalidTypeException, ValidationException { + return new ObjectWithRequiredSchemaBoxedMap(); + } } @SuppressWarnings("nullness") diff --git a/src/main/java/org/openapijsonschematools/codegen/generators/DefaultGenerator.java b/src/main/java/org/openapijsonschematools/codegen/generators/DefaultGenerator.java index 52c01a0aad5..66dd29cf4e0 100644 --- a/src/main/java/org/openapijsonschematools/codegen/generators/DefaultGenerator.java +++ b/src/main/java/org/openapijsonschematools/codegen/generators/DefaultGenerator.java @@ -734,7 +734,7 @@ public HashMap public String toResponseModuleName(String componentName, String jsonPath) { return toModuleFilename(componentName, jsonPath); } - public String getPascalCaseResponse(String componentName) { return toModelName(componentName, null); } + public String getPascalCaseResponse(String componentName, String jsonPath) { return toModelName(componentName, null); } public String toHeaderFilename(String componentName, String jsonPath) { return toModuleFilename(componentName, jsonPath); } @@ -3109,7 +3109,8 @@ public CodegenResponse fromResponse(ApiResponse response, String sourceJsonPath) TreeSet finalImports = imports; CodegenSchema headersObjectSchema = getXParametersSchema(headersProperties, headersRequired, sourceJsonPath + "/" + "Headers", sourceJsonPath + "/" + "Headers"); String pathFromDocRoot = responsePathFromDocRoot(sourceJsonPath); - r = new CodegenResponse(jsonPathPiece, headers, headersObjectSchema, description, finalVendorExtensions, content, refInfo, finalImports, componentModule, pathFromDocRoot); + String subpackage = getSubpackage(sourceJsonPath); + r = new CodegenResponse(jsonPathPiece, headers, headersObjectSchema, description, finalVendorExtensions, content, refInfo, finalImports, componentModule, pathFromDocRoot, subpackage); codegenResponseCache.put(sourceJsonPath, r); return r; } @@ -3774,8 +3775,7 @@ protected void updateComponentsFilepath(String[] pathPieces) { } } else if (pathPieces[2].equals("responses")) { // #/components/responses/SuccessWithJsonApiResponse/headers - String responseJsonPath = "#/components/responses/" + pathPieces[3]; - pathPieces[3] = toResponseModuleName(pathPieces[3], responseJsonPath); + pathPieces[3] = toResponseModuleName(pathPieces[3], jsonPath); if (pathPieces.length == 5 && pathPieces[4].equals("Headers")) { // synthetic json path @@ -3821,7 +3821,6 @@ private void updatePathsFilepath(String[] pathPieces) { return; } // #/paths/somePath - String path = pathPieces[2]; pathPieces[2] = toPathFilename(ModelUtils.decodeSlashes(pathPieces[2]), null); if (pathPieces.length < 4) { return; @@ -3899,8 +3898,7 @@ private void updatePathsFilepath(String[] pathPieces) { return; } // #/paths/user_login/get/responses/200 -> 200 -> response_200 -> length 6 - String responseJsonPath = "#/paths/" + path + "/" + pathPieces[3] + "/responses/" + pathPieces[5]; - pathPieces[5] = toResponseModuleName(pathPieces[5], responseJsonPath); + pathPieces[5] = toResponseModuleName(pathPieces[5], jsonPath); if (pathPieces.length == 7 && pathPieces[6].equals("Headers")) { // synthetic json path // #/paths/user_login/get/responses/200/Headers @@ -4893,7 +4891,7 @@ public CodegenKey getKey(String key, String keyType, String sourceJsonPath) { usedKey = escapeUnsafeCharacters(key); isValid = isValid(usedKey); snakeCaseName = toResponseModuleName(usedKey, sourceJsonPath); - pascalCaseName = getPascalCaseResponse(usedKey); + pascalCaseName = getPascalCaseResponse(usedKey, sourceJsonPath); break; case "securitySchemes": usedKey = escapeUnsafeCharacters(key); diff --git a/src/main/java/org/openapijsonschematools/codegen/generators/JavaClientGenerator.java b/src/main/java/org/openapijsonschematools/codegen/generators/JavaClientGenerator.java index ce41158f3ac..b8e8828f68a 100644 --- a/src/main/java/org/openapijsonschematools/codegen/generators/JavaClientGenerator.java +++ b/src/main/java/org/openapijsonschematools/codegen/generators/JavaClientGenerator.java @@ -118,7 +118,11 @@ public String toModuleFilename(String name, String jsonPath) { String usedName = sanitizeName(name, "[^a-zA-Z0-9]+"); // todo check if empty and if so them use enum name // todo fix this, this does not handle names starting with numbers - return usedName.toLowerCase(Locale.ROOT); + usedName = usedName.toLowerCase(Locale.ROOT); + if (usedName.isEmpty()) { + usedName = toEnumVarName(name, null).toLowerCase(Locale.ROOT); + } + return usedName; } protected void updateServersFilepath(String[] pathPieces) { @@ -279,7 +283,8 @@ public JavaClientGenerator() { DocumentationFeature.Servers, DocumentationFeature.ComponentSchemas, DocumentationFeature.ComponentSecuritySchemes, - DocumentationFeature.ComponentRequestBodies + DocumentationFeature.ComponentRequestBodies, + DocumentationFeature.ComponentResponses ) .includeGlobalFeatures( GlobalFeature.Components, @@ -289,7 +294,8 @@ public JavaClientGenerator() { .includeComponentsFeatures( ComponentsFeature.schemas, ComponentsFeature.securitySchemes, - ComponentsFeature.requestBodies + ComponentsFeature.requestBodies, + ComponentsFeature.responses ) .includeSecurityFeatures( SecurityFeature.ApiKey, @@ -752,7 +758,6 @@ public void processOpts() { "src/test/java/packagename/requestbody/RequestBodySerializerTest.hbs", testPackagePath() + File.separatorChar + "requestbody", "RequestBodySerializerTest.java")); - // mediatype supportingFiles.add(new SupportingFile( "src/main/java/packagename/mediatype/MediaType.hbs", @@ -767,7 +772,25 @@ public void processOpts() { "src/main/java/packagename/parameter/ParameterStyle.hbs", packagePath() + File.separatorChar + "parameter", "ParameterStyle.java")); + // response + supportingFiles.add(new SupportingFile( + "src/main/java/packagename/response/ApiResponse.hbs", + packagePath() + File.separatorChar + "response", + "ApiResponse.java")); + supportingFiles.add(new SupportingFile( + "src/main/java/packagename/response/DeserializedApiResponse.hbs", + packagePath() + File.separatorChar + "response", + "DeserializedApiResponse.java")); + supportingFiles.add(new SupportingFile( + "src/main/java/packagename/response/ResponseDeserializer.hbs", + packagePath() + File.separatorChar + "response", + "ResponseDeserializer.java")); + supportingFiles.add(new SupportingFile( + "src/test/java/packagename/response/ResponseDeserializerTest.hbs", + testPackagePath() + File.separatorChar + "response", + "ResponseDeserializerTest.java")); + // jsonPaths // requestbodies jsonPathTemplateFiles.put( CodegenConstants.JSON_PATH_LOCATION_TYPE.REQUEST_BODY, @@ -781,6 +804,20 @@ public void processOpts() { put("src/main/java/packagename/components/requestbodies/RequestBodyDoc.hbs", ".md"); }} ); + // responses + jsonPathTemplateFiles.put( + CodegenConstants.JSON_PATH_LOCATION_TYPE.RESPONSE, + new HashMap<>() {{ + put("src/main/java/packagename/components/responses/Response.hbs", ".java"); + }} + ); + jsonPathDocTemplateFiles.put( + CodegenConstants.JSON_PATH_LOCATION_TYPE.RESPONSE, + new HashMap<>() {{ + put("src/main/java/packagename/components/responses/ResponseDoc.hbs", ".md"); + }} + ); + // schema HashMap schemaTemplates = new HashMap<>(); schemaTemplates.put("src/main/java/packagename/components/schemas/Schema.hbs", ".java"); @@ -870,12 +907,29 @@ public String toRequestBodyFilename(String componentName, String jsonPath) { return toModuleFilename(componentName, null); } + public String getPascalCaseResponse(String componentName, String jsonPath) { + if (jsonPath.startsWith("#/components/responses/")) { + return toModelName(componentName, null); + } else { + return toModelName("Code"+componentName+"Response", null); + } + } + @Override public String toResponseModuleName(String componentName, String jsonPath) { + String[] pathPieces = jsonPath.split("/"); if (jsonPath.startsWith("#/components/responses/")) { + if (pathPieces.length == 4) { + // #/components/responses/SomeResponse + return toModelName(componentName, null); + } return toModuleFilename(componentName, jsonPath); } - return toModuleFilename("response"+componentName, jsonPath); + if (pathPieces.length == 6) { + // #/paths/somePath/verb/responses/200 + return toModelName("Code"+componentName+"Response", null); + } + return toModuleFilename("code"+componentName+"response", null); } @Override diff --git a/src/main/java/org/openapijsonschematools/codegen/generators/PythonClientGenerator.java b/src/main/java/org/openapijsonschematools/codegen/generators/PythonClientGenerator.java index ae0677bc46d..3d4ea507d87 100644 --- a/src/main/java/org/openapijsonschematools/codegen/generators/PythonClientGenerator.java +++ b/src/main/java/org/openapijsonschematools/codegen/generators/PythonClientGenerator.java @@ -1881,7 +1881,7 @@ public String getPascalCaseParameter(String name) { } } - public String getPascalCaseResponse(String name) { + public String getPascalCaseResponse(String name, String jsonPath) { if (name.matches("^\\d[X\\d]{2}$")) { // 200 or 2XX return "ResponseFor" + name; diff --git a/src/main/java/org/openapijsonschematools/codegen/generators/openapimodels/CodegenResponse.java b/src/main/java/org/openapijsonschematools/codegen/generators/openapimodels/CodegenResponse.java index 709f41f8864..2a90cee518c 100644 --- a/src/main/java/org/openapijsonschematools/codegen/generators/openapimodels/CodegenResponse.java +++ b/src/main/java/org/openapijsonschematools/codegen/generators/openapimodels/CodegenResponse.java @@ -31,6 +31,7 @@ public class CodegenResponse { public final TreeSet imports; public final boolean componentModule; public final String pathFromDocRoot; + public final String subpackage; public CodegenResponse getSelfOrDeepestRef() { if (refInfo == null) { @@ -43,7 +44,7 @@ public CodegenResponse getSelfOrDeepestRef() { return refObject; } - public CodegenResponse(CodegenKey jsonPathPiece, Map headers, CodegenSchema headersObjectSchema, CodegenText description, Map vendorExtensions, LinkedHashMap content, CodegenRefInfo refInfo, TreeSet imports, boolean componentModule, String pathFromDocRoot) { + public CodegenResponse(CodegenKey jsonPathPiece, Map headers, CodegenSchema headersObjectSchema, CodegenText description, Map vendorExtensions, LinkedHashMap content, CodegenRefInfo refInfo, TreeSet imports, boolean componentModule, String pathFromDocRoot, String subpackage) { this.jsonPathPiece = jsonPathPiece; this.headers = headers; this.headersObjectSchema = headersObjectSchema; @@ -54,6 +55,7 @@ public CodegenResponse(CodegenKey jsonPathPiece, Map head this.imports = imports; this.componentModule = componentModule; this.pathFromDocRoot = pathFromDocRoot; + this.subpackage = subpackage; } /** diff --git a/src/main/resources/java/README.hbs b/src/main/resources/java/README.hbs index dc2ee6b3ff5..2477d62306e 100644 --- a/src/main/resources/java/README.hbs +++ b/src/main/resources/java/README.hbs @@ -185,6 +185,18 @@ Class | Description {{/with}} {{/each}} {{/if}} +{{#if responses}} + +## Component Responses + +Class | Description +----- | ------------ +{{#each responses}} + {{#with this}} +[{{jsonPathPiece.pascalCase}}.{{jsonPathPiece.pascalCase}}1](docs/components/responses/{{jsonPathPiece.pascalCase}}.md#{{jsonPathPiece.kebabCase}}1) |{{#if description}} {{description.originalWithBr}}{{/if}} + {{/with}} +{{/each}} +{{/if}} {{#if securitySchemes}} ## Component SecuritySchemes diff --git a/src/main/resources/java/pom.hbs b/src/main/resources/java/pom.hbs index be79badc236..48db5cc9f02 100644 --- a/src/main/resources/java/pom.hbs +++ b/src/main/resources/java/pom.hbs @@ -101,7 +101,7 @@ org.apache.maven.plugins maven-surefire-plugin - 2.12 + 3.2.5 @@ -110,8 +110,8 @@ -Xms512m -Xmx1500m - methods - pertest + classes + true diff --git a/src/main/resources/java/src/main/java/packagename/components/requestbodies/RequestBody.hbs b/src/main/resources/java/src/main/java/packagename/components/requestbodies/RequestBody.hbs index 6b0d2c616cc..0dfe0ab8cbf 100644 --- a/src/main/resources/java/src/main/java/packagename/components/requestbodies/RequestBody.hbs +++ b/src/main/resources/java/src/main/java/packagename/components/requestbodies/RequestBody.hbs @@ -14,28 +14,35 @@ public class {{jsonPathPiece.pascalCase}} extends {{refInfo.refModule}} { {{else}} import {{packageName}}.requestbody.RequestBodySerializer; import {{packageName}}.requestbody.GenericRequestBody; +import {{packageName}}.requestbody.SerializedRequestBody; import {{packageName}}.mediatype.MediaType; {{#each content}} {{#with schema}} import {{{packageName}}}.{{subpackage}}.{{containerJsonPathPiece.pascalCase}}; {{/with}} {{/each}} -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; import java.util.AbstractMap; import java.util.Map; public class {{jsonPathPiece.pascalCase}} { + {{#if content}} + public sealed interface SealedMediaType permits {{#each content}}{{@key.pascalCase}}MediaType{{#unless @last}}, {{/unless}}{{/each}} {} + {{/if}} {{#each content}} - public static class {{@key.pascalCase}}MediaType extends MediaType<{{#with this}}{{#with schema}}{{containerJsonPathPiece.pascalCase}}.{{jsonPathPiece.pascalCase}}{{/with}}{{/with}}> { + public record {{@key.pascalCase}}MediaType({{#with this}}{{#with schema}}{{containerJsonPathPiece.pascalCase}}.{{jsonPathPiece.pascalCase}} schema{{/with}}{{/with}}) implements SealedMediaType, MediaType<{{#with this}}{{#with schema}}{{containerJsonPathPiece.pascalCase}}.{{jsonPathPiece.pascalCase}}{{/with}}{{/with}}, Void> { public {{@key.pascalCase}}MediaType() { - super({{#with this}}{{#with schema}}{{containerJsonPathPiece.pascalCase}}.{{jsonPathPiece.pascalCase}}.getInstance(){{/with}}{{/with}}); + this({{#with this}}{{#with schema}}{{containerJsonPathPiece.pascalCase}}.{{jsonPathPiece.pascalCase}}.getInstance(){{/with}}{{/with}}); + } + @Override + public Void encoding() { + return null; } } {{/each}} - public static class {{jsonPathPiece.pascalCase}}1 extends RequestBodySerializer { + public static class {{jsonPathPiece.pascalCase}}1 extends RequestBodySerializer { public {{jsonPathPiece.pascalCase}}1() { super( Map.ofEntries( @@ -51,7 +58,7 @@ public class {{jsonPathPiece.pascalCase}} { {{#eq content.size 1}} {{#each content}} {{@key.pascalCase}}RequestBody requestBody{{@index}} = ({{@key.pascalCase}}RequestBody) requestBody; - return serialize(requestBody{{@index}}.contentType(), requestBody{{@index}}.body().data()); + return serialize(requestBody{{@index}}.contentType(), requestBody{{@index}}.body().getData()); {{/each}} {{else}} {{#each content}} @@ -65,30 +72,19 @@ public class {{jsonPathPiece.pascalCase}} { } else if (requestBody instanceof {{@key.pascalCase}}RequestBody requestBody{{@index}}) { {{/if}} {{/if}} - return serialize(requestBody{{@index}}.contentType(), requestBody{{@index}}.body().data()); + return serialize(requestBody{{@index}}.contentType(), requestBody{{@index}}.body().getData()); {{/each}} } {{/eq}} } } - public static abstract sealed class SealedRequestBody permits {{#each content}}{{@key.pascalCase}}RequestBody{{#unless @last}}, {{/unless}}{{/each}} {} + public sealed interface SealedRequestBody permits {{#each content}}{{@key.pascalCase}}RequestBody{{#unless @last}}, {{/unless}}{{/each}} {} {{#each content}} - public static final class {{@key.pascalCase}}RequestBody extends SealedRequestBody implements GenericRequestBody<{{#with this}}{{#with schema}}{{containerJsonPathPiece.pascalCase}}.{{#with getSelfOrDeepestRef}}{{> src/main/java/packagename/components/schemas/_sealedClassName }}{{/with}}{{/with}}{{/with}}> { - private final String contentType; - private final {{#with this}}{{#with schema}}{{containerJsonPathPiece.pascalCase}}.{{#with getSelfOrDeepestRef}}{{> src/main/java/packagename/components/schemas/_sealedClassName }}{{/with}}{{/with}}{{/with}} body; - public {{@key.pascalCase}}RequestBody({{#with this}}{{#with schema}}{{containerJsonPathPiece.pascalCase}}.{{#with getSelfOrDeepestRef}}{{> src/main/java/packagename/components/schemas/_sealedClassName }}{{/with}}{{/with}}{{/with}} body) { - contentType = "{{{@key.original}}}"; - this.body = body; - } + public record {{@key.pascalCase}}RequestBody({{#with this}}{{#with schema}}{{containerJsonPathPiece.pascalCase}}.{{#with getSelfOrDeepestRef}}{{> src/main/java/packagename/components/schemas/_sealedClassName }}{{/with}}{{/with}}{{/with}} body) implements SealedRequestBody, GenericRequestBody<{{#with this}}{{#with schema}}{{containerJsonPathPiece.pascalCase}}.{{#with getSelfOrDeepestRef}}{{> src/main/java/packagename/components/schemas/_sealedClassName }}{{/with}}{{/with}}{{/with}}> { @Override public String contentType() { - return contentType; - } - - @Override - public {{#with this}}{{#with schema}}{{containerJsonPathPiece.pascalCase}}.{{#with getSelfOrDeepestRef}}{{> src/main/java/packagename/components/schemas/_sealedClassName }}{{/with}}{{/with}}{{/with}} body() { - return body; + return "{{{@key.original}}}"; } } {{/each}} diff --git a/src/main/resources/java/src/main/java/packagename/components/requestbodies/RequestBodyDoc.hbs b/src/main/resources/java/src/main/java/packagename/components/requestbodies/RequestBodyDoc.hbs index 5334a47d18b..52c1eaee508 100644 --- a/src/main/resources/java/src/main/java/packagename/components/requestbodies/RequestBodyDoc.hbs +++ b/src/main/resources/java/src/main/java/packagename/components/requestbodies/RequestBodyDoc.hbs @@ -28,27 +28,39 @@ a class that serializes SealedRequestBody request bodies, extended from the $ref public class {{jsonPathPiece.pascalCase}} A class that contains necessary nested request body classes -- supporting XMediaType classes which store the openapi request body contentType to schema information +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types - a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances -- SealedRequestBody class, an abstract sealed class which contains all the contentType/schema input types -- final classes which extend SealedRequestBody, the concrete request body types +- SealedRequestBody, a sealed interface which contains all the contentType/schema input types +- records which implement SealedRequestBody, the concrete request body types {{headerSize}}# Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | --------------------- | +| sealed interface | [{{jsonPathPiece.pascalCase}}.SealedMediaType](#{{> src/main/java/packagename/components/_helper_anchor_id identifierPieces=(append identifierPieces "sealedmediatype") }})
media type sealed interface | {{#each content}} -| static class | [{{jsonPathPiece.pascalCase}}.{{@key.pascalCase}}MediaType](#{{@key.kebabCase}}mediatype)
class storing schema info for a specific contentType | +| record | [{{jsonPathPiece.pascalCase}}.{{@key.pascalCase}}MediaType](#{{@key.kebabCase}}mediatype)
record storing schema + encoding for a specific contentType | {{/each}} | static class | [{{jsonPathPiece.pascalCase}}.{{jsonPathPiece.pascalCase}}1](#{{> src/main/java/packagename/components/_helper_anchor_id identifierPieces=(append identifierPieces (join jsonPathPiece.kebabCase "1" "")) }})
class that serializes request bodies | -| static class | [{{jsonPathPiece.pascalCase}}.SealedRequestBody](#{{> src/main/java/packagename/components/_helper_anchor_id identifierPieces=(append identifierPieces "sealedrequestbody") }})
abstract sealed request body class | +| sealed interface | [{{jsonPathPiece.pascalCase}}.SealedRequestBody](#{{> src/main/java/packagename/components/_helper_anchor_id identifierPieces=(append identifierPieces "sealedrequestbody") }})
request body sealed interface | {{#each content}} -| static class | [{{jsonPathPiece.pascalCase}}.{{@key.pascalCase}}RequestBody](#{{@key.kebabCase}}requestbody)
implementing sealed class to store request body input | +| record | [{{jsonPathPiece.pascalCase}}.{{@key.pascalCase}}RequestBody](#{{@key.kebabCase}}requestbody)
implements sealed interface to store request body input | {{/each}} + +{{> src/main/java/packagename/components/_helper_header_from_identifier_pieces headerSize=(join headerSize "#" "") identifierPieces=(append identifierPieces "SealedMediaType") }} +public sealed interface SealedMediaType
+permits
+{{#each content}} +[{{@key.pascalCase}}MediaType](#{{@key.kebabCase}}mediatype){{#unless @last}},{{/unless}} +{{/each}} + +sealed interface that stores schema and encoding info + {{#each content}} {{> src/main/java/packagename/components/_helper_header_from_identifier_pieces headerSize=(join headerSize "#" "") identifierPieces=(append identifierPieces (join @key.pascalCase "MediaType" "")) }} -public static class {{@key.pascalCase}}MediaType
-extends MediaType<{{#with this}}{{#with schema}}[{{containerJsonPathPiece.pascalCase}}.{{jsonPathPiece.pascalCase}}]({{docRoot}}{{pathFromDocRoot}}.md#{{jsonPathPiece.kebabCase}}){{/with}}{{/with}}> +public record {{@key.pascalCase}}MediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<{{#with this}}{{#with schema}}[{{containerJsonPathPiece.pascalCase}}.{{jsonPathPiece.pascalCase}}]({{docRoot}}{{pathFromDocRoot}}.md#{{jsonPathPiece.kebabCase}}){{/with}}{{/with}}, Void> class storing schema info for a specific contentType @@ -57,10 +69,11 @@ class storing schema info for a specific contentType | --------------------------- | | {{@key.pascalCase}}MediaType()
Creates an instance | -{{headerSize}}## Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| {{#with this}}{{#with schema}}[{{containerJsonPathPiece.pascalCase}}.{{jsonPathPiece.pascalCase}}]({{docRoot}}{{pathFromDocRoot}}.md#{{jsonPathPiece.kebabCase}}){{/with}}{{/with}} | schema
the schema for this MediaType | +{{headerSize}}## Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| {{#with this}}{{#with schema}}[{{containerJsonPathPiece.pascalCase}}.{{jsonPathPiece.pascalCase}}]({{docRoot}}{{pathFromDocRoot}}.md#{{jsonPathPiece.kebabCase}}){{/with}}{{/with}} | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | {{/each}} {{> src/main/java/packagename/components/_helper_header_from_identifier_pieces headerSize=(join headerSize "#" "") identifierPieces=(append identifierPieces (join jsonPathPiece.pascalCase "1" "")) }} @@ -77,7 +90,7 @@ a class that serializes SealedRequestBody request bodies | Modifier and Type | Field and Description | | ----------------- | --------------------- | | boolean | required = {{required}}
whether the request body is required | -| Map> | content = Map.ofEntries(
{{#each content}}    new AbstractMap.SimpleEntry<>("{{{@key.original}}}", new [{{@key.pascalCase}}MediaType](#{{@key.kebabCase}}mediatype)()){{#unless @last}},{{/unless}}
{{/each}})
the contentType to schema info | +| Map | content = Map.ofEntries(
{{#each content}}    new AbstractMap.SimpleEntry<>("{{{@key.original}}}", new [{{@key.pascalCase}}MediaType](#{{@key.kebabCase}}mediatype)()){{#unless @last}},{{/unless}}
{{/each}})
the contentType to schema info | {{headerSize}}## Method Summary | Modifier and Type | Method and Description | @@ -85,21 +98,21 @@ a class that serializes SealedRequestBody request bodies | SerializedRequestBody | serialize([SealedRequestBody](#sealedrequestbody) requestBody)
called by endpoint when creating request body bytes | {{> src/main/java/packagename/components/_helper_header_from_identifier_pieces headerSize=(join headerSize "#" "") identifierPieces=(append identifierPieces "SealedRequestBody") }} -public static abstract sealed class SealedRequestBody
+public sealed interface SealedRequestBody
permits
{{#each content}} [{{@key.pascalCase}}RequestBody](#{{@key.kebabCase}}requestbody){{#unless @last}},{{/unless}} {{/each}} -abstract sealed class that stores request contentType + validated schema data +sealed interface that stores request contentType + validated schema data {{#each content}} {{> src/main/java/packagename/components/_helper_header_from_identifier_pieces headerSize=(join headerSize "#" "") identifierPieces=(append identifierPieces (join @key.pascalCase "RequestBody" "")) }} -public static final class {{@key.pascalCase}}RequestBody
-extends [SealedRequestBody](#sealedrequestbody)
-implements GenericRequestBody<{{#with this}}{{#with schema}}{{containerJsonPathPiece.pascalCase}}.{{#with getSelfOrDeepestRef}}{{> src/main/java/packagename/components/schemas/_sealedClassName forDocs=true }}{{/with}}{{/with}}{{/with}}>
+public record {{@key.pascalCase}}RequestBody
+implements [SealedRequestBody](#sealedrequestbody),
+GenericRequestBody<{{#with this}}{{#with schema}}{{containerJsonPathPiece.pascalCase}}.{{#with getSelfOrDeepestRef}}{{> src/main/java/packagename/components/schemas/_sealedClassName forDocs=true }}{{/with}}{{/with}}{{/with}}>
-A final class to store request body input for contentType="{{{@key.original}}}" +A record class to store request body input for contentType="{{{@key.original}}}" {{headerSize}}## Constructor Summary | Constructor and Description | diff --git a/src/main/resources/java/src/main/java/packagename/components/responses/Response.hbs b/src/main/resources/java/src/main/java/packagename/components/responses/Response.hbs new file mode 100644 index 00000000000..c498a65b161 --- /dev/null +++ b/src/main/resources/java/src/main/java/packagename/components/responses/Response.hbs @@ -0,0 +1,105 @@ +{{#with response}} +package {{packageName}}.{{subpackage}}; + +{{#if refInfo}} + {{#neq subpackage refInfo.ref.subpackage}} +import {{packageName}}.{{refInfo.ref.subpackage}}.{{refInfo.refModule}}; + {{/neq}} + +public class {{jsonPathPiece.pascalCase}} extends {{refInfo.refModule}} { + public static class {{jsonPathPiece.pascalCase}}1 extends {{refInfo.refModule}}1 {} +} +{{else}} +import {{packageName}}.configurations.SchemaConfiguration; +import {{packageName}}.response.ResponseDeserializer; + {{#if hasContentSchema}} +import {{packageName}}.mediatype.MediaType; + {{else}} +import {{packageName}}.schemas.validation.MapUtils; + {{/if}} + {{#each content}} + {{#with schema}} +import {{{packageName}}}.{{subpackage}}.{{containerJsonPathPiece.pascalCase}}; + {{/with}} + {{/each}} + + {{#if content}} +import java.util.AbstractMap; + {{/if}} +import java.util.Map; +import java.net.http.HttpHeaders; + +public class {{jsonPathPiece.pascalCase}} { + {{#if hasContentSchema}} + public sealed interface SealedMediaType permits {{#each content}}{{@key.pascalCase}}MediaType{{#unless @last}}, {{/unless}}{{/each}} {} + {{#each content}} + + public record {{@key.pascalCase}}MediaType({{#with this}}{{#with schema}}{{containerJsonPathPiece.pascalCase}}.{{jsonPathPiece.pascalCase}} schema{{/with}}{{/with}}) implements SealedMediaType, MediaType<{{#with this}}{{#with schema}}{{containerJsonPathPiece.pascalCase}}.{{jsonPathPiece.pascalCase}}, Void{{/with}}{{/with}}> { + public {{@key.pascalCase}}MediaType() { + this({{#with this}}{{#with schema}}{{containerJsonPathPiece.pascalCase}}.{{jsonPathPiece.pascalCase}}.getInstance(){{/with}}{{/with}}); + } + @Override + public Void encoding() { + return null; + } + } + {{/each}} + public sealed interface SealedResponseBody permits {{#each content}}{{@key.pascalCase}}ResponseBody{{#unless @last}}, {{/unless}}{{/each}} {} + {{#each content}} + public record {{@key.pascalCase}}ResponseBody({{#with this}}{{#with schema}}{{containerJsonPathPiece.pascalCase}}.{{#with getSelfOrDeepestRef}}{{> src/main/java/packagename/components/schemas/_sealedClassName }}{{/with}}{{/with}}{{/with}} body) implements SealedResponseBody { } + {{/each}} + {{/if}} + + public static class {{jsonPathPiece.pascalCase}}1 extends ResponseDeserializer<{{#if hasContentSchema}}SealedResponseBody{{else}}Void{{/if}}, Void, {{#if hasContentSchema}}SealedMediaType{{else}}Void{{/if}}> { + public {{jsonPathPiece.pascalCase}}1() { + super( + {{#if hasContentSchema}} + Map.ofEntries( + {{#each content}} + new AbstractMap.SimpleEntry<>("{{{@key.original}}}", new {{@key.pascalCase}}MediaType()){{#unless @last}},{{/unless}} + {{/each}} + ) + {{else}} + MapUtils.makeMap( + {{#each content}} + new AbstractMap.SimpleEntry("{{{@key.original}}}", null){{#unless @last}},{{/unless}} + {{/each}} + ) + {{/if}} + ); + } + + {{#if hasContentSchema}} + @Override + protected SealedResponseBody getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + SealedMediaType mediaType = content.get(contentType); + if (mediaType == null) { + throw new RuntimeException("Invalid contentType was received back from the server that does not exist in the openapi document"); + } + {{#each content}} + {{#if @first}} + if (mediaType instanceof {{@key.pascalCase}}MediaType thisMediaType) { + {{else}} + } else if (mediaType instanceof {{@key.pascalCase}}MediaType thisMediaType) { + {{/if}} + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new {{@key.pascalCase}}ResponseBody(deserializedBody); + {{/each}} + } + throw new RuntimeException("contentType="+contentType+" returned by the server is unknown and does not exist in the openapi document"); + } + {{else}} + @Override + protected Void getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + return null; + } + {{/if}} + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } +} +{{/if}} +{{/with}} \ No newline at end of file diff --git a/src/main/resources/java/src/main/java/packagename/components/responses/ResponseDoc.hbs b/src/main/resources/java/src/main/java/packagename/components/responses/ResponseDoc.hbs new file mode 100644 index 00000000000..225e01d0f1c --- /dev/null +++ b/src/main/resources/java/src/main/java/packagename/components/responses/ResponseDoc.hbs @@ -0,0 +1,140 @@ +{{#with response}} +{{#eq identifierPieces.size 0}} +{{> src/main/java/packagename/components/_helper_header_from_identifier_pieces identifierPieces=(append identifierPieces jsonPathPiece) }} +{{else}} +{{> src/main/java/packagename/components/_helper_header_from_identifier_pieces }} +{{/eq}} +{{#if componentModule}} +{{jsonPathPiece.pascalCase}}.java +{{/if}} + +{{#if refInfo}} +public class {{jsonPathPiece.pascalCase}} extends [{{refInfo.refClass}}](../../components/responses/{{refInfo.refClass}}.md) + +A class (extended from the $ref class) that contains necessary nested response classes +- a class that extends ResponseDeserializer and is used to deserialize responses + +{{headerSize}}# Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [{{jsonPathPiece.pascalCase}}.{{jsonPathPiece.pascalCase}}1](#{{> src/main/java/packagename/components/_helper_anchor_id identifierPieces=(append identifierPieces (join jsonPathPiece.kebabCase "1" "")) }})
class that deserializes responses | + +{{> src/main/java/packagename/components/_helper_header_from_identifier_pieces headerSize=(join headerSize "#" "") identifierPieces=(append identifierPieces (join jsonPathPiece.pascalCase "1" "")) }} +public static class {{jsonPathPiece.pascalCase}}1 extends [{{refInfo.refClass}}1](../../components/responses/{{refInfo.refClass}}.md#{{refInfo.ref.jsonPathPiece.kebabCase}}1)
+ +a class that deserializes responses, extended from the $ref class + +{{else}} +public class {{jsonPathPiece.pascalCase}} + +A class that contains necessary nested response classes +{{#if hasContentSchema}} +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types +- SealedResponseBody, a sealed interface which contains all the contentType/schema types +- records which implement SealedResponseBody, the concrete response body types +{{/if}} +- a class that extends ResponseDeserializer and is used to deserialize responses + +{{headerSize}}# Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +{{#if hasContentSchema}} +| sealed interface | [{{jsonPathPiece.pascalCase}}.SealedMediaType](#{{> src/main/java/packagename/components/_helper_anchor_id identifierPieces=(append identifierPieces "sealedmediatype") }})
media type sealed interface | + {{#each content}} +| record | [{{jsonPathPiece.pascalCase}}.{{@key.pascalCase}}MediaType](#{{@key.kebabCase}}mediatype)
record storing schema + encoding for a specific contentType | + {{/each}} +| sealed interface | [{{jsonPathPiece.pascalCase}}.SealedResponseBody](#{{> src/main/java/packagename/components/_helper_anchor_id identifierPieces=(append identifierPieces "sealedresponsebody") }})
response body sealed interface | + {{#each content}} +| record | [{{jsonPathPiece.pascalCase}}.{{@key.pascalCase}}ResponseBody](#{{@key.kebabCase}}responsebody)
implements sealed interface to store response body | + {{/each}} +{{/if}} +| static class | [{{jsonPathPiece.pascalCase}}.{{jsonPathPiece.pascalCase}}1](#{{> src/main/java/packagename/components/_helper_anchor_id identifierPieces=(append identifierPieces (join jsonPathPiece.kebabCase "1" "")) }})
class that deserializes responses | +{{#if hasContentSchema}} + +{{> src/main/java/packagename/components/_helper_header_from_identifier_pieces headerSize=(join headerSize "#" "") identifierPieces=(append identifierPieces "SealedMediaType") }} +public sealed interface SealedMediaType
+permits
+ {{#each content}} +[{{@key.pascalCase}}MediaType](#{{@key.kebabCase}}mediatype){{#unless @last}},{{/unless}} + {{/each}} + +sealed interface that stores schema and encoding info + {{#each content}} + +{{> src/main/java/packagename/components/_helper_header_from_identifier_pieces headerSize=(join headerSize "#" "") identifierPieces=(append identifierPieces (join @key.pascalCase "MediaType" "")) }} +public record {{@key.pascalCase}}MediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<{{#with this}}{{#with schema}}[{{containerJsonPathPiece.pascalCase}}.{{jsonPathPiece.pascalCase}}]({{docRoot}}{{pathFromDocRoot}}.md#{{jsonPathPiece.kebabCase}}){{/with}}{{/with}}, Void> + +class storing schema info for a specific contentType + +{{headerSize}}## Constructor Summary +| Constructor and Description | +| --------------------------- | +| {{@key.pascalCase}}MediaType()
Creates an instance | + +{{headerSize}}## Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| {{#with this}}{{#with schema}}[{{containerJsonPathPiece.pascalCase}}.{{jsonPathPiece.pascalCase}}]({{docRoot}}{{pathFromDocRoot}}.md#{{jsonPathPiece.kebabCase}}){{/with}}{{/with}} | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + {{/each}} + +{{> src/main/java/packagename/components/_helper_header_from_identifier_pieces headerSize=(join headerSize "#" "") identifierPieces=(append identifierPieces "SealedResponseBody") }} +public sealed interface SealedResponseBody
+permits
+ {{#each content}} +[{{@key.pascalCase}}ResponseBody](#{{@key.kebabCase}}responsebody){{#unless @last}},{{/unless}} + {{/each}} + +sealed interface that stores response body + + {{#each content}} +{{> src/main/java/packagename/components/_helper_header_from_identifier_pieces headerSize=(join headerSize "#" "") identifierPieces=(append identifierPieces (join @key.pascalCase "ResponseBody" "")) }} +public record {{@key.pascalCase}}ResponseBody
+implements [SealedResponseBody](#sealedresponsebody) + +A record class to store response body for contentType="{{{@key.original}}}" + +{{headerSize}}## Constructor Summary +| Constructor and Description | +| --------------------------- | +| {{@key.pascalCase}}ResponseBody({{#with this}}{{#with schema}}{{containerJsonPathPiece.pascalCase}}.{{#with getSelfOrDeepestRef}}{{> src/main/java/packagename/components/schemas/_sealedClassName forDocs=true }}{{/with}}{{/with}}{{/with}} body)
Creates an instance | + +{{headerSize}}## Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| {{#with this}}{{#with schema}}{{containerJsonPathPiece.pascalCase}}.{{#with getSelfOrDeepestRef}}{{> src/main/java/packagename/components/schemas/_sealedClassName forDocs=true }}{{/with}}{{/with}}{{/with}} | body()
returns the body passed in in the constructor | + {{/each}} +{{/if}} + +{{> src/main/java/packagename/components/_helper_header_from_identifier_pieces headerSize=(join headerSize "#" "") identifierPieces=(append identifierPieces (join jsonPathPiece.pascalCase "1" "")) }} +public static class {{jsonPathPiece.pascalCase}}1
+extends ResponseDeserializer<{{#if hasContentSchema}}[SealedResponseBody](#sealedresponsebody){{else}}Void{{/if}}, Void, {{#if hasContentSchema}}[SealedMediaType](#sealedmediatype){{else}}Void{{/if}}> + +a class that deserializes responses + +{{headerSize}}## Constructor Summary +| Constructor and Description | +| --------------------------- | +| {{jsonPathPiece.pascalCase}}1()
Creates an instance | + +{{headerSize}}## Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | + {{#if hasContentSchema}} +| Map | content = Map.ofEntries(
{{#each content}}    new AbstractMap.SimpleEntry<>("{{{@key.original}}}", new [{{@key.pascalCase}}MediaType](#{{@key.kebabCase}}mediatype)()){{#unless @last}},{{/unless}}
{{/each}})
the contentType to schema info | + {{else}} +| Map | content = MapUtils.makeMap(
{{#each content}}    new AbstractMap.SimpleEntry<>("{{{@key.original}}}", null){{#unless @last}},{{/unless}}
{{/each}})
the contentType to schema info | + {{/if}} + +{{headerSize}}## Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApiResponse<{{#if hasContentSchema}}[SealedResponseBody](#sealedresponsebody){{else}}Void{{/if}}, Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | +{{/if}} +{{#if componentModule}} + +[[Back to top]](#top) {{> _helper_footer_links readmePath="../../../" responsesLink=true}} +{{/if}} +{{/with}} \ No newline at end of file diff --git a/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_Schema_anytypeOrMultitype.hbs b/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_Schema_anytypeOrMultitype.hbs index cbecfdd81b9..b84ca5875a8 100644 --- a/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_Schema_anytypeOrMultitype.hbs +++ b/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_Schema_anytypeOrMultitype.hbs @@ -4,9 +4,9 @@ {{#if types}} -public static class {{jsonPathPiece.pascalCase}} extends JsonSchema implements {{#with enumInfo}}{{#if typeToValues.null}}NullEnumValidator, {{/if}}{{#if typeToValues.boolean}}BooleanEnumValidator, {{/if}}{{#if typeToValues.string}}StringEnumValidator, {{/if}}{{#if typeToValues.Integer}}IntegerEnumValidator, {{/if}}{{#if typeToValues.Long}}LongEnumValidator, {{/if}}{{#if typeToValues.Float}}FloatEnumValidator, {{/if}}{{#if typeToValues.Double}}DoubleEnumValidator, {{/if}}{{/with}}{{#each types}}{{#eq this "null"}}NullSchemaValidator<{{jsonPathPiece.pascalCase}}BoxedVoid>{{else}}{{#eq this "boolean"}}BooleanSchemaValidator<{{jsonPathPiece.pascalCase}}BoxedBoolean>{{else}}{{#or (eq this "number") (eq this "integer")}}NumberSchemaValidator<{{jsonPathPiece.pascalCase}}BoxedNumber>{{else}}{{#eq this "string"}}StringSchemaValidator<{{jsonPathPiece.pascalCase}}BoxedString>{{else}}{{#eq this "array"}}ListSchemaValidator<{{#if arrayOutputJsonPathPiece}}{{arrayOutputJsonPathPiece.pascalCase}}{{else}}FrozenList<@Nullable Object>{{/if}}, {{jsonPathPiece.pascalCase}}BoxedList>{{else}}{{#eq this "object"}}MapSchemaValidator<{{#if mapOutputJsonPathPiece}}{{mapOutputJsonPathPiece.pascalCase}}{{else}}FrozenMap<{{#with mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}@Nullable Object{{/with}}>{{/if}}, {{jsonPathPiece.pascalCase}}BoxedMap>{{/eq}}{{/eq}}{{/eq}}{{/or}}{{/eq}}{{/eq}}{{#unless @last}}, {{/unless}}{{/each}} { +public static class {{jsonPathPiece.pascalCase}} extends JsonSchema<{{jsonPathPiece.pascalCase}}Boxed> implements {{#with enumInfo}}{{#if typeToValues.null}}NullEnumValidator, {{/if}}{{#if typeToValues.boolean}}BooleanEnumValidator, {{/if}}{{#if typeToValues.string}}StringEnumValidator, {{/if}}{{#if typeToValues.Integer}}IntegerEnumValidator, {{/if}}{{#if typeToValues.Long}}LongEnumValidator, {{/if}}{{#if typeToValues.Float}}FloatEnumValidator, {{/if}}{{#if typeToValues.Double}}DoubleEnumValidator, {{/if}}{{/with}}{{#each types}}{{#eq this "null"}}NullSchemaValidator<{{jsonPathPiece.pascalCase}}BoxedVoid>{{else}}{{#eq this "boolean"}}BooleanSchemaValidator<{{jsonPathPiece.pascalCase}}BoxedBoolean>{{else}}{{#or (eq this "number") (eq this "integer")}}NumberSchemaValidator<{{jsonPathPiece.pascalCase}}BoxedNumber>{{else}}{{#eq this "string"}}StringSchemaValidator<{{jsonPathPiece.pascalCase}}BoxedString>{{else}}{{#eq this "array"}}ListSchemaValidator<{{#if arrayOutputJsonPathPiece}}{{arrayOutputJsonPathPiece.pascalCase}}{{else}}FrozenList<@Nullable Object>{{/if}}, {{jsonPathPiece.pascalCase}}BoxedList>{{else}}{{#eq this "object"}}MapSchemaValidator<{{#if mapOutputJsonPathPiece}}{{mapOutputJsonPathPiece.pascalCase}}{{else}}FrozenMap<{{#with mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}@Nullable Object{{/with}}>{{/if}}, {{jsonPathPiece.pascalCase}}BoxedMap>{{/eq}}{{/eq}}{{/eq}}{{/or}}{{/eq}}{{/eq}}{{#unless @last}}, {{/unless}}{{/each}} { {{else}} -public static class {{jsonPathPiece.pascalCase}} extends JsonSchema implements {{#with enumInfo}}{{#if typeToValues.null}}NullEnumValidator, {{/if}}{{#if typeToValues.boolean}}BooleanEnumValidator, {{/if}}{{#if typeToValues.string}}StringEnumValidator, {{/if}}{{#if typeToValues.Integer}}IntegerEnumValidator, {{/if}}{{#if typeToValues.Long}}LongEnumValidator, {{/if}}{{#if typeToValues.Float}}FloatEnumValidator, {{/if}}{{#if typeToValues.Double}}DoubleEnumValidator, {{/if}}{{/with}}NullSchemaValidator<{{jsonPathPiece.pascalCase}}BoxedVoid>, BooleanSchemaValidator<{{jsonPathPiece.pascalCase}}BoxedBoolean>, NumberSchemaValidator<{{jsonPathPiece.pascalCase}}BoxedNumber>, StringSchemaValidator<{{jsonPathPiece.pascalCase}}BoxedString>, ListSchemaValidator<{{#if arrayOutputJsonPathPiece}}{{arrayOutputJsonPathPiece.pascalCase}}{{else}}FrozenList<@Nullable Object>{{/if}}, {{jsonPathPiece.pascalCase}}BoxedList>, MapSchemaValidator<{{#if mapOutputJsonPathPiece}}{{mapOutputJsonPathPiece.pascalCase}}{{else}}FrozenMap<{{#with mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}@Nullable Object{{/with}}>{{/if}}, {{jsonPathPiece.pascalCase}}BoxedMap> { +public static class {{jsonPathPiece.pascalCase}} extends JsonSchema<{{jsonPathPiece.pascalCase}}Boxed> implements {{#with enumInfo}}{{#if typeToValues.null}}NullEnumValidator, {{/if}}{{#if typeToValues.boolean}}BooleanEnumValidator, {{/if}}{{#if typeToValues.string}}StringEnumValidator, {{/if}}{{#if typeToValues.Integer}}IntegerEnumValidator, {{/if}}{{#if typeToValues.Long}}LongEnumValidator, {{/if}}{{#if typeToValues.Float}}FloatEnumValidator, {{/if}}{{#if typeToValues.Double}}DoubleEnumValidator, {{/if}}{{/with}}NullSchemaValidator<{{jsonPathPiece.pascalCase}}BoxedVoid>, BooleanSchemaValidator<{{jsonPathPiece.pascalCase}}BoxedBoolean>, NumberSchemaValidator<{{jsonPathPiece.pascalCase}}BoxedNumber>, StringSchemaValidator<{{jsonPathPiece.pascalCase}}BoxedString>, ListSchemaValidator<{{#if arrayOutputJsonPathPiece}}{{arrayOutputJsonPathPiece.pascalCase}}{{else}}FrozenList<@Nullable Object>{{/if}}, {{jsonPathPiece.pascalCase}}BoxedList>, MapSchemaValidator<{{#if mapOutputJsonPathPiece}}{{mapOutputJsonPathPiece.pascalCase}}{{else}}FrozenMap<{{#with mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}@Nullable Object{{/with}}>{{/if}}, {{jsonPathPiece.pascalCase}}BoxedMap> { {{/if}} {{#if componentModule}} /* diff --git a/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_Schema_boolean.hbs b/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_Schema_boolean.hbs index 92b1b84e4b8..a4c74773f2f 100644 --- a/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_Schema_boolean.hbs +++ b/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_Schema_boolean.hbs @@ -3,7 +3,7 @@ {{> src/main/java/packagename/components/schemas/SchemaClass/_boxedClasses }} -public static class {{jsonPathPiece.pascalCase}} extends JsonSchema implements BooleanSchemaValidator<{{jsonPathPiece.pascalCase}}BoxedBoolean>{{#and enumInfo enumInfo.typeToValues.boolean}}, BooleanEnumValidator{{/and}} { +public static class {{jsonPathPiece.pascalCase}} extends JsonSchema<{{jsonPathPiece.pascalCase}}Boxed> implements BooleanSchemaValidator<{{jsonPathPiece.pascalCase}}BoxedBoolean>{{#and enumInfo enumInfo.typeToValues.boolean}}, BooleanEnumValidator{{/and}} { {{#if componentModule}} /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. @@ -64,5 +64,5 @@ public static class {{jsonPathPiece.pascalCase}} extends JsonSchema implements B } {{> src/main/java/packagename/components/schemas/SchemaClass/_validate_implementor }} {{> src/main/java/packagename/components/schemas/SchemaClass/_getNewInstanceObject_implementor }} - {{> src/main/java/packagename/components/schemas/SchemaClass/_validateAndBoxBoolean }} + {{> src/main/java/packagename/components/schemas/SchemaClass/_validateAndBox }} } \ No newline at end of file diff --git a/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_Schema_list.hbs b/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_Schema_list.hbs index b1e914b5801..2004c3c7869 100644 --- a/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_Schema_list.hbs +++ b/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_Schema_list.hbs @@ -3,7 +3,7 @@ {{> src/main/java/packagename/components/schemas/SchemaClass/_boxedClasses }} -public static class {{jsonPathPiece.pascalCase}} extends JsonSchema implements ListSchemaValidator<{{#if arrayOutputJsonPathPiece}}{{arrayOutputJsonPathPiece.pascalCase}}{{else}}FrozenList<@Nullable Object>{{/if}}, {{jsonPathPiece.pascalCase}}BoxedList> { +public static class {{jsonPathPiece.pascalCase}} extends JsonSchema<{{jsonPathPiece.pascalCase}}Boxed> implements ListSchemaValidator<{{#if arrayOutputJsonPathPiece}}{{arrayOutputJsonPathPiece.pascalCase}}{{else}}FrozenList<@Nullable Object>{{/if}}, {{jsonPathPiece.pascalCase}}BoxedList> { {{#if componentModule}} /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. @@ -82,5 +82,5 @@ public static class {{jsonPathPiece.pascalCase}} extends JsonSchema implements L } {{> src/main/java/packagename/components/schemas/SchemaClass/_validate_implementor }} {{> src/main/java/packagename/components/schemas/SchemaClass/_getNewInstanceObject_implementor }} - {{> src/main/java/packagename/components/schemas/SchemaClass/_validateAndBoxList }} + {{> src/main/java/packagename/components/schemas/SchemaClass/_validateAndBox }} } \ No newline at end of file diff --git a/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_Schema_map.hbs b/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_Schema_map.hbs index 55f9e8cb689..7f664491e82 100644 --- a/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_Schema_map.hbs +++ b/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_Schema_map.hbs @@ -3,7 +3,7 @@ {{> src/main/java/packagename/components/schemas/SchemaClass/_boxedClasses }} -public static class {{jsonPathPiece.pascalCase}} extends JsonSchema implements MapSchemaValidator<{{#if mapOutputJsonPathPiece}}{{mapOutputJsonPathPiece.pascalCase}}{{else}}FrozenMap<{{#with mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}@Nullable Object{{/with}}>{{/if}}, {{jsonPathPiece.pascalCase}}BoxedMap> { +public static class {{jsonPathPiece.pascalCase}} extends JsonSchema<{{jsonPathPiece.pascalCase}}Boxed> implements MapSchemaValidator<{{#if mapOutputJsonPathPiece}}{{mapOutputJsonPathPiece.pascalCase}}{{else}}FrozenMap<{{#with mapValueSchema}}{{> src/main/java/packagename/components/schemas/types/schema_output_type sourceJsonPath=../jsonPath forceNull=true }}{{else}}@Nullable Object{{/with}}>{{/if}}, {{jsonPathPiece.pascalCase}}BoxedMap> { {{#if componentModule}} /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. @@ -88,5 +88,5 @@ public static class {{jsonPathPiece.pascalCase}} extends JsonSchema implements M {{/if}} {{> src/main/java/packagename/components/schemas/SchemaClass/_validate_implementor }} {{> src/main/java/packagename/components/schemas/SchemaClass/_getNewInstanceObject_implementor }} - {{> src/main/java/packagename/components/schemas/SchemaClass/_validateAndBoxMap }} + {{> src/main/java/packagename/components/schemas/SchemaClass/_validateAndBox }} } diff --git a/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_Schema_null.hbs b/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_Schema_null.hbs index eaf72af47f7..e1c117ade41 100644 --- a/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_Schema_null.hbs +++ b/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_Schema_null.hbs @@ -3,7 +3,7 @@ {{> src/main/java/packagename/components/schemas/SchemaClass/_boxedClasses }} -public static class {{jsonPathPiece.pascalCase}} extends JsonSchema implements NullSchemaValidator<{{jsonPathPiece.pascalCase}}BoxedVoid>{{#and enumInfo enumInfo.typeToValues.null}}, NullEnumValidator{{/and}} { +public static class {{jsonPathPiece.pascalCase}} extends JsonSchema<{{jsonPathPiece.pascalCase}}Boxed> implements NullSchemaValidator<{{jsonPathPiece.pascalCase}}BoxedVoid>{{#and enumInfo enumInfo.typeToValues.null}}, NullEnumValidator{{/and}} { {{#if componentModule}} /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. @@ -64,5 +64,5 @@ public static class {{jsonPathPiece.pascalCase}} extends JsonSchema implements N } {{> src/main/java/packagename/components/schemas/SchemaClass/_validate_implementor }} {{> src/main/java/packagename/components/schemas/SchemaClass/_getNewInstanceObject_implementor }} - {{> src/main/java/packagename/components/schemas/SchemaClass/_validateAndBoxVoid }} + {{> src/main/java/packagename/components/schemas/SchemaClass/_validateAndBox }} } \ No newline at end of file diff --git a/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_Schema_number.hbs b/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_Schema_number.hbs index e9be837d381..7a295b1e94a 100644 --- a/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_Schema_number.hbs +++ b/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_Schema_number.hbs @@ -3,7 +3,7 @@ {{> src/main/java/packagename/components/schemas/SchemaClass/_boxedClasses }} -public static class {{jsonPathPiece.pascalCase}} extends JsonSchema implements {{#with enumInfo}}{{#if typeToValues.Integer}}IntegerEnumValidator, {{/if}}{{#if typeToValues.Long}}LongEnumValidator, {{/if}}{{#if typeToValues.Float}}FloatEnumValidator, {{/if}}{{#if typeToValues.Double}}DoubleEnumValidator, {{/if}}{{/with}}NumberSchemaValidator<{{jsonPathPiece.pascalCase}}BoxedNumber> { +public static class {{jsonPathPiece.pascalCase}} extends JsonSchema<{{jsonPathPiece.pascalCase}}Boxed> implements {{#with enumInfo}}{{#if typeToValues.Integer}}IntegerEnumValidator, {{/if}}{{#if typeToValues.Long}}LongEnumValidator, {{/if}}{{#if typeToValues.Float}}FloatEnumValidator, {{/if}}{{#if typeToValues.Double}}DoubleEnumValidator, {{/if}}{{/with}}NumberSchemaValidator<{{jsonPathPiece.pascalCase}}BoxedNumber> { {{#if componentModule}} /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. @@ -82,5 +82,5 @@ public static class {{jsonPathPiece.pascalCase}} extends JsonSchema implements { } {{> src/main/java/packagename/components/schemas/SchemaClass/_validate_implementor }} {{> src/main/java/packagename/components/schemas/SchemaClass/_getNewInstanceObject_implementor }} - {{> src/main/java/packagename/components/schemas/SchemaClass/_validateAndBoxNumber }} + {{> src/main/java/packagename/components/schemas/SchemaClass/_validateAndBox }} } \ No newline at end of file diff --git a/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_Schema_string.hbs b/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_Schema_string.hbs index cd604001e4e..39836793fcf 100644 --- a/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_Schema_string.hbs +++ b/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_Schema_string.hbs @@ -3,7 +3,7 @@ {{> src/main/java/packagename/components/schemas/SchemaClass/_boxedClasses }} -public static class {{jsonPathPiece.pascalCase}} extends JsonSchema implements StringSchemaValidator<{{jsonPathPiece.pascalCase}}BoxedString>{{#and enumInfo enumInfo.typeToValues.string}}, StringEnumValidator{{/and}}{{#if defaultValue}}, DefaultValueMethod{{/if}} { +public static class {{jsonPathPiece.pascalCase}} extends JsonSchema<{{jsonPathPiece.pascalCase}}Boxed> implements StringSchemaValidator<{{jsonPathPiece.pascalCase}}BoxedString>{{#and enumInfo enumInfo.typeToValues.string}}, StringEnumValidator{{/and}}{{#if defaultValue}}, DefaultValueMethod{{/if}} { {{#if componentModule}} /* NOTE: This class is auto generated by OpenAPI JSON Schema Generator. @@ -84,5 +84,5 @@ public static class {{jsonPathPiece.pascalCase}} extends JsonSchema implements S throw new InvalidTypeException("Invalid type stored in defaultValue"); } {{/if}} - {{> src/main/java/packagename/components/schemas/SchemaClass/_validateAndBoxString }} + {{> src/main/java/packagename/components/schemas/SchemaClass/_validateAndBox }} } \ No newline at end of file diff --git a/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_boxedBoolean.hbs b/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_boxedBoolean.hbs index 6f27595b2ba..e398aaf366f 100644 --- a/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_boxedBoolean.hbs +++ b/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_boxedBoolean.hbs @@ -1,28 +1,25 @@ {{#if forDocs}} {{> src/main/java/packagename/components/_helper_header_from_identifier_pieces headerSize=(join headerSize "#" "") identifierPieces=(append identifierPieces (join jsonPathPiece.pascalCase "BoxedBoolean" "")) }} -public static final class {{jsonPathPiece.pascalCase}}BoxedBoolean
-extends [{{jsonPathPiece.pascalCase}}Boxed](#{{> src/main/java/packagename/components/_helper_anchor_id identifierPieces=(append identifierPieces (join jsonPathPiece.kebabCase "boxed" "")) }}) +public record {{jsonPathPiece.pascalCase}}BoxedBoolean
+implements [{{jsonPathPiece.pascalCase}}Boxed](#{{> src/main/java/packagename/components/_helper_anchor_id identifierPieces=(append identifierPieces (join jsonPathPiece.kebabCase "boxed" "")) }}) -a boxed class to store validated boolean payloads, sealed permits class implementation +record that stores validated boolean payloads, sealed permits implementation {{headerSize}}## Constructor Summary | Constructor and Description | | --------------------------- | | {{jsonPathPiece.pascalCase}}BoxedBoolean(boolean data)
Creates an instance, private visibility | -{{headerSize}}## Field Summary -| Modifier and Type | Field and Description | +{{headerSize}}## Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| boolean | data
validated payload | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | {{else}} -public static final class {{jsonPathPiece.pascalCase}}BoxedBoolean extends {{jsonPathPiece.pascalCase}}Boxed { - public final boolean data; - private {{jsonPathPiece.pascalCase}}BoxedBoolean(boolean data) { - this.data = data; - } +public record {{jsonPathPiece.pascalCase}}BoxedBoolean(boolean data) implements {{jsonPathPiece.pascalCase}}Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } diff --git a/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_boxedClass.hbs b/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_boxedClass.hbs index e1293b7db28..ef06686eb03 100644 --- a/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_boxedClass.hbs +++ b/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_boxedClass.hbs @@ -1,6 +1,6 @@ {{#if forDocs}} {{> src/main/java/packagename/components/_helper_header_from_identifier_pieces headerSize=(join headerSize "#" "") identifierPieces=(append identifierPieces (join jsonPathPiece.pascalCase "Boxed" "")) }} -public static abstract sealed class {{jsonPathPiece.pascalCase}}Boxed
+public sealed interface {{jsonPathPiece.pascalCase}}Boxed
permits
{{#each types}} {{#eq this "null"}} @@ -29,11 +29,11 @@ permits
[{{jsonPathPiece.pascalCase}}BoxedMap](#{{> src/main/java/packagename/components/_helper_anchor_id identifierPieces=(append identifierPieces (join jsonPathPiece.kebabCase "boxedmap" ""))}}) {{/each}} -abstract sealed class that stores validated payloads using boxed classes +sealed interface that stores validated payloads using boxed classes {{else}} -public static abstract sealed class {{jsonPathPiece.pascalCase}}Boxed permits {{#each types}}{{jsonPathPiece.pascalCase}}Boxed{{#eq this "null"}}Void{{/eq}}{{#eq this "boolean"}}Boolean{{/eq}}{{#or (eq this "number") (eq this "integer")}}Number{{/or}}{{#and (eq this "string") (neq ../format "binary") }}String{{/and}}{{#eq this "array"}}List{{/eq}}{{#eq this "object"}}Map{{/eq}}{{#unless @last}}, {{/unless}}{{else}}{{jsonPathPiece.pascalCase}}BoxedVoid, {{jsonPathPiece.pascalCase}}BoxedBoolean, {{jsonPathPiece.pascalCase}}BoxedNumber, {{jsonPathPiece.pascalCase}}BoxedString, {{jsonPathPiece.pascalCase}}BoxedList, {{jsonPathPiece.pascalCase}}BoxedMap{{/each}} { - public abstract @Nullable Object data(); +public sealed interface {{jsonPathPiece.pascalCase}}Boxed permits {{#each types}}{{jsonPathPiece.pascalCase}}Boxed{{#eq this "null"}}Void{{/eq}}{{#eq this "boolean"}}Boolean{{/eq}}{{#or (eq this "number") (eq this "integer")}}Number{{/or}}{{#and (eq this "string") (neq ../format "binary") }}String{{/and}}{{#eq this "array"}}List{{/eq}}{{#eq this "object"}}Map{{/eq}}{{#unless @last}}, {{/unless}}{{else}}{{jsonPathPiece.pascalCase}}BoxedVoid, {{jsonPathPiece.pascalCase}}BoxedBoolean, {{jsonPathPiece.pascalCase}}BoxedNumber, {{jsonPathPiece.pascalCase}}BoxedString, {{jsonPathPiece.pascalCase}}BoxedList, {{jsonPathPiece.pascalCase}}BoxedMap{{/each}} { + @Nullable Object getData(); } {{/if}} \ No newline at end of file diff --git a/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_boxedList.hbs b/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_boxedList.hbs index 5a4312338d3..3bee8c7d57e 100644 --- a/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_boxedList.hbs +++ b/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_boxedList.hbs @@ -1,28 +1,25 @@ {{#if forDocs}} {{> src/main/java/packagename/components/_helper_header_from_identifier_pieces headerSize=(join headerSize "#" "") identifierPieces=(append identifierPieces (join jsonPathPiece.pascalCase "BoxedList" "")) }} -public static final class {{jsonPathPiece.pascalCase}}BoxedList
-extends [{{jsonPathPiece.pascalCase}}Boxed](#{{> src/main/java/packagename/components/_helper_anchor_id identifierPieces=(append identifierPieces (join jsonPathPiece.kebabCase "boxed" "")) }}) +public record {{jsonPathPiece.pascalCase}}BoxedList
+implements [{{jsonPathPiece.pascalCase}}Boxed](#{{> src/main/java/packagename/components/_helper_anchor_id identifierPieces=(append identifierPieces (join jsonPathPiece.kebabCase "boxed" "")) }}) -a boxed class to store validated List payloads, sealed permits class implementation +record that stores validated List payloads, sealed permits implementation {{headerSize}}## Constructor Summary | Constructor and Description | | --------------------------- | | {{jsonPathPiece.pascalCase}}BoxedList({{#if arrayOutputJsonPathPiece}}[{{arrayOutputJsonPathPiece.pascalCase}}](#{{> src/main/java/packagename/components/_helper_anchor_id identifierPieces=(append identifierPieces arrayOutputJsonPathPiece) }}){{else}}FrozenList<@Nullable Object>{{/if}} data)
Creates an instance, private visibility | -{{headerSize}}## Field Summary -| Modifier and Type | Field and Description | +{{headerSize}}## Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| {{#if arrayOutputJsonPathPiece}}[{{arrayOutputJsonPathPiece.pascalCase}}](#{{> src/main/java/packagename/components/_helper_anchor_id identifierPieces=(append identifierPieces arrayOutputJsonPathPiece) }}){{else}}FrozenList<@Nullable Object>{{/if}} | data
validated payload | +| {{#if arrayOutputJsonPathPiece}}[{{arrayOutputJsonPathPiece.pascalCase}}](#{{> src/main/java/packagename/components/_helper_anchor_id identifierPieces=(append identifierPieces arrayOutputJsonPathPiece) }}){{else}}FrozenList<@Nullable Object>{{/if}} | data()
validated payload | +| @Nullable Object | getData()
validated payload | {{else}} -public static final class {{jsonPathPiece.pascalCase}}BoxedList extends {{jsonPathPiece.pascalCase}}Boxed { - public final {{#if arrayOutputJsonPathPiece}}{{arrayOutputJsonPathPiece.pascalCase}}{{else}}FrozenList<@Nullable Object>{{/if}} data; - private {{jsonPathPiece.pascalCase}}BoxedList({{#if arrayOutputJsonPathPiece}}{{arrayOutputJsonPathPiece.pascalCase}}{{else}}FrozenList<@Nullable Object>{{/if}} data) { - this.data = data; - } +public record {{jsonPathPiece.pascalCase}}BoxedList({{#if arrayOutputJsonPathPiece}}{{arrayOutputJsonPathPiece.pascalCase}}{{else}}FrozenList<@Nullable Object>{{/if}} data) implements {{jsonPathPiece.pascalCase}}Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } diff --git a/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_boxedMap.hbs b/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_boxedMap.hbs index fee19a270c2..83804d1ed4b 100644 --- a/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_boxedMap.hbs +++ b/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_boxedMap.hbs @@ -1,28 +1,25 @@ {{#if forDocs}} {{> src/main/java/packagename/components/_helper_header_from_identifier_pieces headerSize=(join headerSize "#" "") identifierPieces=(append identifierPieces (join jsonPathPiece.pascalCase "BoxedMap" "")) }} -public static final class {{jsonPathPiece.pascalCase}}BoxedMap
-extends [{{jsonPathPiece.pascalCase}}Boxed](#{{> src/main/java/packagename/components/_helper_anchor_id identifierPieces=(append identifierPieces (join jsonPathPiece.kebabCase "boxed" "")) }}) +public record {{jsonPathPiece.pascalCase}}BoxedMap
+implements [{{jsonPathPiece.pascalCase}}Boxed](#{{> src/main/java/packagename/components/_helper_anchor_id identifierPieces=(append identifierPieces (join jsonPathPiece.kebabCase "boxed" "")) }}) -a boxed class to store validated Map payloads, sealed permits class implementation +record that stores validated Map payloads, sealed permits implementation {{headerSize}}## Constructor Summary | Constructor and Description | | --------------------------- | | {{jsonPathPiece.pascalCase}}BoxedMap({{#if mapOutputJsonPathPiece}}[{{mapOutputJsonPathPiece.pascalCase}}](#{{> src/main/java/packagename/components/_helper_anchor_id identifierPieces=(append identifierPieces mapOutputJsonPathPiece) }}){{else}}FrozenMap<@Nullable Object>{{/if}} data)
Creates an instance, private visibility | -{{headerSize}}## Field Summary -| Modifier and Type | Field and Description | +{{headerSize}}## Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| {{#if mapOutputJsonPathPiece}}[{{mapOutputJsonPathPiece.pascalCase}}](#{{> src/main/java/packagename/components/_helper_anchor_id identifierPieces=(append identifierPieces mapOutputJsonPathPiece) }}){{else}}FrozenMap<@Nullable Object>{{/if}} | data
validated payload | +| {{#if mapOutputJsonPathPiece}}[{{mapOutputJsonPathPiece.pascalCase}}](#{{> src/main/java/packagename/components/_helper_anchor_id identifierPieces=(append identifierPieces mapOutputJsonPathPiece) }}){{else}}FrozenMap<@Nullable Object>{{/if}} | data()
validated payload | +| @Nullable Object | getData()
validated payload | {{else}} -public static final class {{jsonPathPiece.pascalCase}}BoxedMap extends {{jsonPathPiece.pascalCase}}Boxed { - public final {{#if mapOutputJsonPathPiece}}{{mapOutputJsonPathPiece.pascalCase}}{{else}}FrozenMap<@Nullable Object>{{/if}} data; - private {{jsonPathPiece.pascalCase}}BoxedMap({{#if mapOutputJsonPathPiece}}{{mapOutputJsonPathPiece.pascalCase}}{{else}}FrozenMap<@Nullable Object>{{/if}} data) { - this.data = data; - } +public record {{jsonPathPiece.pascalCase}}BoxedMap({{#if mapOutputJsonPathPiece}}{{mapOutputJsonPathPiece.pascalCase}}{{else}}FrozenMap<@Nullable Object>{{/if}} data) implements {{jsonPathPiece.pascalCase}}Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } diff --git a/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_boxedNumber.hbs b/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_boxedNumber.hbs index c744815b3b2..5706ccbba67 100644 --- a/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_boxedNumber.hbs +++ b/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_boxedNumber.hbs @@ -1,28 +1,25 @@ {{#if forDocs}} {{> src/main/java/packagename/components/_helper_header_from_identifier_pieces headerSize=(join headerSize "#" "") identifierPieces=(append identifierPieces (join jsonPathPiece.pascalCase "BoxedNumber" "")) }} -public static final class {{jsonPathPiece.pascalCase}}BoxedNumber
-extends [{{jsonPathPiece.pascalCase}}Boxed](#{{> src/main/java/packagename/components/_helper_anchor_id identifierPieces=(append identifierPieces (join jsonPathPiece.kebabCase "boxed" "")) }}) +public record {{jsonPathPiece.pascalCase}}BoxedNumber
+implements [{{jsonPathPiece.pascalCase}}Boxed](#{{> src/main/java/packagename/components/_helper_anchor_id identifierPieces=(append identifierPieces (join jsonPathPiece.kebabCase "boxed" "")) }}) -a boxed class to store validated Number payloads, sealed permits class implementation +record that stores validated Number payloads, sealed permits implementation {{headerSize}}## Constructor Summary | Constructor and Description | | --------------------------- | | {{jsonPathPiece.pascalCase}}BoxedNumber(Number data)
Creates an instance, private visibility | -{{headerSize}}## Field Summary -| Modifier and Type | Field and Description | +{{headerSize}}## Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Number | data
validated payload | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | {{else}} -public static final class {{jsonPathPiece.pascalCase}}BoxedNumber extends {{jsonPathPiece.pascalCase}}Boxed { - public final Number data; - private {{jsonPathPiece.pascalCase}}BoxedNumber(Number data) { - this.data = data; - } +public record {{jsonPathPiece.pascalCase}}BoxedNumber(Number data) implements {{jsonPathPiece.pascalCase}}Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } diff --git a/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_boxedString.hbs b/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_boxedString.hbs index a6db1ef7b54..d32717106e6 100644 --- a/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_boxedString.hbs +++ b/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_boxedString.hbs @@ -1,28 +1,25 @@ {{#if forDocs}} {{> src/main/java/packagename/components/_helper_header_from_identifier_pieces headerSize=(join headerSize "#" "") identifierPieces=(append identifierPieces (join jsonPathPiece.pascalCase "BoxedString" "")) }} -public static final class {{jsonPathPiece.pascalCase}}BoxedString
-extends [{{jsonPathPiece.pascalCase}}Boxed](#{{> src/main/java/packagename/components/_helper_anchor_id identifierPieces=(append identifierPieces (join jsonPathPiece.kebabCase "boxed" "")) }}) +public record {{jsonPathPiece.pascalCase}}BoxedString
+implements [{{jsonPathPiece.pascalCase}}Boxed](#{{> src/main/java/packagename/components/_helper_anchor_id identifierPieces=(append identifierPieces (join jsonPathPiece.kebabCase "boxed" "")) }}) -a boxed class to store validated String payloads, sealed permits class implementation +record that stores validated String payloads, sealed permits implementation {{headerSize}}## Constructor Summary | Constructor and Description | | --------------------------- | | {{jsonPathPiece.pascalCase}}BoxedString(String data)
Creates an instance, private visibility | -{{headerSize}}## Field Summary -| Modifier and Type | Field and Description | +{{headerSize}}## Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| String | data
validated payload | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | {{else}} -public static final class {{jsonPathPiece.pascalCase}}BoxedString extends {{jsonPathPiece.pascalCase}}Boxed { - public final String data; - private {{jsonPathPiece.pascalCase}}BoxedString(String data) { - this.data = data; - } +public record {{jsonPathPiece.pascalCase}}BoxedString(String data) implements {{jsonPathPiece.pascalCase}}Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } diff --git a/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_boxedVoid.hbs b/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_boxedVoid.hbs index cd77ecdcdaa..e828f6952ff 100644 --- a/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_boxedVoid.hbs +++ b/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_boxedVoid.hbs @@ -1,28 +1,25 @@ {{#if forDocs}} {{> src/main/java/packagename/components/_helper_header_from_identifier_pieces headerSize=(join headerSize "#" "") identifierPieces=(append identifierPieces (join jsonPathPiece.pascalCase "BoxedVoid" "")) }} -public static final class {{jsonPathPiece.pascalCase}}BoxedVoid
-extends [{{jsonPathPiece.pascalCase}}Boxed](#{{> src/main/java/packagename/components/_helper_anchor_id identifierPieces=(append identifierPieces (join jsonPathPiece.kebabCase "boxed" "")) }}) +public record {{jsonPathPiece.pascalCase}}BoxedVoid
+implements [{{jsonPathPiece.pascalCase}}Boxed](#{{> src/main/java/packagename/components/_helper_anchor_id identifierPieces=(append identifierPieces (join jsonPathPiece.kebabCase "boxed" "")) }}) -a boxed class to store validated null payloads, sealed permits class implementation +record that stores validated null payloads, sealed permits implementation {{headerSize}}## Constructor Summary | Constructor and Description | | --------------------------- | | {{jsonPathPiece.pascalCase}}BoxedVoid(Void data)
Creates an instance, private visibility | -{{headerSize}}## Field Summary -| Modifier and Type | Field and Description | +{{headerSize}}## Method Summary +| Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| Void | data
validated payload | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | {{else}} -public static final class {{jsonPathPiece.pascalCase}}BoxedVoid extends {{jsonPathPiece.pascalCase}}Boxed { - public final Void data; - private {{jsonPathPiece.pascalCase}}BoxedVoid(Void data) { - this.data = data; - } +public record {{jsonPathPiece.pascalCase}}BoxedVoid(Void data) implements {{jsonPathPiece.pascalCase}}Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } diff --git a/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_validateAndBox.hbs b/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_validateAndBox.hbs index 3776aeb7bbd..61e1ac280f5 100644 --- a/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_validateAndBox.hbs +++ b/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_validateAndBox.hbs @@ -19,6 +19,57 @@ {{> src/main/java/packagename/components/schemas/SchemaClass/_validateAndBoxMap }} {{/eq}} {{/each}} +@Override +public {{jsonPathPiece.pascalCase}}Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + {{#each types}} + {{#if @first}} + {{#eq this "null"}} + if (arg == null) { + Void castArg = (Void) arg; + {{/eq}} + {{#eq this "boolean"}} + if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + {{/eq}} + {{#and (eq this "string") (neq ../format "binary") }} + if (arg instanceof String castArg) { + {{/and}} + {{#or (eq this "number") (eq this "integer")}} + if (arg instanceof Number castArg) { + {{/or}} + {{#eq this "array"}} + if (arg instanceof List castArg) { + {{/eq}} + {{#eq this "object"}} + if (arg instanceof Map castArg) { + {{/eq}} + {{else}} + {{#eq this "null"}} + } else if (arg == null) { + Void castArg = (Void) arg; + {{/eq}} + {{#eq this "boolean"}} + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + {{/eq}} + {{#and (eq this "string") (neq ../format "binary") }} + } else if (arg instanceof String castArg) { + {{/and}} + {{#or (eq this "number") (eq this "integer")}} + } else if (arg instanceof Number castArg) { + {{/or}} + {{#eq this "array"}} + } else if (arg instanceof List castArg) { + {{/eq}} + {{#eq this "object"}} + } else if (arg instanceof Map castArg) { + {{/eq}} + {{/if}} + return validateAndBox(castArg, configuration); + {{/each}} + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); +} {{else}} {{> src/main/java/packagename/components/schemas/SchemaClass/_validateAndBoxVoid }} {{> src/main/java/packagename/components/schemas/SchemaClass/_validateAndBoxBoolean }} @@ -26,4 +77,23 @@ {{> src/main/java/packagename/components/schemas/SchemaClass/_validateAndBoxString }} {{> src/main/java/packagename/components/schemas/SchemaClass/_validateAndBoxList }} {{> src/main/java/packagename/components/schemas/SchemaClass/_validateAndBoxMap }} +@Override +public {{jsonPathPiece.pascalCase}}Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); +} {{/if}} \ No newline at end of file diff --git a/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_validate_implementor.hbs b/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_validate_implementor.hbs index c4366dc64e7..834626dbd42 100644 --- a/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_validate_implementor.hbs +++ b/src/main/resources/java/src/main/java/packagename/components/schemas/SchemaClass/_validate_implementor.hbs @@ -26,11 +26,11 @@ public {{#if ../mapOutputJsonPathPiece}}{{../mapOutputJsonPathPiece.pascalCase}} List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); {{#if ../mapValueSchema}} {{#if ../mapValueSchema.isNullableObject }} @@ -73,11 +73,11 @@ public {{#if ../arrayOutputJsonPathPiece}}{{../arrayOutputJsonPathPiece.pascalCa for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); {{#if ../listItemSchema}} {{#if ../listItemSchema.isNullableObject }} @@ -330,11 +330,11 @@ public {{#if arrayOutputJsonPathPiece}}{{arrayOutputJsonPathPiece.pascalCase}}{{ for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object itemInstance = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); {{#if listItemSchema}} {{#if listItemSchema.isNullableObject }} @@ -380,11 +380,11 @@ public {{#if mapOutputJsonPathPiece}}{{mapOutputJsonPathPiece.pascalCase}}{{else List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); {{#if mapValueSchema}} {{#if mapValueSchema.isNullableObject }} diff --git a/src/main/resources/java/src/main/java/packagename/components/schemas/Schema_doc.hbs b/src/main/resources/java/src/main/java/packagename/components/schemas/Schema_doc.hbs index 4e3b2d874d2..024a6669b58 100644 --- a/src/main/resources/java/src/main/java/packagename/components/schemas/Schema_doc.hbs +++ b/src/main/resources/java/src/main/java/packagename/components/schemas/Schema_doc.hbs @@ -14,7 +14,7 @@ extends [{{refInfo.refClass}}]({{docRoot}}{{#with refInfo.ref}}{{pathFromDocRoot A class that contains necessary nested - schema classes (which validate payloads), extends JsonSchema -- abstract sealed classes which store validated payloads, java version of a sum type +- sealed interfaces which store validated payloads, java version of a sum type - boxed classes which store validated payloads, sealed permits class implementations {{#if containsArrayOutputClass}} - classes to store validated list payloads, extends FrozenList @@ -34,32 +34,32 @@ A class that contains necessary nested {{#each (reverse getSchemas)}} {{#eq instanceType "schema"}} {{#eq refInfo null }} -| static class | [{{../containerJsonPathPiece.pascalCase}}.{{jsonPathPiece.pascalCase}}Boxed](#{{> src/main/java/packagename/components/_helper_anchor_id identifierPieces=(append identifierPieces (join jsonPathPiece.kebabCase "boxed" "")) }})
abstract sealed validated payload class | +| sealed interface | [{{../containerJsonPathPiece.pascalCase}}.{{jsonPathPiece.pascalCase}}Boxed](#{{> src/main/java/packagename/components/_helper_anchor_id identifierPieces=(append identifierPieces (join jsonPathPiece.kebabCase "boxed" "")) }})
sealed interface for validated payloads | {{#each types}} {{#eq this "null"}} -| static class | [{{../../containerJsonPathPiece.pascalCase}}.{{jsonPathPiece.pascalCase}}BoxedVoid](#{{> src/main/java/packagename/components/_helper_anchor_id identifierPieces=(append identifierPieces (join jsonPathPiece.kebabCase "boxedvoid" ""))}})
boxed class to store validated null payloads | +| record | [{{../../containerJsonPathPiece.pascalCase}}.{{jsonPathPiece.pascalCase}}BoxedVoid](#{{> src/main/java/packagename/components/_helper_anchor_id identifierPieces=(append identifierPieces (join jsonPathPiece.kebabCase "boxedvoid" ""))}})
boxed class to store validated null payloads | {{/eq}} {{#eq this "boolean"}} -| static class | [{{../../containerJsonPathPiece.pascalCase}}.{{jsonPathPiece.pascalCase}}BoxedBoolean](#{{> src/main/java/packagename/components/_helper_anchor_id identifierPieces=(append identifierPieces (join jsonPathPiece.kebabCase "boxedboolean" ""))}})
boxed class to store validated boolean payloads | +| record | [{{../../containerJsonPathPiece.pascalCase}}.{{jsonPathPiece.pascalCase}}BoxedBoolean](#{{> src/main/java/packagename/components/_helper_anchor_id identifierPieces=(append identifierPieces (join jsonPathPiece.kebabCase "boxedboolean" ""))}})
boxed class to store validated boolean payloads | {{/eq}} {{#or (eq this "number") (eq this "integer")}} -| static class | [{{../../containerJsonPathPiece.pascalCase}}.{{jsonPathPiece.pascalCase}}BoxedNumber](#{{> src/main/java/packagename/components/_helper_anchor_id identifierPieces=(append identifierPieces (join jsonPathPiece.kebabCase "boxednumber" ""))}})
boxed class to store validated Number payloads | +| record | [{{../../containerJsonPathPiece.pascalCase}}.{{jsonPathPiece.pascalCase}}BoxedNumber](#{{> src/main/java/packagename/components/_helper_anchor_id identifierPieces=(append identifierPieces (join jsonPathPiece.kebabCase "boxednumber" ""))}})
boxed class to store validated Number payloads | {{/or}} {{#and (eq this "string") (neq ../format "binary") }} -| static class | [{{../../containerJsonPathPiece.pascalCase}}.{{jsonPathPiece.pascalCase}}BoxedString](#{{> src/main/java/packagename/components/_helper_anchor_id identifierPieces=(append identifierPieces (join jsonPathPiece.kebabCase "boxedstring" ""))}})
boxed class to store validated String payloads | +| record | [{{../../containerJsonPathPiece.pascalCase}}.{{jsonPathPiece.pascalCase}}BoxedString](#{{> src/main/java/packagename/components/_helper_anchor_id identifierPieces=(append identifierPieces (join jsonPathPiece.kebabCase "boxedstring" ""))}})
boxed class to store validated String payloads | {{/and}} {{#eq this "array"}} -| static class | [{{../../containerJsonPathPiece.pascalCase}}.{{jsonPathPiece.pascalCase}}BoxedList](#{{> src/main/java/packagename/components/_helper_anchor_id identifierPieces=(append identifierPieces (join jsonPathPiece.kebabCase "boxedlist" ""))}})
boxed class to store validated List payloads | +| record | [{{../../containerJsonPathPiece.pascalCase}}.{{jsonPathPiece.pascalCase}}BoxedList](#{{> src/main/java/packagename/components/_helper_anchor_id identifierPieces=(append identifierPieces (join jsonPathPiece.kebabCase "boxedlist" ""))}})
boxed class to store validated List payloads | {{/eq}}{{#eq this "object"}} -| static class | [{{../../containerJsonPathPiece.pascalCase}}.{{jsonPathPiece.pascalCase}}BoxedMap](#{{> src/main/java/packagename/components/_helper_anchor_id identifierPieces=(append identifierPieces (join jsonPathPiece.kebabCase "boxedmap" ""))}})
boxed class to store validated Map payloads | +| record | [{{../../containerJsonPathPiece.pascalCase}}.{{jsonPathPiece.pascalCase}}BoxedMap](#{{> src/main/java/packagename/components/_helper_anchor_id identifierPieces=(append identifierPieces (join jsonPathPiece.kebabCase "boxedmap" ""))}})
boxed class to store validated Map payloads | {{/eq}} {{else}} -| static class | [{{../containerJsonPathPiece.pascalCase}}.{{jsonPathPiece.pascalCase}}BoxedVoid](#{{> src/main/java/packagename/components/_helper_anchor_id identifierPieces=(append identifierPieces (join jsonPathPiece.kebabCase "boxedvoid" ""))}})
boxed class to store validated null payloads | -| static class | [{{../containerJsonPathPiece.pascalCase}}.{{jsonPathPiece.pascalCase}}BoxedBoolean](#{{> src/main/java/packagename/components/_helper_anchor_id identifierPieces=(append identifierPieces (join jsonPathPiece.kebabCase "boxedboolean" ""))}})
boxed class to store validated boolean payloads | -| static class | [{{../containerJsonPathPiece.pascalCase}}.{{jsonPathPiece.pascalCase}}BoxedNumber](#{{> src/main/java/packagename/components/_helper_anchor_id identifierPieces=(append identifierPieces (join jsonPathPiece.kebabCase "boxednumber" ""))}})
boxed class to store validated Number payloads | -| static class | [{{../containerJsonPathPiece.pascalCase}}.{{jsonPathPiece.pascalCase}}BoxedString](#{{> src/main/java/packagename/components/_helper_anchor_id identifierPieces=(append identifierPieces (join jsonPathPiece.kebabCase "boxedstring" ""))}})
boxed class to store validated String payloads | -| static class | [{{../containerJsonPathPiece.pascalCase}}.{{jsonPathPiece.pascalCase}}BoxedList](#{{> src/main/java/packagename/components/_helper_anchor_id identifierPieces=(append identifierPieces (join jsonPathPiece.kebabCase "boxedlist" ""))}})
boxed class to store validated List payloads | -| static class | [{{../containerJsonPathPiece.pascalCase}}.{{jsonPathPiece.pascalCase}}BoxedMap](#{{> src/main/java/packagename/components/_helper_anchor_id identifierPieces=(append identifierPieces (join jsonPathPiece.kebabCase "boxedmap" ""))}})
boxed class to store validated Map payloads | +| record | [{{../containerJsonPathPiece.pascalCase}}.{{jsonPathPiece.pascalCase}}BoxedVoid](#{{> src/main/java/packagename/components/_helper_anchor_id identifierPieces=(append identifierPieces (join jsonPathPiece.kebabCase "boxedvoid" ""))}})
boxed class to store validated null payloads | +| record | [{{../containerJsonPathPiece.pascalCase}}.{{jsonPathPiece.pascalCase}}BoxedBoolean](#{{> src/main/java/packagename/components/_helper_anchor_id identifierPieces=(append identifierPieces (join jsonPathPiece.kebabCase "boxedboolean" ""))}})
boxed class to store validated boolean payloads | +| record | [{{../containerJsonPathPiece.pascalCase}}.{{jsonPathPiece.pascalCase}}BoxedNumber](#{{> src/main/java/packagename/components/_helper_anchor_id identifierPieces=(append identifierPieces (join jsonPathPiece.kebabCase "boxednumber" ""))}})
boxed class to store validated Number payloads | +| record | [{{../containerJsonPathPiece.pascalCase}}.{{jsonPathPiece.pascalCase}}BoxedString](#{{> src/main/java/packagename/components/_helper_anchor_id identifierPieces=(append identifierPieces (join jsonPathPiece.kebabCase "boxedstring" ""))}})
boxed class to store validated String payloads | +| record | [{{../containerJsonPathPiece.pascalCase}}.{{jsonPathPiece.pascalCase}}BoxedList](#{{> src/main/java/packagename/components/_helper_anchor_id identifierPieces=(append identifierPieces (join jsonPathPiece.kebabCase "boxedlist" ""))}})
boxed class to store validated List payloads | +| record | [{{../containerJsonPathPiece.pascalCase}}.{{jsonPathPiece.pascalCase}}BoxedMap](#{{> src/main/java/packagename/components/_helper_anchor_id identifierPieces=(append identifierPieces (join jsonPathPiece.kebabCase "boxedmap" ""))}})
boxed class to store validated Map payloads | {{/each}} {{/eq}} | static class | [{{../containerJsonPathPiece.pascalCase}}.{{jsonPathPiece.pascalCase}}](#{{> src/main/java/packagename/components/_helper_anchor_id identifierPieces=(append identifierPieces jsonPathPiece) }})
schema class | diff --git a/src/main/resources/java/src/main/java/packagename/components/schemas/docschema_io_types.hbs b/src/main/resources/java/src/main/java/packagename/components/schemas/docschema_io_types.hbs index 4ced53b7fdb..4ee33c93106 100644 --- a/src/main/resources/java/src/main/java/packagename/components/schemas/docschema_io_types.hbs +++ b/src/main/resources/java/src/main/java/packagename/components/schemas/docschema_io_types.hbs @@ -118,4 +118,5 @@ {{/eq}} {{/each}} {{/eq}} -| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | \ No newline at end of file +| [{{jsonPathPiece.pascalCase}}Boxed](#{{> src/main/java/packagename/components/_helper_anchor_id identifierPieces=(append identifierPieces (join jsonPathPiece.kebabCase "boxed" ""))}}) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | +| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | diff --git a/src/main/resources/java/src/main/java/packagename/mediatype/MediaType.hbs b/src/main/resources/java/src/main/java/packagename/mediatype/MediaType.hbs index e745f595905..d4afc4449dd 100644 --- a/src/main/resources/java/src/main/java/packagename/mediatype/MediaType.hbs +++ b/src/main/resources/java/src/main/java/packagename/mediatype/MediaType.hbs @@ -1,11 +1,8 @@ package {{{packageName}}}.mediatype; import {{{packageName}}}.schemas.validation.JsonSchema; -import org.checkerframework.checker.nullness.qual.Nullable; -import java.util.Map; - -public class MediaType { +public interface MediaType, U> { /* * Used to store request and response body schema information * encoding: @@ -14,16 +11,6 @@ public class MediaType { * The encoding object SHALL only apply to requestBody objects when the media type is * multipart or application/x-www-form-urlencoded. */ - public final T schema; - public final @Nullable Map encoding; - - public MediaType(T schema, @Nullable Map encoding) { - this.schema = schema; - this.encoding = encoding; - } - - public MediaType(T schema) { - this.schema = schema; - this.encoding = null; - } + T schema(); + U encoding(); } \ No newline at end of file diff --git a/src/main/resources/java/src/main/java/packagename/requestbody/RequestBodySerializer.hbs b/src/main/resources/java/src/main/java/packagename/requestbody/RequestBodySerializer.hbs index 9af45e792a7..32947686693 100644 --- a/src/main/resources/java/src/main/java/packagename/requestbody/RequestBodySerializer.hbs +++ b/src/main/resources/java/src/main/java/packagename/requestbody/RequestBodySerializer.hbs @@ -1,28 +1,32 @@ package {{{packageName}}}.requestbody; -import {{{packageName}}}.mediatype.MediaType; - import java.net.http.HttpRequest; import org.checkerframework.checker.nullness.qual.Nullable; import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.ToNumberPolicy; +import {{{packageName}}}.schemas.validation.JsonSchema; import java.util.Map; import java.util.regex.Pattern; -public abstract class RequestBodySerializer { +public abstract class RequestBodySerializer { /* * Describes a single request body * content: contentType to MediaType schema info */ - public final Map> content; + public final Map content; public final boolean required; private static final Pattern jsonContentTypePattern = Pattern.compile( "application/[^+]*[+]?(json);?.*" ); - private static final Gson gson = new Gson(); + private static final Gson gson = new GsonBuilder() + .setObjectToNumberStrategy(ToNumberPolicy.LONG_OR_DOUBLE) + .setNumberToNumberStrategy(ToNumberPolicy.LONG_OR_DOUBLE) + .create(); private static final String textPlainContentType = "text/plain"; - public RequestBodySerializer(Map> content, boolean required) { + public RequestBodySerializer(Map content, boolean required) { this.content = content; this.required = required; } @@ -31,8 +35,13 @@ public abstract class RequestBodySerializer { return jsonContentTypePattern.matcher(contentType).find(); } + @SuppressWarnings("nullness") + private String toJson(@Nullable Object body) { + return gson.toJson(body); + } + private SerializedRequestBody serializeJson(String contentType, @Nullable Object body) { - String jsonText = gson.toJson(body); + String jsonText = toJson(body); return new SerializedRequestBody(contentType, HttpRequest.BodyPublishers.ofString(jsonText)); } @@ -40,7 +49,7 @@ public abstract class RequestBodySerializer { if (body instanceof String stringBody) { return new SerializedRequestBody(contentType, HttpRequest.BodyPublishers.ofString(stringBody)); } - throw new RuntimeException("Invalid non-string data type of "+body.getClass().getName()+" for text/plain body serialization"); + throw new RuntimeException("Invalid non-string data type of "+JsonSchema.getClass(body)+" for text/plain body serialization"); } protected SerializedRequestBody serialize(String contentType, @Nullable Object body) { diff --git a/src/main/resources/java/src/main/java/packagename/response/ApiResponse.hbs b/src/main/resources/java/src/main/java/packagename/response/ApiResponse.hbs new file mode 100644 index 00000000000..00caf937855 --- /dev/null +++ b/src/main/resources/java/src/main/java/packagename/response/ApiResponse.hbs @@ -0,0 +1,9 @@ +package {{{packageName}}}.response; + +import java.net.http.HttpResponse; + +public interface ApiResponse { + HttpResponse response(); + SealedBodyOutputClass body(); + HeaderOutputClass headers(); +} \ No newline at end of file diff --git a/src/main/resources/java/src/main/java/packagename/response/DeserializedApiResponse.hbs b/src/main/resources/java/src/main/java/packagename/response/DeserializedApiResponse.hbs new file mode 100644 index 00000000000..42a0147019a --- /dev/null +++ b/src/main/resources/java/src/main/java/packagename/response/DeserializedApiResponse.hbs @@ -0,0 +1,8 @@ +package {{{packageName}}}.response; + +import java.net.http.HttpResponse; + +public record DeserializedApiResponse(HttpResponse response, + SealedBodyOutputClass body, + HeaderOutputClass headers) implements ApiResponse { +} \ No newline at end of file diff --git a/src/main/resources/java/src/main/java/packagename/response/ResponseDeserializer.hbs b/src/main/resources/java/src/main/java/packagename/response/ResponseDeserializer.hbs new file mode 100644 index 00000000000..289c8e0fe87 --- /dev/null +++ b/src/main/resources/java/src/main/java/packagename/response/ResponseDeserializer.hbs @@ -0,0 +1,83 @@ +package {{{packageName}}}.response; + +import java.net.http.HttpHeaders; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.Map; +import java.util.Optional; +import java.util.regex.Pattern; + +import org.checkerframework.checker.nullness.qual.Nullable; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.ToNumberPolicy; + +import {{{packageName}}}.configurations.SchemaConfiguration; +import {{{packageName}}}.schemas.validation.JsonSchema; + +public abstract class ResponseDeserializer { + public final Map content; + public final @Nullable Map headers; // todo change the value to header + private static final Pattern jsonContentTypePattern = Pattern.compile( + "application/[^+]*[+]?(json);?.*" + ); + private static final Gson gson = new GsonBuilder() + .setObjectToNumberStrategy(ToNumberPolicy.LONG_OR_DOUBLE) + .setNumberToNumberStrategy(ToNumberPolicy.LONG_OR_DOUBLE) + .create(); + protected static final String textPlainContentType = "text/plain"; + + public ResponseDeserializer(Map content) { + this.content = content; + this.headers = null; + } + + protected abstract SealedBodyClass getBody(String contentType, byte[] body, SchemaConfiguration configuration); + protected abstract HeaderClass getHeaders(HttpHeaders headers); + + protected @Nullable Object deserializeJson(byte[] body) { + String bodyStr = new String(body, StandardCharsets.UTF_8); + return gson.fromJson(bodyStr, Object.class); + } + + protected String deserializeTextPlain(byte[] body) { + return new String(body, StandardCharsets.UTF_8); + } + + protected static boolean contentTypeIsJson(String contentType) { + return jsonContentTypePattern.matcher(contentType).find(); + } + + protected static boolean contentTypeIsTextPlain(String contentType) { + return textPlainContentType.equals(contentType); + } + + protected T deserializeBody(String contentType, byte[] body, JsonSchema schema, SchemaConfiguration configuration) { + if (contentTypeIsJson(contentType)) { + @Nullable Object bodyData = deserializeJson(body); + return schema.validateAndBox(bodyData, configuration); + } else if (contentTypeIsTextPlain(contentType)) { + String bodyData = deserializeTextPlain(body); + return schema.validateAndBox(bodyData, configuration); + } + throw new RuntimeException("Deserialization for contentType="+contentType+" has not yet been implemented."); + } + + public ApiResponse deserialize(HttpResponse response, SchemaConfiguration configuration) { + Optional contentTypeInfo = response.headers().firstValue("Content-Type"); + if (contentTypeInfo.isEmpty()) { + throw new RuntimeException("Invalid response returned, Content-Type header is missing and it must be included"); + } + String contentType = contentTypeInfo.get(); + if (content != null && !content.containsKey(contentType)) { + throw new RuntimeException( + "Invalid contentType returned. contentType="+contentType+" was returned "+ + "when only "+content.keySet()+" are defined for statusCode="+response.statusCode() + ); + } + byte[] bodyBytes = response.body(); + SealedBodyClass body = getBody(contentType, bodyBytes, configuration); + HeaderClass headers = getHeaders(response.headers()); + return new DeserializedApiResponse<>(response, body, headers); + } +} \ No newline at end of file diff --git a/src/main/resources/java/src/main/java/packagename/schemas/AnyTypeJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/AnyTypeJsonSchema.hbs index 7fd3788ea51..6b28b58204b 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/AnyTypeJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/AnyTypeJsonSchema.hbs @@ -31,71 +31,47 @@ import java.util.Objects; import java.util.UUID; public class AnyTypeJsonSchema { - public static abstract sealed class AnyTypeJsonSchema1Boxed permits AnyTypeJsonSchema1BoxedVoid, AnyTypeJsonSchema1BoxedBoolean, AnyTypeJsonSchema1BoxedNumber, AnyTypeJsonSchema1BoxedString, AnyTypeJsonSchema1BoxedList, AnyTypeJsonSchema1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface AnyTypeJsonSchema1Boxed permits AnyTypeJsonSchema1BoxedVoid, AnyTypeJsonSchema1BoxedBoolean, AnyTypeJsonSchema1BoxedNumber, AnyTypeJsonSchema1BoxedString, AnyTypeJsonSchema1BoxedList, AnyTypeJsonSchema1BoxedMap { + @Nullable Object getData(); } - public static final class AnyTypeJsonSchema1BoxedVoid extends AnyTypeJsonSchema1Boxed { - public final Void data; - private AnyTypeJsonSchema1BoxedVoid(Void data) { - this.data = data; - } + public record AnyTypeJsonSchema1BoxedVoid(Void data) implements AnyTypeJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AnyTypeJsonSchema1BoxedBoolean extends AnyTypeJsonSchema1Boxed { - public final boolean data; - private AnyTypeJsonSchema1BoxedBoolean(boolean data) { - this.data = data; - } + public record AnyTypeJsonSchema1BoxedBoolean(boolean data) implements AnyTypeJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AnyTypeJsonSchema1BoxedNumber extends AnyTypeJsonSchema1Boxed { - public final Number data; - private AnyTypeJsonSchema1BoxedNumber(Number data) { - this.data = data; - } + public record AnyTypeJsonSchema1BoxedNumber(Number data) implements AnyTypeJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AnyTypeJsonSchema1BoxedString extends AnyTypeJsonSchema1Boxed { - public final String data; - private AnyTypeJsonSchema1BoxedString(String data) { - this.data = data; - } + public record AnyTypeJsonSchema1BoxedString(String data) implements AnyTypeJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AnyTypeJsonSchema1BoxedList extends AnyTypeJsonSchema1Boxed { - public final FrozenList<@Nullable Object> data; - private AnyTypeJsonSchema1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record AnyTypeJsonSchema1BoxedList(FrozenList<@Nullable Object> data) implements AnyTypeJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class AnyTypeJsonSchema1BoxedMap extends AnyTypeJsonSchema1Boxed { - public final FrozenMap<@Nullable Object> data; - private AnyTypeJsonSchema1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record AnyTypeJsonSchema1BoxedMap(FrozenMap<@Nullable Object> data) implements AnyTypeJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class AnyTypeJsonSchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, AnyTypeJsonSchema1BoxedList>, MapSchemaValidator, AnyTypeJsonSchema1BoxedMap> { + public static class AnyTypeJsonSchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, AnyTypeJsonSchema1BoxedList>, MapSchemaValidator, AnyTypeJsonSchema1BoxedMap> { private static @Nullable AnyTypeJsonSchema1 instance = null; protected AnyTypeJsonSchema1() { @@ -192,11 +168,11 @@ public class AnyTypeJsonSchema { for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object castItem = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; @@ -227,11 +203,11 @@ public class AnyTypeJsonSchema { List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object castValue = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } @@ -291,25 +267,50 @@ public class AnyTypeJsonSchema { public AnyTypeJsonSchema1BoxedVoid validateAndBox(Void arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new AnyTypeJsonSchema1BoxedVoid(validate(arg, configuration)); } + @Override public AnyTypeJsonSchema1BoxedBoolean validateAndBox(boolean arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new AnyTypeJsonSchema1BoxedBoolean(validate(arg, configuration)); } + @Override public AnyTypeJsonSchema1BoxedNumber validateAndBox(Number arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new AnyTypeJsonSchema1BoxedNumber(validate(arg, configuration)); } + @Override public AnyTypeJsonSchema1BoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new AnyTypeJsonSchema1BoxedString(validate(arg, configuration)); } + @Override public AnyTypeJsonSchema1BoxedList validateAndBox(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new AnyTypeJsonSchema1BoxedList(validate(arg, configuration)); } + @Override public AnyTypeJsonSchema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new AnyTypeJsonSchema1BoxedMap(validate(arg, configuration)); } + + @Override + public AnyTypeJsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } \ No newline at end of file diff --git a/src/main/resources/java/src/main/java/packagename/schemas/BooleanJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/BooleanJsonSchema.hbs index 7f7c399e49d..3e7af6f87b4 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/BooleanJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/BooleanJsonSchema.hbs @@ -18,20 +18,16 @@ import java.util.Objects; import java.util.Set; public class BooleanJsonSchema { - public static abstract sealed class BooleanJsonSchema1Boxed permits BooleanJsonSchema1BoxedBoolean { - public abstract @Nullable Object data(); + public sealed interface BooleanJsonSchema1Boxed permits BooleanJsonSchema1BoxedBoolean { + @Nullable Object getData(); } - public static final class BooleanJsonSchema1BoxedBoolean extends BooleanJsonSchema1Boxed { - public final boolean data; - private BooleanJsonSchema1BoxedBoolean(boolean data) { - this.data = data; - } + public record BooleanJsonSchema1BoxedBoolean(boolean data) implements BooleanJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class BooleanJsonSchema1 extends JsonSchema implements BooleanSchemaValidator { + public static class BooleanJsonSchema1 extends JsonSchema implements BooleanSchemaValidator { private static @Nullable BooleanJsonSchema1 instance = null; protected BooleanJsonSchema1() { @@ -80,5 +76,14 @@ public class BooleanJsonSchema { public BooleanJsonSchema1BoxedBoolean validateAndBox(boolean arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new BooleanJsonSchema1BoxedBoolean(validate(arg, configuration)); } + + @Override + public BooleanJsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } \ No newline at end of file diff --git a/src/main/resources/java/src/main/java/packagename/schemas/DateJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/DateJsonSchema.hbs index 51e64ae1b43..dabd73a8398 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/DateJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/DateJsonSchema.hbs @@ -19,21 +19,17 @@ import java.util.Objects; import java.util.Set; public class DateJsonSchema { - public static abstract sealed class DateJsonSchema1Boxed permits DateJsonSchema1BoxedString { - public abstract @Nullable Object data(); + public sealed interface DateJsonSchema1Boxed permits DateJsonSchema1BoxedString { + @Nullable Object getData(); } - public static final class DateJsonSchema1BoxedString extends DateJsonSchema1Boxed { - public final String data; - private DateJsonSchema1BoxedString(String data) { - this.data = data; - } + public record DateJsonSchema1BoxedString(String data) implements DateJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class DateJsonSchema1 extends JsonSchema implements StringSchemaValidator { + public static class DateJsonSchema1 extends JsonSchema implements StringSchemaValidator { private static @Nullable DateJsonSchema1 instance = null; protected DateJsonSchema1() { @@ -87,5 +83,13 @@ public class DateJsonSchema { public DateJsonSchema1BoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new DateJsonSchema1BoxedString(validate(arg, configuration)); } + + @Override + public DateJsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } \ No newline at end of file diff --git a/src/main/resources/java/src/main/java/packagename/schemas/DateTimeJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/DateTimeJsonSchema.hbs index 1a9d9feaaa1..b18195dce18 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/DateTimeJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/DateTimeJsonSchema.hbs @@ -19,21 +19,17 @@ import java.util.Objects; import java.util.Set; public class DateTimeJsonSchema { - public static abstract sealed class DateTimeJsonSchema1Boxed permits DateTimeJsonSchema1BoxedString { - public abstract @Nullable Object data(); + public sealed interface DateTimeJsonSchema1Boxed permits DateTimeJsonSchema1BoxedString { + @Nullable Object getData(); } - public static final class DateTimeJsonSchema1BoxedString extends DateTimeJsonSchema1Boxed { - public final String data; - private DateTimeJsonSchema1BoxedString(String data) { - this.data = data; - } + public record DateTimeJsonSchema1BoxedString(String data) implements DateTimeJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class DateTimeJsonSchema1 extends JsonSchema implements StringSchemaValidator { + public static class DateTimeJsonSchema1 extends JsonSchema implements StringSchemaValidator { private static @Nullable DateTimeJsonSchema1 instance = null; protected DateTimeJsonSchema1() { @@ -87,5 +83,13 @@ public class DateTimeJsonSchema { public DateTimeJsonSchema1BoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new DateTimeJsonSchema1BoxedString(validate(arg, configuration)); } + + @Override + public DateTimeJsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } \ No newline at end of file diff --git a/src/main/resources/java/src/main/java/packagename/schemas/DecimalJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/DecimalJsonSchema.hbs index 213b01df536..609cdb31e4b 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/DecimalJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/DecimalJsonSchema.hbs @@ -18,21 +18,17 @@ import java.util.Objects; import java.util.Set; public class DecimalJsonSchema { - public static abstract sealed class DecimalJsonSchema1Boxed permits DecimalJsonSchema1BoxedString { - public abstract @Nullable Object data(); + public sealed interface DecimalJsonSchema1Boxed permits DecimalJsonSchema1BoxedString { + @Nullable Object getData(); } - public static final class DecimalJsonSchema1BoxedString extends DecimalJsonSchema1Boxed { - public final String data; - private DecimalJsonSchema1BoxedString(String data) { - this.data = data; - } + public record DecimalJsonSchema1BoxedString(String data) implements DecimalJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class DecimalJsonSchema1 extends JsonSchema implements StringSchemaValidator { + public static class DecimalJsonSchema1 extends JsonSchema implements StringSchemaValidator { private static @Nullable DecimalJsonSchema1 instance = null; protected DecimalJsonSchema1() { @@ -80,5 +76,13 @@ public class DecimalJsonSchema { public DecimalJsonSchema1BoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new DecimalJsonSchema1BoxedString(validate(arg, configuration)); } + + @Override + public DecimalJsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } \ No newline at end of file diff --git a/src/main/resources/java/src/main/java/packagename/schemas/DoubleJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/DoubleJsonSchema.hbs index 8bb8b1106e3..e668e781762 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/DoubleJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/DoubleJsonSchema.hbs @@ -18,21 +18,17 @@ import java.util.Objects; import java.util.Set; public class DoubleJsonSchema { - public static abstract sealed class DoubleJsonSchema1Boxed permits DoubleJsonSchema1BoxedNumber { - public abstract @Nullable Object data(); + public sealed interface DoubleJsonSchema1Boxed permits DoubleJsonSchema1BoxedNumber { + @Nullable Object getData(); } - public static final class DoubleJsonSchema1BoxedNumber extends DoubleJsonSchema1Boxed { - public final Number data; - private DoubleJsonSchema1BoxedNumber(Number data) { - this.data = data; - } + public record DoubleJsonSchema1BoxedNumber(Number data) implements DoubleJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class DoubleJsonSchema1 extends JsonSchema implements NumberSchemaValidator { + public static class DoubleJsonSchema1 extends JsonSchema implements NumberSchemaValidator { private static @Nullable DoubleJsonSchema1 instance = null; protected DoubleJsonSchema1() { @@ -84,5 +80,13 @@ public class DoubleJsonSchema { public DoubleJsonSchema1BoxedNumber validateAndBox(Number arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new DoubleJsonSchema1BoxedNumber(validate(arg, configuration)); } + + @Override + public DoubleJsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } \ No newline at end of file diff --git a/src/main/resources/java/src/main/java/packagename/schemas/FloatJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/FloatJsonSchema.hbs index 1a620c7165f..7256d2d2b44 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/FloatJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/FloatJsonSchema.hbs @@ -18,21 +18,17 @@ import java.util.Objects; import java.util.Set; public class FloatJsonSchema { - public static abstract sealed class FloatJsonSchema1Boxed permits FloatJsonSchema1BoxedNumber { - public abstract @Nullable Object data(); + public sealed interface FloatJsonSchema1Boxed permits FloatJsonSchema1BoxedNumber { + @Nullable Object getData(); } - public static final class FloatJsonSchema1BoxedNumber extends FloatJsonSchema1Boxed { - public final Number data; - private FloatJsonSchema1BoxedNumber(Number data) { - this.data = data; - } + public record FloatJsonSchema1BoxedNumber(Number data) implements FloatJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class FloatJsonSchema1 extends JsonSchema implements NumberSchemaValidator { + public static class FloatJsonSchema1 extends JsonSchema implements NumberSchemaValidator { private static @Nullable FloatJsonSchema1 instance = null; protected FloatJsonSchema1() { @@ -84,5 +80,13 @@ public class FloatJsonSchema { public FloatJsonSchema1BoxedNumber validateAndBox(Number arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new FloatJsonSchema1BoxedNumber(validate(arg, configuration)); } + + @Override + public FloatJsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/Int32JsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/Int32JsonSchema.hbs index c805f1d1dd5..8070af2f97b 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/Int32JsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/Int32JsonSchema.hbs @@ -18,21 +18,17 @@ import java.util.Objects; import java.util.Set; public class Int32JsonSchema { - public static abstract sealed class Int32JsonSchema1Boxed permits Int32JsonSchema1BoxedNumber { - public abstract @Nullable Object data(); + public sealed interface Int32JsonSchema1Boxed permits Int32JsonSchema1BoxedNumber { + @Nullable Object getData(); } - public static final class Int32JsonSchema1BoxedNumber extends Int32JsonSchema1Boxed { - public final Number data; - private Int32JsonSchema1BoxedNumber(Number data) { - this.data = data; - } + public record Int32JsonSchema1BoxedNumber(Number data) implements Int32JsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Int32JsonSchema1 extends JsonSchema implements NumberSchemaValidator { + public static class Int32JsonSchema1 extends JsonSchema implements NumberSchemaValidator { private static @Nullable Int32JsonSchema1 instance = null; protected Int32JsonSchema1() { @@ -91,5 +87,13 @@ public class Int32JsonSchema { public Int32JsonSchema1BoxedNumber validateAndBox(Number arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Int32JsonSchema1BoxedNumber(validate(arg, configuration)); } + + @Override + public Int32JsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } \ No newline at end of file diff --git a/src/main/resources/java/src/main/java/packagename/schemas/Int64JsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/Int64JsonSchema.hbs index 86bd2122275..0f02ee44e78 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/Int64JsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/Int64JsonSchema.hbs @@ -18,21 +18,17 @@ import java.util.Objects; import java.util.Set; public class Int64JsonSchema { - public static abstract sealed class Int64JsonSchema1Boxed permits Int64JsonSchema1BoxedNumber { - public abstract @Nullable Object data(); + public sealed interface Int64JsonSchema1Boxed permits Int64JsonSchema1BoxedNumber { + @Nullable Object getData(); } - public static final class Int64JsonSchema1BoxedNumber extends Int64JsonSchema1Boxed { - public final Number data; - private Int64JsonSchema1BoxedNumber(Number data) { - this.data = data; - } + public record Int64JsonSchema1BoxedNumber(Number data) implements Int64JsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class Int64JsonSchema1 extends JsonSchema implements NumberSchemaValidator { + public static class Int64JsonSchema1 extends JsonSchema implements NumberSchemaValidator { private static @Nullable Int64JsonSchema1 instance = null; protected Int64JsonSchema1() { @@ -101,5 +97,13 @@ public class Int64JsonSchema { public Int64JsonSchema1BoxedNumber validateAndBox(Number arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new Int64JsonSchema1BoxedNumber(validate(arg, configuration)); } + + @Override + public Int64JsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } \ No newline at end of file diff --git a/src/main/resources/java/src/main/java/packagename/schemas/IntJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/IntJsonSchema.hbs index 66f8975e071..679b44450b0 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/IntJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/IntJsonSchema.hbs @@ -18,21 +18,17 @@ import java.util.Objects; import java.util.Set; public class IntJsonSchema { - public static abstract sealed class IntJsonSchema1Boxed permits IntJsonSchema1BoxedNumber { - public abstract @Nullable Object data(); + public sealed interface IntJsonSchema1Boxed permits IntJsonSchema1BoxedNumber { + @Nullable Object getData(); } - public static final class IntJsonSchema1BoxedNumber extends IntJsonSchema1Boxed { - public final Number data; - private IntJsonSchema1BoxedNumber(Number data) { - this.data = data; - } + public record IntJsonSchema1BoxedNumber(Number data) implements IntJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class IntJsonSchema1 extends JsonSchema implements NumberSchemaValidator { + public static class IntJsonSchema1 extends JsonSchema implements NumberSchemaValidator { private static @Nullable IntJsonSchema1 instance = null; protected IntJsonSchema1() { @@ -101,5 +97,13 @@ public class IntJsonSchema { public IntJsonSchema1BoxedNumber validateAndBox(Number arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new IntJsonSchema1BoxedNumber(validate(arg, configuration)); } + + @Override + public IntJsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } \ No newline at end of file diff --git a/src/main/resources/java/src/main/java/packagename/schemas/ListJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/ListJsonSchema.hbs index 5040979d98a..c50c191ac97 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/ListJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/ListJsonSchema.hbs @@ -21,21 +21,17 @@ import java.util.Objects; import java.util.Set; public class ListJsonSchema { - public static abstract sealed class ListJsonSchema1Boxed permits ListJsonSchema1BoxedList { - public abstract @Nullable Object data(); + public sealed interface ListJsonSchema1Boxed permits ListJsonSchema1BoxedList { + @Nullable Object getData(); } - public static final class ListJsonSchema1BoxedList extends ListJsonSchema1Boxed { - public final FrozenList<@Nullable Object> data; - private ListJsonSchema1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record ListJsonSchema1BoxedList(FrozenList<@Nullable Object> data) implements ListJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class ListJsonSchema1 extends JsonSchema implements ListSchemaValidator, ListJsonSchema1BoxedList> { + public static class ListJsonSchema1 extends JsonSchema implements ListSchemaValidator, ListJsonSchema1BoxedList> { private static @Nullable ListJsonSchema1 instance = null; protected ListJsonSchema1() { @@ -58,11 +54,11 @@ public class ListJsonSchema { for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object castItem = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; @@ -101,5 +97,13 @@ public class ListJsonSchema { public ListJsonSchema1BoxedList validateAndBox(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new ListJsonSchema1BoxedList(validate(arg, configuration)); } + + @Override + public ListJsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/MapJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/MapJsonSchema.hbs index 5f1eca2bf9d..b1035439e4c 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/MapJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/MapJsonSchema.hbs @@ -22,21 +22,17 @@ import java.util.Objects; import java.util.Set; public class MapJsonSchema { - public static abstract sealed class MapJsonSchema1Boxed permits MapJsonSchema1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface MapJsonSchema1Boxed permits MapJsonSchema1BoxedMap { + @Nullable Object getData(); } - public static final class MapJsonSchema1BoxedMap extends MapJsonSchema1Boxed { - public final FrozenMap<@Nullable Object> data; - private MapJsonSchema1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record MapJsonSchema1BoxedMap(FrozenMap<@Nullable Object> data) implements MapJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class MapJsonSchema1 extends JsonSchema implements MapSchemaValidator, MapJsonSchema1BoxedMap> { + public static class MapJsonSchema1 extends JsonSchema implements MapSchemaValidator, MapJsonSchema1BoxedMap> { private static @Nullable MapJsonSchema1 instance = null; protected MapJsonSchema1() { @@ -64,11 +60,11 @@ public class MapJsonSchema { List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object castValue = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } @@ -105,5 +101,13 @@ public class MapJsonSchema { public MapJsonSchema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new MapJsonSchema1BoxedMap(validate(arg, configuration)); } + + @Override + public MapJsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/NotAnyTypeJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/NotAnyTypeJsonSchema.hbs index 4537d2a44f7..d29ccc17ff9 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/NotAnyTypeJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/NotAnyTypeJsonSchema.hbs @@ -31,71 +31,47 @@ import java.util.Objects; import java.util.UUID; public class NotAnyTypeJsonSchema { - public static abstract sealed class NotAnyTypeJsonSchema1Boxed permits NotAnyTypeJsonSchema1BoxedVoid, NotAnyTypeJsonSchema1BoxedBoolean, NotAnyTypeJsonSchema1BoxedNumber, NotAnyTypeJsonSchema1BoxedString, NotAnyTypeJsonSchema1BoxedList, NotAnyTypeJsonSchema1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface NotAnyTypeJsonSchema1Boxed permits NotAnyTypeJsonSchema1BoxedVoid, NotAnyTypeJsonSchema1BoxedBoolean, NotAnyTypeJsonSchema1BoxedNumber, NotAnyTypeJsonSchema1BoxedString, NotAnyTypeJsonSchema1BoxedList, NotAnyTypeJsonSchema1BoxedMap { + @Nullable Object getData(); } - public static final class NotAnyTypeJsonSchema1BoxedVoid extends NotAnyTypeJsonSchema1Boxed { - public final Void data; - private NotAnyTypeJsonSchema1BoxedVoid(Void data) { - this.data = data; - } + public record NotAnyTypeJsonSchema1BoxedVoid(Void data) implements NotAnyTypeJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NotAnyTypeJsonSchema1BoxedBoolean extends NotAnyTypeJsonSchema1Boxed { - public final boolean data; - private NotAnyTypeJsonSchema1BoxedBoolean(boolean data) { - this.data = data; - } + public record NotAnyTypeJsonSchema1BoxedBoolean(boolean data) implements NotAnyTypeJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NotAnyTypeJsonSchema1BoxedNumber extends NotAnyTypeJsonSchema1Boxed { - public final Number data; - private NotAnyTypeJsonSchema1BoxedNumber(Number data) { - this.data = data; - } + public record NotAnyTypeJsonSchema1BoxedNumber(Number data) implements NotAnyTypeJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NotAnyTypeJsonSchema1BoxedString extends NotAnyTypeJsonSchema1Boxed { - public final String data; - private NotAnyTypeJsonSchema1BoxedString(String data) { - this.data = data; - } + public record NotAnyTypeJsonSchema1BoxedString(String data) implements NotAnyTypeJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NotAnyTypeJsonSchema1BoxedList extends NotAnyTypeJsonSchema1Boxed { - public final FrozenList<@Nullable Object> data; - private NotAnyTypeJsonSchema1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record NotAnyTypeJsonSchema1BoxedList(FrozenList<@Nullable Object> data) implements NotAnyTypeJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class NotAnyTypeJsonSchema1BoxedMap extends NotAnyTypeJsonSchema1Boxed { - public final FrozenMap<@Nullable Object> data; - private NotAnyTypeJsonSchema1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record NotAnyTypeJsonSchema1BoxedMap(FrozenMap<@Nullable Object> data) implements NotAnyTypeJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class NotAnyTypeJsonSchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, NotAnyTypeJsonSchema1BoxedList>, MapSchemaValidator, NotAnyTypeJsonSchema1BoxedMap> { + public static class NotAnyTypeJsonSchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, NotAnyTypeJsonSchema1BoxedList>, MapSchemaValidator, NotAnyTypeJsonSchema1BoxedMap> { private static @Nullable NotAnyTypeJsonSchema1 instance = null; protected NotAnyTypeJsonSchema1() { @@ -194,11 +170,11 @@ public class NotAnyTypeJsonSchema { for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object castItem = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; @@ -229,11 +205,11 @@ public class NotAnyTypeJsonSchema { List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object castValue = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } @@ -293,25 +269,50 @@ public class NotAnyTypeJsonSchema { public NotAnyTypeJsonSchema1BoxedVoid validateAndBox(Void arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new NotAnyTypeJsonSchema1BoxedVoid(validate(arg, configuration)); } + @Override public NotAnyTypeJsonSchema1BoxedBoolean validateAndBox(boolean arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new NotAnyTypeJsonSchema1BoxedBoolean(validate(arg, configuration)); } + @Override public NotAnyTypeJsonSchema1BoxedNumber validateAndBox(Number arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new NotAnyTypeJsonSchema1BoxedNumber(validate(arg, configuration)); } + @Override public NotAnyTypeJsonSchema1BoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new NotAnyTypeJsonSchema1BoxedString(validate(arg, configuration)); } + @Override public NotAnyTypeJsonSchema1BoxedList validateAndBox(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new NotAnyTypeJsonSchema1BoxedList(validate(arg, configuration)); } + @Override public NotAnyTypeJsonSchema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new NotAnyTypeJsonSchema1BoxedMap(validate(arg, configuration)); } + + @Override + public NotAnyTypeJsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } \ No newline at end of file diff --git a/src/main/resources/java/src/main/java/packagename/schemas/NullJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/NullJsonSchema.hbs index 54129414205..06da666054b 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/NullJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/NullJsonSchema.hbs @@ -18,21 +18,17 @@ import java.util.Objects; import java.util.Set; public class NullJsonSchema { - public static abstract sealed class NullJsonSchema1Boxed permits NullJsonSchema1BoxedVoid { - public abstract @Nullable Object data(); + public sealed interface NullJsonSchema1Boxed permits NullJsonSchema1BoxedVoid { + @Nullable Object getData(); } - public static final class NullJsonSchema1BoxedVoid extends NullJsonSchema1Boxed { - public final Void data; - private NullJsonSchema1BoxedVoid(Void data) { - this.data = data; - } + public record NullJsonSchema1BoxedVoid(Void data) implements NullJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class NullJsonSchema1 extends JsonSchema implements NullSchemaValidator { + public static class NullJsonSchema1 extends JsonSchema implements NullSchemaValidator { private static @Nullable NullJsonSchema1 instance = null; protected NullJsonSchema1() { @@ -79,5 +75,14 @@ public class NullJsonSchema { public NullJsonSchema1BoxedVoid validateAndBox(Void arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new NullJsonSchema1BoxedVoid(validate(arg, configuration)); } + + @Override + public NullJsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/NumberJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/NumberJsonSchema.hbs index 45cefb7740d..a980452e6ab 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/NumberJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/NumberJsonSchema.hbs @@ -18,21 +18,17 @@ import java.util.Objects; import java.util.Set; public class NumberJsonSchema { - public static abstract sealed class NumberJsonSchema1Boxed permits NumberJsonSchema1BoxedNumber { - public abstract @Nullable Object data(); + public sealed interface NumberJsonSchema1Boxed permits NumberJsonSchema1BoxedNumber { + @Nullable Object getData(); } - public static final class NumberJsonSchema1BoxedNumber extends NumberJsonSchema1Boxed { - public final Number data; - private NumberJsonSchema1BoxedNumber(Number data) { - this.data = data; - } + public record NumberJsonSchema1BoxedNumber(Number data) implements NumberJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class NumberJsonSchema1 extends JsonSchema implements NumberSchemaValidator { + public static class NumberJsonSchema1 extends JsonSchema implements NumberSchemaValidator { private static @Nullable NumberJsonSchema1 instance = null; protected NumberJsonSchema1() { @@ -100,5 +96,13 @@ public class NumberJsonSchema { public NumberJsonSchema1BoxedNumber validateAndBox(Number arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new NumberJsonSchema1BoxedNumber(validate(arg, configuration)); } + + @Override + public NumberJsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } \ No newline at end of file diff --git a/src/main/resources/java/src/main/java/packagename/schemas/StringJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/StringJsonSchema.hbs index ca436fc1c29..b1d30874a11 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/StringJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/StringJsonSchema.hbs @@ -21,20 +21,16 @@ import java.util.Set; import java.util.UUID; public class StringJsonSchema { - public static abstract sealed class StringJsonSchema1Boxed permits StringJsonSchema1BoxedString { - public abstract @Nullable Object data(); + public sealed interface StringJsonSchema1Boxed permits StringJsonSchema1BoxedString { + @Nullable Object getData(); } - public static final class StringJsonSchema1BoxedString extends StringJsonSchema1Boxed { - public final String data; - private StringJsonSchema1BoxedString(String data) { - this.data = data; - } + public record StringJsonSchema1BoxedString(String data) implements StringJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class StringJsonSchema1 extends JsonSchema implements StringSchemaValidator { + public static class StringJsonSchema1 extends JsonSchema implements StringSchemaValidator { private static @Nullable StringJsonSchema1 instance = null; protected StringJsonSchema1() { @@ -99,5 +95,13 @@ public class StringJsonSchema { public StringJsonSchema1BoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new StringJsonSchema1BoxedString(validate(arg, configuration)); } + + @Override + public StringJsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/UuidJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/UuidJsonSchema.hbs index e3ca0d8c4cb..806c13edc67 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/UuidJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/UuidJsonSchema.hbs @@ -19,21 +19,17 @@ import java.util.Set; import java.util.UUID; public class UuidJsonSchema { - public static abstract sealed class UuidJsonSchema1Boxed permits UuidJsonSchema1BoxedString { - public abstract @Nullable Object data(); + public sealed interface UuidJsonSchema1Boxed permits UuidJsonSchema1BoxedString { + @Nullable Object getData(); } - public static final class UuidJsonSchema1BoxedString extends UuidJsonSchema1Boxed { - public final String data; - private UuidJsonSchema1BoxedString(String data) { - this.data = data; - } + public record UuidJsonSchema1BoxedString(String data) implements UuidJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class UuidJsonSchema1 extends JsonSchema implements StringSchemaValidator { + public static class UuidJsonSchema1 extends JsonSchema implements StringSchemaValidator { private static @Nullable UuidJsonSchema1 instance = null; protected UuidJsonSchema1() { @@ -87,5 +83,13 @@ public class UuidJsonSchema { public UuidJsonSchema1BoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new UuidJsonSchema1BoxedString(validate(arg, configuration)); } + + @Override + public UuidJsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } \ No newline at end of file diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/AdditionalPropertiesValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/AdditionalPropertiesValidator.hbs index 4afe7f25942..8bbf3e86757 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/AdditionalPropertiesValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/AdditionalPropertiesValidator.hbs @@ -43,7 +43,7 @@ public class AdditionalPropertiesValidator implements KeywordValidator { data.validationMetadata().validatedPathToSchemas(), data.validationMetadata().seenClasses() ); - JsonSchema addPropsSchema = JsonSchemaFactory.getInstance(additionalProperties); + JsonSchema addPropsSchema = JsonSchemaFactory.getInstance(additionalProperties); if (propValidationMetadata.validationRanEarlier(addPropsSchema)) { // todo add_deeper_validated_schemas continue; diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/AllOfValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/AllOfValidator.hbs index 6ae68f5c87c..f771b150337 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/AllOfValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/AllOfValidator.hbs @@ -11,8 +11,8 @@ public class AllOfValidator implements KeywordValidator { return null; } PathToSchemasMap pathToSchemas = new PathToSchemasMap(); - for(Class allOfClass: allOf) { - JsonSchema allOfSchema = JsonSchemaFactory.getInstance(allOfClass); + for(Class> allOfClass: allOf) { + JsonSchema allOfSchema = JsonSchemaFactory.getInstance(allOfClass); PathToSchemasMap otherPathToSchemas = JsonSchema.validate(allOfSchema, data.arg(), data.validationMetadata()); pathToSchemas.update(otherPathToSchemas); } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/AnyOfValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/AnyOfValidator.hbs index bfd75e7433b..201e4aa0eb0 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/AnyOfValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/AnyOfValidator.hbs @@ -16,8 +16,8 @@ public class AnyOfValidator implements KeywordValidator { return null; } PathToSchemasMap pathToSchemas = new PathToSchemasMap(); - List> validatedAnyOfClasses = new ArrayList<>(); - for(Class anyOfClass: anyOf) { + List>> validatedAnyOfClasses = new ArrayList<>(); + for(Class> anyOfClass: anyOf) { if (anyOfClass == data.schema().getClass()) { /* optimistically assume that schema will pass validation @@ -27,7 +27,7 @@ public class AnyOfValidator implements KeywordValidator { continue; } try { - JsonSchema anyOfSchema = JsonSchemaFactory.getInstance(anyOfClass); + JsonSchema anyOfSchema = JsonSchemaFactory.getInstance(anyOfClass); PathToSchemasMap otherPathToSchemas = JsonSchema.validate(anyOfSchema, data.arg(), data.validationMetadata()); validatedAnyOfClasses.add(anyOfClass); pathToSchemas.update(otherPathToSchemas); diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/DependentSchemasValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/DependentSchemasValidator.hbs index 79715b86929..075b96c4b38 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/DependentSchemasValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/DependentSchemasValidator.hbs @@ -25,13 +25,13 @@ public class DependentSchemasValidator implements KeywordValidator { presentProperties.add((String) key); } } - for(Map.Entry> entry: dependentSchemas.entrySet()) { + for(Map.Entry>> entry: dependentSchemas.entrySet()) { String propName = entry.getKey(); if (!presentProperties.contains(propName)) { continue; } - Class dependentSchemaClass = entry.getValue(); - JsonSchema dependentSchema = JsonSchemaFactory.getInstance(dependentSchemaClass); + Class> dependentSchemaClass = entry.getValue(); + JsonSchema dependentSchema = JsonSchemaFactory.getInstance(dependentSchemaClass); PathToSchemasMap otherPathToSchemas = JsonSchema.validate(dependentSchema, mapArg, data.validationMetadata()); pathToSchemas.update(otherPathToSchemas); } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/ElseValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/ElseValidator.hbs index 9c5d8651e14..f5dc7ee36f4 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/ElseValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/ElseValidator.hbs @@ -22,7 +22,7 @@ public class ElseValidator implements KeywordValidator { // if validation is true return null; } - JsonSchema elseSchemaInstance = JsonSchemaFactory.getInstance(elseSchema); + JsonSchema elseSchemaInstance = JsonSchemaFactory.getInstance(elseSchema); PathToSchemasMap pathToSchemas = new PathToSchemasMap(); var elsePathToSchemas = JsonSchema.validate(elseSchemaInstance, data.arg(), data.validationMetadata()); // todo capture validation error and describe it as an else error? diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/ItemsValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/ItemsValidator.hbs index fe4ca51f048..102f58e9ed8 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/ItemsValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/ItemsValidator.hbs @@ -22,7 +22,7 @@ public class ItemsValidator implements KeywordValidator { } PathToSchemasMap pathToSchemas = new PathToSchemasMap(); int minIndex = data.schema().prefixItems != null ? data.schema().prefixItems.size() : 0; - JsonSchema itemsSchema = JsonSchemaFactory.getInstance(items); + JsonSchema itemsSchema = JsonSchemaFactory.getInstance(items); for(int i = minIndex; i < listArg.size(); i++) { List itemPathToItem = new ArrayList<>(data.validationMetadata().pathToItem()); itemPathToItem.add(i); diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchema.hbs index d5f38b5be93..ce97034c425 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchema.hbs @@ -17,11 +17,11 @@ import java.util.Set; import java.util.UUID; import java.util.regex.Pattern; -public abstract class JsonSchema { +public abstract class JsonSchema { public final @Nullable Set> type; public final @Nullable String format; - public final @Nullable Class items; - public final @Nullable Map> properties; + public final @Nullable Class> items; + public final @Nullable Map>> properties; public final @Nullable Set required; public final @Nullable Number exclusiveMaximum; public final @Nullable Number exclusiveMinimum; @@ -34,11 +34,11 @@ public abstract class JsonSchema { public final @Nullable Number maximum; public final @Nullable Number minimum; public final @Nullable BigDecimal multipleOf; - public final @Nullable Class additionalProperties; - public final @Nullable List> allOf; - public final @Nullable List> anyOf; - public final @Nullable List> oneOf; - public final @Nullable Class not; + public final @Nullable Class> additionalProperties; + public final @Nullable List>> allOf; + public final @Nullable List>> anyOf; + public final @Nullable List>> oneOf; + public final @Nullable Class> not; public final @Nullable Boolean uniqueItems; public final @Nullable Set<@Nullable Object> enumValues; public final @Nullable Pattern pattern; @@ -46,19 +46,19 @@ public abstract class JsonSchema { public final boolean defaultValueSet; public final @Nullable Object constValue; public final boolean constValueSet; - public final @Nullable Class contains; + public final @Nullable Class> contains; public final @Nullable Integer maxContains; public final @Nullable Integer minContains; - public final @Nullable Class propertyNames; + public final @Nullable Class> propertyNames; public final @Nullable Map> dependentRequired; - public final @Nullable Map> dependentSchemas; - public final @Nullable Map> patternProperties; - public final @Nullable List> prefixItems; - public final @Nullable Class ifSchema; - public final @Nullable Class then; - public final @Nullable Class elseSchema; - public final @Nullable Class unevaluatedItems; - public final @Nullable Class unevaluatedProperties; + public final @Nullable Map>> dependentSchemas; + public final @Nullable Map>> patternProperties; + public final @Nullable List>> prefixItems; + public final @Nullable Class> ifSchema; + public final @Nullable Class> then; + public final @Nullable Class> elseSchema; + public final @Nullable Class> unevaluatedItems; + public final @Nullable Class> unevaluatedProperties; private final LinkedHashMap keywordToValidator; protected JsonSchema(JsonSchemaInfo jsonSchemaInfo) { @@ -223,6 +223,7 @@ public abstract class JsonSchema { public abstract @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) throws InvalidTypeException; public abstract @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws InvalidTypeException, ValidationException; + public abstract T validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws InvalidTypeException, ValidationException; private List getContainsPathToSchemas( @Nullable Object arg, @@ -231,7 +232,7 @@ public abstract class JsonSchema { if (!(arg instanceof List listArg) || contains == null) { return new ArrayList<>(); } - JsonSchema containsSchema = JsonSchemaFactory.getInstance(contains); + JsonSchema containsSchema = JsonSchemaFactory.getInstance(contains); @Nullable List containsPathToSchemas = new ArrayList<>(); for(int i = 0; i < listArg.size(); i++) { PathToSchemasMap thesePathToSchemas = new PathToSchemasMap(); @@ -279,13 +280,13 @@ public abstract class JsonSchema { validationMetadata.validatedPathToSchemas(), validationMetadata.seenClasses() ); - for (Map.Entry> patternPropEntry: patternProperties.entrySet()) { + for (Map.Entry>> patternPropEntry: patternProperties.entrySet()) { if (!patternPropEntry.getKey().matcher(key).find()) { continue; } - Class patternPropClass = patternPropEntry.getValue(); - JsonSchema patternPropSchema = JsonSchemaFactory.getInstance(patternPropClass); + Class> patternPropClass = patternPropEntry.getValue(); + JsonSchema patternPropSchema = JsonSchemaFactory.getInstance(patternPropClass); PathToSchemasMap otherPathToSchemas = JsonSchema.validate(patternPropSchema, entry.getValue(), propValidationMetadata); pathToSchemas.update(otherPathToSchemas); } @@ -300,7 +301,7 @@ public abstract class JsonSchema { if (ifSchema == null) { return new PathToSchemasMap(); } - JsonSchema ifSchemaInstance = JsonSchemaFactory.getInstance(ifSchema); + JsonSchema ifSchemaInstance = JsonSchemaFactory.getInstance(ifSchema); PathToSchemasMap pathToSchemas = new PathToSchemasMap(); try { var otherPathToSchemas = JsonSchema.validate(ifSchemaInstance, arg, validationMetadata); @@ -310,7 +311,7 @@ public abstract class JsonSchema { } public static PathToSchemasMap validate( - JsonSchema jsonSchema, + JsonSchema jsonSchema, @Nullable Object arg, ValidationMetadata validationMetadata ) throws ValidationException { @@ -361,7 +362,7 @@ public abstract class JsonSchema { if (!pathToSchemas.containsKey(pathToItem)) { pathToSchemas.put(validationMetadata.pathToItem(), new LinkedHashMap<>()); } - @Nullable LinkedHashMap schemas = pathToSchemas.get(pathToItem); + @Nullable LinkedHashMap, Void> schemas = pathToSchemas.get(pathToItem); if (schemas != null) { schemas.put(jsonSchema, null); } @@ -467,19 +468,19 @@ public abstract class JsonSchema { return arg; } - protected static PathToSchemasMap getPathToSchemas(JsonSchema jsonSchema, @Nullable Object arg, ValidationMetadata validationMetadata, Set> pathSet) { + protected static PathToSchemasMap getPathToSchemas(JsonSchema jsonSchema, @Nullable Object arg, ValidationMetadata validationMetadata, Set> pathSet) { PathToSchemasMap pathToSchemasMap = new PathToSchemasMap(); // todo add check of validationMetadata.validationRanEarlier(this) PathToSchemasMap otherPathToSchemas = validate(jsonSchema, arg, validationMetadata); pathToSchemasMap.update(otherPathToSchemas); for (var schemas: pathToSchemasMap.values()) { - JsonSchema firstSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema firstSchema = schemas.entrySet().iterator().next().getKey(); schemas.clear(); schemas.put(firstSchema, null); } pathSet.removeAll(pathToSchemasMap.keySet()); if (!pathSet.isEmpty()) { - LinkedHashMap unsetAnyTypeSchema = new LinkedHashMap<>(); + LinkedHashMap, Void> unsetAnyTypeSchema = new LinkedHashMap<>(); unsetAnyTypeSchema.put(UnsetAnyTypeJsonSchema.UnsetAnyTypeJsonSchema1.getInstance(), null); for (List pathToItem: pathSet) { pathToSchemasMap.put(pathToItem, unsetAnyTypeSchema); diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchemaFactory.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchemaFactory.hbs index 2ea8c56b4fe..ee529fb4fa1 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchemaFactory.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchemaFactory.hbs @@ -10,10 +10,10 @@ import java.util.Map; public class JsonSchemaFactory { - static Map, JsonSchema> classToInstance = new HashMap<>(); + static Map>, JsonSchema> classToInstance = new HashMap<>(); - public static V getInstance(Class schemaCls) { - @Nullable JsonSchema cacheInst = classToInstance.get(schemaCls); + public static > V getInstance(Class schemaCls) { + @Nullable JsonSchema cacheInst = classToInstance.get(schemaCls); if (cacheInst != null) { assert schemaCls.isInstance(cacheInst); return schemaCls.cast(cacheInst); diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchemaInfo.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchemaInfo.hbs index f5167e1ec58..0d7527947c8 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchemaInfo.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/JsonSchemaInfo.hbs @@ -18,13 +18,13 @@ public class JsonSchemaInfo { this.format = format; return this; } - public @Nullable Class items = null; - public JsonSchemaInfo items(Class items) { + public @Nullable Class> items = null; + public JsonSchemaInfo items(Class> items) { this.items = items; return this; } - public @Nullable Map> properties = null; - public JsonSchemaInfo properties(Map> properties) { + public @Nullable Map>> properties = null; + public JsonSchemaInfo properties(Map>> properties) { this.properties = properties; return this; } @@ -88,28 +88,28 @@ public class JsonSchemaInfo { this.multipleOf = multipleOf; return this; } - public @Nullable Class additionalProperties; - public JsonSchemaInfo additionalProperties(Class additionalProperties) { + public @Nullable Class> additionalProperties; + public JsonSchemaInfo additionalProperties(Class> additionalProperties) { this.additionalProperties = additionalProperties; return this; } - public @Nullable List> allOf = null; - public JsonSchemaInfo allOf(List> allOf) { + public @Nullable List>> allOf = null; + public JsonSchemaInfo allOf(List>> allOf) { this.allOf = allOf; return this; } - public @Nullable List> anyOf = null; - public JsonSchemaInfo anyOf(List> anyOf) { + public @Nullable List>> anyOf = null; + public JsonSchemaInfo anyOf(List>> anyOf) { this.anyOf = anyOf; return this; } - public @Nullable List> oneOf = null; - public JsonSchemaInfo oneOf(List> oneOf) { + public @Nullable List>> oneOf = null; + public JsonSchemaInfo oneOf(List>> oneOf) { this.oneOf = oneOf; return this; } - public @Nullable Class not = null; - public JsonSchemaInfo not(Class not) { + public @Nullable Class> not = null; + public JsonSchemaInfo not(Class> not) { this.not = not; return this; } @@ -142,8 +142,8 @@ public class JsonSchemaInfo { this.constValueSet = true; return this; } - public @Nullable Class contains = null; - public JsonSchemaInfo contains(Class contains) { + public @Nullable Class> contains = null; + public JsonSchemaInfo contains(Class> contains) { this.contains = contains; return this; } @@ -157,8 +157,8 @@ public class JsonSchemaInfo { this.minContains = minContains; return this; } - public @Nullable Class propertyNames = null; - public JsonSchemaInfo propertyNames(Class propertyNames) { + public @Nullable Class> propertyNames = null; + public JsonSchemaInfo propertyNames(Class> propertyNames) { this.propertyNames = propertyNames; return this; } @@ -167,43 +167,43 @@ public class JsonSchemaInfo { this.dependentRequired = dependentRequired; return this; } - public @Nullable Map> dependentSchemas = null; - public JsonSchemaInfo dependentSchemas(Map> dependentSchemas) { + public @Nullable Map>> dependentSchemas = null; + public JsonSchemaInfo dependentSchemas(Map>> dependentSchemas) { this.dependentSchemas = dependentSchemas; return this; } - public @Nullable Map> patternProperties = null; - public JsonSchemaInfo patternProperties(Map> patternProperties) { + public @Nullable Map>> patternProperties = null; + public JsonSchemaInfo patternProperties(Map>> patternProperties) { this.patternProperties = patternProperties; return this; } - public @Nullable List> prefixItems = null; - public JsonSchemaInfo prefixItems(List> prefixItems) { + public @Nullable List>> prefixItems = null; + public JsonSchemaInfo prefixItems(List>> prefixItems) { this.prefixItems = prefixItems; return this; } - public @Nullable Class ifSchema = null; - public JsonSchemaInfo ifSchema(Class ifSchema) { + public @Nullable Class> ifSchema = null; + public JsonSchemaInfo ifSchema(Class> ifSchema) { this.ifSchema = ifSchema; return this; } - public @Nullable Class then = null; - public JsonSchemaInfo then(Class then) { + public @Nullable Class> then = null; + public JsonSchemaInfo then(Class> then) { this.then = then; return this; } - public @Nullable Class elseSchema = null; - public JsonSchemaInfo elseSchema(Class elseSchema) { + public @Nullable Class> elseSchema = null; + public JsonSchemaInfo elseSchema(Class> elseSchema) { this.elseSchema = elseSchema; return this; } - public @Nullable Class unevaluatedItems = null; - public JsonSchemaInfo unevaluatedItems(Class unevaluatedItems) { + public @Nullable Class> unevaluatedItems = null; + public JsonSchemaInfo unevaluatedItems(Class> unevaluatedItems) { this.unevaluatedItems = unevaluatedItems; return this; } - public @Nullable Class unevaluatedProperties = null; - public JsonSchemaInfo unevaluatedProperties(Class unevaluatedProperties) { + public @Nullable Class> unevaluatedProperties = null; + public JsonSchemaInfo unevaluatedProperties(Class> unevaluatedProperties) { this.unevaluatedProperties = unevaluatedProperties; return this; } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/NotValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/NotValidator.hbs index 665d13f253f..3d29af2e934 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/NotValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/NotValidator.hbs @@ -14,7 +14,7 @@ public class NotValidator implements KeywordValidator { } PathToSchemasMap pathToSchemas; try { - JsonSchema notSchema = JsonSchemaFactory.getInstance(not); + JsonSchema notSchema = JsonSchemaFactory.getInstance(not); pathToSchemas = JsonSchema.validate(notSchema, data.arg(), data.validationMetadata()); } catch (ValidationException e) { return null; diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/OneOfValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/OneOfValidator.hbs index 2ce2f630251..a3c40833442 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/OneOfValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/OneOfValidator.hbs @@ -16,8 +16,8 @@ public class OneOfValidator implements KeywordValidator { return null; } PathToSchemasMap pathToSchemas = new PathToSchemasMap(); - List> validatedOneOfClasses = new ArrayList<>(); - for(Class oneOfClass: oneOf) { + List>> validatedOneOfClasses = new ArrayList<>(); + for(Class> oneOfClass: oneOf) { if (oneOfClass == data.schema().getClass()) { /* optimistically assume that schema will pass validation @@ -27,7 +27,7 @@ public class OneOfValidator implements KeywordValidator { continue; } try { - JsonSchema oneOfSchema = JsonSchemaFactory.getInstance(oneOfClass); + JsonSchema oneOfSchema = JsonSchemaFactory.getInstance(oneOfClass); PathToSchemasMap otherPathToSchemas = JsonSchema.validate(oneOfSchema, data.arg(), data.validationMetadata()); validatedOneOfClasses.add(oneOfClass); pathToSchemas.update(otherPathToSchemas); diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/PathToSchemasMap.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/PathToSchemasMap.hbs index 83ddc2233e4..732e60e4878 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/PathToSchemasMap.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/PathToSchemasMap.hbs @@ -5,12 +5,12 @@ import java.util.List; import java.util.Map; @SuppressWarnings("serial") -public class PathToSchemasMap extends LinkedHashMap, LinkedHashMap> { +public class PathToSchemasMap extends LinkedHashMap, LinkedHashMap, Void>> { public void update(PathToSchemasMap other) { - for (Map.Entry, LinkedHashMap> entry: other.entrySet()) { + for (Map.Entry, LinkedHashMap, Void>> entry: other.entrySet()) { List pathToItem = entry.getKey(); - LinkedHashMap otherSchemas = entry.getValue(); + LinkedHashMap, Void> otherSchemas = entry.getValue(); if (containsKey(pathToItem)) { get(pathToItem).putAll(otherSchemas); } else { diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/PrefixItemsValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/PrefixItemsValidator.hbs index a13b4211a6e..ab1c1402059 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/PrefixItemsValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/PrefixItemsValidator.hbs @@ -31,7 +31,7 @@ public class PrefixItemsValidator implements KeywordValidator { data.validationMetadata().validatedPathToSchemas(), data.validationMetadata().seenClasses() ); - JsonSchema itemsSchema = JsonSchemaFactory.getInstance(prefixItems.get(i)); + JsonSchema itemsSchema = JsonSchemaFactory.getInstance(prefixItems.get(i)); PathToSchemasMap otherPathToSchemas = JsonSchema.validate(itemsSchema, listArg.get(i), itemValidationMetadata); pathToSchemas.update(otherPathToSchemas); } diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/PropertiesValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/PropertiesValidator.hbs index d2dc11f8ec1..914170287d2 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/PropertiesValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/PropertiesValidator.hbs @@ -27,7 +27,7 @@ public class PropertiesValidator implements KeywordValidator { presentProperties.add((String) key); } } - for(Map.Entry> entry: properties.entrySet()) { + for(Map.Entry>> entry: properties.entrySet()) { String propName = entry.getKey(); if (!presentProperties.contains(propName)) { continue; @@ -41,8 +41,8 @@ public class PropertiesValidator implements KeywordValidator { data.validationMetadata().validatedPathToSchemas(), data.validationMetadata().seenClasses() ); - Class propClass = entry.getValue(); - JsonSchema propSchema = JsonSchemaFactory.getInstance(propClass); + Class> propClass = entry.getValue(); + JsonSchema propSchema = JsonSchemaFactory.getInstance(propClass); if (propValidationMetadata.validationRanEarlier(propSchema)) { // todo add_deeper_validated_schemas continue; diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/PropertyEntry.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/PropertyEntry.hbs index 8d3d3840474..e931cdbb0a4 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/PropertyEntry.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/PropertyEntry.hbs @@ -3,8 +3,8 @@ package {{{packageName}}}.schemas.validation; import java.util.AbstractMap; @SuppressWarnings("serial") -public class PropertyEntry extends AbstractMap.SimpleEntry> { - public PropertyEntry(String key, Class value) { +public class PropertyEntry extends AbstractMap.SimpleEntry>> { + public PropertyEntry(String key, Class> value) { super(key, value); } -} +} \ No newline at end of file diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/PropertyNamesValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/PropertyNamesValidator.hbs index 4777695d0f6..49315059c97 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/PropertyNamesValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/PropertyNamesValidator.hbs @@ -18,7 +18,7 @@ public class PropertyNamesValidator implements KeywordValidator { if (!(data.arg() instanceof Map mapArg)) { return null; } - JsonSchema propertyNamesSchema = JsonSchemaFactory.getInstance(propertyNames); + JsonSchema propertyNamesSchema = JsonSchemaFactory.getInstance(propertyNames); for (Object objKey: mapArg.keySet()) { if (objKey instanceof String key) { List propPathToItem = new ArrayList<>(data.validationMetadata().pathToItem()); diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/ThenValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/ThenValidator.hbs index e273bd5fed3..c84fec4b79d 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/ThenValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/ThenValidator.hbs @@ -22,7 +22,7 @@ public class ThenValidator implements KeywordValidator { // if validation is false return null; } - JsonSchema thenSchema = JsonSchemaFactory.getInstance(then); + JsonSchema thenSchema = JsonSchemaFactory.getInstance(then); PathToSchemasMap pathToSchemas = new PathToSchemasMap(); var thenPathToSchemas = JsonSchema.validate(thenSchema, data.arg(), data.validationMetadata()); // todo capture validation error and describe it as an then error? diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/UnevaluatedItemsValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/UnevaluatedItemsValidator.hbs index b6743e8f3f9..08491693ad1 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/UnevaluatedItemsValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/UnevaluatedItemsValidator.hbs @@ -26,7 +26,7 @@ public class UnevaluatedItemsValidator implements KeywordValidator { } PathToSchemasMap pathToSchemas = new PathToSchemasMap(); int minIndex = data.schema().prefixItems != null ? data.schema().prefixItems.size() : 0; - JsonSchema unevaluatedItemsSchema = JsonSchemaFactory.getInstance(unevaluatedItems); + JsonSchema unevaluatedItemsSchema = JsonSchemaFactory.getInstance(unevaluatedItems); for(int i = minIndex; i < listArg.size(); i++) { List itemPathToItem = new ArrayList<>(data.validationMetadata().pathToItem()); itemPathToItem.add(i); diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/UnevaluatedPropertiesValidator.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/UnevaluatedPropertiesValidator.hbs index eb247129553..f8db065d12a 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/UnevaluatedPropertiesValidator.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/UnevaluatedPropertiesValidator.hbs @@ -24,7 +24,7 @@ public class UnevaluatedPropertiesValidator implements KeywordValidator { return null; } PathToSchemasMap pathToSchemas = new PathToSchemasMap(); - JsonSchema unevaluatedPropertiesSchema = JsonSchemaFactory.getInstance(unevaluatedProperties); + JsonSchema unevaluatedPropertiesSchema = JsonSchemaFactory.getInstance(unevaluatedProperties); for(Map.Entry entry: mapArg.entrySet()) { if (!(entry.getKey() instanceof String propName)) { throw new InvalidTypeException("Map keys must be strings"); diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/UnsetAnyTypeJsonSchema.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/UnsetAnyTypeJsonSchema.hbs index c83d88147e2..54dfe11b32b 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/UnsetAnyTypeJsonSchema.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/UnsetAnyTypeJsonSchema.hbs @@ -19,70 +19,46 @@ import java.util.Objects; import java.util.UUID; public class UnsetAnyTypeJsonSchema { - public static abstract sealed class UnsetAnyTypeJsonSchema1Boxed permits UnsetAnyTypeJsonSchema1BoxedVoid, UnsetAnyTypeJsonSchema1BoxedBoolean, UnsetAnyTypeJsonSchema1BoxedNumber, UnsetAnyTypeJsonSchema1BoxedString, UnsetAnyTypeJsonSchema1BoxedList, UnsetAnyTypeJsonSchema1BoxedMap { - public abstract @Nullable Object data(); + public sealed interface UnsetAnyTypeJsonSchema1Boxed permits UnsetAnyTypeJsonSchema1BoxedVoid, UnsetAnyTypeJsonSchema1BoxedBoolean, UnsetAnyTypeJsonSchema1BoxedNumber, UnsetAnyTypeJsonSchema1BoxedString, UnsetAnyTypeJsonSchema1BoxedList, UnsetAnyTypeJsonSchema1BoxedMap { + @Nullable Object getData(); } - public static final class UnsetAnyTypeJsonSchema1BoxedVoid extends UnsetAnyTypeJsonSchema1Boxed { - public final Void data; - private UnsetAnyTypeJsonSchema1BoxedVoid(Void data) { - this.data = data; - } + public record UnsetAnyTypeJsonSchema1BoxedVoid(Void data) implements UnsetAnyTypeJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UnsetAnyTypeJsonSchema1BoxedBoolean extends UnsetAnyTypeJsonSchema1Boxed { - public final boolean data; - private UnsetAnyTypeJsonSchema1BoxedBoolean(boolean data) { - this.data = data; - } + public record UnsetAnyTypeJsonSchema1BoxedBoolean(boolean data) implements UnsetAnyTypeJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UnsetAnyTypeJsonSchema1BoxedNumber extends UnsetAnyTypeJsonSchema1Boxed { - public final Number data; - private UnsetAnyTypeJsonSchema1BoxedNumber(Number data) { - this.data = data; - } + public record UnsetAnyTypeJsonSchema1BoxedNumber(Number data) implements UnsetAnyTypeJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UnsetAnyTypeJsonSchema1BoxedString extends UnsetAnyTypeJsonSchema1Boxed { - public final String data; - private UnsetAnyTypeJsonSchema1BoxedString(String data) { - this.data = data; - } + public record UnsetAnyTypeJsonSchema1BoxedString(String data) implements UnsetAnyTypeJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UnsetAnyTypeJsonSchema1BoxedList extends UnsetAnyTypeJsonSchema1Boxed { - public final FrozenList<@Nullable Object> data; - private UnsetAnyTypeJsonSchema1BoxedList(FrozenList<@Nullable Object> data) { - this.data = data; - } + public record UnsetAnyTypeJsonSchema1BoxedList(FrozenList<@Nullable Object> data) implements UnsetAnyTypeJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static final class UnsetAnyTypeJsonSchema1BoxedMap extends UnsetAnyTypeJsonSchema1Boxed { - public final FrozenMap<@Nullable Object> data; - private UnsetAnyTypeJsonSchema1BoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record UnsetAnyTypeJsonSchema1BoxedMap(FrozenMap<@Nullable Object> data) implements UnsetAnyTypeJsonSchema1Boxed { @Override - public @Nullable Object data() { + public @Nullable Object getData() { return data; } } - public static class UnsetAnyTypeJsonSchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, UnsetAnyTypeJsonSchema1BoxedList>, MapSchemaValidator, UnsetAnyTypeJsonSchema1BoxedMap> { + public static class UnsetAnyTypeJsonSchema1 extends JsonSchema implements NullSchemaValidator, BooleanSchemaValidator, NumberSchemaValidator, StringSchemaValidator, ListSchemaValidator, UnsetAnyTypeJsonSchema1BoxedList>, MapSchemaValidator, UnsetAnyTypeJsonSchema1BoxedMap> { private static @Nullable UnsetAnyTypeJsonSchema1 instance = null; protected UnsetAnyTypeJsonSchema1() { @@ -179,11 +155,11 @@ public class UnsetAnyTypeJsonSchema { for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object castItem = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); items.add(castItem); i += 1; @@ -214,11 +190,11 @@ public class UnsetAnyTypeJsonSchema { List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object castValue = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } @@ -278,25 +254,50 @@ public class UnsetAnyTypeJsonSchema { public UnsetAnyTypeJsonSchema1BoxedVoid validateAndBox(Void arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new UnsetAnyTypeJsonSchema1BoxedVoid(validate(arg, configuration)); } + @Override public UnsetAnyTypeJsonSchema1BoxedBoolean validateAndBox(boolean arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new UnsetAnyTypeJsonSchema1BoxedBoolean(validate(arg, configuration)); } + @Override public UnsetAnyTypeJsonSchema1BoxedNumber validateAndBox(Number arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new UnsetAnyTypeJsonSchema1BoxedNumber(validate(arg, configuration)); } + @Override public UnsetAnyTypeJsonSchema1BoxedString validateAndBox(String arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new UnsetAnyTypeJsonSchema1BoxedString(validate(arg, configuration)); } + @Override public UnsetAnyTypeJsonSchema1BoxedList validateAndBox(List arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new UnsetAnyTypeJsonSchema1BoxedList(validate(arg, configuration)); } + @Override public UnsetAnyTypeJsonSchema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { return new UnsetAnyTypeJsonSchema1BoxedMap(validate(arg, configuration)); } + + @Override + public UnsetAnyTypeJsonSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException, InvalidTypeException { + if (arg == null) { + Void castArg = (Void) arg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof Boolean booleanArg) { + boolean castArg = booleanArg; + return validateAndBox(castArg, configuration); + } else if (arg instanceof String castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Number castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof List castArg) { + return validateAndBox(castArg, configuration); + } else if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } } \ No newline at end of file diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/ValidationData.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/ValidationData.hbs index d5c4f5de75a..1563757d83a 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/ValidationData.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/ValidationData.hbs @@ -5,7 +5,7 @@ import org.checkerframework.checker.nullness.qual.Nullable; import java.util.List; public record ValidationData( - JsonSchema schema, + JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata, @Nullable List containsPathToSchemas, @@ -14,7 +14,7 @@ public record ValidationData( @Nullable PathToSchemasMap knownPathToSchemas ) { public ValidationData( - JsonSchema schema, + JsonSchema schema, @Nullable Object arg, ValidationMetadata validationMetadata ) { diff --git a/src/main/resources/java/src/main/java/packagename/schemas/validation/ValidationMetadata.hbs b/src/main/resources/java/src/main/java/packagename/schemas/validation/ValidationMetadata.hbs index a868e40d0b2..e7658c4da96 100644 --- a/src/main/resources/java/src/main/java/packagename/schemas/validation/ValidationMetadata.hbs +++ b/src/main/resources/java/src/main/java/packagename/schemas/validation/ValidationMetadata.hbs @@ -13,8 +13,8 @@ public record ValidationMetadata( Set> seenClasses ) { - public boolean validationRanEarlier(JsonSchema schema) { - @Nullable Map validatedSchemas = validatedPathToSchemas.get(pathToItem); + public boolean validationRanEarlier(JsonSchema schema) { + @Nullable Map, Void> validatedSchemas = validatedPathToSchemas.get(pathToItem); if (validatedSchemas != null && validatedSchemas.containsKey(schema)) { return true; } diff --git a/src/main/resources/java/src/test/java/packagename/requestbody/RequestBodySerializerTest.hbs b/src/main/resources/java/src/test/java/packagename/requestbody/RequestBodySerializerTest.hbs index 1d9904cd021..0355eaf142e 100644 --- a/src/main/resources/java/src/test/java/packagename/requestbody/RequestBodySerializerTest.hbs +++ b/src/main/resources/java/src/test/java/packagename/requestbody/RequestBodySerializerTest.hbs @@ -2,7 +2,8 @@ package {{{packageName}}}.requestbody; import {{{packageName}}}.configurations.JsonSchemaKeywordFlags; import {{{packageName}}}.configurations.SchemaConfiguration; -import {{{packageName}}}.schemas.MapJsonSchema; +import {{{packageName}}}.schemas.AnyTypeJsonSchema; +import {{{packageName}}}.schemas.StringJsonSchema; import org.checkerframework.checker.nullness.qual.Nullable; import org.junit.Assert; @@ -11,73 +12,59 @@ import org.junit.Test; import java.net.http.HttpResponse; import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; +import java.util.AbstractMap; import java.util.List; import java.util.Map; import java.util.concurrent.Flow; public final class RequestBodySerializerTest { + public sealed interface SealedMediaType permits ApplicationjsonMediaType, TextplainMediaType {} + public record ApplicationjsonMediaType(AnyTypeJsonSchema.AnyTypeJsonSchema1 schema) implements SealedMediaType {} + public record TextplainMediaType(StringJsonSchema.StringJsonSchema1 schema) implements SealedMediaType {} - public static abstract sealed class SealedRequestBody permits ApplicationjsonRequestBody, TextplainRequestBody {} - public static final class ApplicationjsonRequestBody extends SealedRequestBody implements GenericRequestBody<@Nullable Object> { - private final String contentType; - private final @Nullable Object body; - public ApplicationjsonRequestBody(@Nullable Object body) { - contentType = "application/json"; - this.body = body; - } + public sealed interface SealedRequestBody permits ApplicationjsonRequestBody, TextplainRequestBody {} + public record ApplicationjsonRequestBody(AnyTypeJsonSchema.AnyTypeJsonSchema1Boxed body) implements SealedRequestBody, GenericRequestBody<@Nullable Object> { @Override public String contentType() { - return contentType; - } - - @Override - public @Nullable Object body() { - return body; + return "application/json"; } } - public static final class TextplainRequestBody extends SealedRequestBody implements GenericRequestBody<@Nullable Object> { - private final String contentType; - private final @Nullable Object body; - public TextplainRequestBody(@Nullable Object body) { - contentType = "text/plain"; - this.body = body; - } + public record TextplainRequestBody(StringJsonSchema.StringJsonSchema1Boxed body) implements SealedRequestBody, GenericRequestBody<@Nullable Object> { @Override public String contentType() { - return contentType; - } - - @Override - public @Nullable Object body() { - return body; + return "text/plain"; } } - public static class MyRequestBodySerializer extends RequestBodySerializer { + public static class MyRequestBodySerializer extends RequestBodySerializer { public MyRequestBodySerializer() { - super(Map.of(), true); + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType(AnyTypeJsonSchema.AnyTypeJsonSchema1.getInstance())), + new AbstractMap.SimpleEntry<>("text/plain", new TextplainMediaType(StringJsonSchema.StringJsonSchema1.getInstance())) + ), + true); } public SerializedRequestBody serialize(SealedRequestBody requestBody) { if (requestBody instanceof ApplicationjsonRequestBody requestBody0) { - return serialize(requestBody0.contentType(), requestBody0.body()); + return serialize(requestBody0.contentType(), requestBody0.body().getData()); } else { TextplainRequestBody requestBody1 = (TextplainRequestBody) requestBody; - return serialize(requestBody1.contentType(), requestBody1.body()); + return serialize(requestBody1.contentType(), requestBody1.body().getData()); } } } @Test public void testContentTypeIsJson() { - var serializer = new MyRequestBodySerializer(); - Assert.assertTrue(serializer.contentTypeIsJson("application/json")); - Assert.assertTrue(serializer.contentTypeIsJson("application/json; charset=UTF-8")); - Assert.assertTrue(serializer.contentTypeIsJson("application/json-patch+json")); - Assert.assertTrue(serializer.contentTypeIsJson("application/geo+json")); + Assert.assertTrue(RequestBodySerializer.contentTypeIsJson("application/json")); + Assert.assertTrue(RequestBodySerializer.contentTypeIsJson("application/json; charset=UTF-8")); + Assert.assertTrue(RequestBodySerializer.contentTypeIsJson("application/json-patch+json")); + Assert.assertTrue(RequestBodySerializer.contentTypeIsJson("application/geo+json")); - Assert.assertFalse(serializer.contentTypeIsJson("application/octet-stream")); - Assert.assertFalse(serializer.contentTypeIsJson("text/plain")); + Assert.assertFalse(RequestBodySerializer.contentTypeIsJson("application/octet-stream")); + Assert.assertFalse(RequestBodySerializer.contentTypeIsJson("text/plain")); } static final class StringSubscriber implements Flow.Subscriber { @@ -101,63 +88,91 @@ public final class RequestBodySerializerTest { var bodySubscriber = HttpResponse.BodySubscribers.ofString(StandardCharsets.UTF_8); var flowSubscriber = new StringSubscriber(bodySubscriber); requestBody.bodyPublisher.subscribe(flowSubscriber); - return bodySubscriber.getBody().toCompletableFuture().join(); } @Test public void testSerializeApplicationJson() { + SchemaConfiguration configuration = new SchemaConfiguration(JsonSchemaKeywordFlags.ofNone()); var serializer = new MyRequestBodySerializer(); String jsonBody; - SerializedRequestBody requestBody = serializer.serialize(new ApplicationjsonRequestBody(1)); + SerializedRequestBody requestBody = serializer.serialize( + new ApplicationjsonRequestBody( + AnyTypeJsonSchema.AnyTypeJsonSchema1.getInstance().validateAndBox(1, configuration) + ) + ); Assert.assertEquals("application/json", requestBody.contentType); jsonBody = getJsonBody(requestBody); Assert.assertEquals(jsonBody, "1"); - requestBody = serializer.serialize(new ApplicationjsonRequestBody(3.14)); + requestBody = serializer.serialize( + new ApplicationjsonRequestBody( + AnyTypeJsonSchema.AnyTypeJsonSchema1.getInstance().validateAndBox(3.14, configuration) + ) + ); jsonBody = getJsonBody(requestBody); Assert.assertEquals(jsonBody, "3.14"); - requestBody = serializer.serialize(new ApplicationjsonRequestBody(null)); + requestBody = serializer.serialize( + new ApplicationjsonRequestBody( + AnyTypeJsonSchema.AnyTypeJsonSchema1.getInstance().validateAndBox((Void) null, configuration) + ) + ); jsonBody = getJsonBody(requestBody); Assert.assertEquals(jsonBody, "null"); - requestBody = serializer.serialize(new ApplicationjsonRequestBody(true)); + requestBody = serializer.serialize( + new ApplicationjsonRequestBody( + AnyTypeJsonSchema.AnyTypeJsonSchema1.getInstance().validateAndBox(true, configuration) + ) + ); jsonBody = getJsonBody(requestBody); Assert.assertEquals(jsonBody, "true"); - requestBody = serializer.serialize(new ApplicationjsonRequestBody(false)); + requestBody = serializer.serialize( + new ApplicationjsonRequestBody( + AnyTypeJsonSchema.AnyTypeJsonSchema1.getInstance().validateAndBox(false, configuration) + ) + ); jsonBody = getJsonBody(requestBody); Assert.assertEquals(jsonBody, "false"); - - requestBody = serializer.serialize(new ApplicationjsonRequestBody(List.of())); + requestBody = serializer.serialize( + new ApplicationjsonRequestBody( + AnyTypeJsonSchema.AnyTypeJsonSchema1.getInstance().validateAndBox(List.of(), configuration) + ) + ); jsonBody = getJsonBody(requestBody); Assert.assertEquals(jsonBody, "[]"); - requestBody = serializer.serialize(new ApplicationjsonRequestBody(Map.of())); + requestBody = serializer.serialize( + new ApplicationjsonRequestBody( + AnyTypeJsonSchema.AnyTypeJsonSchema1.getInstance().validateAndBox(Map.of(), configuration) + ) + ); jsonBody = getJsonBody(requestBody); Assert.assertEquals(jsonBody, "{}"); - SchemaConfiguration configuration = new SchemaConfiguration(JsonSchemaKeywordFlags.ofNone()); - MapJsonSchema.MapJsonSchema1 mapJsonSchema = MapJsonSchema.MapJsonSchema1.getInstance(); - var frozenMap = mapJsonSchema.validate(Map.of("k1", "v1", "k2", "v2"), configuration); - requestBody = serializer.serialize(new ApplicationjsonRequestBody(frozenMap)); + requestBody = serializer.serialize( + new ApplicationjsonRequestBody( + AnyTypeJsonSchema.AnyTypeJsonSchema1.getInstance().validateAndBox(Map.of("k1", "v1", "k2", "v2"), configuration) + ) + ); jsonBody = getJsonBody(requestBody); Assert.assertEquals(jsonBody, "{\"k2\":\"v2\",\"k1\":\"v1\"}"); } @Test public void testSerializeTextPlain() { + SchemaConfiguration configuration = new SchemaConfiguration(JsonSchemaKeywordFlags.ofNone()); var serializer = new MyRequestBodySerializer(); - SerializedRequestBody requestBody = serializer.serialize(new TextplainRequestBody("a")); + SerializedRequestBody requestBody = serializer.serialize( + new TextplainRequestBody( + StringJsonSchema.StringJsonSchema1.getInstance().validateAndBox("a", configuration) + ) + ); Assert.assertEquals("text/plain", requestBody.contentType); String textBody = getJsonBody(requestBody); Assert.assertEquals(textBody, "a"); - - Assert.assertThrows( - RuntimeException.class, - () -> serializer.serialize(new TextplainRequestBody(null)) - ); } } \ No newline at end of file diff --git a/src/main/resources/java/src/test/java/packagename/response/ResponseDeserializerTest.hbs b/src/main/resources/java/src/test/java/packagename/response/ResponseDeserializerTest.hbs new file mode 100644 index 00000000000..e39c223ca31 --- /dev/null +++ b/src/main/resources/java/src/test/java/packagename/response/ResponseDeserializerTest.hbs @@ -0,0 +1,255 @@ +package {{{packageName}}}.response; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.ToNumberPolicy; +import org.checkerframework.checker.nullness.qual.Nullable; +import org.junit.Assert; +import org.junit.Test; +import {{{packageName}}}.configurations.JsonSchemaKeywordFlags; +import {{{packageName}}}.configurations.SchemaConfiguration; +import {{{packageName}}}.mediatype.MediaType; +import {{{packageName}}}.schemas.AnyTypeJsonSchema; +import {{{packageName}}}.schemas.StringJsonSchema; + +import javax.net.ssl.SSLSession; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpHeaders; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.function.BiPredicate; + +public class ResponseDeserializerTest { + private static final Gson gson = new GsonBuilder() + .setObjectToNumberStrategy(ToNumberPolicy.LONG_OR_DOUBLE) + .setNumberToNumberStrategy(ToNumberPolicy.LONG_OR_DOUBLE) + .create(); + public sealed interface SealedResponseBody permits ApplicationjsonBody, TextplainBody { } + + public record ApplicationjsonBody(AnyTypeJsonSchema.AnyTypeJsonSchema1Boxed body) implements SealedResponseBody { } + + public record TextplainBody(StringJsonSchema.StringJsonSchema1Boxed body) implements SealedResponseBody {} + + public sealed interface SealedMediaType permits ApplicationjsonMediatype, TextplainMediatype { } + + public record ApplicationjsonMediatype(AnyTypeJsonSchema.AnyTypeJsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediatype() { + this(AnyTypeJsonSchema.AnyTypeJsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + + public record TextplainMediatype(StringJsonSchema.StringJsonSchema1 schema) implements SealedMediaType, MediaType { + public TextplainMediatype() { + this(StringJsonSchema.StringJsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + + public static class MyResponseDeserializer extends ResponseDeserializer { + + public MyResponseDeserializer() { + super(Map.of("application/json", new ApplicationjsonMediatype(), "text/plain", new TextplainMediatype())); + } + + @Override + protected SealedResponseBody getBody(String contentType, byte[] body, SchemaConfiguration configuration) { + SealedMediaType mediaType = content.get(contentType); + if (mediaType == null) { + throw new RuntimeException("Invalid contentType was received back from the server that does not exist in the openapi document"); + } + if (mediaType instanceof ApplicationjsonMediatype thisMediaType) { + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonBody(deserializedBody); + } else { + TextplainMediatype thisMediaType = (TextplainMediatype) mediaType; + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new TextplainBody(deserializedBody); + } + } + + @Override + protected Void getHeaders(HttpHeaders headers) { + return null; + } + } + + public static class BytesHttpResponse implements HttpResponse { + private final byte[] body; + private final HttpHeaders headers; + private final HttpRequest request; + private final URI uri; + private final HttpClient.Version version; + public BytesHttpResponse(byte[] body, String contentType) { + this.body = body; + BiPredicate headerFilter = (key, val) -> true; + headers = HttpHeaders.of(Map.of("Content-Type", List.of(contentType)), headerFilter); + uri = URI.create("https://abc.com/"); + request = HttpRequest.newBuilder().uri(uri).build(); + version = HttpClient.Version.HTTP_2; + } + + @Override + public int statusCode() { + return 202; + } + + @Override + public HttpRequest request() { + return request; + } + + @Override + public Optional> previousResponse() { + return Optional.empty(); + } + + @Override + public HttpHeaders headers() { + return headers; + } + + @Override + public byte[] body() { + return body; + } + + @Override + public Optional sslSession() { + return Optional.empty(); + } + + @Override + public URI uri() { + return uri; + } + + @Override + public HttpClient.Version version() { + return version; + } + } + + @SuppressWarnings("nullness") + private String toJson(@Nullable Object body) { + return gson.toJson(body); + } + + @SuppressWarnings("nullness") + private void assertNull(@Nullable Object object) { + Assert.assertNull(object); + } + + @Test + public void testDeserializeApplicationJsonNull() { + var deserializer = new MyResponseDeserializer(); + byte[] bodyBytes = toJson(null).getBytes(StandardCharsets.UTF_8); + BytesHttpResponse response = new BytesHttpResponse(bodyBytes, "application/json"); + SchemaConfiguration configuration = new SchemaConfiguration(JsonSchemaKeywordFlags.ofNone()); + ApiResponse apiResponse = deserializer.deserialize(response, configuration); + Assert.assertEquals(response, apiResponse.response()); + if (!(apiResponse.body() instanceof ApplicationjsonBody jsonBody)) { + throw new RuntimeException("body must be type ApplicationjsonBody"); + } + if (!(jsonBody.body() instanceof AnyTypeJsonSchema.AnyTypeJsonSchema1BoxedVoid boxedVoid)) { + throw new RuntimeException("body must be type AnyTypeJsonSchema1BoxedVoid"); + } + assertNull(boxedVoid.data()); + } + + @Test + public void testDeserializeApplicationJsonTrue() { + var deserializer = new MyResponseDeserializer(); + byte[] bodyBytes = toJson(true).getBytes(StandardCharsets.UTF_8); + BytesHttpResponse response = new BytesHttpResponse(bodyBytes, "application/json"); + SchemaConfiguration configuration = new SchemaConfiguration(JsonSchemaKeywordFlags.ofNone()); + ApiResponse apiResponse = deserializer.deserialize(response, configuration); + Assert.assertEquals(response, apiResponse.response()); + if (!(apiResponse.body() instanceof ApplicationjsonBody jsonBody)) { + throw new RuntimeException("body must be type ApplicationjsonBody"); + } + if (!(jsonBody.body() instanceof AnyTypeJsonSchema.AnyTypeJsonSchema1BoxedBoolean boxedBoolean)) { + throw new RuntimeException("body must be type AnyTypeJsonSchema1BoxedBoolean"); + } + Assert.assertTrue(boxedBoolean.data()); + } + + @Test + public void testDeserializeApplicationJsonFalse() { + var deserializer = new MyResponseDeserializer(); + byte[] bodyBytes = toJson(false).getBytes(StandardCharsets.UTF_8); + BytesHttpResponse response = new BytesHttpResponse(bodyBytes, "application/json"); + SchemaConfiguration configuration = new SchemaConfiguration(JsonSchemaKeywordFlags.ofNone()); + ApiResponse apiResponse = deserializer.deserialize(response, configuration); + Assert.assertEquals(response, apiResponse.response()); + if (!(apiResponse.body() instanceof ApplicationjsonBody jsonBody)) { + throw new RuntimeException("body must be type ApplicationjsonBody"); + } + if (!(jsonBody.body() instanceof AnyTypeJsonSchema.AnyTypeJsonSchema1BoxedBoolean boxedBoolean)) { + throw new RuntimeException("body must be type AnyTypeJsonSchema1BoxedBoolean"); + } + Assert.assertFalse(boxedBoolean.data()); + } + + @Test + public void testDeserializeApplicationJsonInt() { + var deserializer = new MyResponseDeserializer(); + byte[] bodyBytes = toJson(1).getBytes(StandardCharsets.UTF_8); + BytesHttpResponse response = new BytesHttpResponse(bodyBytes, "application/json"); + SchemaConfiguration configuration = new SchemaConfiguration(JsonSchemaKeywordFlags.ofNone()); + ApiResponse apiResponse = deserializer.deserialize(response, configuration); + Assert.assertEquals(response, apiResponse.response()); + if (!(apiResponse.body() instanceof ApplicationjsonBody jsonBody)) { + throw new RuntimeException("body must be type ApplicationjsonBody"); + } + if (!(jsonBody.body() instanceof AnyTypeJsonSchema.AnyTypeJsonSchema1BoxedNumber boxedNumber)) { + throw new RuntimeException("body must be type AnyTypeJsonSchema1BoxedNumber"); + } + Assert.assertEquals(boxedNumber.data(), 1L); + } + + @Test + public void testDeserializeApplicationJsonFloat() { + var deserializer = new MyResponseDeserializer(); + byte[] bodyBytes = toJson(3.14).getBytes(StandardCharsets.UTF_8); + BytesHttpResponse response = new BytesHttpResponse(bodyBytes, "application/json"); + SchemaConfiguration configuration = new SchemaConfiguration(JsonSchemaKeywordFlags.ofNone()); + ApiResponse apiResponse = deserializer.deserialize(response, configuration); + Assert.assertEquals(response, apiResponse.response()); + if (!(apiResponse.body() instanceof ApplicationjsonBody jsonBody)) { + throw new RuntimeException("body must be type ApplicationjsonBody"); + } + if (!(jsonBody.body() instanceof AnyTypeJsonSchema.AnyTypeJsonSchema1BoxedNumber boxedNumber)) { + throw new RuntimeException("body must be type AnyTypeJsonSchema1BoxedNumber"); + } + Assert.assertEquals(boxedNumber.data(), 3.14); + } + + @Test + public void testDeserializeApplicationJsonString() { + var deserializer = new MyResponseDeserializer(); + byte[] bodyBytes = toJson("a").getBytes(StandardCharsets.UTF_8); + BytesHttpResponse response = new BytesHttpResponse(bodyBytes, "application/json"); + SchemaConfiguration configuration = new SchemaConfiguration(JsonSchemaKeywordFlags.ofNone()); + ApiResponse apiResponse = deserializer.deserialize(response, configuration); + Assert.assertEquals(response, apiResponse.response()); + if (!(apiResponse.body() instanceof ApplicationjsonBody jsonBody)) { + throw new RuntimeException("body must be type ApplicationjsonBody"); + } + if (!(jsonBody.body() instanceof AnyTypeJsonSchema.AnyTypeJsonSchema1BoxedString boxedString)) { + throw new RuntimeException("body must be type AnyTypeJsonSchema1BoxedString"); + } + Assert.assertEquals(boxedString.data(), "a"); + } +} \ No newline at end of file diff --git a/src/main/resources/java/src/test/java/packagename/schemas/ArrayTypeSchemaTest.hbs b/src/main/resources/java/src/test/java/packagename/schemas/ArrayTypeSchemaTest.hbs index 931bd3751d7..3256926f42d 100644 --- a/src/main/resources/java/src/test/java/packagename/schemas/ArrayTypeSchemaTest.hbs +++ b/src/main/resources/java/src/test/java/packagename/schemas/ArrayTypeSchemaTest.hbs @@ -31,16 +31,12 @@ public class ArrayTypeSchemaTest { new LinkedHashSet<>() ); - public static abstract sealed class ArrayWithItemsSchemaBoxed permits ArrayWithItemsSchemaBoxedList { + public sealed interface ArrayWithItemsSchemaBoxed permits ArrayWithItemsSchemaBoxedList { } - public static final class ArrayWithItemsSchemaBoxedList extends ArrayWithItemsSchemaBoxed { - public final FrozenList data; - private ArrayWithItemsSchemaBoxedList(FrozenList data) { - this.data = data; - } + public record ArrayWithItemsSchemaBoxedList(FrozenList data) implements ArrayWithItemsSchemaBoxed { } - public static class ArrayWithItemsSchema extends JsonSchema implements ListSchemaValidator, ArrayWithItemsSchemaBoxedList> { + public static class ArrayWithItemsSchema extends JsonSchema implements ListSchemaValidator, ArrayWithItemsSchemaBoxedList> { public ArrayWithItemsSchema() { super(new JsonSchemaInfo() .type(Set.of(List.class)) @@ -55,11 +51,11 @@ public class ArrayTypeSchemaTest { for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object castItem = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(castItem instanceof String)) { throw new InvalidTypeException("Instantiated type of item is invalid"); @@ -100,6 +96,14 @@ public class ArrayTypeSchemaTest { } throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); } + + @Override + public ArrayWithItemsSchemaBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws InvalidTypeException, ValidationException { + if (arg instanceof List listArg) { + return new ArrayWithItemsSchemaBoxedList(validate(listArg, configuration)); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } public static class ArrayWithOutputClsSchemaList extends FrozenList { @@ -112,15 +116,11 @@ public class ArrayTypeSchemaTest { } } - public static abstract sealed class ArrayWithOutputClsSchemaBoxed permits ArrayWithOutputClsSchemaBoxedList { + public sealed interface ArrayWithOutputClsSchemaBoxed permits ArrayWithOutputClsSchemaBoxedList { } - public static final class ArrayWithOutputClsSchemaBoxedList extends ArrayWithOutputClsSchemaBoxed { - public final ArrayWithOutputClsSchemaList data; - private ArrayWithOutputClsSchemaBoxedList(ArrayWithOutputClsSchemaList data) { - this.data = data; - } + public record ArrayWithOutputClsSchemaBoxedList(ArrayWithOutputClsSchemaList data) implements ArrayWithOutputClsSchemaBoxed { } - public static class ArrayWithOutputClsSchema extends JsonSchema implements ListSchemaValidator { + public static class ArrayWithOutputClsSchema extends JsonSchema implements ListSchemaValidator { public ArrayWithOutputClsSchema() { super(new JsonSchemaInfo() .type(Set.of(List.class)) @@ -136,11 +136,11 @@ public class ArrayTypeSchemaTest { for (Object item: arg) { List itemPathToItem = new ArrayList<>(pathToItem); itemPathToItem.add(i); - LinkedHashMap schemas = pathToSchemas.get(itemPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(itemPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema itemSchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object castItem = itemSchema.getNewInstance(item, itemPathToItem, pathToSchemas); if (!(castItem instanceof String)) { throw new InvalidTypeException("Instantiated type of item is invalid"); @@ -182,6 +182,14 @@ public class ArrayTypeSchemaTest { } throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); } + + @Override + public ArrayWithOutputClsSchemaBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws InvalidTypeException, ValidationException { + if (arg instanceof List listArg) { + return new ArrayWithOutputClsSchemaBoxedList(validate(listArg, configuration)); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } @Test diff --git a/src/main/resources/java/src/test/java/packagename/schemas/ObjectTypeSchemaTest.hbs b/src/main/resources/java/src/test/java/packagename/schemas/ObjectTypeSchemaTest.hbs index 3ba04f06025..ffc84f68f75 100644 --- a/src/main/resources/java/src/test/java/packagename/schemas/ObjectTypeSchemaTest.hbs +++ b/src/main/resources/java/src/test/java/packagename/schemas/ObjectTypeSchemaTest.hbs @@ -33,15 +33,11 @@ public class ObjectTypeSchemaTest { new LinkedHashSet<>() ); - public static abstract sealed class ObjectWithPropsSchemaBoxed permits ObjectWithPropsSchemaBoxedMap { + public sealed interface ObjectWithPropsSchemaBoxed permits ObjectWithPropsSchemaBoxedMap { } - public static final class ObjectWithPropsSchemaBoxedMap extends ObjectWithPropsSchemaBoxed { - public final FrozenMap<@Nullable Object> data; - private ObjectWithPropsSchemaBoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record ObjectWithPropsSchemaBoxedMap(FrozenMap<@Nullable Object> data) implements ObjectWithPropsSchemaBoxed { } - public static class ObjectWithPropsSchema extends JsonSchema implements MapSchemaValidator, ObjectWithPropsSchemaBoxedMap> { + public static class ObjectWithPropsSchema extends JsonSchema implements MapSchemaValidator, ObjectWithPropsSchemaBoxedMap> { private static @Nullable ObjectWithPropsSchema instance = null; private ObjectWithPropsSchema() { super(new JsonSchemaInfo() @@ -72,11 +68,11 @@ public class ObjectTypeSchemaTest { List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object castValue = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } @@ -113,18 +109,22 @@ public class ObjectTypeSchemaTest { } throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); } + + @Override + public ObjectWithPropsSchemaBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws InvalidTypeException, ValidationException { + if (arg instanceof Map mapArg) { + return new ObjectWithPropsSchemaBoxedMap(validate(mapArg, configuration)); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } } - public static abstract sealed class ObjectWithAddpropsSchemaBoxed permits ObjectWithAddpropsSchemaBoxedMap { + public sealed interface ObjectWithAddpropsSchemaBoxed permits ObjectWithAddpropsSchemaBoxedMap { } - public static final class ObjectWithAddpropsSchemaBoxedMap extends ObjectWithAddpropsSchemaBoxed { - public final FrozenMap data; - private ObjectWithAddpropsSchemaBoxedMap(FrozenMap data) { - this.data = data; - } + public record ObjectWithAddpropsSchemaBoxedMap(FrozenMap data) implements ObjectWithAddpropsSchemaBoxed { } - public static class ObjectWithAddpropsSchema extends JsonSchema implements MapSchemaValidator, ObjectWithAddpropsSchemaBoxedMap> { + public static class ObjectWithAddpropsSchema extends JsonSchema implements MapSchemaValidator, ObjectWithAddpropsSchemaBoxedMap> { private static @Nullable ObjectWithAddpropsSchema instance = null; private ObjectWithAddpropsSchema() { super(new JsonSchemaInfo() @@ -152,11 +152,11 @@ public class ObjectTypeSchemaTest { List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object castValue = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); if (!(castValue instanceof String)) { throw new InvalidTypeException("Invalid type for property value"); @@ -189,6 +189,14 @@ public class ObjectTypeSchemaTest { throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); } + @Override + public ObjectWithAddpropsSchemaBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws InvalidTypeException, ValidationException { + if (arg instanceof Map mapArg) { + return new ObjectWithAddpropsSchemaBoxedMap(validate(mapArg, configuration)); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + @Override public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof Map) { @@ -198,15 +206,11 @@ public class ObjectTypeSchemaTest { } } - public static abstract sealed class ObjectWithPropsAndAddpropsSchemaBoxed permits ObjectWithPropsAndAddpropsSchemaBoxedMap { + public sealed interface ObjectWithPropsAndAddpropsSchemaBoxed permits ObjectWithPropsAndAddpropsSchemaBoxedMap { } - public static final class ObjectWithPropsAndAddpropsSchemaBoxedMap extends ObjectWithPropsAndAddpropsSchemaBoxed { - public final FrozenMap<@Nullable Object> data; - private ObjectWithPropsAndAddpropsSchemaBoxedMap(FrozenMap<@Nullable Object> data) { - this.data = data; - } + public record ObjectWithPropsAndAddpropsSchemaBoxedMap(FrozenMap<@Nullable Object> data) implements ObjectWithPropsAndAddpropsSchemaBoxed { } - public static class ObjectWithPropsAndAddpropsSchema extends JsonSchema implements MapSchemaValidator, ObjectWithPropsAndAddpropsSchemaBoxedMap> { + public static class ObjectWithPropsAndAddpropsSchema extends JsonSchema implements MapSchemaValidator, ObjectWithPropsAndAddpropsSchemaBoxedMap> { private static @Nullable ObjectWithPropsAndAddpropsSchema instance = null; private ObjectWithPropsAndAddpropsSchema() { super(new JsonSchemaInfo() @@ -237,11 +241,11 @@ public class ObjectTypeSchemaTest { List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object castValue = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } @@ -271,6 +275,14 @@ public class ObjectTypeSchemaTest { throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); } + @Override + public ObjectWithPropsAndAddpropsSchemaBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws InvalidTypeException, ValidationException { + if (arg instanceof Map mapArg) { + return new ObjectWithPropsAndAddpropsSchemaBoxedMap(validate(mapArg, configuration)); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + @Override public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof Map) { @@ -290,15 +302,11 @@ public class ObjectTypeSchemaTest { } } - public static abstract sealed class ObjectWithOutputTypeSchemaBoxed permits ObjectWithOutputTypeSchemaBoxedMap { + public sealed interface ObjectWithOutputTypeSchemaBoxed permits ObjectWithOutputTypeSchemaBoxedMap { } - public static final class ObjectWithOutputTypeSchemaBoxedMap extends ObjectWithOutputTypeSchemaBoxed { - public final ObjectWithOutputTypeSchemaMap data; - private ObjectWithOutputTypeSchemaBoxedMap(ObjectWithOutputTypeSchemaMap data) { - this.data = data; - } + public record ObjectWithOutputTypeSchemaBoxedMap(ObjectWithOutputTypeSchemaMap data) implements ObjectWithOutputTypeSchemaBoxed { } - public static class ObjectWithOutputTypeSchema extends JsonSchema implements MapSchemaValidator { + public static class ObjectWithOutputTypeSchema extends JsonSchema implements MapSchemaValidator { private static @Nullable ObjectWithOutputTypeSchema instance = null; public ObjectWithOutputTypeSchema() { super(new JsonSchemaInfo() @@ -328,11 +336,11 @@ public class ObjectTypeSchemaTest { List propertyPathToItem = new ArrayList<>(pathToItem); propertyPathToItem.add(propertyName); Object value = entry.getValue(); - LinkedHashMap schemas = pathToSchemas.get(propertyPathToItem); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); if (schemas == null) { throw new InvalidTypeException("Validation result is invalid, schemas must exist for a pathToItem"); } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); @Nullable Object castValue = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); properties.put(propertyName, castValue); } @@ -362,6 +370,14 @@ public class ObjectTypeSchemaTest { throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); } + @Override + public ObjectWithOutputTypeSchemaBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws InvalidTypeException, ValidationException { + if (arg instanceof Map mapArg) { + return new ObjectWithOutputTypeSchemaBoxedMap(validate(mapArg, configuration)); + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + @Override public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { if (arg instanceof FrozenMap) { diff --git a/src/main/resources/java/src/test/java/packagename/schemas/validation/AdditionalPropertiesValidatorTest.hbs b/src/main/resources/java/src/test/java/packagename/schemas/validation/AdditionalPropertiesValidatorTest.hbs index dc3ed93d361..88cbb7d6150 100644 --- a/src/main/resources/java/src/test/java/packagename/schemas/validation/AdditionalPropertiesValidatorTest.hbs +++ b/src/main/resources/java/src/test/java/packagename/schemas/validation/AdditionalPropertiesValidatorTest.hbs @@ -18,7 +18,10 @@ import java.util.Map; import java.util.Set; public class AdditionalPropertiesValidatorTest { - public static class ObjectWithPropsSchema extends JsonSchema { + public sealed interface ObjectWithPropsSchemaBoxed permits ObjectWithPropsSchemaBoxedMap {} + public record ObjectWithPropsSchemaBoxedMap() implements ObjectWithPropsSchemaBoxed {} + + public static class ObjectWithPropsSchema extends JsonSchema { private static @Nullable ObjectWithPropsSchema instance = null; private ObjectWithPropsSchema() { super(new JsonSchemaInfo() @@ -53,6 +56,11 @@ public class AdditionalPropertiesValidatorTest { } throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); } + + @Override + public ObjectWithPropsSchemaBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws InvalidTypeException, ValidationException { + return new ObjectWithPropsSchemaBoxedMap(); + } } @SuppressWarnings("nullness") @@ -88,7 +96,7 @@ public class AdditionalPropertiesValidatorTest { List expectedPathToItem = new ArrayList<>(); expectedPathToItem.add("args[0]"); expectedPathToItem.add("someAddProp"); - LinkedHashMap expectedClasses = new LinkedHashMap<>(); + LinkedHashMap, Void> expectedClasses = new LinkedHashMap<>(); StringJsonSchema.StringJsonSchema1 schema = JsonSchemaFactory.getInstance(StringJsonSchema.StringJsonSchema1.class); expectedClasses.put(schema, null); PathToSchemasMap expectedPathToSchemas = new PathToSchemasMap(); diff --git a/src/main/resources/java/src/test/java/packagename/schemas/validation/ItemsValidatorTest.hbs b/src/main/resources/java/src/test/java/packagename/schemas/validation/ItemsValidatorTest.hbs index 9a9e095cd08..af2b41c10ac 100644 --- a/src/main/resources/java/src/test/java/packagename/schemas/validation/ItemsValidatorTest.hbs +++ b/src/main/resources/java/src/test/java/packagename/schemas/validation/ItemsValidatorTest.hbs @@ -21,7 +21,10 @@ public class ItemsValidatorTest { Assert.assertNull(object); } - public static class ArrayWithItemsSchema extends JsonSchema { + public sealed interface ArrayWithItemsSchemaBoxed permits ArrayWithItemsSchemaBoxedList {} + public record ArrayWithItemsSchemaBoxedList() implements ArrayWithItemsSchemaBoxed {} + + public static class ArrayWithItemsSchema extends JsonSchema { public ArrayWithItemsSchema() { super(new JsonSchemaInfo() .type(Set.of(List.class)) @@ -44,6 +47,11 @@ public class ItemsValidatorTest { } throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); } + + @Override + public ArrayWithItemsSchemaBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws InvalidTypeException, ValidationException { + return new ArrayWithItemsSchemaBoxedList(); + } } @Test @@ -72,7 +80,7 @@ public class ItemsValidatorTest { List expectedPathToItem = new ArrayList<>(); expectedPathToItem.add("args[0]"); expectedPathToItem.add(0); - LinkedHashMap expectedClasses = new LinkedHashMap<>(); + LinkedHashMap, Void> expectedClasses = new LinkedHashMap<>(); StringJsonSchema.StringJsonSchema1 schema = JsonSchemaFactory.getInstance(StringJsonSchema.StringJsonSchema1.class); expectedClasses.put(schema, null); PathToSchemasMap expectedPathToSchemas = new PathToSchemasMap(); diff --git a/src/main/resources/java/src/test/java/packagename/schemas/validation/JsonSchemaTest.hbs b/src/main/resources/java/src/test/java/packagename/schemas/validation/JsonSchemaTest.hbs index 0f61a6f2ce9..be5faa5e9c8 100644 --- a/src/main/resources/java/src/test/java/packagename/schemas/validation/JsonSchemaTest.hbs +++ b/src/main/resources/java/src/test/java/packagename/schemas/validation/JsonSchemaTest.hbs @@ -13,39 +13,49 @@ import java.util.LinkedHashSet; import java.util.List; import java.util.Set; -class SomeSchema extends JsonSchema { - private static @Nullable SomeSchema instance = null; - protected SomeSchema() { - super(new JsonSchemaInfo() - .type(Set.of(String.class)) - ); - } +sealed interface SomeSchemaBoxed permits SomeSchemaBoxedString {} +record SomeSchemaBoxedString() implements SomeSchemaBoxed {} + +public class JsonSchemaTest { + sealed interface SomeSchemaBoxed permits SomeSchemaBoxedString {} + record SomeSchemaBoxedString() implements SomeSchemaBoxed {} - public static SomeSchema getInstance() { - if (instance == null) { - instance = new SomeSchema(); + static class SomeSchema extends JsonSchema { + private static @Nullable SomeSchema instance = null; + protected SomeSchema() { + super(new JsonSchemaInfo() + .type(Set.of(String.class)) + ); } - return instance; - } - @Override - public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { - if (arg instanceof String) { - return arg; + public static SomeSchema getInstance() { + if (instance == null) { + instance = new SomeSchema(); + } + return instance; } - throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); - } - @Override - public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws InvalidTypeException, ValidationException { - if (arg instanceof String) { - return arg; + @Override + public Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + if (arg instanceof String) { + return arg; + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); } - throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } -} -public class JsonSchemaTest { + @Override + public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws InvalidTypeException, ValidationException { + if (arg instanceof String) { + return arg; + } + throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + + @Override + public SomeSchemaBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws InvalidTypeException, ValidationException { + return new SomeSchemaBoxedString(); + } + } @Test public void testValidateSucceeds() { @@ -63,7 +73,7 @@ public class JsonSchemaTest { validationMetadata ); PathToSchemasMap expectedPathToSchemas = new PathToSchemasMap(); - LinkedHashMap validatedClasses = new LinkedHashMap<>(); + LinkedHashMap, Void> validatedClasses = new LinkedHashMap<>(); validatedClasses.put(schema, null); expectedPathToSchemas.put(pathToItem, validatedClasses); Assert.assertEquals(pathToSchemas, expectedPathToSchemas); diff --git a/src/main/resources/java/src/test/java/packagename/schemas/validation/PropertiesValidatorTest.hbs b/src/main/resources/java/src/test/java/packagename/schemas/validation/PropertiesValidatorTest.hbs index e8bd82e371c..de7a97379fc 100644 --- a/src/main/resources/java/src/test/java/packagename/schemas/validation/PropertiesValidatorTest.hbs +++ b/src/main/resources/java/src/test/java/packagename/schemas/validation/PropertiesValidatorTest.hbs @@ -17,7 +17,10 @@ import java.util.Map; import java.util.Set; public class PropertiesValidatorTest { - public static class ObjectWithPropsSchema extends JsonSchema { + public sealed interface ObjectWithPropsSchemaBoxed permits ObjectWithPropsSchemaBoxedMap {} + public record ObjectWithPropsSchemaBoxedMap() implements ObjectWithPropsSchemaBoxed {} + + public static class ObjectWithPropsSchema extends JsonSchema { private ObjectWithPropsSchema() { super(new JsonSchemaInfo() .type(Set.of(Map.class)) @@ -43,6 +46,11 @@ public class PropertiesValidatorTest { } throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); } + + @Override + public ObjectWithPropsSchemaBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws InvalidTypeException, ValidationException { + return new ObjectWithPropsSchemaBoxedMap(); + } } @SuppressWarnings("nullness") @@ -76,7 +84,7 @@ public class PropertiesValidatorTest { List expectedPathToItem = new ArrayList<>(); expectedPathToItem.add("args[0]"); expectedPathToItem.add("someString"); - LinkedHashMap expectedClasses = new LinkedHashMap<>(); + LinkedHashMap, Void> expectedClasses = new LinkedHashMap<>(); expectedClasses.put(JsonSchemaFactory.getInstance(StringJsonSchema.StringJsonSchema1.class), null); PathToSchemasMap expectedPathToSchemas = new PathToSchemasMap(); expectedPathToSchemas.put(expectedPathToItem, expectedClasses); diff --git a/src/main/resources/java/src/test/java/packagename/schemas/validation/RequiredValidatorTest.hbs b/src/main/resources/java/src/test/java/packagename/schemas/validation/RequiredValidatorTest.hbs index d18574778b4..491a7affc7f 100644 --- a/src/main/resources/java/src/test/java/packagename/schemas/validation/RequiredValidatorTest.hbs +++ b/src/main/resources/java/src/test/java/packagename/schemas/validation/RequiredValidatorTest.hbs @@ -15,7 +15,10 @@ import java.util.Map; import java.util.Set; public class RequiredValidatorTest { - public static class ObjectWithRequiredSchema extends JsonSchema { + public sealed interface ObjectWithRequiredSchemaBoxed permits ObjectWithRequiredSchemaBoxedMap {} + public record ObjectWithRequiredSchemaBoxedMap() implements ObjectWithRequiredSchemaBoxed {} + + public static class ObjectWithRequiredSchema extends JsonSchema { private ObjectWithRequiredSchema() { super(new JsonSchemaInfo() .type(Set.of(Map.class)) @@ -39,6 +42,11 @@ public class RequiredValidatorTest { } throw new InvalidTypeException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); } + + @Override + public ObjectWithRequiredSchemaBoxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws InvalidTypeException, ValidationException { + return new ObjectWithRequiredSchemaBoxedMap(); + } } @SuppressWarnings("nullness")